import SCNPhysicsContactDelegate from 'jscenekit/js/SceneKit/SCNPhysicsContactDelegate.js'
SCNPhysicsContactDelegate
Methods you can implement to respond when a contact or collision occurs between two physics bodies in a scene.
Method Summary
Public Methods | ||
public |
physicsWorldDidBegin(world: SCNPhysicsWorld, contact: SCNPhysicsContact): void Tells the delegate that two bodies have come into contact. |
|
public |
physicsWorldDidEnd(world: SCNPhysicsWorld, contact: SCNPhysicsContact): void Tells the delegate that a contact has ended. |
|
public |
physicsWorldDidUpdate(world: SCNPhysicsWorld, contact: SCNPhysicsContact): void SceneKit calls this method on each step of the physics simulation (see the timeStep property) if information about the contact changes—for example, if two bodies are sliding against one another. |
Public Methods
public physicsWorldDidBegin(world: SCNPhysicsWorld, contact: SCNPhysicsContact): void source
Tells the delegate that two bodies have come into contact.
Params:
Name | Type | Attribute | Description |
world | SCNPhysicsWorld | The physics world that is processing the contact. |
|
contact | SCNPhysicsContact | An object that describes the contact. |
Return:
void |
public physicsWorldDidEnd(world: SCNPhysicsWorld, contact: SCNPhysicsContact): void source
Tells the delegate that a contact has ended.
Params:
Name | Type | Attribute | Description |
world | SCNPhysicsWorld | The physics world that is processing the contact. |
|
contact | SCNPhysicsContact | An object that describes the contact. |
Return:
void |
public physicsWorldDidUpdate(world: SCNPhysicsWorld, contact: SCNPhysicsContact): void source
SceneKit calls this method on each step of the physics simulation (see the timeStep property) if information about the contact changes—for example, if two bodies are sliding against one another.
Params:
Name | Type | Attribute | Description |
world | SCNPhysicsWorld | The physics world that is processing the contact. |
|
contact | SCNPhysicsContact | An object that describes the contact. |
Return:
void |