Added POINT_VEC3 and POINT_VEC2 Set and Add methods + documentation

This commit is contained in:
FlightControl 2017-03-03 13:34:10 +01:00
parent edaa5112a1
commit b75c1a92ad
107 changed files with 681 additions and 65 deletions

View File

@ -14,11 +14,25 @@
-- * @{Point#POINT_VEC3.New}(): a 3D point. -- * @{Point#POINT_VEC3.New}(): a 3D point.
-- * @{Point#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{DCSTypes#Vec3}. -- * @{Point#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{DCSTypes#Vec3}.
-- --
-- ## 1.2) Smoke, flare, explode, illuminate -- ## 1.2) Manupulate the X, Y, Z coordinates of the point
--
-- A POINT_VEC3 class works in 3D space. It contains internally an X, Y, Z coordinate.
-- Methods exist to manupulate these coordinates.
--
-- The current X, Y, Z axis can be retrieved with the methods @{#POINT_VEC3.GetX}(), @{#POINT_VEC3.GetY}(), @{#POINT_VEC3.GetZ}() respectively.
-- The methods @{#POINT_VEC3.SetX}(), @{#POINT_VEC3.SetY}(), @{#POINT_VEC3.SetZ}() change the respective axis with a new value.
-- The current axis values can be changed by using the methods @{#POINT_VEC3.AddX}(), @{#POINT_VEC3.AddY}(), @{#POINT_VEC3.AddZ}()
-- to add or substract a value from the current respective axis value.
-- Note that the Set and Add methods return the current POINT_VEC3 object, so these manipulation methods can be chained... For example:
--
-- local Vec3 = PointVec3:AddX( 100 ):AddZ( 150 ):GetVec3()
--
--
-- ## 1.5) Smoke, flare, explode, illuminate
-- --
-- At the point a smoke, flare, explosion and illumination bomb can be triggered. Use the following methods: -- At the point a smoke, flare, explosion and illumination bomb can be triggered. Use the following methods:
-- --
-- ### 1.2.1) Smoke -- ### 1.5.1) Smoke
-- --
-- * @{#POINT_VEC3.Smoke}(): To smoke the point in a certain color. -- * @{#POINT_VEC3.Smoke}(): To smoke the point in a certain color.
-- * @{#POINT_VEC3.SmokeBlue}(): To smoke the point in blue. -- * @{#POINT_VEC3.SmokeBlue}(): To smoke the point in blue.
@ -27,7 +41,7 @@
-- * @{#POINT_VEC3.SmokeWhite}(): To smoke the point in white. -- * @{#POINT_VEC3.SmokeWhite}(): To smoke the point in white.
-- * @{#POINT_VEC3.SmokeGreen}(): To smoke the point in green. -- * @{#POINT_VEC3.SmokeGreen}(): To smoke the point in green.
-- --
-- ### 1.2.2) Flare -- ### 1.5.2) Flare
-- --
-- * @{#POINT_VEC3.Flare}(): To flare the point in a certain color. -- * @{#POINT_VEC3.Flare}(): To flare the point in a certain color.
-- * @{#POINT_VEC3.FlareRed}(): To flare the point in red. -- * @{#POINT_VEC3.FlareRed}(): To flare the point in red.
@ -35,14 +49,14 @@
-- * @{#POINT_VEC3.FlareWhite}(): To flare the point in white. -- * @{#POINT_VEC3.FlareWhite}(): To flare the point in white.
-- * @{#POINT_VEC3.FlareGreen}(): To flare the point in green. -- * @{#POINT_VEC3.FlareGreen}(): To flare the point in green.
-- --
-- ### 1.2.3) Explode -- ### 1.5.3) Explode
-- --
-- * @{#POINT_VEC3.Explosion}(): To explode the point with a certain intensity. -- * @{#POINT_VEC3.Explosion}(): To explode the point with a certain intensity.
-- --
-- ### 1.2.4) Illuminate -- ### 1.5.4) Illuminate
-- --
-- * @{#POINT_VEC3.IlluminationBomb}(): To illuminate the point. -- * @{#POINT_VEC3.IlluminationBomb}(): To illuminate the point.
-- --
-- --
-- 2) @{Point#POINT_VEC2} class, extends @{Point#POINT_VEC3} -- 2) @{Point#POINT_VEC2} class, extends @{Point#POINT_VEC3}
-- ========================================================= -- =========================================================
@ -55,6 +69,19 @@
-- * @{Point#POINT_VEC2.New}(): a 2D point, taking an additional height parameter. -- * @{Point#POINT_VEC2.New}(): a 2D point, taking an additional height parameter.
-- * @{Point#POINT_VEC2.NewFromVec2}(): a 2D point created from a @{DCSTypes#Vec2}. -- * @{Point#POINT_VEC2.NewFromVec2}(): a 2D point created from a @{DCSTypes#Vec2}.
-- --
-- ## 1.2) Manupulate the X, Altitude, Y coordinates of the 2D point
--
-- A POINT_VEC2 class works in 2D space, with an altitude setting. It contains internally an X, Altitude, Y coordinate.
-- Methods exist to manupulate these coordinates.
--
-- The current X, Altitude, Y axis can be retrieved with the methods @{#POINT_VEC2.GetX}(), @{#POINT_VEC2.GetAlt}(), @{#POINT_VEC2.GetY}() respectively.
-- The methods @{#POINT_VEC2.SetX}(), @{#POINT_VEC2.SetAlt}(), @{#POINT_VEC2.SetY}() change the respective axis with a new value.
-- The current axis values can be changed by using the methods @{#POINT_VEC2.AddX}(), @{#POINT_VEC2.AddAlt}(), @{#POINT_VEC2.AddY}()
-- to add or substract a value from the current respective axis value.
-- Note that the Set and Add methods return the current POINT_VEC2 object, so these manipulation methods can be chained... For example:
--
-- local Vec2 = PointVec2:AddX( 100 ):AddY( 2000 ):GetVec2()
--
-- === -- ===
-- --
-- **API CHANGE HISTORY** -- **API CHANGE HISTORY**
@ -228,21 +255,57 @@ function POINT_VEC3:GetZ()
end end
--- Set the x coordinate of the POINT_VEC3. --- Set the x coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number x The x coordinate. -- @param #number x The x coordinate.
-- @return #POINT_VEC3
function POINT_VEC3:SetX( x ) function POINT_VEC3:SetX( x )
self.x = x self.x = x
return self
end end
--- Set the y coordinate of the POINT_VEC3. --- Set the y coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number y The y coordinate. -- @param #number y The y coordinate.
-- @return #POINT_VEC3
function POINT_VEC3:SetY( y ) function POINT_VEC3:SetY( y )
self.y = y self.y = y
return self
end end
--- Set the z coordinate of the POINT_VEC3. --- Set the z coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number z The z coordinate. -- @param #number z The z coordinate.
-- @return #POINT_VEC3
function POINT_VEC3:SetZ( z ) function POINT_VEC3:SetZ( z )
self.z = z self.z = z
return self
end
--- Add to the x coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number x The x coordinate value to add to the current x coodinate.
-- @return #POINT_VEC3
function POINT_VEC3:AddX( x )
self.x = self.x + x
return self
end
--- Add to the y coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number y The y coordinate value to add to the current y coodinate.
-- @return #POINT_VEC3
function POINT_VEC3:AddY( y )
self.y = self.y + y
return self
end
--- Add to the z coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number z The z coordinate value to add to the current z coodinate.
-- @return #POINT_VEC3
function POINT_VEC3:AddZ( z )
self.z = self.z +z
return self
end end
--- Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3. --- Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
@ -713,15 +776,57 @@ function POINT_VEC2:GetAlt()
end end
--- Set the x coordinate of the POINT_VEC2. --- Set the x coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number x The x coordinate. -- @param #number x The x coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:SetX( x ) function POINT_VEC2:SetX( x )
self.x = x self.x = x
return self
end end
--- Set the y coordinate of the POINT_VEC2. --- Set the y coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number y The y coordinate. -- @param #number y The y coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:SetY( y ) function POINT_VEC2:SetY( y )
self.z = y self.z = y
return self
end
--- Set the altitude of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number Altitude The land altitude. If nothing (nil) is given, then the current land altitude is set.
-- @return #POINT_VEC2
function POINT_VEC2:SetAlt( Altitude )
self.y = Altitude or land.getHeight( { x = self.x, y = self.z } )
return self
end
--- Add to the x coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number x The x coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:AddX( x )
self.x = self.x + x
return self
end
--- Add to the y coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number y The y coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:AddY( y )
self.z = self.z + y
return self
end
--- Add to the current land height an altitude.
-- @param #POINT_VEC2 self
-- @param #number Altitude The Altitude to add. If nothing (nil) is given, then the current land altitude is set.
-- @return #POINT_VEC2
function POINT_VEC2:AddAlt( Altitude )
self.y = land.getHeight( { x = self.x, y = self.z } ) + Altitude or 0
return self
end end

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' ) env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170303_0827' ) env.info( 'Moose Generation Timestamp: 20170303_1333' )
local base = _G local base = _G
Include = {} Include = {}
@ -10184,11 +10184,25 @@ end
-- * @{Point#POINT_VEC3.New}(): a 3D point. -- * @{Point#POINT_VEC3.New}(): a 3D point.
-- * @{Point#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{DCSTypes#Vec3}. -- * @{Point#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{DCSTypes#Vec3}.
-- --
-- ## 1.2) Smoke, flare, explode, illuminate -- ## 1.2) Manupulate the X, Y, Z coordinates of the point
--
-- A POINT_VEC3 class works in 3D space. It contains internally an X, Y, Z coordinate.
-- Methods exist to manupulate these coordinates.
--
-- The current X, Y, Z axis can be retrieved with the methods @{#POINT_VEC3.GetX}(), @{#POINT_VEC3.GetY}(), @{#POINT_VEC3.GetZ}() respectively.
-- The methods @{#POINT_VEC3.SetX}(), @{#POINT_VEC3.SetY}(), @{#POINT_VEC3.SetZ}() change the respective axis with a new value.
-- The current axis values can be changed by using the methods @{#POINT_VEC3.AddX}(), @{#POINT_VEC3.AddY}(), @{#POINT_VEC3.AddZ}()
-- to add or substract a value from the current respective axis value.
-- Note that the Set and Add methods return the current POINT_VEC3 object, so these manipulation methods can be chained... For example:
--
-- local Vec3 = PointVec3:AddX( 100 ):AddZ( 150 ):GetVec3()
--
--
-- ## 1.5) Smoke, flare, explode, illuminate
-- --
-- At the point a smoke, flare, explosion and illumination bomb can be triggered. Use the following methods: -- At the point a smoke, flare, explosion and illumination bomb can be triggered. Use the following methods:
-- --
-- ### 1.2.1) Smoke -- ### 1.5.1) Smoke
-- --
-- * @{#POINT_VEC3.Smoke}(): To smoke the point in a certain color. -- * @{#POINT_VEC3.Smoke}(): To smoke the point in a certain color.
-- * @{#POINT_VEC3.SmokeBlue}(): To smoke the point in blue. -- * @{#POINT_VEC3.SmokeBlue}(): To smoke the point in blue.
@ -10197,7 +10211,7 @@ end
-- * @{#POINT_VEC3.SmokeWhite}(): To smoke the point in white. -- * @{#POINT_VEC3.SmokeWhite}(): To smoke the point in white.
-- * @{#POINT_VEC3.SmokeGreen}(): To smoke the point in green. -- * @{#POINT_VEC3.SmokeGreen}(): To smoke the point in green.
-- --
-- ### 1.2.2) Flare -- ### 1.5.2) Flare
-- --
-- * @{#POINT_VEC3.Flare}(): To flare the point in a certain color. -- * @{#POINT_VEC3.Flare}(): To flare the point in a certain color.
-- * @{#POINT_VEC3.FlareRed}(): To flare the point in red. -- * @{#POINT_VEC3.FlareRed}(): To flare the point in red.
@ -10205,14 +10219,14 @@ end
-- * @{#POINT_VEC3.FlareWhite}(): To flare the point in white. -- * @{#POINT_VEC3.FlareWhite}(): To flare the point in white.
-- * @{#POINT_VEC3.FlareGreen}(): To flare the point in green. -- * @{#POINT_VEC3.FlareGreen}(): To flare the point in green.
-- --
-- ### 1.2.3) Explode -- ### 1.5.3) Explode
-- --
-- * @{#POINT_VEC3.Explosion}(): To explode the point with a certain intensity. -- * @{#POINT_VEC3.Explosion}(): To explode the point with a certain intensity.
-- --
-- ### 1.2.4) Illuminate -- ### 1.5.4) Illuminate
-- --
-- * @{#POINT_VEC3.IlluminationBomb}(): To illuminate the point. -- * @{#POINT_VEC3.IlluminationBomb}(): To illuminate the point.
-- --
-- --
-- 2) @{Point#POINT_VEC2} class, extends @{Point#POINT_VEC3} -- 2) @{Point#POINT_VEC2} class, extends @{Point#POINT_VEC3}
-- ========================================================= -- =========================================================
@ -10225,6 +10239,19 @@ end
-- * @{Point#POINT_VEC2.New}(): a 2D point, taking an additional height parameter. -- * @{Point#POINT_VEC2.New}(): a 2D point, taking an additional height parameter.
-- * @{Point#POINT_VEC2.NewFromVec2}(): a 2D point created from a @{DCSTypes#Vec2}. -- * @{Point#POINT_VEC2.NewFromVec2}(): a 2D point created from a @{DCSTypes#Vec2}.
-- --
-- ## 1.2) Manupulate the X, Altitude, Y coordinates of the 2D point
--
-- A POINT_VEC2 class works in 2D space, with an altitude setting. It contains internally an X, Altitude, Y coordinate.
-- Methods exist to manupulate these coordinates.
--
-- The current X, Altitude, Y axis can be retrieved with the methods @{#POINT_VEC2.GetX}(), @{#POINT_VEC2.GetAlt}(), @{#POINT_VEC2.GetY}() respectively.
-- The methods @{#POINT_VEC2.SetX}(), @{#POINT_VEC2.SetAlt}(), @{#POINT_VEC2.SetY}() change the respective axis with a new value.
-- The current axis values can be changed by using the methods @{#POINT_VEC2.AddX}(), @{#POINT_VEC2.AddAlt}(), @{#POINT_VEC2.AddY}()
-- to add or substract a value from the current respective axis value.
-- Note that the Set and Add methods return the current POINT_VEC2 object, so these manipulation methods can be chained... For example:
--
-- local Vec2 = PointVec2:AddX( 100 ):AddY( 2000 ):GetVec2()
--
-- === -- ===
-- --
-- **API CHANGE HISTORY** -- **API CHANGE HISTORY**
@ -10398,21 +10425,57 @@ function POINT_VEC3:GetZ()
end end
--- Set the x coordinate of the POINT_VEC3. --- Set the x coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number x The x coordinate. -- @param #number x The x coordinate.
-- @return #POINT_VEC3
function POINT_VEC3:SetX( x ) function POINT_VEC3:SetX( x )
self.x = x self.x = x
return self
end end
--- Set the y coordinate of the POINT_VEC3. --- Set the y coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number y The y coordinate. -- @param #number y The y coordinate.
-- @return #POINT_VEC3
function POINT_VEC3:SetY( y ) function POINT_VEC3:SetY( y )
self.y = y self.y = y
return self
end end
--- Set the z coordinate of the POINT_VEC3. --- Set the z coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number z The z coordinate. -- @param #number z The z coordinate.
-- @return #POINT_VEC3
function POINT_VEC3:SetZ( z ) function POINT_VEC3:SetZ( z )
self.z = z self.z = z
return self
end
--- Add to the x coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number x The x coordinate value to add to the current x coodinate.
-- @return #POINT_VEC3
function POINT_VEC3:AddX( x )
self.x = self.x + x
return self
end
--- Add to the y coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number y The y coordinate value to add to the current y coodinate.
-- @return #POINT_VEC3
function POINT_VEC3:AddY( y )
self.y = self.y + y
return self
end
--- Add to the z coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number z The z coordinate value to add to the current z coodinate.
-- @return #POINT_VEC3
function POINT_VEC3:AddZ( z )
self.z = self.z +z
return self
end end
--- Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3. --- Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
@ -10883,15 +10946,57 @@ function POINT_VEC2:GetAlt()
end end
--- Set the x coordinate of the POINT_VEC2. --- Set the x coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number x The x coordinate. -- @param #number x The x coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:SetX( x ) function POINT_VEC2:SetX( x )
self.x = x self.x = x
return self
end end
--- Set the y coordinate of the POINT_VEC2. --- Set the y coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number y The y coordinate. -- @param #number y The y coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:SetY( y ) function POINT_VEC2:SetY( y )
self.z = y self.z = y
return self
end
--- Set the altitude of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number Altitude The land altitude. If nothing (nil) is given, then the current land altitude is set.
-- @return #POINT_VEC2
function POINT_VEC2:SetAlt( Altitude )
self.y = Altitude or land.getHeight( { x = self.x, y = self.z } )
return self
end
--- Add to the x coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number x The x coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:AddX( x )
self.x = self.x + x
return self
end
--- Add to the y coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number y The y coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:AddY( y )
self.z = self.z + y
return self
end
--- Add to the current land height an altitude.
-- @param #POINT_VEC2 self
-- @param #number Altitude The Altitude to add. If nothing (nil) is given, then the current land altitude is set.
-- @return #POINT_VEC2
function POINT_VEC2:AddAlt( Altitude )
self.y = land.getHeight( { x = self.x, y = self.z } ) + Altitude or 0
return self
end end

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' ) env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170303_0827' ) env.info( 'Moose Generation Timestamp: 20170303_1333' )
local base = _G local base = _G
Include = {} Include = {}
@ -10184,11 +10184,25 @@ end
-- * @{Point#POINT_VEC3.New}(): a 3D point. -- * @{Point#POINT_VEC3.New}(): a 3D point.
-- * @{Point#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{DCSTypes#Vec3}. -- * @{Point#POINT_VEC3.NewFromVec3}(): a 3D point created from a @{DCSTypes#Vec3}.
-- --
-- ## 1.2) Smoke, flare, explode, illuminate -- ## 1.2) Manupulate the X, Y, Z coordinates of the point
--
-- A POINT_VEC3 class works in 3D space. It contains internally an X, Y, Z coordinate.
-- Methods exist to manupulate these coordinates.
--
-- The current X, Y, Z axis can be retrieved with the methods @{#POINT_VEC3.GetX}(), @{#POINT_VEC3.GetY}(), @{#POINT_VEC3.GetZ}() respectively.
-- The methods @{#POINT_VEC3.SetX}(), @{#POINT_VEC3.SetY}(), @{#POINT_VEC3.SetZ}() change the respective axis with a new value.
-- The current axis values can be changed by using the methods @{#POINT_VEC3.AddX}(), @{#POINT_VEC3.AddY}(), @{#POINT_VEC3.AddZ}()
-- to add or substract a value from the current respective axis value.
-- Note that the Set and Add methods return the current POINT_VEC3 object, so these manipulation methods can be chained... For example:
--
-- local Vec3 = PointVec3:AddX( 100 ):AddZ( 150 ):GetVec3()
--
--
-- ## 1.5) Smoke, flare, explode, illuminate
-- --
-- At the point a smoke, flare, explosion and illumination bomb can be triggered. Use the following methods: -- At the point a smoke, flare, explosion and illumination bomb can be triggered. Use the following methods:
-- --
-- ### 1.2.1) Smoke -- ### 1.5.1) Smoke
-- --
-- * @{#POINT_VEC3.Smoke}(): To smoke the point in a certain color. -- * @{#POINT_VEC3.Smoke}(): To smoke the point in a certain color.
-- * @{#POINT_VEC3.SmokeBlue}(): To smoke the point in blue. -- * @{#POINT_VEC3.SmokeBlue}(): To smoke the point in blue.
@ -10197,7 +10211,7 @@ end
-- * @{#POINT_VEC3.SmokeWhite}(): To smoke the point in white. -- * @{#POINT_VEC3.SmokeWhite}(): To smoke the point in white.
-- * @{#POINT_VEC3.SmokeGreen}(): To smoke the point in green. -- * @{#POINT_VEC3.SmokeGreen}(): To smoke the point in green.
-- --
-- ### 1.2.2) Flare -- ### 1.5.2) Flare
-- --
-- * @{#POINT_VEC3.Flare}(): To flare the point in a certain color. -- * @{#POINT_VEC3.Flare}(): To flare the point in a certain color.
-- * @{#POINT_VEC3.FlareRed}(): To flare the point in red. -- * @{#POINT_VEC3.FlareRed}(): To flare the point in red.
@ -10205,14 +10219,14 @@ end
-- * @{#POINT_VEC3.FlareWhite}(): To flare the point in white. -- * @{#POINT_VEC3.FlareWhite}(): To flare the point in white.
-- * @{#POINT_VEC3.FlareGreen}(): To flare the point in green. -- * @{#POINT_VEC3.FlareGreen}(): To flare the point in green.
-- --
-- ### 1.2.3) Explode -- ### 1.5.3) Explode
-- --
-- * @{#POINT_VEC3.Explosion}(): To explode the point with a certain intensity. -- * @{#POINT_VEC3.Explosion}(): To explode the point with a certain intensity.
-- --
-- ### 1.2.4) Illuminate -- ### 1.5.4) Illuminate
-- --
-- * @{#POINT_VEC3.IlluminationBomb}(): To illuminate the point. -- * @{#POINT_VEC3.IlluminationBomb}(): To illuminate the point.
-- --
-- --
-- 2) @{Point#POINT_VEC2} class, extends @{Point#POINT_VEC3} -- 2) @{Point#POINT_VEC2} class, extends @{Point#POINT_VEC3}
-- ========================================================= -- =========================================================
@ -10225,6 +10239,19 @@ end
-- * @{Point#POINT_VEC2.New}(): a 2D point, taking an additional height parameter. -- * @{Point#POINT_VEC2.New}(): a 2D point, taking an additional height parameter.
-- * @{Point#POINT_VEC2.NewFromVec2}(): a 2D point created from a @{DCSTypes#Vec2}. -- * @{Point#POINT_VEC2.NewFromVec2}(): a 2D point created from a @{DCSTypes#Vec2}.
-- --
-- ## 1.2) Manupulate the X, Altitude, Y coordinates of the 2D point
--
-- A POINT_VEC2 class works in 2D space, with an altitude setting. It contains internally an X, Altitude, Y coordinate.
-- Methods exist to manupulate these coordinates.
--
-- The current X, Altitude, Y axis can be retrieved with the methods @{#POINT_VEC2.GetX}(), @{#POINT_VEC2.GetAlt}(), @{#POINT_VEC2.GetY}() respectively.
-- The methods @{#POINT_VEC2.SetX}(), @{#POINT_VEC2.SetAlt}(), @{#POINT_VEC2.SetY}() change the respective axis with a new value.
-- The current axis values can be changed by using the methods @{#POINT_VEC2.AddX}(), @{#POINT_VEC2.AddAlt}(), @{#POINT_VEC2.AddY}()
-- to add or substract a value from the current respective axis value.
-- Note that the Set and Add methods return the current POINT_VEC2 object, so these manipulation methods can be chained... For example:
--
-- local Vec2 = PointVec2:AddX( 100 ):AddY( 2000 ):GetVec2()
--
-- === -- ===
-- --
-- **API CHANGE HISTORY** -- **API CHANGE HISTORY**
@ -10398,21 +10425,57 @@ function POINT_VEC3:GetZ()
end end
--- Set the x coordinate of the POINT_VEC3. --- Set the x coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number x The x coordinate. -- @param #number x The x coordinate.
-- @return #POINT_VEC3
function POINT_VEC3:SetX( x ) function POINT_VEC3:SetX( x )
self.x = x self.x = x
return self
end end
--- Set the y coordinate of the POINT_VEC3. --- Set the y coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number y The y coordinate. -- @param #number y The y coordinate.
-- @return #POINT_VEC3
function POINT_VEC3:SetY( y ) function POINT_VEC3:SetY( y )
self.y = y self.y = y
return self
end end
--- Set the z coordinate of the POINT_VEC3. --- Set the z coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number z The z coordinate. -- @param #number z The z coordinate.
-- @return #POINT_VEC3
function POINT_VEC3:SetZ( z ) function POINT_VEC3:SetZ( z )
self.z = z self.z = z
return self
end
--- Add to the x coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number x The x coordinate value to add to the current x coodinate.
-- @return #POINT_VEC3
function POINT_VEC3:AddX( x )
self.x = self.x + x
return self
end
--- Add to the y coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number y The y coordinate value to add to the current y coodinate.
-- @return #POINT_VEC3
function POINT_VEC3:AddY( y )
self.y = self.y + y
return self
end
--- Add to the z coordinate of the POINT_VEC3.
-- @param #POINT_VEC3 self
-- @param #number z The z coordinate value to add to the current z coodinate.
-- @return #POINT_VEC3
function POINT_VEC3:AddZ( z )
self.z = self.z +z
return self
end end
--- Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3. --- Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.
@ -10883,15 +10946,57 @@ function POINT_VEC2:GetAlt()
end end
--- Set the x coordinate of the POINT_VEC2. --- Set the x coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number x The x coordinate. -- @param #number x The x coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:SetX( x ) function POINT_VEC2:SetX( x )
self.x = x self.x = x
return self
end end
--- Set the y coordinate of the POINT_VEC2. --- Set the y coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number y The y coordinate. -- @param #number y The y coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:SetY( y ) function POINT_VEC2:SetY( y )
self.z = y self.z = y
return self
end
--- Set the altitude of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number Altitude The land altitude. If nothing (nil) is given, then the current land altitude is set.
-- @return #POINT_VEC2
function POINT_VEC2:SetAlt( Altitude )
self.y = Altitude or land.getHeight( { x = self.x, y = self.z } )
return self
end
--- Add to the x coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number x The x coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:AddX( x )
self.x = self.x + x
return self
end
--- Add to the y coordinate of the POINT_VEC2.
-- @param #POINT_VEC2 self
-- @param #number y The y coordinate.
-- @return #POINT_VEC2
function POINT_VEC2:AddY( y )
self.z = self.z + y
return self
end
--- Add to the current land height an altitude.
-- @param #POINT_VEC2 self
-- @param #number Altitude The Altitude to add. If nothing (nil) is given, then the current land altitude is set.
-- @return #POINT_VEC2
function POINT_VEC2:AddAlt( Altitude )
self.y = land.getHeight( { x = self.x, y = self.z } ) + Altitude or 0
return self
end end

Some files were not shown because too many files have changed in this diff Show More