Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orient the camera in CelestialSphere, not World #3249

Merged
merged 1 commit into from
Dec 27, 2021

Conversation

eggrobin
Copy link
Member

@eggrobin eggrobin commented Dec 24, 2021

Fix #3235.

The reference rotation is used here:

// Both the scaled space and galaxy cameras are used in the flight scene as
// well as map view; they should not be reoriented there.
if (MapView.MapIsEnabled) {
PlanetariumCamera.fetch.GetPivot().rotation =
reference_rotation *
(UnityEngine.QuaternionD)PlanetariumCamera.fetch.GetPivot().rotation *
camera_roll;
ScaledCamera.Instance.galaxyCamera.transform.rotation =
reference_rotation *
(UnityEngine.QuaternionD)ScaledCamera.Instance.galaxyCamera.transform.
rotation *
camera_roll;
}

The rotation of the pivot is with respect to World. However, the game compensates for the planetarium rotation, and we only adjust the orientation maintained by the game, we do not maintain an authoritative camera orientation, so that we should not compensate for the planetarium rotation ourselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The camera rotates in the plotting frame when KSP uses a rotating reference frame
2 participants