Class

SCNPhysicsContact

Detailed information about a contact between two physics bodies in a scene’s physics simulation.

Overview

You don't create SCNPhysicsContact instances directly; SceneKit automatically creates these objects whenever contacts occur.

To receive contact messages, assign your custom class implementing the SCNPhysicsContactDelegate protocol to the contactDelegate property of your scene’s SCNPhysicsWorld obejct. Next, for each physics body in your scene, set the categoryBitMask and collisionBitMask properties to define which interactions should generate contact messages.

Topics

Inspecting the Contact Properties

var nodeA: SCNNode

The node containing the first body in the contact.

var nodeB: SCNNode

The node containing the second body in the contact.

var contactPoint: SCNVector3

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

var contactNormal: SCNVector3

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

var collisionImpulse: CGFloat

The force over time of the collision, in newton-seconds.

var penetrationDistance: CGFloat

The distance of overlap, in units of scene coordinate space, between the two physics bodies.

Instance Properties

Relationships

Inherits From

Conforms To

See Also

Collision and Contact Detection

protocol SCNPhysicsContactDelegate

Methods you can implement to respond when a contact or collision occurs between two physics bodies in a scene.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software