From 1293cbd6476480ea6f0cb9a4501460587e36ee2e Mon Sep 17 00:00:00 2001 From: Kevin Staunton-Lambert Date: Tue, 30 Jul 2024 20:18:28 +1000 Subject: [PATCH] KJSL: Reviving DeviceOrientationControls for iPhone --- vendor/three/DeviceOrientationControls.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vendor/three/DeviceOrientationControls.js b/vendor/three/DeviceOrientationControls.js index 7449e98..6069232 100644 --- a/vendor/three/DeviceOrientationControls.js +++ b/vendor/three/DeviceOrientationControls.js @@ -124,13 +124,13 @@ class DeviceOrientationControls extends EventDispatcher { const orient = scope.screenOrientation ? MathUtils.degToRad( scope.screenOrientation ) : 0; // O - setObjectQuaternion( scope.object.quaternion, alpha, beta, gamma, orient ); - - if ( 8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ) { - - lastQuaternion.copy( scope.object.quaternion ); - scope.dispatchEvent( _changeEvent ); - return true; + if (alpha !== 0 && beta !== 0 && gamma !== 0) { + setObjectQuaternion(scope.object.quaternion, alpha, beta, gamma, orient); + if (8 * (1 - lastQuaternion.dot(scope.object.quaternion)) > EPS) { + lastQuaternion.copy(scope.object.quaternion); + scope.dispatchEvent(_changeEvent); + return true; + } } }