From 06038d3e90e8f3443a665c4005d35fb79d6cb6ce Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Wed, 17 Jun 2026 17:14:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=AF=8F=E5=8F=91=E7=82=AE=E5=BC=B9?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E8=AE=A1=E7=AE=97=E5=8F=91=E5=B0=84=E8=A7=92?= =?UTF-8?q?=EF=BC=8C=E4=BA=91=E5=9B=A2=E5=9D=87=E5=8C=80=E5=88=86=E5=B8=83?= =?UTF-8?q?=EF=BC=9B=E6=8E=A2=E6=B5=8B=E9=97=A8=E6=8E=A7=E5=8F=91=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DefensePlanner: - PlanUnitLane 中为目标点(tx,ty,tz)重新计算 launchAngle - 不再复用 InterceptCalculator 的统一角度,每发角度不同 - 活塞想定:平台从 7000→6600(1.1×探测距离) 结果:8发炮弹云团沿航线均匀分布,间距~32m --- src/CounterDrone.Core/Algorithms/DefensePlanner.cs | 9 +++++++++ src/CounterDrone.Core/DefaultScenarios.cs | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/CounterDrone.Core/Algorithms/DefensePlanner.cs b/src/CounterDrone.Core/Algorithms/DefensePlanner.cs index 5a6d60f..b777a11 100644 --- a/src/CounterDrone.Core/Algorithms/DefensePlanner.cs +++ b/src/CounterDrone.Core/Algorithms/DefensePlanner.cs @@ -536,6 +536,15 @@ namespace CounterDrone.Core.Algorithms float ty = routeY; float tz = routeZ + normalZ * laneOffset; + // 为每个目标点重新计算发射角(不等同于拦截弧处的角度) + if (unit.Type == PlatformType.GroundBased) + { + float dist = (float)Math.Sqrt( + (tx - unit.Position.X) * (tx - unit.Position.X) + + (tz - unit.Position.Z) * (tz - unit.Position.Z)); + launchAngle = Kinematics.CalculateLaunchAngle(dist, unit.MuzzleVelocity, ty - unit.Position.Y); + } + // 无人机到达穿越点的时间:基于探测边界,而非航路起点。 // planner 是参谋,只能基于探测信息规划。威胁从探测边界被发现, // 飞行时间 = (拦截弧长 - 探测弧长) / 速度。无探测时 DetectArc=0(回退到起点)。 diff --git a/src/CounterDrone.Core/DefaultScenarios.cs b/src/CounterDrone.Core/DefaultScenarios.cs index 704ddcd..a056bac 100644 --- a/src/CounterDrone.Core/DefaultScenarios.cs +++ b/src/CounterDrone.Core/DefaultScenarios.cs @@ -75,11 +75,11 @@ namespace CounterDrone.Core s.SaveRoute(t.Id, "default", d.Formations.First(f => f.Id == "single").ToRoutePlan(), new List { new() { PosX = 0, PosY = 500, PosZ = 0, Speed = 200 }, - new() { PosX = 7000, PosY = 500, PosZ = 0, Speed = 200 }, + new() { PosX = 6600, PosY = 500, PosZ = 0, Speed = 200 }, }); s.SaveDeployment(t.Id, new List { - d.FireUnits.First(f => f.Id == "ground-light").ToEquipmentDeployment(AerosolType.InertGas, 1, 7000, 0, 50), + d.FireUnits.First(f => f.Id == "ground-light").ToEquipmentDeployment(AerosolType.InertGas, 1, 6600, 0, 50), }); s.SaveCloudDispersal(t.Id, new CloudDispersal { AerosolType = (int)AerosolType.InertGas, DisperseHeight = 500 }); s.UpdateStep(t.Id, 5);