void NewtonBodySetForceAndTorqueCallback( const NewtonBody* bodyPtr, NewtonApplyForceAndTorque callback)
Assign an event function for applying external force and torque to a rigid body.
- const NewtonBody *bodyPtr - pointer to the body.
- NewtonApplyForceAndTorque callback - pointer to a function callback used to apply force and torque to a rigid body.
- Before the NewtonApplyForceAndTorque callback is called for a body, Newton first clears the net force and net torque for the body.
- The function NewtonApplyForceAndTorque callback is called by the Newton Engine every time an active body is going to be simulated. The Newton Engine does not call the NewtonApplyForceAndTorque callback function for bodies that are inactive or have reached a state of stable equilibrium.