vec_accelerate(
VECTOR* distance,VECTOR* speed,VECTOR* accel,var friction): VECTOR*
Like accelerate, but calculates three values for using distance
and speed vectors rather than amounts.
Parameters:
distance |
a vector that is set to the distance to cover in quants, A7.85 or NULL for returning a temporary distance vector. |
speed |
current speed vector in quants per tick. This value is changed by the acceleration |
accel |
acceleration vector in quants per square tick |
friction |
the resistance parameter of the surrounding medium. 0 means no resistance |
Returns:
distance
Modifies:
distance |
vector is set to the distance to cover in quants |
speed |
current speed vector in quants per tick |
Remarks:
This function is faster than applying accelerate separately on the
three elements of a vector.
Speed:
Fast
Example:
vec_accelerate(dist,speed,force,0.5);
c_move(me,dist,nullvector,IGNORE_YOU|IGNORE_PASSABLE);
See also:
accelerate
► latest
version online