Vector lerp function
📝 LuaReturns a vector linearly interpolated between two vectors by a given fraction.
Lua
function vectorLerp(a, b, t) local result = {} for i = 1, #a do result[i] = a[i] + (b[i] - a[i]) t end return result
end
Comments
the fraction clamping is the tricky part-one off and you're past the endpoint. we actually added an option to disable clamping for that exact reason.