Skip to content

Commit

Permalink
KJSL: Reviving DeviceOrientationControls for iPhone
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Staunton-Lambert committed Jul 30, 2024
1 parent 26c4ef1 commit 1293cbd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions vendor/three/DeviceOrientationControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

}
Expand Down

0 comments on commit 1293cbd

Please sign in to comment.