@woosh/meep-engine 2.33.31 → 2.33.35
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/core/geom/Vector2.d.ts
CHANGED
package/core/geom/Vector3.d.ts
CHANGED
|
@@ -31,6 +31,14 @@ export default class Vector3 implements Vector3Like {
|
|
|
31
31
|
|
|
32
32
|
_sub(x: number, y: number, z: number): void
|
|
33
33
|
|
|
34
|
+
abs(): void
|
|
35
|
+
|
|
36
|
+
round(): void
|
|
37
|
+
|
|
38
|
+
floor(): void
|
|
39
|
+
|
|
40
|
+
ceil(): void
|
|
41
|
+
|
|
34
42
|
_multiply(x: number, y: number, z: number): void
|
|
35
43
|
|
|
36
44
|
multiply(other: Vector3Like): void
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ThreeInstancedAdapter } from "../instanced/ThreeInstancedAdapter.js";
|
|
2
2
|
import { composeCompile } from "../../../material/composeCompile.js";
|
|
3
|
-
import { Mesh, MeshDepthMaterial, MeshNormalMaterial, RGBADepthPacking } from "three";
|
|
3
|
+
import { Material, Mesh, MeshDepthMaterial, MeshNormalMaterial, RGBADepthPacking } from "three";
|
|
4
4
|
import { VIRTUAL_MESH_FLAG } from "../VIRTUAL_MESH_FLAG.js";
|
|
5
5
|
|
|
6
6
|
const MATERIAL_FLAG = '@micron_instanced_rewritten';
|
|
@@ -9,7 +9,7 @@ const MATERIAL_VERTEX_DISPLACED = '@meep/vertex-displaced';
|
|
|
9
9
|
export class MaterialContext {
|
|
10
10
|
/**
|
|
11
11
|
*
|
|
12
|
-
* @param {
|
|
12
|
+
* @param {VertexDataSpec} spec
|
|
13
13
|
* @param {Material} material
|
|
14
14
|
*/
|
|
15
15
|
constructor(spec, material) {
|
|
@@ -19,6 +19,13 @@ export class MaterialContext {
|
|
|
19
19
|
*/
|
|
20
20
|
this.adapter = new ThreeInstancedAdapter(spec);
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {VertexDataSpec}
|
|
25
|
+
* @private
|
|
26
|
+
*/
|
|
27
|
+
this.__vertex_spec = spec;
|
|
28
|
+
|
|
22
29
|
/**
|
|
23
30
|
*
|
|
24
31
|
* @type {Material}
|
|
@@ -56,6 +63,7 @@ export class MaterialContext {
|
|
|
56
63
|
this.__patch_count = 0;
|
|
57
64
|
}
|
|
58
65
|
|
|
66
|
+
|
|
59
67
|
/**
|
|
60
68
|
*
|
|
61
69
|
* @param {MicronGeometryPatchOccurrence} occurrence
|
|
@@ -74,6 +82,7 @@ export class MaterialContext {
|
|
|
74
82
|
|
|
75
83
|
if (material[MATERIAL_FLAG] === undefined) {
|
|
76
84
|
material.onBeforeCompile = composeCompile(this.material.onBeforeCompile, rewrite_material);
|
|
85
|
+
|
|
77
86
|
material[MATERIAL_FLAG] = true;
|
|
78
87
|
material[MATERIAL_VERTEX_DISPLACED] = true;
|
|
79
88
|
} else {
|
|
@@ -60,14 +60,30 @@ function forEachTouch(touchList, callback) {
|
|
|
60
60
|
*/
|
|
61
61
|
function getTouchCenter(touchList, result) {
|
|
62
62
|
const length = touchList.length;
|
|
63
|
+
|
|
63
64
|
let x = 0, y = 0;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
|
|
66
|
+
if (length > 0) {
|
|
67
|
+
|
|
68
|
+
for (let i = 0; i < length; i++) {
|
|
69
|
+
const touch = touchList.item(i);
|
|
70
|
+
|
|
71
|
+
if (touch === null) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
x += touch.clientX;
|
|
76
|
+
y += touch.clientY;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// average to get center
|
|
80
|
+
x /= length;
|
|
81
|
+
y /= length;
|
|
82
|
+
|
|
68
83
|
}
|
|
69
|
-
|
|
70
|
-
result.set(x
|
|
84
|
+
|
|
85
|
+
result.set(x, y);
|
|
86
|
+
|
|
71
87
|
}
|
|
72
88
|
|
|
73
89
|
/**
|
|
@@ -435,13 +451,13 @@ function PointerDevice(domElement) {
|
|
|
435
451
|
observeTap(this.on.up, this.on.down, this.on.move, 10, this.on.tap);
|
|
436
452
|
observeDrag(globalUp, this.on.down, this.on.move, this.on.dragStart, this.on.dragEnd, this.on.drag);
|
|
437
453
|
observePinch({
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
454
|
+
touchStart: touchStart,
|
|
455
|
+
touchEnd: touchEnd,
|
|
456
|
+
touchMove: touchMove,
|
|
457
|
+
pinch: this.on.pinch,
|
|
458
|
+
pinchStart: this.on.pinchStart,
|
|
459
|
+
pinchEnd: this.on.pinchEnd
|
|
460
|
+
});
|
|
445
461
|
}
|
|
446
462
|
|
|
447
463
|
/**
|
package/package.json
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
"productName": "Meep",
|
|
5
5
|
"description": "production-ready JavaScript game engine based on Entity Component System Architecture",
|
|
6
6
|
"author": "Alexander Goldring",
|
|
7
|
-
"version": "2.33.
|
|
7
|
+
"version": "2.33.35",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"fast-levenshtein": "2.0.6",
|
|
10
10
|
"opentype.js": "1.3.3",
|
|
11
11
|
"simplex-noise": "2.4.0",
|
|
12
|
-
"three": "^0.
|
|
12
|
+
"three": "^0.135.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"babel-jest": "^26.6.3",
|
|
16
|
-
"@types/three": "^0.
|
|
16
|
+
"@types/three": "^0.135.0"
|
|
17
17
|
}
|
|
18
18
|
}
|