pXent_setmassoffset
(ENTITY* entity , VECTOR* vOffset, VECTOR* vInertia)
This
function sets the local position of the center of mass, and the relative inertia tensor.
Parameters:
entity |
Registered entity pointer (Actor) |
vOffset |
Position of the mass center point in entity coordinates, or NULL for letting PhysX calculate the mass center. |
vInertia |
Vector containing relative inertia factors - resistance against rotation - about the x, y, z axis. Use NULL for letting PhysX calculate the inertia tensor from the actor shape. |
Returns:
1
if successful, 0
otherwise.
Remarks:
- An unrealistic center
of mass can lead to instability and jittering bodies.
- All components of the inertia tensor must be nonzero. Use (1,1,1) for the rotation behavior of a symmetric object (such as a spere), or f.i. (0.1,10,10) for an object that is elongated along the x-axis (such as a rod).
- This call wakes the
Actor if it is sleeping.
Speed:
Fast
Example:
pXent_setmassoffset(my,vector(0,0,-10),NULL); //moves the center of mass 10 quants down.
See also:
pXent_setmass