From b4324cb05753c33bafe78b172bead155ee79c959 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Tue, 18 Jun 2019 20:18:43 +0300 Subject: [PATCH] Optimized inclination for formation flying. --- Moose Development/Moose/AI/AI_Formation.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/AI/AI_Formation.lua b/Moose Development/Moose/AI/AI_Formation.lua index 7d0be781a..cf1971f8f 100644 --- a/Moose Development/Moose/AI/AI_Formation.lua +++ b/Moose Development/Moose/AI/AI_Formation.lua @@ -1141,8 +1141,12 @@ function AI_FORMATION:onenterFollowing( FollowGroupSet ) --R2.1 -- Now we calculate the intersecting vector between the circle around CV2 with radius FollowDistance and GH2. -- From the GeoGebra model: CVI = (x(CV2) + FollowDistance cos(alpha), y(GH2) + FollowDistance sin(alpha), z(CV2)) + local Inclination = ( Distance + FollowFormation.x ) / 10 + if Inclination < -30 then + Inclination = - 30 + end local CVI = { x = CV2.x + CS * 10 * math.sin(Ca), - --y = GH2.y + ( Distance + FollowFormation.x ) / 10, -- + FollowFormation.y, + y = GH2.y + Inclination, -- + FollowFormation.y, y = GH2.y, z = CV2.z + CS * 10 * math.cos(Ca), }