mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Implemented a new method on ZONE:BoundZone
Creates a visual boundary around a ZONE_* of tires with a white flag. These tires will also move when the ZONE is "rebound".
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
---
|
||||
-- Name: ZON-100 - Normal Zone
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 21 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE has been defined, which boundaries are smoking.
|
||||
-- A vehicle is driving through the zone perimeters.
|
||||
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the zone perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
|
||||
local GroupInside = GROUP:FindByName( "Test Inside Polygon" )
|
||||
local GroupOutside = GROUP:FindByName( "Test Outside Polygon" )
|
||||
|
||||
local ZoneA = ZONE:New( "Zone A" )
|
||||
ZoneA:BoundZone( 90 )
|
||||
|
||||
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 )
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,33 @@
|
||||
---
|
||||
-- Name: ZON-502 - Polygon Zone Boundary
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 18 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- A ZONE_POLYGON has been defined, which boundaries are tires.
|
||||
-- A vehicle is driving through the zone perimeters.
|
||||
-- When the vehicle is driving in the zone, a red smoke is fired from the vehicle location.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the polygon perimeter smoke.
|
||||
-- 2. Observe the vehicle smoking a red smoke when driving through the zone.
|
||||
|
||||
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 )
|
||||
PolygonZone:BoundZone()
|
||||
|
||||
Messager = SCHEDULER:New( nil,
|
||||
function()
|
||||
GroupInside:MessageToAll( ( GroupInside:IsCompletelyInZone( PolygonZone ) ) and "Inside Polygon A" or "Outside Polygon A", 1 )
|
||||
if GroupInside:IsCompletelyInZone( PolygonZone ) then
|
||||
GroupInside:GetUnit(1):SmokeRed()
|
||||
end
|
||||
end,
|
||||
{}, 0, 1 )
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user