summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/3rd/lovr/library/lovr.math.lua42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/3rd/lovr/library/lovr.math.lua b/meta/3rd/lovr/library/lovr.math.lua
index 7cf348c6..3ce62dd9 100644
--- a/meta/3rd/lovr/library/lovr.math.lua
+++ b/meta/3rd/lovr/library/lovr.math.lua
@@ -644,6 +644,20 @@ local Vec2 = {}
function Vec2:add(u) end
---
+---Returns the angle between vectors.
+---
+---
+---### NOTE:
+---If any of the two vectors have a length of zero, the angle between them is not well defined.
+---
+---In this case the function returns `math.pi / 2`.
+---
+---@overload fun(self: lovr.Vec2, x: number, y: number):number
+---@param u lovr.Vec2 # The other vector.
+---@return number angle # The angle to the other vector, in radians.
+function Vec2:angle(u) end
+
+---
---Returns the distance to another vector.
---
---@overload fun(self: lovr.Vec2, x: number, y: number):number
@@ -749,6 +763,20 @@ local Vec3 = {}
function Vec3:add(u) end
---
+---Returns the angle between vectors.
+---
+---
+---### NOTE:
+---If any of the two vectors have a length of zero, the angle between them is not well defined.
+---
+---In this case the function returns `math.pi / 2`.
+---
+---@overload fun(self: lovr.Vec3, x: number, y: number, z: number):number
+---@param u lovr.Vec3 # The other vector.
+---@return number angle # The angle to the other vector, in radians.
+function Vec3:angle(u) end
+
+---
---Sets this vector to be equal to the cross product between this vector and another one.
---
---The new `v` will be perpendicular to both the old `v` and `u`.
@@ -873,6 +901,20 @@ local Vec4 = {}
function Vec4:add(u) end
---
+---Returns the angle between vectors.
+---
+---
+---### NOTE:
+---If any of the two vectors have a length of zero, the angle between them is not well defined.
+---
+---In this case the function returns `math.pi / 2`.
+---
+---@overload fun(self: lovr.Vec4, x: number, y: number, z: number, w: number):number
+---@param u lovr.Vec4 # The other vector.
+---@return number angle # The angle to other vector, in radians.
+function Vec4:angle(u) end
+
+---
---Returns the distance to another vector.
---
---@overload fun(self: lovr.Vec4, x: number, y: number, z: number, w: number):number