OPS Respawn

This commit is contained in:
Frank
2021-07-15 22:25:02 +02:00
parent 835041e5f6
commit 78b3e3c60b
6 changed files with 252 additions and 98 deletions

View File

@@ -26,19 +26,28 @@
--
-- ### Authors:
--
-- * FlightControl : Design & Programming
-- * FlightControl (Design & Programming)
--
-- ### Contributions:
--
-- * funkyfranky
-- * Applevangelist
--
-- ===
--
-- @module Core.Point
-- @image Core_Coordinate.JPG
do -- COORDINATE
--- @type COORDINATE
-- @field #string ClassName Name of the class
-- @field #number x Component of the 3D vector.
-- @field #number y Component of the 3D vector.
-- @field #number z Component of the 3D vector.
-- @field #number Heading Heading in degrees. Needs to be set first.
-- @field #number Velocity Velocity in meters per second. Needs to be set first.
-- @extends Core.Base#BASE
@@ -201,13 +210,24 @@ do -- COORDINATE
ClassName = "COORDINATE",
}
--- @field COORDINATE.WaypointAltType
--- Waypoint altitude types.
-- @type COORDINATE.WaypointAltType
-- @field #string BARO Barometric altitude.
-- @field #string RADIO Radio altitude.
COORDINATE.WaypointAltType = {
BARO = "BARO",
RADIO = "RADIO",
}
--- @field COORDINATE.WaypointAction
--- Waypoint actions.
-- @type COORDINATE.WaypointAction
-- @field #string TurningPoint Turning point.
-- @field #string FlyoverPoint Fly over point.
-- @field #string FromParkingArea From parking area.
-- @field #string FromParkingAreaHot From parking area hot.
-- @field #string FromRunway From runway.
-- @field #string Landing Landing.
-- @field #string LandingReFuAr Landing and refuel and rearm.
COORDINATE.WaypointAction = {
TurningPoint = "Turning Point",
FlyoverPoint = "Fly Over Point",
@@ -218,7 +238,14 @@ do -- COORDINATE
LandingReFuAr = "LandingReFuAr",
}
--- @field COORDINATE.WaypointType
--- Waypoint types.
-- @type COORDINATE.WaypointType
-- @field #string TakeOffParking Take of parking.
-- @field #string TakeOffParkingHot Take of parking hot.
-- @field #string TakeOff Take off parking hot.
-- @field #string TurningPoint Turning point.
-- @field #string Land Landing point.
-- @field #string LandingReFuAr Landing and refuel and rearm.
COORDINATE.WaypointType = {
TakeOffParking = "TakeOffParking",
TakeOffParkingHot = "TakeOffParkingHot",
@@ -232,13 +259,13 @@ do -- COORDINATE
--- COORDINATE constructor.
-- @param #COORDINATE self
-- @param DCS#Distance x The x coordinate of the Vec3 point, pointing to the North.
-- @param DCS#Distance y The y coordinate of the Vec3 point, pointing to the Right.
-- @param DCS#Distance z The z coordinate of the Vec3 point, pointing to the Right.
-- @return #COORDINATE
-- @param DCS#Distance y The y coordinate of the Vec3 point, pointing to up.
-- @param DCS#Distance z The z coordinate of the Vec3 point, pointing to the right.
-- @return #COORDINATE self
function COORDINATE:New( x, y, z )
--env.info("FF COORDINATE New")
local self = BASE:Inherit( self, BASE:New() ) -- #COORDINATE
local self=BASE:Inherit(self, BASE:New()) -- #COORDINATE
self.x = x
self.y = y
self.z = z
@@ -249,7 +276,7 @@ do -- COORDINATE
--- COORDINATE constructor.
-- @param #COORDINATE self
-- @param #COORDINATE Coordinate.
-- @return #COORDINATE
-- @return #COORDINATE self
function COORDINATE:NewFromCoordinate( Coordinate )
local self = BASE:Inherit( self, BASE:New() ) -- #COORDINATE
@@ -263,8 +290,8 @@ do -- COORDINATE
--- Create a new COORDINATE object from Vec2 coordinates.
-- @param #COORDINATE self
-- @param DCS#Vec2 Vec2 The Vec2 point.
-- @param DCS#Distance LandHeightAdd (optional) The default height if required to be evaluated will be the land height of the x, y coordinate. You can specify an extra height to be added to the land height.
-- @return #COORDINATE
-- @param DCS#Distance LandHeightAdd (Optional) The default height if required to be evaluated will be the land height of the x, y coordinate. You can specify an extra height to be added to the land height.
-- @return #COORDINATE self
function COORDINATE:NewFromVec2( Vec2, LandHeightAdd )
local LandHeight = land.getHeight( Vec2 )
@@ -274,8 +301,6 @@ do -- COORDINATE
local self = self:New( Vec2.x, LandHeight, Vec2.y ) -- #COORDINATE
self:F2( self )
return self
end
@@ -283,7 +308,7 @@ do -- COORDINATE
--- Create a new COORDINATE object from Vec3 coordinates.
-- @param #COORDINATE self
-- @param DCS#Vec3 Vec3 The Vec3 point.
-- @return #COORDINATE
-- @return #COORDINATE self
function COORDINATE:NewFromVec3( Vec3 )
local self = self:New( Vec3.x, Vec3.y, Vec3.z ) -- #COORDINATE
@@ -292,6 +317,22 @@ do -- COORDINATE
return self
end
--- Create a new COORDINATE object from a waypoint. This uses the components
--
-- * `waypoint.x`
-- * `waypoint.alt`
-- * `waypoint.y`
--
-- @param #COORDINATE self
-- @param DCS#Waypoint Waypoint The waypoint.
-- @return #COORDINATE self
function COORDINATE:NewFromWaypoint(Waypoint)
local self=self:New(Waypoint.x, Waypoint.alt, Waypoint.y) -- #COORDINATE
return self
end
--- Return the coordinates itself. Sounds stupid but can be useful for compatibility.
-- @param #COORDINATE self
@@ -1720,7 +1761,7 @@ do -- COORDINATE
return self:GetSurfaceType()==land.SurfaceType.LAND
end
--- Checks if the surface type is road.
--- Checks if the surface type is land.
-- @param #COORDINATE self
-- @return #boolean If true, the surface type at the coordinate is land.
function COORDINATE:IsSurfaceTypeLand()
@@ -2082,7 +2123,7 @@ do -- COORDINATE
--- Circle to all.
-- Creates a circle on the map with a given radius, color, fill color, and outline.
-- @param #COORDINATE self
-- @param #numberr Radius Radius in meters. Default 1000 m.
-- @param #number Radius Radius in meters. Default 1000 m.
-- @param #number Coalition Coalition: All=-1, Neutral=0, Red=1, Blue=2. Default -1=All.
-- @param #table Color RGB color table {r, g, b}, e.g. {1,0,0} for red (default).
-- @param #number Alpha Transparency [0,1]. Default 1.