Init
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user