@woosh/meep-engine 2.47.26 → 2.47.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/meep.cjs CHANGED
@@ -45190,7 +45190,7 @@ class Quaternion {
45190
45190
 
45191
45191
  right._crossVectors(ux, uy, uz, forward.x, forward.y, forward.z);
45192
45192
 
45193
- if(right.lengthSq() === 0){
45193
+ if (right.lengthSq() === 0) {
45194
45194
  // up and forward are parallel
45195
45195
 
45196
45196
  /*
@@ -45198,14 +45198,14 @@ class Quaternion {
45198
45198
  code take from : https://github.com/mrdoob/three.js/blob/88e8954b69377dad4ad1ceaf1a383f3536e88e5a/src/math/Matrix4.js#L304
45199
45199
  */
45200
45200
 
45201
- if(Math.abs(uz) === 1){
45201
+ if (Math.abs(uz) === 1) {
45202
45202
  forward.x += 0.001;
45203
- }else {
45203
+ } else {
45204
45204
  forward.z += 0.001;
45205
45205
  }
45206
45206
 
45207
45207
  forward.normalize();
45208
- right._crossVectors(ux,uy,uz, forward.x, forward.y, forward.z);
45208
+ right._crossVectors(ux, uy, uz, forward.x, forward.y, forward.z);
45209
45209
 
45210
45210
  }
45211
45211
 
@@ -45328,8 +45328,6 @@ class Quaternion {
45328
45328
  * @return {number} angle in radians
45329
45329
  */
45330
45330
  angleTo(other) {
45331
- //compute inverse
45332
-
45333
45331
  const x0 = this.x;
45334
45332
  const y0 = this.y;
45335
45333
  const z0 = this.z;
@@ -45340,31 +45338,13 @@ class Quaternion {
45340
45338
  const z1 = other.z;
45341
45339
  const w1 = other.w;
45342
45340
 
45343
- const dot = x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0;
45344
-
45345
- let ix, iy, iz, iw;
45346
-
45347
- if (dot === 0) {
45348
- ix = 0;
45349
- iy = 0;
45350
- iz = 0;
45351
- iw = 0;
45352
- } else {
45353
-
45354
- const invDot = 1.0 / dot;
45341
+ const dot = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1;
45355
45342
 
45356
- ix = -x0 * invDot;
45357
- iy = -y0 * invDot;
45358
- iz = -z0 * invDot;
45359
- iw = w0 * invDot;
45360
- }
45361
-
45362
- //compute resulting quaternion
45363
- const w = w1 * iw - x1 * ix - y1 * iy - z1 * iz;
45343
+ const dot_clamped = clamp$1(dot, -1, 1);
45364
45344
 
45365
- const _w = clamp$1(w, -1, 1);
45345
+ const dot_abs = Math.abs(dot_clamped);
45366
45346
 
45367
- return Math.acos(_w) * 2;
45347
+ return Math.acos(dot_abs) * 2;
45368
45348
  }
45369
45349
 
45370
45350
  /**
@@ -46676,7 +46656,7 @@ class Quaternion {
46676
46656
  * @param {number[]} array
46677
46657
  * @param {number} offset
46678
46658
  */
46679
- readFromArray(array, offset=0) {
46659
+ readFromArray(array, offset = 0) {
46680
46660
  this.set(
46681
46661
  array[offset],
46682
46662
  array[offset + 1],
@@ -46690,7 +46670,7 @@ class Quaternion {
46690
46670
  * @param {number[]} array
46691
46671
  * @param {number} offset
46692
46672
  */
46693
- writeToArray(array, offset=0) {
46673
+ writeToArray(array, offset = 0) {
46694
46674
  array[offset] = this.x;
46695
46675
  array[offset + 1] = this.y;
46696
46676
  array[offset + 2] = this.z;
@@ -96858,6 +96838,30 @@ class PointerDevice {
96858
96838
  */
96859
96839
  buttons = new Array(32);
96860
96840
 
96841
+ /**
96842
+ *
96843
+ * @returns {InputDeviceSwitch}
96844
+ */
96845
+ get mouseButtonLeft() {
96846
+ return this.buttons[0];
96847
+ }
96848
+
96849
+ /**
96850
+ *
96851
+ * @returns {InputDeviceSwitch}
96852
+ */
96853
+ get mouseButtonRight() {
96854
+ return this.buttons[2];
96855
+ }
96856
+
96857
+ /**
96858
+ *
96859
+ * @returns {InputDeviceSwitch}
96860
+ */
96861
+ get mouseButtonMiddle() {
96862
+ return this.buttons[1];
96863
+ }
96864
+
96861
96865
  /**
96862
96866
  *
96863
96867
  * @param {EventTarget} domElement html element