- 'Utils.lua'
1. Add function getObjHeading() - 'BAirboss.lua' 1. Add function getAirCraftOnBoardNumber()
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user