Vec4

Edit

A vector object that holds four numbers.

Constructors

lovr.math.newVec4Create a new Vec4.
lovr.math.vec4Create a temporary Vec4.

Methods

Vec4:addAdd a vector or a number to the vector.
Vec4:angleGet the angle to another vector.
Vec4:distanceGet the distance to another vector.
Vec4:divDivides the vector by a vector or a number.
Vec4:dotGet the dot product with another vector.
Vec4:equalsCheck if a vector equals another vector.
Vec4:lengthGet the length of the vector.
Vec4:lerpMoves this vector some amount towards another one.
Vec4:mulMultiply the vector by a vector or a number.
Vec4:normalizeNormalize the length of the vector to 1.
Vec4:setSet the components of the vector.
Vec4:subSubtract a vector or a number from the vector.
Vec4:transformApply a transform to the vector.
Vec4:unpackGet the components of the vector.

See also