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);