mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
progress
This commit is contained in:
parent
ca32c57c52
commit
7963f04bdc
@ -261,7 +261,7 @@ function CARGO:New( Type, Name, Weight ) --R2.1
|
|||||||
self.Name = Name
|
self.Name = Name
|
||||||
self.Weight = Weight
|
self.Weight = Weight
|
||||||
self.CargoObject = nil
|
self.CargoObject = nil
|
||||||
self.CargoCarrier = nil
|
self.CargoCarrier = nil -- Wrapper.Client#CLIENT
|
||||||
self.Representable = false
|
self.Representable = false
|
||||||
self.Slingloadable = false
|
self.Slingloadable = false
|
||||||
self.Moveable = false
|
self.Moveable = false
|
||||||
@ -753,7 +753,7 @@ do -- CARGO_UNIT
|
|||||||
|
|
||||||
if From == "Loaded" then
|
if From == "Loaded" then
|
||||||
|
|
||||||
local CargoCarrier = self.CargoCarrier -- Wrapper.Controllable#CONTROLLABLE
|
local CargoCarrier = self.CargoCarrier -- Wrapper.Client#CLIENT
|
||||||
|
|
||||||
local CargoCarrierPointVec2 = CargoCarrier:GetPointVec2()
|
local CargoCarrierPointVec2 = CargoCarrier:GetPointVec2()
|
||||||
local CargoCarrierHeading = self.CargoCarrier:GetHeading() -- Get Heading of object in degrees.
|
local CargoCarrierHeading = self.CargoCarrier:GetHeading() -- Get Heading of object in degrees.
|
||||||
@ -764,11 +764,12 @@ do -- CARGO_UNIT
|
|||||||
|
|
||||||
|
|
||||||
-- if there is no ToPointVec2 given, then use the CargoRoutePointVec2
|
-- if there is no ToPointVec2 given, then use the CargoRoutePointVec2
|
||||||
ToPointVec2 = ToPointVec2 or CargoRoutePointVec2
|
ToPointVec2 = ToPointVec2 or CargoCarrierPointVec2:GetRandomCoordinateInRadius( NearRadius, 5 )
|
||||||
local DirectionVec3 = CargoCarrierPointVec2:GetDirectionVec3(ToPointVec2)
|
local DirectionVec3 = CargoCarrierPointVec2:GetDirectionVec3(ToPointVec2)
|
||||||
local Angle = CargoCarrierPointVec2:GetAngleDegrees(DirectionVec3)
|
local Angle = CargoCarrierPointVec2:GetAngleDegrees(DirectionVec3)
|
||||||
|
|
||||||
local CargoDeployPointVec2 = CargoCarrierPointVec2:Translate( DeployDistance, Angle )
|
local CargoDeployPointVec2 = CargoCarrierPointVec2:Translate( DeployDistance, Angle )
|
||||||
|
local CargoDeployPointVec2 = CargoCarrierPointVec2:GetRandomCoordinateInRadius( NearRadius, 5 )
|
||||||
|
|
||||||
local FromPointVec2 = CargoCarrierPointVec2
|
local FromPointVec2 = CargoCarrierPointVec2
|
||||||
|
|
||||||
@ -937,7 +938,7 @@ do -- CARGO_UNIT
|
|||||||
-- @param #string Event
|
-- @param #string Event
|
||||||
-- @param #string From
|
-- @param #string From
|
||||||
-- @param #string To
|
-- @param #string To
|
||||||
-- @param Wrapper.Unit#UNIT CargoCarrier
|
-- @param Wrapper.Client#CLIENT CargoCarrier
|
||||||
-- @param #number NearRadius
|
-- @param #number NearRadius
|
||||||
function CARGO_UNIT:onafterBoarding( From, Event, To, CargoCarrier, NearRadius, ... )
|
function CARGO_UNIT:onafterBoarding( From, Event, To, CargoCarrier, NearRadius, ... )
|
||||||
self:F( { From, Event, To, CargoCarrier.UnitName, NearRadius } )
|
self:F( { From, Event, To, CargoCarrier.UnitName, NearRadius } )
|
||||||
@ -1367,6 +1368,8 @@ function CARGO_GROUP:onenterUnBoarding( From, Event, To, ToPointVec2, NearRadius
|
|||||||
|
|
||||||
NearRadius = NearRadius or 25
|
NearRadius = NearRadius or 25
|
||||||
|
|
||||||
|
local CargoCarrier = self.CargoCarrier -- Wrapper.Client#CLIENT
|
||||||
|
|
||||||
local Timer = 1
|
local Timer = 1
|
||||||
|
|
||||||
if From == "Loaded" then
|
if From == "Loaded" then
|
||||||
|
|||||||
@ -303,6 +303,18 @@ do -- COORDINATE
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Return a random Coordinate within an Outer Radius and optionally NOT within an Inner Radius of the COORDINATE.
|
||||||
|
-- @param #COORDINATE self
|
||||||
|
-- @param Dcs.DCSTypes#Distance OuterRadius
|
||||||
|
-- @param Dcs.DCSTypes#Distance InnerRadius
|
||||||
|
-- @return #COORDINATE
|
||||||
|
function COORDINATE:GetRandomCoordinateInRadius( OuterRadius, InnerRadius )
|
||||||
|
self:F2( { OuterRadius, InnerRadius } )
|
||||||
|
|
||||||
|
return COORDINATE:NewFromVec2( self:GetRandomVec2InRadius( OuterRadius, InnerRadius ) )
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--- Return a random Vec3 within an Outer Radius and optionally NOT within an Inner Radius of the COORDINATE.
|
--- Return a random Vec3 within an Outer Radius and optionally NOT within an Inner Radius of the COORDINATE.
|
||||||
-- @param #COORDINATE self
|
-- @param #COORDINATE self
|
||||||
-- @param Dcs.DCSTypes#Distance OuterRadius
|
-- @param Dcs.DCSTypes#Distance OuterRadius
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user