Module Point
This module contains the POINT classes.
1) Point#POINT_VEC3 class, extends Base#BASE
The Point#POINT_VEC3 class defines a 3D point in the simulator.
Important Note: Most of the functions in this section were taken from MIST, and reworked to OO concepts. In order to keep the credibility of the the author, I want to emphasize that the of the MIST framework was created by Grimes, who you can find on the Eagle Dynamics Forums.
1.1) POINT_VEC3 constructor
A new POINT_VEC3 instance can be created with:
- Point#POINT_VEC3.New(): a 3D point.
- Point#POINT_VEC3.NewFromVec3(): a 3D point created from a DCSTypes#Vec3.
2) Point#POINT_VEC2 class, extends Point#POINT_VEC3
The Point#POINT_VEC2 class defines a 2D point in the simulator. The height coordinate (if needed) will be the land height + an optional added height specified.
2.1) POINT_VEC2 constructor
A new POINT_VEC2 instance can be created with:
- Point#POINT_VEC2.New(): a 2D point, taking an additional height parameter.
- Point#POINT_VEC2.NewFromVec2(): a 2D point created from a DCSTypes#Vec2.
API CHANGE HISTORY
The underlying change log documents the API changes. Please read this carefully. The following notation is used:
- Added parts are expressed in bold type face.
- Removed parts are expressed in italic type face.
Hereby the change log:
2017-02-18: POINT_VEC3:NewFromVec2( Vec2, LandHeightAdd ) added.
2016-08-12: POINT_VEC3:Translate( Distance, Angle ) added.
2016-08-06: Made PointVec3 and Vec3, PointVec2 and Vec2 terminology used in the code consistent.
- Replaced method PointVec3() to Vec3() where the code manages a Vec3. Replaced all references to the method.
- Replaced method PointVec2() to Vec2() where the code manages a Vec2. Replaced all references to the method.
- Replaced method RandomPointVec3() to RandomVec3() where the code manages a Vec3. Replaced all references to the method. .
Authors:
- FlightControl : Design & Programming
Contributions:
Global(s)
| POINT_VEC2 | |
| POINT_VEC3 |
Type POINT_VEC2
| POINT_VEC2.ClassName | |
| POINT_VEC2:DistanceFromPointVec2(PointVec2Reference) |
Calculate the distance from a reference #POINT_VEC2. |
| POINT_VEC2:DistanceFromVec2(Vec2Reference) |
Calculate the distance from a reference DCSTypes#Vec2. |
| POINT_VEC2:GetAlt() |
Return the altitude of the land at the POINT_VEC2. |
| POINT_VEC2:GetAltitudeText() |
Return no text for the altitude of the POINT_VEC2. |
| POINT_VEC2:GetX() |
Return the x coordinate of the POINT_VEC2. |
| POINT_VEC2:GetY() |
Return the y coordinate of the POINT_VEC2. |
| POINT_VEC2:New(x, y, LandHeightAdd) |
POINT_VEC2 constructor. |
| POINT_VEC2:NewFromVec2(Vec2, LandHeightAdd) |
Create a new POINT_VEC2 object from Vec2 coordinates. |
| POINT_VEC2:NewFromVec3(Vec3) |
Create a new POINT_VEC2 object from Vec3 coordinates. |
| POINT_VEC2.SetX(x, self) |
Set the x coordinate of the POINT_VEC2. |
| POINT_VEC2.SetY(y, self) |
Set the y coordinate of the POINT_VEC2. |
| POINT_VEC2:Translate(Distance, Angle) |
Add a Distance in meters from the POINTVEC2 orthonormal plane, with the given angle, and calculate the new POINTVEC2. |
| POINT_VEC2.x |
The x coordinate in meters. |
| POINT_VEC2.y |
the y coordinate in meters. |
Type POINT_VEC3
| POINT_VEC3.ClassName | |
| POINT_VEC3:Flare(FlareColor, (, Azimuth) |
Flares the point in a color. |
| POINT_VEC3.FlareColor | |
| POINT_VEC3:FlareGreen((, Azimuth) |
Flare the POINT_VEC3 Green. |
| POINT_VEC3:FlareRed(Azimuth) |
Flare the POINT_VEC3 Red. |
| POINT_VEC3:FlareWhite((, Azimuth) |
Flare the POINT_VEC3 White. |
| POINT_VEC3:FlareYellow((, Azimuth) |
Flare the POINT_VEC3 Yellow. |
| POINT_VEC3:Get2DDistance(TargetPointVec3) |
Return the 2D distance in meters between the target POINTVEC3 and the POINTVEC3. |
| POINT_VEC3:Get3DDistance(TargetPointVec3) |
Return the 3D distance in meters between the target POINTVEC3 and the POINTVEC3. |
| POINT_VEC3:GetAltitudeText() |
Return the altitude text of the POINT_VEC3. |
| POINT_VEC3:GetBRText(TargetPointVec3) |
Return a BR string from a POINTVEC3 to the POINTVEC3. |
| POINT_VEC3:GetDirectionRadians(DirectionVec3) |
Return a direction in radians from the POINT_VEC3 using a direction vector in Vec3 format. |
| POINT_VEC3:GetDirectionVec3(TargetPointVec3) |
Return a direction vector Vec3 from POINTVEC3 to the POINTVEC3. |
| POINT_VEC3:GetNorthCorrectionRadians() |
Get a correction in radians of the real magnetic north of the POINT_VEC3. |
| POINT_VEC3:GetRandomPointVec2InRadius(OuterRadius, InnerRadius) |
Return a random POINTVEC2 within an Outer Radius and optionally NOT within an Inner Radius of the POINTVEC3. |
| POINT_VEC3:GetRandomPointVec3InRadius(OuterRadius, InnerRadius) |
Return a random POINTVEC3 within an Outer Radius and optionally NOT within an Inner Radius of the POINTVEC3. |
| POINT_VEC3:GetRandomVec2InRadius(OuterRadius, InnerRadius) |
Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3. |
| POINT_VEC3:GetRandomVec3InRadius(OuterRadius, InnerRadius) |
Return a random Vec3 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3. |
| POINT_VEC3:GetVec2() |
Return the coordinates of the POINT_VEC3 in Vec2 format. |
| POINT_VEC3:GetVec3() |
Return the coordinates of the POINT_VEC3 in Vec3 format. |
| POINT_VEC3:GetX() |
Return the x coordinate of the POINT_VEC3. |
| POINT_VEC3:GetY() |
Return the y coordinate of the POINT_VEC3. |
| POINT_VEC3:GetZ() |
Return the z coordinate of the POINT_VEC3. |
| POINT_VEC3:IsMetric() |
Gets if the POINT_VEC3 is metric or NM. |
| POINT_VEC3.Metric | |
| POINT_VEC3:New(x, y, z) |
Create a new POINT_VEC3 object. |
| POINT_VEC3:NewFromVec2(Vec2, LandHeightAdd) |
Create a new POINT_VEC3 object from Vec2 coordinates. |
| POINT_VEC3:NewFromVec3(Vec3) |
Create a new POINT_VEC3 object from Vec3 coordinates. |
| POINT_VEC3.RoutePointAction | |
| POINT_VEC3:RoutePointAir(AltType, Type, Action, Speed, SpeedLocked) |
Build an air type route point. |
| POINT_VEC3.RoutePointAltType | |
| POINT_VEC3:RoutePointGround(Speed, Formation) |
Build an ground type route point. |
| POINT_VEC3.RoutePointType | |
| POINT_VEC3:SetMetric(Metric) |
Sets the POINT_VEC3 metric or NM. |
| POINT_VEC3.SetX(x, self) |
Set the x coordinate of the POINT_VEC3. |
| POINT_VEC3.SetY(y, self) |
Set the y coordinate of the POINT_VEC3. |
| POINT_VEC3.SetZ(z, self) |
Set the z coordinate of the POINT_VEC3. |
| POINT_VEC3:Smoke(SmokeColor) |
Smokes the point in a color. |
| POINT_VEC3:SmokeBlue() |
Smoke the POINT_VEC3 Blue. |
| POINT_VEC3.SmokeColor | |
| POINT_VEC3:SmokeGreen() |
Smoke the POINT_VEC3 Green. |
| POINT_VEC3:SmokeOrange() |
Smoke the POINT_VEC3 Orange. |
| POINT_VEC3:SmokeRed() |
Smoke the POINT_VEC3 Red. |
| POINT_VEC3:SmokeWhite() |
Smoke the POINT_VEC3 White. |
| POINT_VEC3:ToStringBR(AngleRadians, Distance) |
Provides a Bearing / Range string |
| POINT_VEC3:ToStringLL(AngleRadians, Distance, acc, DMS) |
Provides a Bearing / Range string |
| POINT_VEC3:Translate(Distance, Angle) |
Add a Distance in meters from the POINTVEC3 horizontal plane, with the given angle, and calculate the new POINTVEC3. |
| POINT_VEC3.x |
The x coordinate in 3D space. |
| POINT_VEC3.y |
The y coordinate in 3D space. |
| POINT_VEC3.z |
The z coordiante in 3D space. |
Type POINT_VEC3.RoutePointAction
| POINT_VEC3.RoutePointAction.FromParkingArea |
"From Parking Area" |
| POINT_VEC3.RoutePointAction.TurningPoint |
"Turning Point" |
Type POINT_VEC3.RoutePointAltType
| POINT_VEC3.RoutePointAltType.BARO |
"BARO" |
Type POINT_VEC3.RoutePointType
| POINT_VEC3.RoutePointType.TakeOffParking |
"TakeOffParking" |
| POINT_VEC3.RoutePointType.TurningPoint |
"Turning Point" |
Global(s)
Type Point
Type POINT_VEC2
The POINT_VEC2 class
Field(s)
- #string POINT_VEC2.ClassName
- POINT_VEC2:DistanceFromPointVec2(PointVec2Reference)
-
Calculate the distance from a reference #POINT_VEC2.
Parameter
-
#POINT_VEC2 PointVec2Reference: The reference #POINT_VEC2.
Return value
Dcs.DCSTypes#Distance: The distance from the reference #POINT_VEC2 in meters.
-
- POINT_VEC2:DistanceFromVec2(Vec2Reference)
-
Calculate the distance from a reference DCSTypes#Vec2.
Parameter
-
Dcs.DCSTypes#Vec2 Vec2Reference: The reference DCSTypes#Vec2.
Return value
Dcs.DCSTypes#Distance: The distance from the reference DCSTypes#Vec2 in meters.
-
- POINT_VEC2:GetAlt()
-
Return the altitude of the land at the POINT_VEC2.
Return value
#number: The land altitude.
- POINT_VEC2:GetAltitudeText()
-
Return no text for the altitude of the POINT_VEC2.
Return value
#string: Empty string.
- POINT_VEC2:GetX()
-
Return the x coordinate of the POINT_VEC2.
Return value
#number: The x coodinate.
- POINT_VEC2:GetY()
-
Return the y coordinate of the POINT_VEC2.
Return value
#number: The y coodinate.
- POINT_VEC2:New(x, y, LandHeightAdd)
-
POINT_VEC2 constructor.
Parameters
-
Dcs.DCSTypes#Distance x: The x coordinate of the Vec3 point, pointing to the North. -
Dcs.DCSTypes#Distance y: The y coordinate of the Vec3 point, pointing to the Right. -
Dcs.DCSTypes#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 value
-
- POINT_VEC2:NewFromVec2(Vec2, LandHeightAdd)
-
Create a new POINT_VEC2 object from Vec2 coordinates.
Parameters
-
Dcs.DCSTypes#Vec2 Vec2: The Vec2 point. -
LandHeightAdd:
Return value
Core.Point#POINT_VEC2: self
-
- POINT_VEC2:NewFromVec3(Vec3)
-
Create a new POINT_VEC2 object from Vec3 coordinates.
Parameter
-
Dcs.DCSTypes#Vec3 Vec3: The Vec3 point.
Return value
Core.Point#POINT_VEC2: self
-
- POINT_VEC2.SetX(x, self)
-
Set the x coordinate of the POINT_VEC2.
Parameters
-
#number x: The x coordinate. -
self:
-
- POINT_VEC2.SetY(y, self)
-
Set the y coordinate of the POINT_VEC2.
Parameters
-
#number y: The y coordinate. -
self:
-
- POINT_VEC2:Translate(Distance, Angle)
-
Add a Distance in meters from the POINTVEC2 orthonormal plane, with the given angle, and calculate the new POINTVEC2.
Parameters
-
Dcs.DCSTypes#Distance Distance: The Distance to be added in meters. -
Dcs.DCSTypes#Angle Angle: The Angle in degrees.
Return value
#POINT_VEC2: The new calculated POINT_VEC2.
-
- Dcs.DCSTypes#Distance POINT_VEC2.x
-
The x coordinate in meters.
- Dcs.DCSTypes#Distance POINT_VEC2.y
-
the y coordinate in meters.
Type POINT_VEC3
The POINT_VEC3 class
Field(s)
- #string POINT_VEC3.ClassName
- POINT_VEC3:Flare(FlareColor, (, Azimuth)
-
Flares the point in a color.
Parameters
-
Utilities.Utils#FLARECOLOR FlareColor: -
Dcs.DCSTypes#Azimuth (: ptional) Azimuth The azimuth of the flare direction. The default azimuth is 0. -
Azimuth:
-
- POINT_VEC3:FlareGreen((, Azimuth)
-
Flare the POINT_VEC3 Green.
Parameters
-
Dcs.DCSTypes#Azimuth (: ptional) Azimuth The azimuth of the flare direction. The default azimuth is 0. -
Azimuth:
-
- POINT_VEC3:FlareRed(Azimuth)
-
Flare the POINT_VEC3 Red.
Parameter
-
Azimuth:
-
- POINT_VEC3:FlareWhite((, Azimuth)
-
Flare the POINT_VEC3 White.
Parameters
-
Dcs.DCSTypes#Azimuth (: ptional) Azimuth The azimuth of the flare direction. The default azimuth is 0. -
Azimuth:
-
- POINT_VEC3:FlareYellow((, Azimuth)
-
Flare the POINT_VEC3 Yellow.
Parameters
-
Dcs.DCSTypes#Azimuth (: ptional) Azimuth The azimuth of the flare direction. The default azimuth is 0. -
Azimuth:
-
- POINT_VEC3:Get2DDistance(TargetPointVec3)
-
Return the 2D distance in meters between the target POINTVEC3 and the POINTVEC3.
Parameter
-
#POINT_VEC3 TargetPointVec3: The target POINT_VEC3.
Return value
Dcs.DCSTypes#Distance: Distance The distance in meters.
-
- POINT_VEC3:Get3DDistance(TargetPointVec3)
-
Return the 3D distance in meters between the target POINTVEC3 and the POINTVEC3.
Parameter
-
#POINT_VEC3 TargetPointVec3: The target POINT_VEC3.
Return value
Dcs.DCSTypes#Distance: Distance The distance in meters.
-
- POINT_VEC3:GetAltitudeText()
-
Return the altitude text of the POINT_VEC3.
Return value
#string: Altitude text.
- POINT_VEC3:GetBRText(TargetPointVec3)
-
Return a BR string from a POINTVEC3 to the POINTVEC3.
Parameter
-
#POINT_VEC3 TargetPointVec3: The target POINT_VEC3.
Return value
#string: The BR text.
-
- POINT_VEC3:GetDirectionRadians(DirectionVec3)
-
Return a direction in radians from the POINT_VEC3 using a direction vector in Vec3 format.
Parameter
-
Dcs.DCSTypes#Vec3 DirectionVec3: The direction vector in Vec3 format.
Return value
#number: DirectionRadians The direction in radians.
-
- POINT_VEC3:GetDirectionVec3(TargetPointVec3)
-
Return a direction vector Vec3 from POINTVEC3 to the POINTVEC3.
Parameter
-
#POINT_VEC3 TargetPointVec3: The target POINT_VEC3.
Return value
Dcs.DCSTypes#Vec3: DirectionVec3 The direction vector in Vec3 format.
-
- POINT_VEC3:GetNorthCorrectionRadians()
-
Get a correction in radians of the real magnetic north of the POINT_VEC3.
Return value
#number: CorrectionRadians The correction in radians.
- POINT_VEC3:GetRandomPointVec2InRadius(OuterRadius, InnerRadius)
-
Return a random POINTVEC2 within an Outer Radius and optionally NOT within an Inner Radius of the POINTVEC3.
Parameters
-
Dcs.DCSTypes#Distance OuterRadius: -
Dcs.DCSTypes#Distance InnerRadius:
Return value
-
- POINT_VEC3:GetRandomPointVec3InRadius(OuterRadius, InnerRadius)
-
Return a random POINTVEC3 within an Outer Radius and optionally NOT within an Inner Radius of the POINTVEC3.
Parameters
-
Dcs.DCSTypes#Distance OuterRadius: -
Dcs.DCSTypes#Distance InnerRadius:
Return value
-
- POINT_VEC3:GetRandomVec2InRadius(OuterRadius, InnerRadius)
-
Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
Parameters
-
Dcs.DCSTypes#Distance OuterRadius: -
Dcs.DCSTypes#Distance InnerRadius:
Return value
Dcs.DCSTypes#Vec2: Vec2
-
- POINT_VEC3:GetRandomVec3InRadius(OuterRadius, InnerRadius)
-
Return a random Vec3 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
Parameters
-
Dcs.DCSTypes#Distance OuterRadius: -
Dcs.DCSTypes#Distance InnerRadius:
Return value
Dcs.DCSTypes#Vec3: Vec3
-
- POINT_VEC3:GetVec2()
-
Return the coordinates of the POINT_VEC3 in Vec2 format.
Return value
Dcs.DCSTypes#Vec2: The Vec2 coodinate.
- POINT_VEC3:GetVec3()
-
Return the coordinates of the POINT_VEC3 in Vec3 format.
Return value
Dcs.DCSTypes#Vec3: The Vec3 coodinate.
- POINT_VEC3:GetX()
-
Return the x coordinate of the POINT_VEC3.
Return value
#number: The x coodinate.
- POINT_VEC3:GetY()
-
Return the y coordinate of the POINT_VEC3.
Return value
#number: The y coodinate.
- POINT_VEC3:GetZ()
-
Return the z coordinate of the POINT_VEC3.
Return value
#number: The z coodinate.
- POINT_VEC3:IsMetric()
-
Gets if the POINT_VEC3 is metric or NM.
Return value
#boolean: Metric true means metric, false means NM.
- POINT_VEC3:New(x, y, z)
-
Create a new POINT_VEC3 object.
Parameters
-
Dcs.DCSTypes#Distance x: The x coordinate of the Vec3 point, pointing to the North. -
Dcs.DCSTypes#Distance y: The y coordinate of the Vec3 point, pointing Upwards. -
Dcs.DCSTypes#Distance z: The z coordinate of the Vec3 point, pointing to the Right.
Return value
Core.Point#POINT_VEC3: self
-
- POINT_VEC3:NewFromVec2(Vec2, LandHeightAdd)
-
Create a new POINT_VEC3 object from Vec2 coordinates.
Parameters
-
Dcs.DCSTypes#Vec2 Vec2: The Vec2 point. -
LandHeightAdd:
Return value
Core.Point#POINT_VEC3: self
-
- POINT_VEC3:NewFromVec3(Vec3)
-
Create a new POINT_VEC3 object from Vec3 coordinates.
Parameter
-
Dcs.DCSTypes#Vec3 Vec3: The Vec3 point.
Return value
Core.Point#POINT_VEC3: self
-
- POINT_VEC3:RoutePointAir(AltType, Type, Action, Speed, SpeedLocked)
-
Build an air type route point.
Parameters
-
#POINT_VEC3.RoutePointAltType AltType: The altitude type. -
#POINT_VEC3.RoutePointType Type: The route point type. -
#POINT_VEC3.RoutePointAction Action: The route point action. -
Dcs.DCSTypes#Speed Speed: Airspeed in km/h. -
#boolean SpeedLocked: true means the speed is locked.
Return value
#table: The route point.
-
- POINT_VEC3:RoutePointGround(Speed, Formation)
-
Build an ground type route point.
Parameters
-
Dcs.DCSTypes#Speed Speed: Speed in km/h. -
#POINT_VEC3.RoutePointAction Formation: The route point Formation.
Return value
#table: The route point.
-
- POINT_VEC3:SetMetric(Metric)
-
Sets the POINT_VEC3 metric or NM.
Parameter
-
#boolean Metric: true means metric, false means NM.
-
- POINT_VEC3.SetX(x, self)
-
Set the x coordinate of the POINT_VEC3.
Parameters
-
#number x: The x coordinate. -
self:
-
- POINT_VEC3.SetY(y, self)
-
Set the y coordinate of the POINT_VEC3.
Parameters
-
#number y: The y coordinate. -
self:
-
- POINT_VEC3.SetZ(z, self)
-
Set the z coordinate of the POINT_VEC3.
Parameters
-
#number z: The z coordinate. -
self:
-
- POINT_VEC3:Smoke(SmokeColor)
-
Smokes the point in a color.
Parameter
-
Utilities.Utils#SMOKECOLOR SmokeColor:
-
- POINT_VEC3:SmokeBlue()
-
Smoke the POINT_VEC3 Blue.
- POINT_VEC3:SmokeGreen()
-
Smoke the POINT_VEC3 Green.
- POINT_VEC3:SmokeOrange()
-
Smoke the POINT_VEC3 Orange.
- POINT_VEC3:SmokeRed()
-
Smoke the POINT_VEC3 Red.
- POINT_VEC3:SmokeWhite()
-
Smoke the POINT_VEC3 White.
- POINT_VEC3:ToStringBR(AngleRadians, Distance)
-
Provides a Bearing / Range string
Parameters
-
#number AngleRadians: The angle in randians -
#number Distance: The distance
Return value
#string: The BR Text
-
- POINT_VEC3:ToStringLL(AngleRadians, Distance, acc, DMS)
-
Provides a Bearing / Range string
Parameters
-
#number AngleRadians: The angle in randians -
#number Distance: The distance -
acc: -
DMS:
Return value
#string: The BR Text
-
- POINT_VEC3:Translate(Distance, Angle)
-
Add a Distance in meters from the POINTVEC3 horizontal plane, with the given angle, and calculate the new POINTVEC3.
Parameters
-
Dcs.DCSTypes#Distance Distance: The Distance to be added in meters. -
Dcs.DCSTypes#Angle Angle: The Angle in degrees.
Return value
#POINT_VEC3: The new calculated POINT_VEC3.
-
- #number POINT_VEC3.x
-
The x coordinate in 3D space.
- #number POINT_VEC3.y
-
The y coordinate in 3D space.
- #number POINT_VEC3.z
-
The z coordiante in 3D space.
Type POINT_VEC3.RoutePointAction
RoutePoint Actions
Field(s)
- POINT_VEC3.RoutePointAction.FromParkingArea
-
"From Parking Area"
- POINT_VEC3.RoutePointAction.TurningPoint
-
"Turning Point"
Type POINT_VEC3.RoutePointAltType
RoutePoint AltTypes
Field(s)
Type POINT_VEC3.RoutePointType
RoutePoint Types
Field(s)
- POINT_VEC3.RoutePointType.TakeOffParking
-
"TakeOffParking"
- POINT_VEC3.RoutePointType.TurningPoint
-
"Turning Point"