phent_setdamping ( ENTITY* entity, var linear, var angular );

A simple way to simulate airdrag and 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.


entity the entity to be affected
linear amount of linear damping, between 0.0 and 100.0
angular amount of angular damping, between 0.0 and 100.0


1 if successful, 0 otherwise.


As long as linear or angular damping is enabled for an object calculations need to be performed each frame. Set both to 0 to increase frame rate.





See also:

► latest version online