fix: 每发炮弹独立计算发射角,云团均匀分布;探测门控发射
DefensePlanner: - PlanUnitLane 中为目标点(tx,ty,tz)重新计算 launchAngle - 不再复用 InterceptCalculator 的统一角度,每发角度不同 - 活塞想定:平台从 7000→6600(1.1×探测距离) 结果:8发炮弹云团沿航线均匀分布,间距~32m
This commit is contained in:
parent
24ba621581
commit
06038d3e90
@ -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(回退到起点)。
|
||||
|
||||
@ -75,11 +75,11 @@ namespace CounterDrone.Core
|
||||
s.SaveRoute(t.Id, "default", d.Formations.First(f => f.Id == "single").ToRoutePlan(),
|
||||
new List<Waypoint> {
|
||||
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<EquipmentDeployment>
|
||||
{
|
||||
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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user