NewtonBodyAddImpulse

From Newton Wiki
Jump to: navigation, search

NewtonBodyAddImpulse

void NewtonBodyAddImpulse( const NewtonBody* bodyPtr, const dFloat* pointDeltaVeloc, const dFloat* pointPosit)

Usage

Add an impulse to a specific point on a body.

This function forces a point on a body to achieve the specified instantaneous velocity. pointDeltaVeloc is the desired increase in velocity at point pointPosit.

Parameters

  • const NewtonBody *bodyPtr - is the pointer to the body.
  • const dFloat pointDeltaVeloc - pointer to the first element an array of at least three floats containing the desired change in velocity to point pointPosit.
  • const dFloat pointPosit - pointer to the first element an array of at least three floats containing the center of the impulse in global space.
  • dFloat timestep

Remarks

  • pointPosit and pointDeltaVeloc must be specified in global space.
  • pointDeltaVeloc represent a change in velocity. For example, a value of pointDeltaVeloc of (1, 0, 0) changes the velocity of bodyPtr in such a way that the velocity of point pointDeltaVeloc will increase by (1, 0, 0)
  • Because pointDeltaVeloc represents a change in velocity, this function must be used with care. Repeated calls to this function will result in an increase of the velocity of the body and may cause to integrator to lose stability.