mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Use navmesh to plan sweep missions.
https://github.com/Khopa/dcs_liberation/issues/292
This commit is contained in:
parent
2856fbc42b
commit
d95f623ca9
@ -5,7 +5,7 @@ Saves from 2.3 are not compatible with 2.4.
|
|||||||
## Features/Improvements
|
## Features/Improvements
|
||||||
|
|
||||||
* **[Flight Planner]** Air-to-air and SEAD escorts will no longer be automatically planned for packages that are not in range of threats.
|
* **[Flight Planner]** Air-to-air and SEAD escorts will no longer be automatically planned for packages that are not in range of threats.
|
||||||
* **[Flight Planner]** BARCAP, TARCAP, and CAS flights will now navigate around threat areas en route to the target area when practical. More types coming soon.
|
* **[Flight Planner]** BARCAP, TARCAP, CAS, and Fighter Sweep flights will now navigate around threat areas en route to the target area when practical. More types coming soon.
|
||||||
|
|
||||||
# 2.3.3
|
# 2.3.3
|
||||||
|
|
||||||
|
|||||||
@ -620,20 +620,22 @@ class StrikeFlightPlan(FormationFlightPlan):
|
|||||||
@dataclass(frozen=True)
|
@dataclass(frozen=True)
|
||||||
class SweepFlightPlan(LoiterFlightPlan):
|
class SweepFlightPlan(LoiterFlightPlan):
|
||||||
takeoff: FlightWaypoint
|
takeoff: FlightWaypoint
|
||||||
|
nav_to: List[FlightWaypoint]
|
||||||
sweep_start: FlightWaypoint
|
sweep_start: FlightWaypoint
|
||||||
sweep_end: FlightWaypoint
|
sweep_end: FlightWaypoint
|
||||||
|
nav_from: List[FlightWaypoint]
|
||||||
land: FlightWaypoint
|
land: FlightWaypoint
|
||||||
divert: Optional[FlightWaypoint]
|
divert: Optional[FlightWaypoint]
|
||||||
lead_time: timedelta
|
lead_time: timedelta
|
||||||
|
|
||||||
def iter_waypoints(self) -> Iterator[FlightWaypoint]:
|
def iter_waypoints(self) -> Iterator[FlightWaypoint]:
|
||||||
yield from [
|
yield self.takeoff
|
||||||
self.takeoff,
|
yield self.hold
|
||||||
self.hold,
|
yield from self.nav_to
|
||||||
self.sweep_start,
|
yield self.sweep_start
|
||||||
self.sweep_end,
|
yield self.sweep_end
|
||||||
self.land,
|
yield from self.nav_from
|
||||||
]
|
yield self.land
|
||||||
if self.divert is not None:
|
if self.divert is not None:
|
||||||
yield self.divert
|
yield self.divert
|
||||||
|
|
||||||
@ -909,9 +911,10 @@ class FlightPlanBuilder:
|
|||||||
Args:
|
Args:
|
||||||
flight: The flight to generate the flight plan for.
|
flight: The flight to generate the flight plan for.
|
||||||
"""
|
"""
|
||||||
|
assert self.package.waypoints is not None
|
||||||
target = self.package.target.position
|
target = self.package.target.position
|
||||||
|
|
||||||
heading = self._heading_to_package_airfield(target)
|
heading = self.package.waypoints.join.heading_between_point(target)
|
||||||
start = target.point_from_heading(heading,
|
start = target.point_from_heading(heading,
|
||||||
-self.doctrine.sweep_distance.meters)
|
-self.doctrine.sweep_distance.meters)
|
||||||
|
|
||||||
@ -919,13 +922,19 @@ class FlightPlanBuilder:
|
|||||||
start, end = builder.sweep(start, target,
|
start, end = builder.sweep(start, target,
|
||||||
self.doctrine.ingress_altitude)
|
self.doctrine.ingress_altitude)
|
||||||
|
|
||||||
|
hold = builder.hold(self._hold_point(flight))
|
||||||
|
|
||||||
return SweepFlightPlan(
|
return SweepFlightPlan(
|
||||||
package=self.package,
|
package=self.package,
|
||||||
flight=flight,
|
flight=flight,
|
||||||
lead_time=timedelta(minutes=5),
|
lead_time=timedelta(minutes=5),
|
||||||
takeoff=builder.takeoff(flight.departure),
|
takeoff=builder.takeoff(flight.departure),
|
||||||
hold=builder.hold(self._hold_point(flight)),
|
hold=hold,
|
||||||
hold_duration=timedelta(minutes=5),
|
hold_duration=timedelta(minutes=5),
|
||||||
|
nav_to=builder.nav_path(hold.position, start.position,
|
||||||
|
self.doctrine.ingress_altitude),
|
||||||
|
nav_from=builder.nav_path(end.position, flight.arrival.position,
|
||||||
|
self.doctrine.ingress_altitude),
|
||||||
sweep_start=start,
|
sweep_start=start,
|
||||||
sweep_end=end,
|
sweep_end=end,
|
||||||
land=builder.land(flight.arrival),
|
land=builder.land(flight.arrival),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user