mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Add orientation info and allow user to rotate TGO
- Give user information about the heading of a TGO - Add a button to change the heading to head to conflic - Change the orientation of a TGO during Buy - Run the heading to conflict calculation to change the orientation of the newly bought group. It will then head to the center of the conflict
This commit is contained in:
@@ -260,6 +260,18 @@ class TheaterGroundObject(MissionTarget, SidcDescribable, ABC):
|
||||
return group
|
||||
return None
|
||||
|
||||
def rotate(self, heading: Heading) -> None:
|
||||
"""Rotate the whole TGO clockwise to the new heading"""
|
||||
rotation = heading - self.heading
|
||||
if rotation.degrees < 0:
|
||||
rotation = Heading.from_degrees(rotation.degrees + 360)
|
||||
|
||||
self.heading = heading
|
||||
# Rotate the whole TGO to match the new heading
|
||||
for unit in self.units:
|
||||
unit.position.heading += rotation
|
||||
unit.position.rotate(self.position, rotation)
|
||||
|
||||
|
||||
class BuildingGroundObject(TheaterGroundObject):
|
||||
def __init__(
|
||||
|
||||
Reference in New Issue
Block a user