From Newton Wiki
Jump to: navigation, search


 void  NewtonBodyGetRotation(const NewtonBody* body, dFloat* rotation);



  • NewtonBody *body - pointer to body
  • dFloat *rotation - pointer and array of a least 4 floats to hold rotation (Note: this is a quaternion vector)



  • The rotation matrix is written set in the form of a unit quaternion in the order (x, y, z, w)
  • The rotation quaternion is the same as what the application would get by using at function to extract a quaternion form a matrix.
  • However, since the rigid body already contained the rotation in it, it is more efficient to just call this function avoiding expensive conversion.
  • This function could be very useful for the implementation of pseudo frame rate independent simulation by running the simulation at a fix rate and using linear interpolation between the last two simulation frames to determine the exact fraction of the render step.


  • Added since Newton 2.0
  • The returned vector is a quaternion vector

See also

NewtonBodySetMatrix NewtonBodyGetMatrix