Vec2
EditA vector object that holds two numbers.
Constructors
lovr.math.newVec2 | Create a new Vec2. |
lovr.math.vec2 | Create a temporary Vec2. |
Methods
Vec2:add | Add a vector or a number to the vector. |
Vec2:angle | Get the angle to another vector. |
Vec2:distance | Get the distance to another vector. |
Vec2:div | Divides the vector by a vector or a number. |
Vec2:dot | Get the dot product with another vector. |
Vec2:equals | Check if a vector equals another vector. |
Vec2:length | Get the length of the vector. |
Vec2:lerp | Moves this vector some amount towards another one. |
Vec2:mul | Multiply the vector by a vector or a number. |
Vec2:normalize | Normalize the length of the vector to 1. |
Vec2:set | Set the components of the vector. |
Vec2:sub | Subtract a vector or a number from the vector. |
Vec2:unpack | Get the components of the vector. |