Class: ContactProcessedUtil
Defined in: packages/physics/utils/ContactProcessedUtil.ts:8
Collision processing utility
Constructors
Constructor
new ContactProcessedUtil():
ContactProcessedUtil
Returns
ContactProcessedUtil
Methods
registerCollisionCallback()
staticregisterCollisionCallback(pointer,callback):void
Defined in: packages/physics/utils/ContactProcessedUtil.ts:18
Register a collision event.
Parameters
pointer
number
Pointer to the physics object
callback
Callback
Event callback
Returns
void
unregisterCollisionCallback()
staticunregisterCollisionCallback(pointer):void
Defined in: packages/physics/utils/ContactProcessedUtil.ts:32
Unregister a collision event.
Parameters
pointer
number
Pointer to the physics object
Returns
void
addIgnoredPointer()
staticaddIgnoredPointer(pointer):void
Defined in: packages/physics/utils/ContactProcessedUtil.ts:64
Add a pointer to the ignored set. Once added, no collision event will be triggered when any object collides with the object referenced by this pointer.
Parameters
pointer
number
Pointer to the physics object
Returns
void
removeIgnoredPointer()
staticremoveIgnoredPointer(pointer):void
Defined in: packages/physics/utils/ContactProcessedUtil.ts:74
Remove a pointer from the ignored set.
Parameters
pointer
number
Pointer to the physics object
Returns
void
isIgnored()
staticisIgnored(pointer):boolean
Defined in: packages/physics/utils/ContactProcessedUtil.ts:82
Check whether the pointer is in the ignored set.
Parameters
pointer
number
Pointer to the physics object
Returns
boolean
isCollision()
staticisCollision(pointer):boolean
Defined in: packages/physics/utils/ContactProcessedUtil.ts:90
Check whether the pointer has a registered collision event.
Parameters
pointer
number
Pointer to the physics object
Returns
boolean
performCollisionTest()
staticperformCollisionTest(bodyA,bodyB?):object
Defined in: packages/physics/utils/ContactProcessedUtil.ts:129
Perform a one-shot collision test. If bodyB is provided, tests whether bodyA collides with bodyB. Otherwise, tests whether bodyA collides with any other rigid body.
Parameters
bodyA
The first rigid body.
bodyB?
(Optional) The second rigid body.
Returns
object
An object with collision information if a collision occurred; otherwise null.
cpPtr
cpPtr:
number
colObj0Wrap
colObj0Wrap:
btCollisionObjectWrapper
colObj1Wrap
colObj1Wrap:
btCollisionObjectWrapper
partId0
partId0:
number
index0
index0:
number
partId1
partId1:
number
index1
index1:
number
checkCollision()
staticcheckCollision(bodyA,bodyB):boolean
Defined in: packages/physics/utils/ContactProcessedUtil.ts:174
Collision check: determines whether two rigid bodies are currently colliding.
Parameters
bodyA
bodyB
Returns
boolean
boolean

