Difference between revisions of "NewtonBodyGetRotation"
(fixed to order) |
m |
||
Line 13: | Line 13: | ||
== Description == | == Description == | ||
− | * The rotation matrix is written set in the form of a unit quaternion in the | + | * 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. | * 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. | * However, since the rigid body already contained the rotation in it, it is more efficient to just call this function avoiding expensive conversion. |
Latest revision as of 16:09, 14 June 2019
NewtonBodyGetRotation
void NewtonBodyGetRotation(const NewtonBody* body, dFloat* rotation);
Usage
Parameters
- NewtonBody *body - pointer to body
- dFloat *rotation - pointer and array of a least 4 floats to hold rotation (Note: this is a quaternion vector)
Return
Description
- 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.
Remarks
- Added since Newton 2.0
- The returned vector is a quaternion vector