From c029f67832ed8fa748fb88552628093dad477db3 Mon Sep 17 00:00:00 2001 From: todayama_r <13657682+Corvus400@users.noreply.github.com> Date: Wed, 4 Sep 2024 18:57:17 +0900 Subject: [PATCH] :wrench: Reverse the pitch value to match the left-hand coordinate system. If you don't reverse the values, the tilt of the device will be opposite between Android and iOS. --- .../confsched/droidkaigiui/OrientationSensorManager.ios.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.ios.kt b/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.ios.kt index 55614fdbc..e10eb58f7 100644 --- a/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.ios.kt +++ b/core/droidkaigiui/src/iosMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/OrientationSensorManager.ios.kt @@ -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(), ), )