phent_addvelcentral(ENTITY*,VECTOR* speed)
A linear velocity is added to the entity’s center of mass. When there
is no gravity and no damping, the entity will just continue to float
with the direction and speed given by the speed vector, which is
independent of the body's current orientation.
Parameters:
ENTITY* |
the entity to be affected |
speed |
a vector determining the speed to be added to the entity. |
Returns:
1 if successful, 0 otherwise.
Remarks:
For giving an entity a defined push, use this instruction rather than
phent_addcentralforce. The effect by phent_addvelcentral is independent
of the entity's mass and of the time a force is applied.
Speed:
Fast
Example:
...
ph_setgravity(nullvector);
phent_setmass(my,10);
phent_setdamping(my,0);
phent_addvelcentral(my,vector(50,0,0));
See also:
phent_addcentralforce
► latest
version online