Vec4Lerp

Top  Previous  Next

Syntax:

 

Vec4Lerp(VECTOR4 v1, VECTOR4 v2, FLOAT  s), VECTOR4

 

Purpose:

Performs a linear interpolation between two 4D vectors.

 

Parameters:

v1 - First vector

v2 - Second vector

s - Parameter that linearly interpolates between the vectors.

 

Returned value:

The new vector in a VECTOR4 UDT

 

Application:

'take 10 secs to move the object between the start and end points.
newpos = Vec4Lerp(vstart, vend, (timeGetTime() - StartTime) / 10.0)

 

Additional Info:

This function performs the linear interpolation based on the following formula: Result = V1 + s(V2-V1).