Skip to content

Commit

Permalink
Merge pull request #961 from Corvus400/bug/fix_ios_orientation_sensor…
Browse files Browse the repository at this point in the history
…_manager_2

🔧 [IosOrientationSensorManager] Reverse the pitch value to match the left-hand coordinate system.
  • Loading branch information
takahirom authored Sep 4, 2024
2 parents 01a5193 + c029f67 commit 8818ef9
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ internal class IosOrientationSensorManager(
onOrientationChanged(
Orientation(
azimuth = motion.attitude.yaw.toFloat(),
pitch = motion.attitude.pitch.toFloat(),
// Unlike Android, iOS uses a left-handed coordinate system, so we need to invert the pitch value.
pitch = -motion.attitude.pitch.toFloat(),
roll = motion.attitude.roll.toFloat(),
),
)
Expand Down

0 comments on commit 8818ef9

Please sign in to comment.