NewtonBodySetCollision

From Newton Wiki
Jump to: navigation, search

NewtonBodySetCollision

void NewtonBodySetCollision( const NewtonBody* bodyPtr, const NewtonCollision* collisionPtr)

Usage

Assign a collision primitive to the body.

Parameters

  • const NewtonBody *bodyPtr - pointer to the body.
  • const collisionPtr *collisionPtr - pointer to the new collision geometry.

Return

  • Nothing.

Remarks

  • This function replaces a collision geometry of a body with the new collision geometry. This function increments the reference count of the collision geometry and decrements the reference count of the old collision geometry. If the reference count of the old collision geometry reaches zero, the old collision geometry is destroyed. This function can be used to swap the collision geometry of bodies at runtime.

See also

NewtonCreateBody NewtonBodyGetCollision