mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Reworked zone and vector functions
2017-02-08 - Reworked some vector functions. -- POINT_VEC3:NewFromVec2( Vec2, LandHeightAdd ) added. -- ZONE_RADIUS:GetRandomPointVec2( inner, outer ) added. -- ZONE_RADIUS:GetRandomPointVec3( inner, outer ) added. -- ZONE_POLYGON_BASE:GetRandomPointVec2() added. -- ZONE_POLYGON_BASE:GetRandomPointVec3() added.
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
--
|
||||
-- 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.
|
||||
@@ -127,6 +129,24 @@ function POINT_VEC3:New( x, y, z )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Create a new POINT_VEC3 object from Vec2 coordinates.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param Dcs.DCSTypes#Vec2 Vec2 The Vec2 point.
|
||||
-- @return Core.Point#POINT_VEC3 self
|
||||
function POINT_VEC3:NewFromVec2( Vec2, LandHeightAdd )
|
||||
|
||||
local LandHeight = land.getHeight( Vec2 )
|
||||
|
||||
LandHeightAdd = LandHeightAdd or 0
|
||||
LandHeight = LandHeight + LandHeightAdd
|
||||
|
||||
self = self:New( Vec2.x, LandHeight, Vec2.y )
|
||||
|
||||
self:F2( self )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Create a new POINT_VEC3 object from Vec3 coordinates.
|
||||
-- @param #POINT_VEC3 self
|
||||
-- @param Dcs.DCSTypes#Vec3 Vec3 The Vec3 point.
|
||||
|
||||
Reference in New Issue
Block a user