Interface CharacterCollisionEvent
interface CharacterCollisionEvent {
collider: PhysicsBody;
colliderIndex: number;
impulse: Vec3;
impulsePosition: Vec3;
}
collider: PhysicsBody;
colliderIndex: number;
impulse: Vec3;
impulsePosition: Vec3;
}
Properties
collider
The dynamic physics body the character contacted. Its .node.name identifies the collider.
collider Index
colliderIndex: number
Thin-instance index of the collider; 0 for an ordinary body.
impulse
Impulse (world space) the character applied to the collider at the contact point.
impulse Position
World-space position of the contact at which the impulse was applied.
Collision event fired by PhysicsCharacterController.onTriggerCollisionObservable for every dynamic body the character pushes during a step. Mirrors Babylon.js'
onTriggerCollisionObservablepayload, including the thin-instance collider index.