pXent_enable (ENTITY*,
var enable)
This
function
temporarily disables the entity for physics. It can be used for displacing a physics entity by directly changing its position or angle.
Parameters:
ENTITY* |
registered Entity pointer (Actor) or unregistered
Actor |
enable
|
a value of 1 recreates the Actor, 0
deletes the Actor
|
Returns:
Nonzero if successful, 0
otherwise.
Remarks:
- The function
temporarily deletes the physics actor, but saves its index, body, hull, and scale size for recreation.
-
Remove all joints or wheels connected to the actor before calling this function.
Speed:
Medium
Example:
// disable physics entity so we can manually alter its position.
pXent_enable( me, 0 );
vec_set(my.x, newPosition );
vec_set(my.pan, newOrientation );
// re-enable entity, this will inform the physics system that position/orientation has changed.
pXent_enable( me, 1 );
See also:
pXent_settype