From 1081b5a5939269b55ec3f40b170d2ce4dc004bad Mon Sep 17 00:00:00 2001 From: JujieX <67930474+JujieX@users.noreply.github.com> Date: Thu, 12 Jan 2023 10:41:33 +0800 Subject: [PATCH] Fix: cannot flip back to up direction (#138) * fix: cannot rotate back to up direction error * fix: remove perspective restriction --- packages/navigation-gizmo/src/SphereScript.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/navigation-gizmo/src/SphereScript.ts b/packages/navigation-gizmo/src/SphereScript.ts index 84ea6607..1f3f3bb8 100644 --- a/packages/navigation-gizmo/src/SphereScript.ts +++ b/packages/navigation-gizmo/src/SphereScript.ts @@ -117,8 +117,6 @@ export class SphereScript extends Script { onPointerDown(pointer: Pointer) { this._disableComponent(); - - this._sceneCamera.isOrthographic = false; this._recoverTextColor(); // get targetPoint @@ -188,7 +186,9 @@ export class SphereScript extends Script { let x = -this._deltaPointer.x * this._speedXFactor; let y = -this._deltaPointer.y * this._speedYFactor; - if (this._startRadian - y <= 0 || this._startRadian - y > Math.PI) { + const isBetween = this._startRadian - y > Math.PI && this._startRadian - y < 2 * Math.PI; + + if (this._startRadian - y <= 0 || isBetween) { this._isBack = true; } else { this._isBack = false;