Skip to content

Commit e5bb611

Browse files
committed
[bluetooth] Use .invert() instead of .inverse() for three's quats. Hopefully fixes #195.
Thanks to @anicolao for identifying the issue and fix.
1 parent fa04e69 commit e5bb611

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/cubing/bluetooth/smart-puzzle/gan.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class PhysicalState {
108108
const quat = new Quaternion(x, y, z, w);
109109

110110
if (!homeQuatInverse) {
111-
homeQuatInverse = quat.clone().inverse();
111+
homeQuatInverse = quat.clone().invert();
112112
}
113113

114114
return quat.clone().multiply(homeQuatInverse.clone());

src/cubing/bluetooth/smart-puzzle/gocube.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export class GoCube extends BluetoothPuzzle {
104104
}
105105

106106
public resetOrientation(): void {
107-
this.homeQuatInverse = this.lastRawQuat.clone().inverse();
107+
this.homeQuatInverse = this.lastRawQuat.clone().invert();
108108
this.currentQuat = new Quaternion(0, 0, 0, 1);
109109
this.lastTarget = new Quaternion(0, 0, 0, 1);
110110
}
@@ -140,7 +140,7 @@ export class GoCube extends BluetoothPuzzle {
140140
this.lastRawQuat = quat.clone();
141141

142142
if (!this.homeQuatInverse) {
143-
this.homeQuatInverse = quat.clone().inverse();
143+
this.homeQuatInverse = quat.clone().invert();
144144
}
145145

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

0 commit comments

Comments
 (0)