Skip to content

Commit

Permalink
[bluetooth] Use .invert() instead of .inverse() for three's qua…
Browse files Browse the repository at this point in the history
…ts. Hopefully fixes #195.

Thanks to @anicolao for identifying the issue and fix.
  • Loading branch information
lgarron committed Aug 20, 2022
1 parent fa04e69 commit e5bb611
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cubing/bluetooth/smart-puzzle/gan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class PhysicalState {
const quat = new Quaternion(x, y, z, w);

if (!homeQuatInverse) {
homeQuatInverse = quat.clone().inverse();
homeQuatInverse = quat.clone().invert();
}

return quat.clone().multiply(homeQuatInverse.clone());
Expand Down
4 changes: 2 additions & 2 deletions src/cubing/bluetooth/smart-puzzle/gocube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class GoCube extends BluetoothPuzzle {
}

public resetOrientation(): void {
this.homeQuatInverse = this.lastRawQuat.clone().inverse();
this.homeQuatInverse = this.lastRawQuat.clone().invert();
this.currentQuat = new Quaternion(0, 0, 0, 1);
this.lastTarget = new Quaternion(0, 0, 0, 1);
}
Expand Down Expand Up @@ -140,7 +140,7 @@ export class GoCube extends BluetoothPuzzle {
this.lastRawQuat = quat.clone();

if (!this.homeQuatInverse) {
this.homeQuatInverse = quat.clone().inverse();
this.homeQuatInverse = quat.clone().invert();
}

const targetQuat = quat.clone().multiply(this.homeQuatInverse.clone());
Expand Down

0 comments on commit e5bb611

Please sign in to comment.