Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4de322598208
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9412bfb69a61
Choose a head ref
  • 4 commits
  • 2 files changed
  • 1 contributor

Commits on Dec 10, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    24e05ff View commit details

Commits on Dec 11, 2019

  1. Copy the full SHA
    1b882ae View commit details
  2. Use the target frame

    eggrobin committed Dec 11, 2019
    Copy the full SHA
    742cb36 View commit details

Commits on Dec 12, 2019

  1. Merge pull request #2398 from eggrobin/camera-rotation

    Fix miscellaneous bugs with camera rotation
    eggrobin authored Dec 12, 2019
    Copy the full SHA
    9412bfb View commit details
Showing with 14 additions and 7 deletions.
  1. +1 −1 ksp_plugin/renderer.cpp
  2. +13 −6 ksp_plugin_adapter/ksp_plugin_adapter.cs
2 changes: 1 addition & 1 deletion ksp_plugin/renderer.cpp
Original file line number Diff line number Diff line change
@@ -274,7 +274,7 @@ Rotation<CameraReference, World> Renderer::CameraReferenceRotation(
auto const result =
OrthogonalMap<WorldSun, World>::Identity() *
sun_looking_glass.Inverse().Forget() * planetarium_rotation.Forget() *
plotting_frame_->FromThisFrameAtTime(time).orthogonal_map() *
GetPlottingFrame()->FromThisFrameAtTime(time).orthogonal_map() *
celestial_mirror.Forget();
CHECK(result.Determinant().is_positive());
return result.rotation();
19 changes: 13 additions & 6 deletions ksp_plugin_adapter/ksp_plugin_adapter.cs
Original file line number Diff line number Diff line change
@@ -744,17 +744,22 @@ private void OrientPlanetariumCamera() {
should_transfer_camera_coordinates_ = false;
}
previous_camera_reference_rotation_ = reference_rotation;
PlanetariumCamera.fetch.GetPivot().rotation =
reference_rotation *
(UnityEngine.QuaternionD)PlanetariumCamera.fetch.GetPivot().rotation *
camera_roll;
// The galaxy camera also renders the galaxy cube outside map view; it
// should not be rotated there.
// 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;
// We cannot run between the |PlanetariumCamera| and |ScaledSpace|
// |LateUpdate|s, but we need the ScaledSpace one to run after us to put the
// scaled origin where the scaled camera is. Manually running another
// |LateUpdate| on ScaledSpace works, albeit ugly.
ScaledSpace.Instance.SendMessage("LateUpdate");
}
if (camera_roll_ != 0) {
// TODO(egg): Should we be doing this in LateUpdate?
@@ -1659,12 +1664,14 @@ private void RenderNavball(Vessel active_vessel) {
.selected_celestial.flightGlobalsIndex);
if (plotting_frame_selector_.target_override != target_vessel) {
navball_changed_ = true;
should_transfer_camera_coordinates_ = true;
plotting_frame_selector_.target_override = target_vessel;
}
} else {
plugin_.ClearTargetVessel();
if (plotting_frame_selector_.target_override != null) {
navball_changed_ = true;
should_transfer_camera_coordinates_ = true;
plotting_frame_selector_.target_override = null;
}
}