@woosh/meep-engine 2.47.27 → 2.47.29
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 +42 -40
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +42 -40
- package/package.json +1 -1
- package/src/core/geom/Quaternion.js +10 -30
- package/src/core/geom/Vector1.js +2 -3
- package/src/engine/graphics/ecs/decal/v2/Decal.d.ts +4 -0
- package/src/engine/input/devices/PointerDevice.d.ts +13 -4
- package/src/engine/input/devices/PointerDevice.js +24 -0
- package/src/engine/intelligence/behavior/Behavior.js +6 -7
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 *
|
|
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
|
-
|
|
45357
|
-
iy = -y0 * invDot;
|
|
45358
|
-
iz = -z0 * invDot;
|
|
45359
|
-
iw = w0 * invDot;
|
|
45360
|
-
}
|
|
45343
|
+
const dot_clamped = clamp$1(dot, -1, 1);
|
|
45361
45344
|
|
|
45362
|
-
|
|
45363
|
-
const w = w1 * iw - x1 * ix - y1 * iy - z1 * iz;
|
|
45345
|
+
const dot_abs = Math.abs(dot_clamped);
|
|
45364
45346
|
|
|
45365
|
-
|
|
45366
|
-
|
|
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;
|
|
@@ -54220,9 +54200,8 @@ class Vector1 extends Number {
|
|
|
54220
54200
|
constructor(x = 0) {
|
|
54221
54201
|
super();
|
|
54222
54202
|
|
|
54223
|
-
assert.
|
|
54224
|
-
|
|
54225
|
-
assert.ok(!Number.isNaN(x), `X must be a valid number, instead was NaN`);
|
|
54203
|
+
assert.isNumber( x, 'x');
|
|
54204
|
+
assert.notNaN(x, 'x');
|
|
54226
54205
|
|
|
54227
54206
|
this.x = x;
|
|
54228
54207
|
|
|
@@ -96858,6 +96837,30 @@ class PointerDevice {
|
|
|
96858
96837
|
*/
|
|
96859
96838
|
buttons = new Array(32);
|
|
96860
96839
|
|
|
96840
|
+
/**
|
|
96841
|
+
*
|
|
96842
|
+
* @returns {InputDeviceSwitch}
|
|
96843
|
+
*/
|
|
96844
|
+
get mouseButtonLeft() {
|
|
96845
|
+
return this.buttons[0];
|
|
96846
|
+
}
|
|
96847
|
+
|
|
96848
|
+
/**
|
|
96849
|
+
*
|
|
96850
|
+
* @returns {InputDeviceSwitch}
|
|
96851
|
+
*/
|
|
96852
|
+
get mouseButtonRight() {
|
|
96853
|
+
return this.buttons[2];
|
|
96854
|
+
}
|
|
96855
|
+
|
|
96856
|
+
/**
|
|
96857
|
+
*
|
|
96858
|
+
* @returns {InputDeviceSwitch}
|
|
96859
|
+
*/
|
|
96860
|
+
get mouseButtonMiddle() {
|
|
96861
|
+
return this.buttons[1];
|
|
96862
|
+
}
|
|
96863
|
+
|
|
96861
96864
|
/**
|
|
96862
96865
|
*
|
|
96863
96866
|
* @param {EventTarget} domElement html element
|
|
@@ -99954,13 +99957,12 @@ const BehaviorStatus = {
|
|
|
99954
99957
|
* @template CTX
|
|
99955
99958
|
*/
|
|
99956
99959
|
class Behavior {
|
|
99957
|
-
|
|
99958
|
-
|
|
99959
|
-
|
|
99960
|
-
|
|
99961
|
-
|
|
99962
|
-
|
|
99963
|
-
}
|
|
99960
|
+
|
|
99961
|
+
/**
|
|
99962
|
+
* Any internal state used by the behavior
|
|
99963
|
+
* @type {CTX|null}
|
|
99964
|
+
*/
|
|
99965
|
+
context = null;
|
|
99964
99966
|
|
|
99965
99967
|
/**
|
|
99966
99968
|
* Main update function. Every behavior executes some logic, some behaviors are long-running and some are instantaneous
|