- 'Utils.lua'

1. Add function getObjHeading()
- 'BAirboss.lua'
 1. Add function getAirCraftOnBoardNumber()
This commit is contained in:
2024-12-20 18:49:32 +08:00
parent 9240705a2c
commit d16e4acbb9
3 changed files with 73 additions and 11 deletions
+10
View File
@@ -89,6 +89,16 @@ do
return Utils.mag({x = point1.x - point2.x, y = 0, z = point1.z - point2.z})
end
-- @return radians
function Utils.getObjHeading(object)
if not object then return false end
local objectPos = object:getPosition()
local objectHeading = math.atan2(objectPos.x.z, objectPos.x.x)
return objectHeading
end
function Utils.getNorthCorrection(gPoint) --gets the correction needed for true north
local point = Utils.deepCopy(gPoint)
if not point.z then --Vec2; convert to Vec3