mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
new point generation
This commit is contained in:
parent
dd9fe87ff4
commit
4f1b0055e1
@ -1183,29 +1183,26 @@ class FlightPlanBuilder:
|
|||||||
return start, end
|
return start, end
|
||||||
|
|
||||||
def aewc_orbit(self, location: MissionTarget) -> Point:
|
def aewc_orbit(self, location: MissionTarget) -> Point:
|
||||||
heading = 0
|
heading = location.position.heading_between_point(location.position)
|
||||||
distance = 0
|
|
||||||
|
|
||||||
while True:
|
position = ShapelyPoint(
|
||||||
# Generate our Orbit point
|
self.package.target.position.x, self.package.target.position.y
|
||||||
orbit_point = location.position.point_from_heading(heading, distance)
|
|
||||||
# Check if our generated point is in a threat zone
|
|
||||||
test_pos = ShapelyPoint(
|
|
||||||
orbit_point.x, orbit_point.y
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if heading > 360:
|
# in threat zone
|
||||||
if meters(test_pos.distance(self.threat_zones.all)) == meters(0):
|
if meters(position.distance(self.threat_zones.all)) == meters(0):
|
||||||
distance += int(nautical_miles(50).meters)
|
# Borderpoint
|
||||||
else:
|
closest_closest_boundary = self.threat_zones.closest_boundary(position)
|
||||||
break
|
|
||||||
heading = 0
|
|
||||||
elif meters(test_pos.distance(self.threat_zones.all)) == meters(0):
|
|
||||||
heading += 60
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
|
|
||||||
return orbit_point
|
# Heading + Distance to border point
|
||||||
|
heading = location.position.heading_between_point(closest_closest_boundary)
|
||||||
|
distance = location.position.distance_to_point(closest_closest_boundary)
|
||||||
|
|
||||||
|
return location.position.point_from_heading(heading, distance)
|
||||||
|
|
||||||
|
# this Part is fine. No threat zone, just use our point
|
||||||
|
else:
|
||||||
|
return location.position.point_from_heading(heading, 0)
|
||||||
|
|
||||||
def racetrack_for_frontline(
|
def racetrack_for_frontline(
|
||||||
self, origin: Point, front_line: FrontLine
|
self, origin: Point, front_line: FrontLine
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user