Class

SKPhysicsContact

A description of the contact between two physics bodies.

Declaration

@interface SKPhysicsContact : NSObject

Overview

An SKPhysicsContact object is created automatically by SpriteKit to describe a contact between two physical bodies in a physics world.To receive contact messages, read the physicsWorld property of an SKScene object you are interested in, and assign its contactDelegate property to point to an object that implements the SKPhysicsContactDelegate protocol. Then, for each physics body in your scene, set the categoryBitMask and contactTestBitMask properties to define which interactions should generate contact messages.

Topics

Inspecting the Contact Properties

bodyA

The first body in the contact.

bodyB

The second body in the contact.

contactPoint

The contact point between the two physics bodies, in scene coordinates.

collisionImpulse

The impulse that specifies how hard these two bodies struck each other in Newton-seconds.

contactNormal

The normal vector specifying the direction of the collision.

Relationships

Inherits From

See Also

Physics Simulation

Getting Started with Physics

Simulate gravity, acceleration, collision detection, or joints.

SKPhysicsWorld

The driver of the physics engine in a scene; it exposes the ability for you to configure and query the physics system.

SKPhysicsBody

An object that adds physics simulation to a node.

SKPhysicsContactDelegate

Methods your app can implement to respond when physics bodies come into contact.

SKFieldNode

A node that applies physics effects to nearby nodes.