This commit is contained in:
2025-04-10 21:47:48 +08:00
parent 5827b74619
commit 0152f7b08f
3 changed files with 17 additions and 559 deletions
+16
View File
@@ -49,6 +49,8 @@ do
end
function Utils.getTableSize(table)
if not table then return end
local tableSize = 0
for _,_ in pairs(table) do
tableSize = tableSize + 1
@@ -145,6 +147,20 @@ do
return Utils.mag({x = point1.x - point2.x, y = 0, z = point1.z - point2.z})
end
--- Returns distance in meters between two points in 3D space.
-- @tparam Vec3 point1 first point
-- @tparam Vec3 point2 second point
-- @treturn number distancen between given points in 3D space.
function Utils.get3DDist(point1, point2)
if not point1 then
log:warn("Utils.get3DDist 1st input value is nil")
end
if not point2 then
log:warn("Utils.get3DDist 2nd input value is nil")
end
return Utils.mag({x = point1.x - point2.x, y = point1.y - point2.y, z = point1.z - point2.z})
end
-- @return radians
function Utils.getObjHeading(object)
if not object then return false end