Skip to content

Commit

Permalink
Fix #220: fix camera orientation when boarding from EVA
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyOThan committed Nov 6, 2023
1 parent cf569f3 commit a1dd049
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions FreeIva/FreeIva.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,10 @@ static IEnumerator PostBoardCoroutine(ProtoCrewMember protoCrewMember, Collider
if (!KerbalIvaAddon.Instance.buckled)
{
Vector3 position = matchingHatch.transform.TransformPoint(matchingHatch.inwardsDirection * 0.3f);
Vector3 hatchInwards = matchingHatch.transform.TransformVector(matchingHatch.inwardsDirection);
Vector3 hatchInwards = matchingHatch.transform.TransformDirection(matchingHatch.inwardsDirection);
Quaternion rotation = Quaternion.LookRotation(hatchInwards, matchingHatch.internalModel.transform.up);
KerbalIvaAddon.Instance.KerbalIva.transform.SetPositionAndRotation(position, rotation);
KerbalIvaAddon.Instance.KerbalIva.transform.position = position;
KerbalIvaAddon.Instance.KerbalIva.SetCameraOrientation(rotation);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion FreeIva/KerbalIvaController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void OrientToGravity()
}
}

void SetCameraOrientation(Quaternion rotation)
public void SetCameraOrientation(Quaternion rotation)
{
if (UseRelativeMovement())
{
Expand Down

0 comments on commit a1dd049

Please sign in to comment.