mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Fixed bug with GetPointVec2 function that was renamed ...
This commit is contained in:
parent
5d88e449be
commit
bee6e8d7c6
@ -477,8 +477,8 @@ ZONE_GROUP = {
|
|||||||
-- @param DCSTypes#Distance Radius The radius of the zone.
|
-- @param DCSTypes#Distance Radius The radius of the zone.
|
||||||
-- @return #ZONE_GROUP self
|
-- @return #ZONE_GROUP self
|
||||||
function ZONE_GROUP:New( ZoneName, ZoneGROUP, Radius )
|
function ZONE_GROUP:New( ZoneName, ZoneGROUP, Radius )
|
||||||
local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, ZoneGROUP:GetPointVec2(), Radius ) )
|
local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, ZoneGROUP:GetVec2(), Radius ) )
|
||||||
self:F( { ZoneName, ZoneGROUP:GetPointVec2(), Radius } )
|
self:F( { ZoneName, ZoneGROUP:GetVec2(), Radius } )
|
||||||
|
|
||||||
self.ZoneGROUP = ZoneGROUP
|
self.ZoneGROUP = ZoneGROUP
|
||||||
|
|
||||||
@ -489,14 +489,14 @@ end
|
|||||||
--- Returns the current location of the @{Group}.
|
--- Returns the current location of the @{Group}.
|
||||||
-- @param #ZONE_GROUP self
|
-- @param #ZONE_GROUP self
|
||||||
-- @return DCSTypes#Vec2 The location of the zone based on the @{Group} location.
|
-- @return DCSTypes#Vec2 The location of the zone based on the @{Group} location.
|
||||||
function ZONE_GROUP:GetPointVec2()
|
function ZONE_GROUP:GetVec2()
|
||||||
self:F( self.ZoneName )
|
self:F( self.ZoneName )
|
||||||
|
|
||||||
local ZonePointVec2 = self.ZoneGROUP:GetPointVec2()
|
local ZoneVec2 = self.ZoneGROUP:GetVec2()
|
||||||
|
|
||||||
self:T( { ZonePointVec2 } )
|
self:T( { ZoneVec2 } )
|
||||||
|
|
||||||
return ZonePointVec2
|
return ZoneVec2
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Returns a random location within the zone of the @{Group}.
|
--- Returns a random location within the zone of the @{Group}.
|
||||||
@ -506,11 +506,11 @@ function ZONE_GROUP:GetRandomVec2()
|
|||||||
self:F( self.ZoneName )
|
self:F( self.ZoneName )
|
||||||
|
|
||||||
local Point = {}
|
local Point = {}
|
||||||
local PointVec2 = self.ZoneGROUP:GetPointVec2()
|
local Vec2 = self.ZoneGROUP:GetVec2()
|
||||||
|
|
||||||
local angle = math.random() * math.pi*2;
|
local angle = math.random() * math.pi*2;
|
||||||
Point.x = PointVec2.x + math.cos( angle ) * math.random() * self:GetRadius();
|
Point.x = Vec2.x + math.cos( angle ) * math.random() * self:GetRadius();
|
||||||
Point.y = PointVec2.y + math.sin( angle ) * math.random() * self:GetRadius();
|
Point.y = Vec2.y + math.sin( angle ) * math.random() * self:GetRadius();
|
||||||
|
|
||||||
self:T( { Point } )
|
self:T( { Point } )
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,20 @@
|
|||||||
|
local GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||||
|
local GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||||
|
|
||||||
|
local Tank = GROUP:FindByName( "Tank" )
|
||||||
|
local ZoneA = ZONE_GROUP:New( "Zone A", Tank, 100 )
|
||||||
|
|
||||||
|
Messager = SCHEDULER:New( nil,
|
||||||
|
function()
|
||||||
|
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( ZoneA ) ) and "Inside Zone A" or "Outside Zone A", 1 )
|
||||||
|
if GroupInside:IsCompletelyInZone( ZoneA ) then
|
||||||
|
GroupInside:GetUnit(1):SmokeRed()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
{}, 0, 1 )
|
||||||
|
|
||||||
|
TankZoneColoring = SCHEDULER:New( nil,
|
||||||
|
function()
|
||||||
|
ZoneA:FlareZone( POINT_VEC3.FlareColor.White, 90, 60 )
|
||||||
|
end,
|
||||||
|
{}, 0, 5 )
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user