Vec3

Edit

A vector object that holds three numbers.

Constructors

lovr.math.newVec3Create a new Vec3.
lovr.math.vec3Create a temporary Vec3.

Methods

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

See also