pXent_setdamping ( entity, var linear, var angular );

A simple way to simulate airdrag and gear friction is to use velocity damping. Each frame a force & torque gets applied to the selected entity, compensating its movement. An amount of 0 disables damping and unless stopped by other objects or forces, a moving physical entity will continue moving indefinitely. When set to 100%, the object will only move while a force or torque is applied to it.

Parameters:

entity registered Entity pointer (Actor)
linear amount of linear damping, between 0.0 and 100.0
angular amount of angular damping, between 0.0 and 100.0

Returns:

Nonzero if successful, 0 otherwise.

Remarks:

Speed:

Fast

Example:

pXent_setdamping(my, 50, 50); // both set to 50% damping

See also:

pXent_setfriction