@woosh/meep-engine 2.34.25 → 2.34.26
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/engine/graphics/micron/build/PatchRepresentation.js +3 -2
- package/engine/graphics/micron/build/hierarchy/merge_patches.js +2 -1
- package/engine/graphics/micron/format/serialization/deserialize_patch.js +0 -29
- package/engine/graphics/micron/prototypeVirtualGeometry.js +2 -2
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ import { vec4 } from "gl-matrix";
|
|
|
10
10
|
import { computeTopoMeshBoundiningBox } from "../../../../core/geom/3d/topology/bounds/computeTopoMeshBoundiningBox.js";
|
|
11
11
|
import { computeTopoMeshBoundingSphere } from "../../../../core/geom/3d/topology/bounds/computeTopoMeshBoundingSphere.js";
|
|
12
12
|
import { meshopt_optimizeVertexCache } from "../../geometry/optimization/VertexCacheOptimizer.js";
|
|
13
|
+
import { array_copy } from "../../../../core/collection/array/copyArray.js";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
*
|
|
@@ -399,11 +400,11 @@ export class PatchRepresentation {
|
|
|
399
400
|
|
|
400
401
|
this.group_aabb.getCorners(result.group_bounding_box_corners);
|
|
401
402
|
|
|
402
|
-
|
|
403
|
+
array_copy(this.group_bounding_sphere, 0, result.group_bounding_sphere, 0, 4);
|
|
403
404
|
|
|
404
405
|
result.group_error = this.group_error;
|
|
405
406
|
|
|
406
|
-
|
|
407
|
+
array_copy(this.bounding_sphere, 0, result.bounding_sphere, 0, 4);
|
|
407
408
|
|
|
408
409
|
result.normal_cone.copy(this.normal_cone);
|
|
409
410
|
|
|
@@ -477,7 +477,8 @@ async function many_to_many_merge(
|
|
|
477
477
|
|
|
478
478
|
rep.group_aabb.copy(group_aabb);
|
|
479
479
|
rep.group_bounding_sphere.set(group_bounding_sphere);
|
|
480
|
-
|
|
480
|
+
|
|
481
|
+
rep.computeBounds();
|
|
481
482
|
|
|
482
483
|
rep.group_error = group_per_pixel_error;
|
|
483
484
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { aabb3_build_corners } from "../../../../../core/geom/3d/aabb/aabb3_build_corners.js";
|
|
2
2
|
import { DataTypeByteSizes } from "../../../../../core/collection/table/DataTypeByteSizes.js";
|
|
3
3
|
import { DataType2TypedArrayConstructorMapping } from "../../../../../core/collection/table/DataType2TypedArrayConstructorMapping.js";
|
|
4
|
-
import { v3_distance } from "../../../../../core/geom/v3_distance.js";
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
*
|
|
@@ -19,7 +18,6 @@ export function deserialize_patch(buffer, patch, vertex_spec, patch_array) {
|
|
|
19
18
|
buffer.readFloat32Array(gbb, 0, 6);
|
|
20
19
|
buffer.readFloat32Array(patch.group_bounding_sphere, 0, 4);
|
|
21
20
|
|
|
22
|
-
|
|
23
21
|
patch.group_error = buffer.readFloat32();
|
|
24
22
|
patch.lod = buffer.readUintVar();
|
|
25
23
|
patch.polygon_count = buffer.readUintVar();
|
|
@@ -92,33 +90,6 @@ export function deserialize_patch(buffer, patch, vertex_spec, patch_array) {
|
|
|
92
90
|
patch.vertex_attribute_arrays[i] = array;
|
|
93
91
|
}
|
|
94
92
|
|
|
95
|
-
|
|
96
|
-
// validate and fix group bounds as necessary
|
|
97
|
-
if (
|
|
98
|
-
patch.group_bounding_box[0] > patch.bounding_box[0] // x0
|
|
99
|
-
|| patch.group_bounding_box[1] > patch.bounding_box[1] // y0
|
|
100
|
-
|| patch.group_bounding_box[2] > patch.bounding_box[2] // x0
|
|
101
|
-
|| patch.group_bounding_box[3] < patch.bounding_box[3] // x1
|
|
102
|
-
|| patch.group_bounding_box[4] < patch.bounding_box[4] // y1
|
|
103
|
-
|| patch.group_bounding_box[5] < patch.bounding_box[5] // z1
|
|
104
|
-
) {
|
|
105
|
-
// bounds are violated, fix
|
|
106
|
-
patch.group_bounding_box.set(patch.bounding_box);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (v3_distance(
|
|
110
|
-
patch.group_bounding_sphere[0],
|
|
111
|
-
patch.group_bounding_sphere[1],
|
|
112
|
-
patch.group_bounding_sphere[2],
|
|
113
|
-
patch.bounding_sphere[0],
|
|
114
|
-
patch.bounding_sphere[1],
|
|
115
|
-
patch.bounding_sphere[2]
|
|
116
|
-
) + patch.bounding_sphere[3] > patch.group_bounding_sphere[3]) {
|
|
117
|
-
// group's sphere bounds are violated, fix
|
|
118
|
-
patch.group_bounding_sphere.set(patch.bounding_sphere);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
93
|
// reconstruct corners
|
|
123
94
|
aabb3_build_corners(
|
|
124
95
|
patch.group_bounding_box_corners,
|
|
@@ -455,7 +455,7 @@ function init() {
|
|
|
455
455
|
}
|
|
456
456
|
|
|
457
457
|
// sample_gltf_sponza();
|
|
458
|
-
|
|
458
|
+
gltf_sample('data/models/RTS_Buildings_Humans/18/Building_R_18_out/Building_R_18.gltf');
|
|
459
459
|
// sample_lucy();
|
|
460
460
|
// sample_gltf_hapro_2();
|
|
461
461
|
// sample_gltf_hapro_1();
|
|
@@ -467,7 +467,7 @@ function init() {
|
|
|
467
467
|
// gltf_sample('data/models/moicon/isiflow_Oct_15_21/0/model.gltf');
|
|
468
468
|
// gltf_sample('moicon/29_Dec_2021_Nammo/1/model.gltf');
|
|
469
469
|
// gltf_sample('moicon/29_Dec_2021_Nammo/1-onematerial/model.gltf');
|
|
470
|
-
gltf_sample('moicon/29_Dec_2021_Nammo/2/model.gltf');
|
|
470
|
+
// gltf_sample('moicon/29_Dec_2021_Nammo/2/model.gltf');
|
|
471
471
|
|
|
472
472
|
document.addEventListener("mousemove", onDocumentMouseMove);
|
|
473
473
|
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"productName": "Meep",
|
|
6
6
|
"description": "production-ready JavaScript game engine based on Entity Component System Architecture",
|
|
7
7
|
"author": "Alexander Goldring",
|
|
8
|
-
"version": "2.34.
|
|
8
|
+
"version": "2.34.26",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"gl-matrix": "3.4.3",
|
|
11
11
|
"fast-levenshtein": "2.0.6",
|