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: 196a33c92dae
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: cc3b73a69176
Choose a head ref
  • 10 commits
  • 1 file changed
  • 2 contributors

Commits on Mar 19, 2017

  1. let's be unfashionable

    eggrobin committed Mar 19, 2017
    Copy the full SHA
    95142d7 View commit details

Commits on Mar 20, 2017

  1. traces and confusion

    eggrobin committed Mar 20, 2017
    Copy the full SHA
    6e7cdbc View commit details
  2. Copy the full SHA
    24ddbc1 View commit details
  3. I may have fixed it?

    eggrobin committed Mar 20, 2017
    Copy the full SHA
    8947fe6 View commit details
  4. undo reformatting

    eggrobin committed Mar 20, 2017
    Copy the full SHA
    dbd8a2b View commit details
  5. Copy the full SHA
    9e9154d View commit details
  6. apparently this is fine too

    eggrobin committed Mar 20, 2017
    Copy the full SHA
    2e116ef View commit details
  7. Copy the full SHA
    b4a19fd View commit details
  8. Copy the full SHA
    666aa55 View commit details
  9. Merge pull request #1275 from eggrobin/daemmerungsgoetter

    Dämmerungsgötterdämmerung
    pleroy authored Mar 20, 2017
    Copy the full SHA
    cc3b73a View commit details
Showing with 24 additions and 1 deletion.
  1. +24 −1 ksp_plugin_adapter/ksp_plugin_adapter.cs
25 changes: 24 additions & 1 deletion ksp_plugin_adapter/ksp_plugin_adapter.cs
Original file line number Diff line number Diff line change
@@ -272,7 +272,9 @@ private bool is_in_space(Vessel vessel) {
return vessel.state != Vessel.State.DEAD &&
(vessel.situation == Vessel.Situations.SUB_ORBITAL ||
vessel.situation == Vessel.Situations.ORBITING ||
vessel.situation == Vessel.Situations.ESCAPING);
vessel.situation == Vessel.Situations.ESCAPING) &&
(vessel.packed ||
vessel.altitude > vessel.mainBody.inverseRotThresholdAltitude);
}

private bool is_on_rails_in_space(Vessel vessel) {
@@ -985,6 +987,18 @@ private void SetBodyFrames() {
FlightGlobals.currentMainBody.flightGlobalsIndex);
}
ApplyToBodyTree(body => UpdateBody(body, Planetarium.GetUniversalTime()));

Vector3d ? offset = null;
if (FlightGlobals.ActiveVessel != null &&
plugin_.HasVessel(FlightGlobals.ActiveVessel.id.ToString())) {
QP main_body_dof = plugin_.CelestialWorldDegreesOfFreedom(
FlightGlobals.ActiveVessel.mainBody.flightGlobalsIndex,
FlightGlobals.ActiveVessel.rootPart.flightID);
krakensbane.FrameVel = -(Vector3d)main_body_dof.p;
offset = (Vector3d)main_body_dof.q -
FlightGlobals.ActiveVessel.mainBody.position;
}

foreach (var body in FlightGlobals.Bodies) {
// TODO(egg): I have no idea why this |swizzle| thing makes things work.
// This probably really means something in terms of frames that should
@@ -996,6 +1010,15 @@ private void SetBodyFrames() {
X = swizzly_body_world_to_world * new Vector3d{x = 1, y = 0, z = 0},
Y = swizzly_body_world_to_world * new Vector3d{x = 0, y = 1, z = 0},
Z = swizzly_body_world_to_world * new Vector3d{x = 0, y = 0, z = 1}};
if (offset.HasValue) {
body.position += offset.Value;
}
}
if (offset.HasValue) {
foreach (Vessel vessel in FlightGlobals.Vessels.Where(
is_on_rails_in_space)) {
vessel.SetPosition(vessel.transform.position + offset.Value);
}
}
}
}