NewtonBodySetForceAndTorqueCallback

From Newton Wiki
Revision as of 08:02, 10 June 2019 by Unknown user (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NewtonBodySetForceAndTorqueCallback

void NewtonBodySetForceAndTorqueCallback( const NewtonBody* bodyPtr, NewtonApplyForceAndTorque callback)

Usage

Assign an event function for applying external force and torque to a rigid body.

Parameters

  • const NewtonBody *bodyPtr - pointer to the body.
  • NewtonApplyForceAndTorque callback - pointer to a function callback used to apply force and torque to a rigid body.

Return

  • Nothing.

Remarks

  • 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.

See also

NewtonBodyGetUserData NewtonBodyGetUserData NewtonBodyGetForceAndTorqueCallback