From 71fd72e4627fd065626bc2a7f51bff2e25ff4078 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 25 Apr 2022 09:59:38 +0200 Subject: [PATCH] adding ZONE_POLYGON_BASE:IsVec3InZone( Vec3 ) (might be called from POSITIONABLE), closes gap for GROUP/UNIT:IsInZone(Zone_Polygon) GROUP - better docu --- Moose Development/Moose/Core/Zone.lua | 12 ++++++++++++ Moose Development/Moose/Wrapper/Group.lua | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Core/Zone.lua b/Moose Development/Moose/Core/Zone.lua index e7359808f..de5b91b97 100644 --- a/Moose Development/Moose/Core/Zone.lua +++ b/Moose Development/Moose/Core/Zone.lua @@ -1989,6 +1989,18 @@ function ZONE_POLYGON_BASE:IsVec2InZone( Vec2 ) return InPolygon end +--- Returns if a point is within the zone. +-- @param #ZONE_POLYGON_BASE self +-- @param DCS#Vec3 Vec3 The point to test. +-- @return #boolean true if the point is within the zone. +function ZONE_POLYGON_BASE:IsVec3InZone( Vec3 ) + self:F2( Vec3 ) + + local InZone = self:IsVec2InZone( { x = Vec3.x, y = Vec3.z } ) + + return InZone +end + --- Define a random @{DCS#Vec2} within the zone. -- @param #ZONE_POLYGON_BASE self -- @return DCS#Vec2 The Vec2 coordinate. diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 8098a0526..8127ffba9 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -908,8 +908,8 @@ function GROUP:GetTypeName() return nil end ---- [AIRPLANE] Get the NATO reporting name of a UNIT. Currently airplanes only! ---@param #UNIT self +--- [AIRPLANE] Get the NATO reporting name (platform, e.g. "Flanker") of a GROUP (note - first unit the group). "Bogey" if not found. Currently airplanes only! +--@param #GROUP self --@return #string NatoReportingName or "Bogey" if unknown. function GROUP:GetNatoReportingName() self:F2( self.GroupName ) @@ -1087,7 +1087,7 @@ end -- amount of fuel in the group. -- @param #GROUP self -- @return #number The fuel state of the unit with the least amount of fuel. --- @return #Unit reference to #Unit object for further processing. +-- @return Wrapper.Unit#UNIT reference to #Unit object for further processing. function GROUP:GetFuelMin() self:F3(self.ControllableName)