Fine-tune SEAD search point

This commit is contained in:
Raffson 2023-06-17 21:28:33 +02:00
parent d3069bdaad
commit 5818367f2e
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -431,9 +431,12 @@ class WaypointBuilder:
# Use the threat range as offset distance to avoid flying all the way to the SAM site
assert self.flight.package.waypoints
ingress = self.flight.package.waypoints.ingress
ingress2tgt_dist = ingress.distance_to_point(target.position)
threat_range = 1.1 * max([x.threat_range for x in target.strike_targets]).meters
hdg = target.position.heading_between_point(ingress)
hold = target.position.point_from_heading(hdg, threat_range)
hold = target.position.point_from_heading(
hdg, min(threat_range, ingress2tgt_dist * 0.95)
)
return FlightWaypoint(
"SEAD Search",