NewtonStaticCollisionSetDebugCallback

From Newton Wiki
Jump to: navigation, search

NewtonStaticCollisionSetDebugCallback

 void NewtonStaticCollisionSetDebugCallback (const NewtonCollision* staticCollision, NewtonTreeCollisionCallback userCallback);

Usage

Assign an event function in case a Collision Tree primitive collides.

Parameters

Description

Assign a callback to be triggered, in case a Collision Tree primitive collides with another dynamic object.

The event handler callback function receives a pointer to the body having the Collision Tree, pointer to the dynamic body causing the collision, the face ID which collided, the data of the vertices corresponding to the given face.

The application can use this callback for debugging purposes or also to modify the collision geometry by changing the face ID. This can be useful to make surface changes based for the given faces based on collision with bodies with different attributes.

Remarks

  • Added in Newton 2.0
  • This callback can be used for TreeCollision, HeightFieldCollision primitives and for SceneCollision primitives containing TreeCollision and/or HeightFieldCollision primitives

See also

NewtonMaterialSetCollisionCallback