Added DCSEx.world.getGroupCenter

This commit is contained in:
Ambroise Garel
2025-07-25 10:08:43 +02:00
parent 81d833dc30
commit 46cea8eba9
+7 -1
View File
@@ -360,7 +360,7 @@ do
return sceneries return sceneries
end end
-- TODO: description -- TODO: description, update file header
function DCSEx.world.getTerrainHeightDiff(coord, searchRadius) function DCSEx.world.getTerrainHeightDiff(coord, searchRadius)
local samples = {} local samples = {}
searchRadius = searchRadius or 5 searchRadius = searchRadius or 5
@@ -385,6 +385,12 @@ do
return tMax - tMin return tMax - tMin
end end
-- TODO: description, update file header
function DCSEx.world.getGroupCenter(group)
return DCSEx.world.getUnitsCenter(group:getUnits())
end
-- TODO: description, update file header
function DCSEx.world.getUnitsCenter(units) function DCSEx.world.getUnitsCenter(units)
if not units or #units == 0 then return { x = 0, y = 0 } end if not units or #units == 0 then return { x = 0, y = 0 } end