First test mission with ZONE_POLYGON working!

This commit is contained in:
FlightControl 2016-06-05 00:03:27 +02:00
parent 2ac9e76f5c
commit d8790ad2f1
10 changed files with 1188 additions and 34729 deletions

View File

@ -1,8 +0,0 @@
Include.File( "Group" )
Include.File( "Unit" )
local UnitAirPlaneAI = _DATABASE:FindUnit( "Airplane AI" )
UnitAirPlaneAI:FlareRed()

View File

@ -526,6 +526,24 @@ end
-- Is Functions
--- Returns if all units of the group are within a @{Zone#ZONE}.
-- @param #GROUP self
-- @param Zone#ZONE_BASE Zone The zone to test.
-- @return #boolean Returns true if the Group is completely within the @{Zone#ZONE}
function GROUP:IsCompletelyInZone( Zone )
self:F2( { self.GroupName, Zone } )
for UnitID, UnitData in pairs( self:GetUnits() ) do
local Unit = UnitData -- Unit#UNIT
if Zone:IsPointVec3InZone( Unit:GetPointVec3() ) then
else
return false
end
end
return true
end
--- Returns if the group is of an air category.
-- If the group is a helicopter or a plane, then this method will return true, otherwise false.
-- @param #GROUP self
@ -2488,7 +2506,7 @@ end
--- Returns a message for a coalition or a client.
-- @param #GROUP self
-- @param #string Message The message text
-- @param #Duration Duration The duration of the message.
-- @param DCSTypes#Duration Duration The duration of the message.
-- @return Message#MESSAGE
function GROUP:Message( Message, Duration )
self:F2( { Message, Duration } )
@ -2505,7 +2523,7 @@ end
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
-- @param #GROUP self
-- @param #string Message The message text
-- @param #Duration Duration The duration of the message.
-- @param DCSTypes#Duration Duration The duration of the message.
function GROUP:MessageToAll( Message, Duration )
self:F2( { Message, Duration } )
@ -2521,7 +2539,7 @@ end
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
-- @param #GROUP self
-- @param #string Message The message text
-- @param #Duration Duration The duration of the message.
-- @param DCSTYpes#Duration Duration The duration of the message.
function GROUP:MessageToRed( Message, Duration )
self:F2( { Message, Duration } )
@ -2537,7 +2555,7 @@ end
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
-- @param #GROUP self
-- @param #string Message The message text
-- @param #Duration Duration The duration of the message.
-- @param DCSTypes#Duration Duration The duration of the message.
function GROUP:MessageToBlue( Message, Duration )
self:F2( { Message, Duration } )
@ -2553,7 +2571,7 @@ end
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
-- @param #GROUP self
-- @param #string Message The message text
-- @param #Duration Duration The duration of the message.
-- @param DCSTypes#Duration Duration The duration of the message.
-- @param Client#CLIENT Client The client object receiving the message.
function GROUP:MessageToClient( Message, Duration, Client )
self:F2( { Message, Duration } )

View File

@ -121,7 +121,7 @@ function SCHEDULER:_Scheduler()
self:T( { Status, Result } )
if Status and Status == true and Result and Result == true then
if Status and ( ( not Result ) or ( Result and Result ~= false ) ) then
if self.Repeat and ( not self.StopSeconds or ( self.StopSeconds and timer.getTime() <= self.StartTime + self.StopSeconds ) ) then
timer.scheduleFunction(
self._Scheduler,

View File

@ -1,79 +1,346 @@
--- ZONE Classes
-- =============
-- This module contains the ZONE classes, inherited from @{Zone#ZONE_BASE}.
-- There are essentially two core functions that zones accomodate:
--
-- * Test if an object is within the zone boundaries.
-- * Provide the zone behaviour. Some zones are static, while others are moveable.
--
-- The object classes are using the zone classes to test the zone boundaries, which can take various forms:
--
-- * Test if completely within the zone.
-- * Test if partly within the zone (for @{Group#GROUP} objects).
-- * Test if not in the zone.
-- * Distance to the nearest intersecting point of the zone.
-- * Distance to the center of the zone.
-- * ...
--
-- Each of these ZONE classes have a zone name, and specific parameters defining the zone type:
--
-- * @{Zone#ZONE_BASE}: The ZONE_BASE class defining the base for all other zone classes.
-- * @{Zone#ZONE_RADIUS}: The ZONE_RADIUS class defined by a zone name, a location and a radius.
-- * @{Zone#ZONE}: The ZONE class, defined by the zone name as defined within the Mission Editor.
-- * @{Zone#ZONE_UNIT}: The ZONE_UNIT class defined by a zone around a @{Unit#UNIT} with a radius.
-- * @{Zone#ZONE_POLYGON}: The ZONE_POLYGON class defined by a sequence of @{Group#GROUP} waypoints within the Mission Editor, forming a polygon.
--
-- Polymorphic methods
-- ===================
-- Each zone implements two polymorphic functions defined in @{Zone#ZONE_BASE}:
--
-- * @{#ZONE_BASE.IsPointVec2InZone}: Returns if a location is within the zone.
-- * @{#ZONE_BASE.IsPointVec3InZone}: Returns if a point is within the zone.
--
-- @module Zone
-- @author FlightControl
Include.File( "Routines" )
Include.File( "Base" )
Include.File( "Message" )
--- The ZONE class
-- @type ZONE
-- @Extends Base#BASE
ZONE = {
ClassName="ZONE",
}
function ZONE:New( ZoneName )
local self = BASE:Inherit( self, BASE:New() )
self:F( ZoneName )
local Zone = trigger.misc.getZone( ZoneName )
if not Zone then
error( "Zone " .. ZoneName .. " does not exist." )
return nil
end
self.Zone = Zone
self.ZoneName = ZoneName
--- The ZONE_BASE class
-- @type ZONE_BASE
-- @Extends Base#BASE
ZONE_BASE = {
ClassName = "ZONE_BASE",
}
function ZONE_BASE:New( ZoneName )
local self = BASE:Inherit( self, BASE:New() )
self:F( ZoneName )
self.ZoneName = ZoneName
return self
end
--- Returns if a location is within the zone.
-- @param #ZONE_RADIUS self
-- @param DCSTypes#Vec2 PointVec2 The location to test.
-- @return #boolean true if the location is within the zone.
function ZONE_BASE:IsPointVec2InZone( PointVec2 )
self:F2( PointVec2 )
return false
end
--- Returns if a point is within the zone.
-- @param #ZONE_RADIUS self
-- @param DCSTypes#Vec3 PointVec3 The point to test.
-- @return #boolean true if the point is within the zone.
function ZONE_BASE:IsPointVec3InZone( PointVec3 )
self:F2( PointVec3 )
local InZone = self:IsPointVec2InZone( { x = PointVec3.x, y = PointVec3.z } )
return InZone
end
--- The ZONE_RADIUS class, defined by a zone name, a location and a radius.
-- @type ZONE_RADIUS
-- @field DCSTypes#Vec2 PointVec2 The current location of the zone.
-- @field DCSTypes#Distance Radius The radius of the zone.
-- @Extends Zone#ZONE_BASE
ZONE_RADIUS = {
ClassName="ZONE_RADIUS",
}
--- Constructor of ZONE_RADIUS, taking the zone name, the zone location and a radius.
-- @param #ZONE_RADIUS self
-- @param DCSTypes#Vec2 PointVec2 The location of the zone.
-- @param DCSTypes#Distance Radius The radius of the zone.
-- @return #ZONE_RADIUS
function ZONE_RADIUS:New( ZoneName, PointVec2, Radius )
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) )
self:F( { ZoneName, PointVec2, Radius } )
self.Radius = Radius
self.PointVec2 = PointVec2
return self
end
function ZONE:GetPointVec2()
self:F( self.ZoneName )
local Zone = trigger.misc.getZone( self.ZoneName )
local Point = { x = Zone.point.x, y = Zone.point.z }
--- Returns the radius of the zone.
-- @param #ZONE_RADIUS self
-- @return DCSTypes#Distance The radius of the zone.
function ZONE_RADIUS:GetRadius()
self:F2( self.ZoneName )
self:T( { Zone, Point } )
self:T2( { self.Radius } )
return self.Radius
end
--- Sets the radius of the zone.
-- @param #ZONE_RADIUS self
-- @param DCSTypes#Distance Radius The radius of the zone.
-- @return DCSTypes#Distance The radius of the zone.
function ZONE_RADIUS:SetRadius( Radius )
self:F2( self.ZoneName )
self.Radius = Radius
self:T2( { self.Radius } )
return self.Radius
end
--- Returns the location of the zone.
-- @param #ZONE_RADIUS self
-- @return DCSTypes#Vec2 The location of the zone.
function ZONE_RADIUS:GetPointVec2()
self:F2( self.ZoneName )
self:T2( { self.PointVec2 } )
return Point
return self.PointVec2
end
function ZONE:GetPointVec3( Height )
self:F( self.ZoneName )
local Zone = trigger.misc.getZone( self.ZoneName )
local Point = { x = Zone.point.x, y = land.getHeight( self:GetPointVec2() ) + Height, z = Zone.point.z }
self:T( { Zone, Point } )
--- Sets the location of the zone.
-- @param #ZONE_RADIUS self
-- @param DCSTypes#Vec2 PointVec2 The new location of the zone.
-- @return DCSTypes#Vec2 The new location of the zone.
function ZONE_RADIUS:SetPointVec2( PointVec2 )
self:F2( self.ZoneName )
return Point
self.PointVec2 = PointVec2
self:T2( { self.PointVec2 } )
return self.PointVec2
end
function ZONE:GetRandomPointVec2()
--- Returns the point of the zone.
-- @param #ZONE_RADIUS self
-- @param DCSTypes#Distance Height The height to add to the land height where the center of the zone is located.
-- @return DCSTypes#Vec3 The point of the zone.
function ZONE_RADIUS:GetPointVec3( Height )
self:F2( self.ZoneName )
local PointVec2 = self:GetPointVec2()
local PointVec3 = { x = PointVec2.x, y = land.getHeight( self:GetPointVec2() ) + Height, z = PointVec2.y }
self:T2( { PointVec3 } )
return PointVec3
end
--- Returns if a location is within the zone.
-- @param #ZONE_RADIUS self
-- @param DCSTypes#Vec2 PointVec2 The location to test.
-- @return #boolean true if the location is within the zone.
function ZONE_RADIUS:IsPointVec2InZone( PointVec2 )
self:F2( PointVec2 )
if (( PointVec2.x - self.PointVec2.x )^2 + ( PointVec2.y - self.PointVec2.y ) ^2 ) ^ 0.5 <= self.Radius then
return true
end
return false
end
--- Returns if a point is within the zone.
-- @param #ZONE_RADIUS self
-- @param DCSTypes#Vec3 PointVec3 The point to test.
-- @return #boolean true if the point is within the zone.
function ZONE_RADIUS:IsPointVec3InZone( PointVec3 )
self:F2( PointVec3 )
local InZone = self:IsPointVec3InZone( { x = PointVec3.x, y = PointVec3.z } )
return InZone
end
--- Returns a random location within the zone.
-- @param #ZONE_RADIUS self
-- @return DCSTypes#Vec2 The random location within the zone.
function ZONE_RADIUS:GetRandomPointVec2()
self:F( self.ZoneName )
local Point = {}
local Zone = trigger.misc.getZone( self.ZoneName )
local angle = math.random() * math.pi*2;
Point.x = Zone.point.x + math.cos( angle ) * math.random() * Zone.radius;
Point.y = Zone.point.z + math.sin( angle ) * math.random() * Zone.radius;
Point.x = self.PointVec2.x + math.cos( angle ) * math.random() * self.Radius;
Point.y = self.PointVec2.y + math.sin( angle ) * math.random() * self.Radius;
self:T( { Zone, Point } )
self:T( { Point } )
return Point
end
function ZONE:GetRadius()
self:F( self.ZoneName )
local Zone = trigger.misc.getZone( self.ZoneName )
self:T( { Zone } )
--- The ZONE class, defined by the zone name as defined within the Mission Editor. The location and the radius are automatically collected from the mission settings.
-- @type ZONE
-- @Extends Zone#ZONE_RADIUS
ZONE = {
ClassName="ZONE",
}
return Zone.radius
--- Constructor of ZONE, taking the zone name.
-- @param #ZONE self
-- @param #string ZoneName The name of the zone as defined within the mission editor.
-- @return #ZONE
function ZONE:New( ZoneName )
local Zone = trigger.misc.getZone( ZoneName )
if not Zone then
error( "Zone " .. ZoneName .. " does not exist." )
return nil
end
local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, { x = Zone.x, y = Zone.y }, Zone.radius ) )
self:F( ZoneName )
self.Zone = Zone
return self
end
--- The ZONE_UNIT class defined by a zone around a @{Unit#UNIT} with a radius.
-- @type ZONE_UNIT
-- @field Unit#UNIT ZoneUNIT
-- @Extends Zone#ZONE_RADIUS
ZONE_UNIT = {
ClassName="ZONE_UNIT",
}
--- Constructor to create a ZONE_UNIT instance, taking the zone name, a zone unit and a radius.
-- @param #ZONE_UNIT self
-- @param #string ZoneName Name of the zone.
-- @param Unit#UNIT ZoneUNIT The unit as the center of the zone.
-- @param DCSTypes#Distance Radius The radius of the zone.
-- @return #ZONE_UNIT self
function ZONE_UNIT:New( ZoneName, ZoneUNIT, Radius )
local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, ZoneUNIT:GetPointVec2(), Radius ) )
self:F( { ZoneName, ZoneUNIT:GetPointVec2(), Radius } )
self.ZoneUNIT = ZoneUNIT
return self
end
--- Returns the current location of the @{Unit#UNIT}.
-- @param #ZONE_UNIT self
-- @return DCSTypes#Vec2 The location of the zone based on the @{Unit#UNIT}location.
function ZONE_UNIT:GetPointVec2()
self:F( self.ZoneName )
local ZonePointVec2 = self.ZoneUNIT:GetPointVec2()
self:T( { ZonePointVec2 } )
return ZonePointVec2
end
--- The ZONE_POLYGON class defined by a sequence of @{Group#GROUP} waypoints within the Mission Editor, forming a polygon.
-- @type ZONE_POLYGON
-- @Extends Zone#ZONE_BASE
ZONE_POLYGON = {
ClassName="ZONE_POLYGON",
}
--- Constructor to create a ZONE_POLYGON instance, taking the zone name and the name of the @{Group#GROUP} defined within the Mission Editor.
-- The @{Group#GROUP} waypoints define the polygon corners. The first and the last point are automatically connected by ZONE_POLYGON.
-- @param #ZONE_POLYGON self
-- @param #string ZoneName Name of the zone.
-- @param Group#GROUP ZoneGroup The GROUP waypoints as defined within the Mission Editor define the polygon shape.
-- @return #ZONE_POLYGON self
function ZONE_POLYGON:New( ZoneName, ZoneGroup )
local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) )
self:F( { ZoneName, ZoneGroup } )
local GroupPoints = ZoneGroup:GetTaskRoute()
local i = 0
self.Polygon = {}
for i = 1, #GroupPoints do
self.Polygon[i] = {}
self.Polygon[i].x = GroupPoints[i].x
self.Polygon[i].y = GroupPoints[i].y
end
return self
end
--- Returns if a location is within the zone.
-- @param #ZONE_POLYGON self
-- @param DCSTypes#Vec2 PointVec2 The location to test.
-- @return #boolean true if the location is within the zone.
function ZONE_POLYGON:IsPointVec2InZone( PointVec2 )
self:F2( PointVec2 )
local i
local j
local c = false
i = 1
j = #self.Polygon
while i < #self.Polygon do
j = i
i = i + 1
self:T( { i, j, self.Polygon[i], self.Polygon[j] } )
if ( ( ( self.Polygon[i].y > PointVec2.y ) ~= ( self.Polygon[j].y > PointVec2.y ) ) and
( PointVec2.x < ( self.Polygon[j].x - self.Polygon[i].x ) * ( PointVec2.y - self.Polygon[i].y ) / ( self.Polygon[j].y - self.Polygon[i].y ) + self.Polygon[i].x )
) then
c = not c
end
self:T( { "c = ", c } )
end
return c
end

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
Include.File( "Zone" )
Include.File( "Group" )
Include.File( "Scheduler" )
local GroupInside = GROUP:FindByName( "Test Inside Polygon" )
local GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
local GroupPolygon = GROUP:FindByName( "Polygon A" )
local PolygonZone = ZONE_POLYGON:New( "Polygon A", GroupPolygon )
local function Message()
end
Messager = SCHEDULER:New( nil,
function()
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 0.5 )
if GroupInside:IsCompletelyInZone( PolygonZone ) then
GroupInside:GetUnit(1):SmokeWhite()
end
end,
{}, 0, 0.5 )

View File

@ -71,7 +71,46 @@
<div id="content">
<h1>Module <code>Zone</code></h1>
<p>ZONE Classes</p>
<h1>ZONE Classes</h1>
<p>This module contains the ZONE classes, inherited from <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>.</p>
<p>There are essentially two core functions that zones accomodate:</p>
<ul>
<li>Test if an object is within the zone boundaries.</li>
<li>Provide the zone behaviour. Some zones are static, while others are moveable.</li>
</ul>
<p>The object classes are using the zone classes to test the zone boundaries, which can take various forms:</p>
<ul>
<li>Test if completely within the zone.</li>
<li>Test if partly within the zone (for <a href="Group.html##(GROUP)">Group#GROUP</a> objects).</li>
<li>Test if not in the zone.</li>
<li>Distance to the nearest intersecting point of the zone.</li>
<li>Distance to the center of the zone.</li>
<li>...</li>
</ul>
<p>Each of these ZONE classes have a zone name, and specific parameters defining the zone type:</p>
<ul>
<li><a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>: The ZONE_BASE class defining the base for all other zone classes.</li>
<li><a href="Zone.html##(ZONE_RADIUS)">Zone#ZONE_RADIUS</a>: The ZONE_RADIUS class defined by a zone name, a location and a radius.</li>
<li><a href="Zone.html##(ZONE)">Zone#ZONE</a>: The ZONE class, defined by the zone name as defined within the Mission Editor.</li>
<li><a href="Zone.html##(ZONE_UNIT)">Zone#ZONE_UNIT</a>: The ZONE_UNIT class defined by a zone around a <a href="Unit.html##(UNIT)">Unit#UNIT</a> with a radius.</li>
<li><a href="Zone.html##(ZONE_POLYGON)">Zone#ZONE_POLYGON</a>: The ZONE_POLYGON class defined by a sequence of <a href="Group.html##(GROUP)">Group#GROUP</a> waypoints within the Mission Editor, forming a polygon.</li>
</ul>
<h1>Polymorphic methods</h1>
<p>Each zone implements two polymorphic functions defined in <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>:</p>
<ul>
<li><a href="##(ZONE_BASE).IsPointVec2InZone">ZONE_BASE.IsPointVec2InZone</a>: Returns if a location is within the zone.</li>
<li><a href="##(ZONE_BASE).IsPointVec3InZone">ZONE_BASE.IsPointVec3InZone</a>: Returns if a point is within the zone.</li>
</ul>
<h2>Global(s)</h2>
<table class="function_list">
@ -79,6 +118,30 @@
<td class="name" nowrap="nowrap"><a href="#ZONE">ZONE</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#ZONE_BASE">ZONE_BASE</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#ZONE_POLYGON">ZONE_POLYGON</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#ZONE_RADIUS">ZONE_RADIUS</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#ZONE_UNIT">ZONE_UNIT</a></td>
<td class="summary">
</td>
</tr>
</table>
@ -88,35 +151,165 @@
<td class="name" nowrap="nowrap"><a href="##(ZONE).ClassName">ZONE.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE).GetPointVec2">ZONE:GetPointVec2()</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE).GetPointVec3">ZONE:GetPointVec3(Height)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE).GetRadius">ZONE:GetRadius()</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE).GetRandomPointVec2">ZONE:GetRandomPointVec2()</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE).New">ZONE:New(ZoneName)</a></td>
<td class="summary">
<p>Constructor of ZONE, taking the zone name.</p>
</td>
</tr>
</table>
<h2><a id="#(ZONE_BASE)">Type <code>ZONE_BASE</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).ClassName">ZONE_BASE.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).IsPointVec2InZone">ZONE_BASE:IsPointVec2InZone(PointVec2)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).IsPointVec3InZone">ZONE_BASE:IsPointVec3InZone(PointVec3)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).New">ZONE_BASE:New(ZoneName)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(ZONE_POLYGON)">Type <code>ZONE_POLYGON</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_POLYGON).ClassName">ZONE_POLYGON.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_POLYGON).IsPointVec2InZone">ZONE_POLYGON:IsPointVec2InZone(PointVec2)</a></td>
<td class="summary">
<p>Returns if a location is within the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_POLYGON).New">ZONE_POLYGON:New(ZoneName, ZoneGroup)</a></td>
<td class="summary">
<p>Constructor to create a ZONE_POLYGON instance, taking the zone name and the name of the <a href="Group.html##(GROUP)">Group#GROUP</a> defined within the Mission Editor.</p>
</td>
</tr>
</table>
<h2><a id="#(ZONE_RADIUS)">Type <code>ZONE_RADIUS</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).ClassName">ZONE_RADIUS.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).GetPointVec2">ZONE_RADIUS:GetPointVec2()</a></td>
<td class="summary">
<p>Returns the location of the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).GetPointVec3">ZONE_RADIUS:GetPointVec3(Height)</a></td>
<td class="summary">
<p>Returns the point of the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).GetRadius">ZONE_RADIUS:GetRadius()</a></td>
<td class="summary">
<p>Returns the radius of the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).GetRandomPointVec2">ZONE_RADIUS:GetRandomPointVec2()</a></td>
<td class="summary">
<p>Returns a random location within the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).IsPointVec2InZone">ZONE_RADIUS:IsPointVec2InZone(PointVec2)</a></td>
<td class="summary">
<p>Returns if a location is within the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).IsPointVec3InZone">ZONE_RADIUS:IsPointVec3InZone(PointVec3)</a></td>
<td class="summary">
<p>Returns if a point is within the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).New">ZONE_RADIUS:New(PointVec2, Radius, ZoneName)</a></td>
<td class="summary">
<p>Constructor of ZONE_RADIUS, taking the zone name, the zone location and a radius.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).PointVec2">ZONE_RADIUS.PointVec2</a></td>
<td class="summary">
<p>The current location of the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).Radius">ZONE_RADIUS.Radius</a></td>
<td class="summary">
<p>The radius of the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).SetPointVec2">ZONE_RADIUS:SetPointVec2(PointVec2)</a></td>
<td class="summary">
<p>Sets the location of the zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).SetRadius">ZONE_RADIUS:SetRadius(Radius)</a></td>
<td class="summary">
<p>Sets the radius of the zone.</p>
</td>
</tr>
</table>
<h2><a id="#(ZONE_UNIT)">Type <code>ZONE_UNIT</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_UNIT).ClassName">ZONE_UNIT.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_UNIT).GetPointVec2">ZONE_UNIT:GetPointVec2()</a></td>
<td class="summary">
<p>Returns the current location of the <a href="Unit.html##(UNIT)">Unit#UNIT</a>.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_UNIT).New">ZONE_UNIT:New(ZoneName, ZoneUNIT, Radius)</a></td>
<td class="summary">
<p>Constructor to create a ZONE_UNIT instance, taking the zone name, a zone unit and a radius.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_UNIT).ZoneUNIT">ZONE_UNIT.ZoneUNIT</a></td>
<td class="summary">
</td>
</tr>
@ -135,13 +328,72 @@
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(ZONE_BASE)">#ZONE_BASE</a></em>
<a id="ZONE_BASE" >
<strong>ZONE_BASE</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(ZONE_POLYGON)">#ZONE_POLYGON</a></em>
<a id="ZONE_POLYGON" >
<strong>ZONE_POLYGON</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(ZONE_RADIUS)">#ZONE_RADIUS</a></em>
<a id="ZONE_RADIUS" >
<strong>ZONE_RADIUS</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(ZONE_UNIT)">#ZONE_UNIT</a></em>
<a id="ZONE_UNIT" >
<strong>ZONE_UNIT</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(Zone)" >Type <code>Zone</code></a></h2>
<h2><a id="#(ZONE)" >Type <code>ZONE</code></a></h2>
<p>The ZONE class</p>
<p>The ZONE class, defined by the zone name as defined within the Mission Editor.</p>
<p>The location and the radius are automatically collected from the mission settings.</p>
<h3>Field(s)</h3>
<dl class="function">
@ -161,8 +413,42 @@
<dl class="function">
<dt>
<a id="#(ZONE).GetPointVec2" >
<strong>ZONE:GetPointVec2()</strong>
<a id="#(ZONE).New" >
<strong>ZONE:New(ZoneName)</strong>
</a>
</dt>
<dd>
<p>Constructor of ZONE, taking the zone name.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string ZoneName </em></code>:
The name of the zone as defined within the mission editor.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(ZONE)">#ZONE</a>:</em></p>
</dd>
</dl>
<h2><a id="#(ZONE_BASE)" >Type <code>ZONE_BASE</code></a></h2>
<p>The ZONE_BASE class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(ZONE_BASE).ClassName" >
<strong>ZONE_BASE.ClassName</strong>
</a>
</dt>
<dd>
@ -174,8 +460,8 @@
<dl class="function">
<dt>
<a id="#(ZONE).GetPointVec3" >
<strong>ZONE:GetPointVec3(Height)</strong>
<a id="#(ZONE_BASE).IsPointVec2InZone" >
<strong>ZONE_BASE:IsPointVec2InZone(PointVec2)</strong>
</a>
</dt>
<dd>
@ -186,7 +472,7 @@
<ul>
<li>
<p><code><em> Height </em></code>: </p>
<p><code><em> PointVec2 </em></code>: </p>
</li>
</ul>
@ -195,34 +481,29 @@
<dl class="function">
<dt>
<a id="#(ZONE).GetRadius" >
<strong>ZONE:GetRadius()</strong>
<a id="#(ZONE_BASE).IsPointVec3InZone" >
<strong>ZONE_BASE:IsPointVec3InZone(PointVec3)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> PointVec3 </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE).GetRandomPointVec2" >
<strong>ZONE:GetRandomPointVec2()</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE).New" >
<strong>ZONE:New(ZoneName)</strong>
<a id="#(ZONE_BASE).New" >
<strong>ZONE_BASE:New(ZoneName)</strong>
</a>
</dt>
<dd>
@ -237,6 +518,455 @@
</li>
</ul>
</dd>
</dl>
<h2><a id="#(ZONE_POLYGON)" >Type <code>ZONE_POLYGON</code></a></h2>
<p>The ZONE_POLYGON class defined by a sequence of <a href="Group.html##(GROUP)">Group#GROUP</a> waypoints within the Mission Editor, forming a polygon.</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(ZONE_POLYGON).ClassName" >
<strong>ZONE_POLYGON.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_POLYGON).IsPointVec2InZone" >
<strong>ZONE_POLYGON:IsPointVec2InZone(PointVec2)</strong>
</a>
</dt>
<dd>
<p>Returns if a location is within the zone.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> PointVec2 </em></code>:
The location to test.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
true if the location is within the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_POLYGON).New" >
<strong>ZONE_POLYGON:New(ZoneName, ZoneGroup)</strong>
</a>
</dt>
<dd>
<p>Constructor to create a ZONE_POLYGON instance, taking the zone name and the name of the <a href="Group.html##(GROUP)">Group#GROUP</a> defined within the Mission Editor.</p>
<p>The <a href="Group.html##(GROUP)">Group#GROUP</a> waypoints define the polygon corners. The first and the last point are automatically connected by ZONE_POLYGON.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string ZoneName </em></code>:
Name of the zone.</p>
</li>
<li>
<p><code><em><a href="Group.html##(GROUP)">Group#GROUP</a> ZoneGroup </em></code>:
The GROUP waypoints as defined within the Mission Editor define the polygon shape.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(ZONE_POLYGON)">#ZONE_POLYGON</a>:</em>
self</p>
</dd>
</dl>
<h2><a id="#(ZONE_RADIUS)" >Type <code>ZONE_RADIUS</code></a></h2>
<p>The ZONE_RADIUS class, defined by a zone name, a location and a radius.</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(ZONE_RADIUS).ClassName" >
<strong>ZONE_RADIUS.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_RADIUS).GetPointVec2" >
<strong>ZONE_RADIUS:GetPointVec2()</strong>
</a>
</dt>
<dd>
<p>Returns the location of the zone.</p>
<h3>Return value</h3>
<p><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>:</em>
The location of the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_RADIUS).GetPointVec3" >
<strong>ZONE_RADIUS:GetPointVec3(Height)</strong>
</a>
</dt>
<dd>
<p>Returns the point of the zone.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a> Height </em></code>:
The height to add to the land height where the center of the zone is located.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="DCSTypes.html##(Vec3)">DCSTypes#Vec3</a>:</em>
The point of the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_RADIUS).GetRadius" >
<strong>ZONE_RADIUS:GetRadius()</strong>
</a>
</dt>
<dd>
<p>Returns the radius of the zone.</p>
<h3>Return value</h3>
<p><em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a>:</em>
The radius of the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_RADIUS).GetRandomPointVec2" >
<strong>ZONE_RADIUS:GetRandomPointVec2()</strong>
</a>
</dt>
<dd>
<p>Returns a random location within the zone.</p>
<h3>Return value</h3>
<p><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>:</em>
The random location within the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_RADIUS).IsPointVec2InZone" >
<strong>ZONE_RADIUS:IsPointVec2InZone(PointVec2)</strong>
</a>
</dt>
<dd>
<p>Returns if a location is within the zone.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> PointVec2 </em></code>:
The location to test.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
true if the location is within the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_RADIUS).IsPointVec3InZone" >
<strong>ZONE_RADIUS:IsPointVec3InZone(PointVec3)</strong>
</a>
</dt>
<dd>
<p>Returns if a point is within the zone.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="DCSTypes.html##(Vec3)">DCSTypes#Vec3</a> PointVec3 </em></code>:
The point to test.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
true if the point is within the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_RADIUS).New" >
<strong>ZONE_RADIUS:New(PointVec2, Radius, ZoneName)</strong>
</a>
</dt>
<dd>
<p>Constructor of ZONE_RADIUS, taking the zone name, the zone location and a radius.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> PointVec2 </em></code>:
The location of the zone.</p>
</li>
<li>
<p><code><em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a> Radius </em></code>:
The radius of the zone.</p>
</li>
<li>
<p><code><em> ZoneName </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(ZONE_RADIUS)">#ZONE_RADIUS</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a></em>
<a id="#(ZONE_RADIUS).PointVec2" >
<strong>ZONE_RADIUS.PointVec2</strong>
</a>
</dt>
<dd>
<p>The current location of the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a></em>
<a id="#(ZONE_RADIUS).Radius" >
<strong>ZONE_RADIUS.Radius</strong>
</a>
</dt>
<dd>
<p>The radius of the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_RADIUS).SetPointVec2" >
<strong>ZONE_RADIUS:SetPointVec2(PointVec2)</strong>
</a>
</dt>
<dd>
<p>Sets the location of the zone.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> PointVec2 </em></code>:
The new location of the zone.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>:</em>
The new location of the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_RADIUS).SetRadius" >
<strong>ZONE_RADIUS:SetRadius(Radius)</strong>
</a>
</dt>
<dd>
<p>Sets the radius of the zone.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a> Radius </em></code>:
The radius of the zone.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a>:</em>
The radius of the zone.</p>
</dd>
</dl>
<h2><a id="#(ZONE_UNIT)" >Type <code>ZONE_UNIT</code></a></h2>
<p>The ZONE_UNIT class defined by a zone around a <a href="Unit.html##(UNIT)">Unit#UNIT</a> with a radius.</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(ZONE_UNIT).ClassName" >
<strong>ZONE_UNIT.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_UNIT).GetPointVec2" >
<strong>ZONE_UNIT:GetPointVec2()</strong>
</a>
</dt>
<dd>
<p>Returns the current location of the <a href="Unit.html##(UNIT)">Unit#UNIT</a>.</p>
<h3>Return value</h3>
<p><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a>:</em>
The location of the zone based on the <a href="Unit.html##(UNIT)">Unit#UNIT</a>location.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(ZONE_UNIT).New" >
<strong>ZONE_UNIT:New(ZoneName, ZoneUNIT, Radius)</strong>
</a>
</dt>
<dd>
<p>Constructor to create a ZONE_UNIT instance, taking the zone name, a zone unit and a radius.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string ZoneName </em></code>:
Name of the zone.</p>
</li>
<li>
<p><code><em><a href="Unit.html##(UNIT)">Unit#UNIT</a> ZoneUNIT </em></code>:
The unit as the center of the zone.</p>
</li>
<li>
<p><code><em><a href="DCSTypes.html##(Distance)">DCSTypes#Distance</a> Radius </em></code>:
The radius of the zone.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(ZONE_UNIT)">#ZONE_UNIT</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Unit.html##(UNIT)">Unit#UNIT</a></em>
<a id="#(ZONE_UNIT).ZoneUNIT" >
<strong>ZONE_UNIT.ZoneUNIT</strong>
</a>
</dt>
<dd>
</dd>
</dl>

View File

@ -358,7 +358,8 @@
<tr>
<td class="name" nowrap="nowrap"><a href="Zone.html">Zone</a></td>
<td class="summary">
<p>ZONE Classes</p>
<h1>ZONE Classes</h1>
<p>This module contains the ZONE classes, inherited from <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>.</p>
</td>
</tr>
<tr>