@woosh/meep-engine 2.87.6 → 2.88.1
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 +26 -4
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +26 -4
- package/editor/view/ecs/HierarchicalEntityListView.js +1 -1
- package/editor/view/v2/prototypeEditor.js +1 -1
- package/package.json +1 -1
- package/src/core/bvh2/bvh3/BVH.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/BVH.js +4 -2
- package/src/core/bvh2/bvh3/BVH.spec.js +15 -3
- package/src/core/geom/2d/aabb/aabb2_clip_line_cohen_sutherland.d.ts +16 -0
- package/src/core/geom/2d/aabb/aabb2_clip_line_cohen_sutherland.d.ts.map +1 -0
- package/src/core/geom/2d/aabb/aabb2_clip_line_cohen_sutherland.js +149 -0
- package/src/core/geom/2d/aabb/aabb2_intersects_circle.d.ts +13 -0
- package/src/core/geom/2d/aabb/aabb2_intersects_circle.d.ts.map +1 -0
- package/src/core/geom/2d/aabb/aabb2_intersects_circle.js +27 -0
- package/src/core/geom/2d/hash-grid/SpatialHashGrid.d.ts +41 -6
- package/src/core/geom/2d/hash-grid/SpatialHashGrid.d.ts.map +1 -1
- package/src/core/geom/2d/hash-grid/SpatialHashGrid.js +92 -22
- package/src/core/geom/2d/hash-grid/SpatialHashGrid.spec.js +98 -2
- package/src/core/geom/2d/hash-grid/prototypeGridQueries.d.ts +2 -0
- package/src/core/geom/2d/hash-grid/prototypeGridQueries.d.ts.map +1 -0
- package/src/core/geom/2d/hash-grid/prototypeGridQueries.js +387 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_circle.d.ts +12 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_circle.d.ts.map +1 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_circle.js +160 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_circle.spec.d.ts +2 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_circle.spec.d.ts.map +1 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_circle.spec.js +85 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_line.d.ts +14 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_line.d.ts.map +1 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_line.js +132 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_line.spec.d.ts +2 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_line.spec.d.ts.map +1 -0
- package/src/core/geom/2d/hash-grid/shg_query_elements_line.spec.js +102 -0
- package/src/core/geom/2d/line/line2_distance_to_point_sqr.d.ts +11 -0
- package/src/core/geom/2d/line/line2_distance_to_point_sqr.d.ts.map +1 -0
- package/src/core/geom/2d/line/line2_distance_to_point_sqr.js +39 -0
- package/src/core/geom/2d/quad-tree/QuadTreeNode.spec.js +53 -0
- package/src/core/geom/2d/quad-tree/qt_match_data_by_circle.spec.d.ts +2 -0
- package/src/core/geom/2d/quad-tree/qt_match_data_by_circle.spec.d.ts.map +1 -0
- package/src/core/geom/2d/quad-tree/qt_match_data_by_circle.spec.js +86 -0
- package/src/core/model/ObservedString.d.ts.map +1 -1
- package/src/core/model/ObservedString.js +1 -1
- package/src/engine/animation/curve/ecd_bind_animation_curve.js +1 -1
- package/src/engine/ecs/name/Name.d.ts +25 -0
- package/src/engine/ecs/name/Name.d.ts.map +1 -0
- package/src/engine/ecs/name/Name.js +42 -0
- package/src/engine/ecs/name/NameSerializationAdapter.d.ts +18 -0
- package/src/engine/ecs/name/NameSerializationAdapter.d.ts.map +1 -0
- package/src/engine/ecs/name/NameSerializationAdapter.js +29 -0
- package/src/engine/ecs/transform/Transform.d.ts +2 -2
- package/src/engine/graphics/canvas/canvas2d_draw_grid.js +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.js +17 -1
- package/src/engine/graphics/ecs/mesh-v2/three_object_to_entity_composition.js +1 -1
- package/src/core/geom/2d/hash-grid/shg_query_raycast.d.ts +0 -14
- package/src/core/geom/2d/hash-grid/shg_query_raycast.d.ts.map +0 -1
- package/src/core/geom/2d/hash-grid/shg_query_raycast.js +0 -21
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BinaryClassSerializationAdapter } from "../storage/binary/BinaryClassSerializationAdapter.js";
|
|
2
|
+
import Name from "./Name.js";
|
|
3
|
+
|
|
4
|
+
export class NameSerializationAdapter extends BinaryClassSerializationAdapter {
|
|
5
|
+
klass = Name;
|
|
6
|
+
version = 0;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
* @param {BinaryBuffer} buffer
|
|
11
|
+
* @param {Name} value
|
|
12
|
+
*/
|
|
13
|
+
serialize(buffer, value) {
|
|
14
|
+
buffer.writeUTF8String(value.getValue());
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @param {BinaryBuffer} buffer
|
|
21
|
+
* @param {Name} value
|
|
22
|
+
*/
|
|
23
|
+
deserialize(buffer, value) {
|
|
24
|
+
const str = buffer.readUTF8String();
|
|
25
|
+
|
|
26
|
+
value.set(str);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
@@ -21,8 +21,8 @@ export class Transform {
|
|
|
21
21
|
}): Transform
|
|
22
22
|
|
|
23
23
|
fromJSON(json: {
|
|
24
|
-
position?: { x: number, y: number, z: number },
|
|
25
|
-
scale?: { x: number, y: number, z: number },
|
|
24
|
+
position?: number | { x: number, y: number, z: number },
|
|
25
|
+
scale?: number | { x: number, y: number, z: number },
|
|
26
26
|
rotation?: { x: number, y: number, z: number, w: number },
|
|
27
27
|
}): void
|
|
28
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SGMesh.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.js"],"names":[],"mappings":";;;;;AAmBA;IA4OI;;;;OAIG;IACH,oBAHW,MAAM,GACJ,MAAM,CAUlB;IAlPD;;;OAGG;IACH,OAFU,MAAM,CAEM;IAEtB;;;OAGG;IACH,OAFU,MAAM,GAAC,IAAI,CAER;IAEb;;;;OAIG;IACH,eAAc;IAEd;;;;OAIG;IACH,yBAA+B;IAE/B;;;;OAIG;IACH,gBAEC;IAED;;;;OAIG;IACH,cAHW,MAAM,GACJ,OAAO,CAUnB;IAED,eAEC;IAED;;;OAGG;IACH,YAFW,MAAM,QAOhB;IAED;;;OAGG;IACH,SAFa,MAAM,CAQlB;IAED;;;OAGG;IACH,oCAYC;IAED,iCAEC;IAED,8BAYC;IAUD;;;OAGG;IACH,qBAOC;IAnBD;;;OAGG;IACH,kBAEC;IAeD;;;;OAIG;IACH,4BAHW,KAAK,GACH,OAAO,CAUnB;IAED;;;OAGG;IACH,yCAFW,KAAK,QAIf;IAED;;;;OAIG;IACH,cAHW,MAAM;;;;KAAY,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM;;;;KAAY,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM;;;;KAAY,SAClB,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM;;;;KAAY,GAChB,OAAO,CAInB;IAUD;;;OAGG;IACH,6BAEC;IAdD;;;OAGG;IACH,0BAEC;IAkBD;;;OAGG;IACH,gCAEC;IAdD;;;OAGG;IACH,6BAEC;;
|
|
1
|
+
{"version":3,"file":"SGMesh.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/ecs/mesh-v2/aggregate/SGMesh.js"],"names":[],"mappings":";;;;;AAmBA;IA4OI;;;;OAIG;IACH,oBAHW,MAAM,GACJ,MAAM,CAUlB;IAlPD;;;OAGG;IACH,OAFU,MAAM,CAEM;IAEtB;;;OAGG;IACH,OAFU,MAAM,GAAC,IAAI,CAER;IAEb;;;;OAIG;IACH,eAAc;IAEd;;;;OAIG;IACH,yBAA+B;IAE/B;;;;OAIG;IACH,gBAEC;IAED;;;;OAIG;IACH,cAHW,MAAM,GACJ,OAAO,CAUnB;IAED,eAEC;IAED;;;OAGG;IACH,YAFW,MAAM,QAOhB;IAED;;;OAGG;IACH,SAFa,MAAM,CAQlB;IAED;;;OAGG;IACH,oCAYC;IAED,iCAEC;IAED,8BAYC;IAUD;;;OAGG;IACH,qBAOC;IAnBD;;;OAGG;IACH,kBAEC;IAeD;;;;OAIG;IACH,4BAHW,KAAK,GACH,OAAO,CAUnB;IAED;;;OAGG;IACH,yCAFW,KAAK,QAIf;IAED;;;;OAIG;IACH,cAHW,MAAM;;;;KAAY,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM;;;;KAAY,GAChB,IAAI,CAIhB;IAED;;;;OAIG;IACH,gBAHW,MAAM;;;;KAAY,SAClB,OAAO,QAQjB;IAED;;;;OAIG;IACH,cAHW,MAAM;;;;KAAY,GAChB,OAAO,CAInB;IAUD;;;OAGG;IACH,6BAEC;IAdD;;;OAGG;IACH,0BAEC;IAkBD;;;OAGG;IACH,gCAEC;IAdD;;;OAGG;IACH,6BAEC;IAyBD;;;;MAMC;IAED;;;;aAMC;;CACJ;;;;sBA7RqB,2CAA2C"}
|
|
@@ -55,7 +55,7 @@ export class SGMesh {
|
|
|
55
55
|
* Do not modify contents unless you know exactly what you're doing
|
|
56
56
|
* @returns {EntityNode|null}
|
|
57
57
|
*/
|
|
58
|
-
get node(){
|
|
58
|
+
get node() {
|
|
59
59
|
return this.__node;
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -267,6 +267,22 @@ export class SGMesh {
|
|
|
267
267
|
|
|
268
268
|
return r;
|
|
269
269
|
}
|
|
270
|
+
|
|
271
|
+
toJSON() {
|
|
272
|
+
return {
|
|
273
|
+
url: this.__url,
|
|
274
|
+
receiveShadow: this.receiveShadow,
|
|
275
|
+
castShadow: this.castShadow,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
fromJSON({ url, receiveShadow = true, castShadow = true }) {
|
|
280
|
+
this.clearFlag(SGMeshFlags.Loaded);
|
|
281
|
+
|
|
282
|
+
this.__url = url;
|
|
283
|
+
this.receiveShadow = receiveShadow;
|
|
284
|
+
this.castShadow = castShadow;
|
|
285
|
+
}
|
|
270
286
|
}
|
|
271
287
|
|
|
272
288
|
SGMesh.typeName = "SGMesh";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Name from "
|
|
1
|
+
import Name from "../../../ecs/name/Name.js";
|
|
2
2
|
import { EntityNode } from "../../../ecs/parent/EntityNode.js";
|
|
3
3
|
import { copy_three_transform } from "../../../ecs/transform/copy_three_transform.js";
|
|
4
4
|
import { Transform } from "../../../ecs/transform/Transform.js";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {SpatialHashGrid} grid
|
|
4
|
-
* @param {number} origin_x
|
|
5
|
-
* @param {number} origin_y
|
|
6
|
-
* @param {number} direction_x
|
|
7
|
-
* @param {number} direction_y
|
|
8
|
-
* @param {number} max_distance
|
|
9
|
-
* @param {function} predicate
|
|
10
|
-
* @param {*} [predicateContext]
|
|
11
|
-
* @returns {number} element ID or -1 if not found
|
|
12
|
-
*/
|
|
13
|
-
export function shg_query_raycast(grid: SpatialHashGrid, origin_x: number, origin_y: number, direction_x: number, direction_y: number, max_distance: number, predicate: Function, predicateContext?: any): number;
|
|
14
|
-
//# sourceMappingURL=shg_query_raycast.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shg_query_raycast.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/2d/hash-grid/shg_query_raycast.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,mEATW,MAAM,YACN,MAAM,eACN,MAAM,eACN,MAAM,gBACN,MAAM,gDAGJ,MAAM,CAUlB"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* @param {SpatialHashGrid} grid
|
|
4
|
-
* @param {number} origin_x
|
|
5
|
-
* @param {number} origin_y
|
|
6
|
-
* @param {number} direction_x
|
|
7
|
-
* @param {number} direction_y
|
|
8
|
-
* @param {number} max_distance
|
|
9
|
-
* @param {function} predicate
|
|
10
|
-
* @param {*} [predicateContext]
|
|
11
|
-
* @returns {number} element ID or -1 if not found
|
|
12
|
-
*/
|
|
13
|
-
export function shg_query_raycast(
|
|
14
|
-
grid,
|
|
15
|
-
origin_x, origin_y,
|
|
16
|
-
direction_x, direction_y,
|
|
17
|
-
max_distance,
|
|
18
|
-
predicate, predicateContext
|
|
19
|
-
) {
|
|
20
|
-
throw new Error('NIY');
|
|
21
|
-
}
|