NewtonBodyCalculateInverseDynamicsForce

From Newton Wiki
Jump to: navigation, search

NewtonBodyCalculateInverseDynamicsForce

void  NewtonBodyCalculateInverseDynamicsForce (const NewtonBody* const body, dFloat timestep, const dFloat* const desiredVeloc, dFloat* const forceOut)

Usage

Calculate the next force that net to be applied to the body to archive the desired velocity in the current time step.

Parameters

  • const NewtonBody* const body
  • dFloat timestep
  • const dFloat* const desiredVeloc
  • dFloat* const forceOut

Return

  • (Procedure)

Description

  • this function can be useful when creating object for game play.
  • this treat the body as a point mass and is uses the solver to calculates the net force that need to be applied to the body
  • such that is reach the desired velocity in the net time step.
  • In general the force should be calculated by the expression f = M * (dsiredVeloc - bodyVeloc) / timestep
  • however due to algorithmic optimization and limitations if such equation is used then the solver will generate a different desired velocity.

See also

NewtonBodySetForce NewtonBodyAddForce NewtonBodyGetForce NewtonBodyGetForceAcc