@woosh/meep-engine 2.119.2 → 2.119.3
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/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveBoxOverlapUsingForce.d.ts","sourceRoot":"","sources":["../../../../../../src/core/graph/layout/box/resolveBoxOverlapUsingForce.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveBoxOverlapUsingForce.d.ts","sourceRoot":"","sources":["../../../../../../src/core/graph/layout/box/resolveBoxOverlapUsingForce.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,oDAJW,SAAS,SACT,YAAa,GACX,MAAM,CAyFlB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import Vector2 from "../../../geom/Vector2.js";
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
*
|
|
5
3
|
* @param {Vector2[]} forces
|
|
@@ -63,10 +61,6 @@ export function resolveBoxOverlapUsingForce(forces, boxes) {
|
|
|
63
61
|
dX = 0;
|
|
64
62
|
}
|
|
65
63
|
|
|
66
|
-
//create separation vector
|
|
67
|
-
const d = new Vector2(dX, dY);
|
|
68
|
-
const halfD = d.multiplyScalar(0.5);
|
|
69
|
-
|
|
70
64
|
const f1 = forces[i];
|
|
71
65
|
const f2 = forces[j];
|
|
72
66
|
|
|
@@ -74,12 +68,12 @@ export function resolveBoxOverlapUsingForce(forces, boxes) {
|
|
|
74
68
|
if (b0.locked === true && b1.locked === true) {
|
|
75
69
|
continue;
|
|
76
70
|
} else if (b0.locked === true) {
|
|
77
|
-
f2.
|
|
71
|
+
f2._sub(dX, dY);
|
|
78
72
|
} else if (b1.locked === true) {
|
|
79
|
-
f1.
|
|
73
|
+
f1._add(dX, dY);
|
|
80
74
|
} else {
|
|
81
|
-
f1.
|
|
82
|
-
f2.
|
|
75
|
+
f1._add(dX*0.5, dY*0.5);
|
|
76
|
+
f2._sub(dX*0.5, dY*0.5);
|
|
83
77
|
}
|
|
84
78
|
|
|
85
79
|
moves++;
|
package/src/engine/Engine.js
CHANGED
|
@@ -301,6 +301,22 @@ class Engine {
|
|
|
301
301
|
this.plugins.initialize(this);
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
+
#initialize_audio() {
|
|
305
|
+
const sound = this.sound;
|
|
306
|
+
if (sound === undefined || sound === null) {
|
|
307
|
+
// no sound engine
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// hook up context resumption to input
|
|
312
|
+
if (this.devices.pointer !== undefined) {
|
|
313
|
+
|
|
314
|
+
this.devices.pointer.on.down.addOne(sound.resumeContext, sound);
|
|
315
|
+
this.devices.keyboard.on.down.addOne(sound.resumeContext, sound);
|
|
316
|
+
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
304
320
|
|
|
305
321
|
get inputEngine() {
|
|
306
322
|
throw new Error('Deprecated, use .devices instead');
|
|
@@ -449,6 +465,8 @@ class Engine {
|
|
|
449
465
|
start() {
|
|
450
466
|
this.assetManager.startup();
|
|
451
467
|
|
|
468
|
+
this.#initialize_audio();
|
|
469
|
+
|
|
452
470
|
const promiseEntityManager = () => {
|
|
453
471
|
return new Promise((resolve, reject) => {
|
|
454
472
|
//initialize entity manager
|