void NewtonBodySetDestructorCallback( const NewtonBody* bodyPtr, NewtonBodyDestructor callback)
Assign an event function to be called when this body is about to be destroyed.
- const NewtonBody *bodyPtr - pointer to the body to be destroyed.
- NewtonBodyDestructor callback - pointer to a function callback.
- This function NewtonBodyDestructor callback acts like a destruction function in CPP. This function is called when the body and all data joints associated with the body are about to be destroyed. The application could use this function to destroy or release any resource associated with this body. The application should not make reference to this body after this function returns.
- The destruction of a body will destroy all joints associated with the body.