Skip to content

Commit

Permalink
cleaner quaternion conversion
Browse files Browse the repository at this point in the history
does what is says on the tin
  • Loading branch information
CaiVR committed Feb 28, 2024
1 parent bc3bfa9 commit e139070
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions AxSlime/Bridge/BridgeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,13 @@ private void UpdateTracker(AxisTracker axis)
}

Quaternion jankQuat = new Quaternion( //Quaternion Left to right convert (or right to left idk)
axis.Rotation.X,
axis.Rotation.Z,
-axis.Rotation.Y,
-axis.Rotation.X,
-axis.Rotation.Z,
axis.Rotation.Y,
axis.Rotation.W
);

slime.SendPacket(
new Packet17RotationData() { Rotation = AxesOffset * Quaternion.Inverse(jankQuat) }
);
slime.SendPacket(new Packet17RotationData() { Rotation = AxesOffset * jankQuat });

if (axis.HasAcceleration)
{
Expand Down

0 comments on commit e139070

Please sign in to comment.