From 1e5e91dabff9914363170dcbde7b79f14c0bbd0f Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 15 Mar 2020 15:06:32 +0800 Subject: [PATCH] Try to fix broken gyroscope control in iOS --- lib/irrlicht/source/Irrlicht/CIrrDeviceiOS.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceiOS.mm b/lib/irrlicht/source/Irrlicht/CIrrDeviceiOS.mm index 7cb722a71..c84f538ca 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceiOS.mm +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceiOS.mm @@ -559,6 +559,8 @@ namespace irr ev.AccelerometerEvent.Z = motionManager.accelerometerData.acceleration.z * 9.81; if (m_upside_down) ev.AccelerometerEvent.Y = -ev.AccelerometerEvent.Y; + if (ev.AccelerometerEvent.X < 0.0) + ev.AccelerometerEvent.X *= -1.0; postEventFromUser(ev); }