@woosh/meep-engine 2.39.4 → 2.39.5
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.
|
@@ -11,7 +11,7 @@ import { v3_angle_between } from "../../../v3_angle_between.js";
|
|
|
11
11
|
* @param {ConicRay} result
|
|
12
12
|
* @param {Iterable<TopoTriangle>} faces
|
|
13
13
|
*/
|
|
14
|
-
export function
|
|
14
|
+
export function computeTriangleClusterNormalBoundingCone(result, faces) {
|
|
15
15
|
const normal_data = [];
|
|
16
16
|
let normal_count = 0;
|
|
17
17
|
|
|
@@ -45,6 +45,13 @@ export function computeTraingleClusterNormalBoundingCone(result, faces) {
|
|
|
45
45
|
|
|
46
46
|
const miniball_center = miniball.center();
|
|
47
47
|
|
|
48
|
+
if (Number.isNaN(miniball_center[0]) || Number.isNaN(miniball_center[1]) || Number.isNaN(miniball_center[2])) {
|
|
49
|
+
// something went wrong, center is undefined, fall-back to an open cone
|
|
50
|
+
result_direction.set(1, 0, 0);
|
|
51
|
+
result.angle = Math.PI;
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
48
55
|
result_direction.readFromArray(miniball_center, 0);
|
|
49
56
|
const center_vector_magnitude = result_direction.length();
|
|
50
57
|
|
|
@@ -4,8 +4,8 @@ import { fill_patch_geometry_data } from "./fill_patch_geometry_data.js";
|
|
|
4
4
|
import { AABB3 } from "../../../../core/bvh2/aabb3/AABB3.js";
|
|
5
5
|
import { assert } from "../../../../core/assert.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
} from "../../../../core/geom/3d/topology/bounds/
|
|
7
|
+
computeTriangleClusterNormalBoundingCone
|
|
8
|
+
} from "../../../../core/geom/3d/topology/bounds/computeTriangleClusterNormalBoundingCone.js";
|
|
9
9
|
import { noop } from "../../../../core/function/Functions.js";
|
|
10
10
|
import { ConicRay } from "../../../../core/geom/ConicRay.js";
|
|
11
11
|
import { vec4 } from "gl-matrix";
|
|
@@ -379,7 +379,7 @@ export class PatchRepresentation {
|
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
computeNormalBoundingCone() {
|
|
382
|
-
|
|
382
|
+
computeTriangleClusterNormalBoundingCone(this.normal_cone, this.topology_snapshot.getFaces());
|
|
383
383
|
}
|
|
384
384
|
|
|
385
385
|
/**
|
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.39.
|
|
8
|
+
"version": "2.39.5",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"gl-matrix": "3.4.3",
|
|
11
11
|
"fast-levenshtein": "2.0.6",
|