Skip to content

Commit

Permalink
Fix: cannot flip back to up direction (#138)
Browse files Browse the repository at this point in the history
* fix: cannot rotate back to up direction error

* fix: remove perspective restriction
  • Loading branch information
JujieX authored Jan 12, 2023
1 parent a475584 commit 1081b5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/navigation-gizmo/src/SphereScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ export class SphereScript extends Script {

onPointerDown(pointer: Pointer) {
this._disableComponent();

this._sceneCamera.isOrthographic = false;
this._recoverTextColor();

// get targetPoint
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1081b5a

Please sign in to comment.