Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Decoupling Cameras from the Player's Ship #4818
As promised in #192, this issue tracks the work needed to detach the view controller from the Player and allow centering / orbiting arbitrary objects or indeed any point in space at all.
We have several use-cases for this but they ultimately boil down to two:
This naturally requires that the camera is able to "fly" on its own, with systems such as terrain generation and model rendering reacting appropriately to the presence of the camera and not the ship. As far as I am aware, most rendering-related systems use the camera's position by default, so I anticipate very little clean-up beyond decoupling such systems from vestigial dependencies on the player object.
As part of this work, we would like to improve handling of the existing cameras:
We would ideally like to add support for several additional camera controllers, being specializations of the general-purpose External camera:
This is not going to be a small undertaking, but the groundwork for it has been laid in #4536. This work will involve further decoupling ship and view controller, allowing PiGui to control the transition between a ShipViewController and a non-Ship ViewController, updating WorldView to properly handle the disconnect between a ship and a ViewController, and passing the responsibility for which object to orbit / center on to the ViewController instead of the individual CameraControllers.