You are here: Lua Scripting Resources eGuide > Lua Scripting API Reference Guide > Physics Library > lerp

19.2.11 lerp

v = physics.Vect:lerp(vec, f)

Parameter

Type

Description

self

in physics.Vect

The input vector

vec

in physics.Vect

The other vector

f

in number

f is a fractional number from 0 to 1 representing the proportion of distance between self and vec

v

out physics.Vect

A vector interpolated between self and vec

Returns the linear interpolation between self and vec as a vector. f is the fraction of distance between self and vec.

Note

May not behave as expected for f larger than 1.0 or less than 0.

Introduced in platform.apiLevel = '2.0'