Skip to content

Commit

Permalink
Correct root part offset and rotation
Browse files Browse the repository at this point in the history
This improves built vessel orientation for the micro pad. However, it
works correctly only when the rotation to get the node pointing up is
around the X axis.
  • Loading branch information
taniwha committed Apr 7, 2020
1 parent c0784ff commit 1ae35c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/DisposablePad/DisposablePad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ public void SetShipTransform (Transform shipTransform, Part rootPart)
pos = rootXform.TransformVector (n.position);
}
Debug.Log ($"[EL] pos: {pos} rot: {rot}");
shipTransform.position = pos;
shipTransform.rotation = rot;
shipTransform.position = rot * -pos;
shipTransform.rotation = rot * shipTransform.rotation;
}

public Transform PlaceShip (Transform shipTransform, Box vessel_bounds)
Expand Down

0 comments on commit 1ae35c4

Please sign in to comment.