@woosh/meep-engine 2.34.30 → 2.34.31
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.
|
@@ -3,6 +3,7 @@ import { assert } from "../../../../core/assert.js";
|
|
|
3
3
|
import { computeTriangleRayIntersection } from "../../../../core/geom/3d/triangle/computeTriangleRayIntersection.js";
|
|
4
4
|
import { SurfacePoint3 } from "../../../../core/geom/3d/SurfacePoint3.js";
|
|
5
5
|
import { aabb3_array_intersects_ray } from "../../../../core/bvh2/aabb3/aabb3_array_intersects_ray.js";
|
|
6
|
+
import { sphere_array_intersects_ray } from "../../../../core/geom/3d/sphere/sphere_array_intersects_ray.js";
|
|
6
7
|
|
|
7
8
|
let id_counter = 0;
|
|
8
9
|
|
|
@@ -105,25 +106,18 @@ export class MicronGeometry {
|
|
|
105
106
|
|
|
106
107
|
const patch = stack[stack_cursor];
|
|
107
108
|
|
|
108
|
-
// using group bounds because it's conservative, as we want to be able to hit LOD_0
|
|
109
|
-
|
|
110
|
-
// sphere test
|
|
111
|
-
|
|
112
|
-
|
|
113
109
|
if (patch.lod === 0) {
|
|
114
110
|
// LOD 0 - source geometry
|
|
115
111
|
|
|
116
112
|
// cast against bounds
|
|
117
113
|
|
|
118
114
|
// sphere test
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
// continue;
|
|
126
|
-
// }
|
|
115
|
+
if (!sphere_array_intersects_ray(patch.bounding_sphere,
|
|
116
|
+
origin_x, origin_y, origin_z,
|
|
117
|
+
direction_x, direction_y, direction_z
|
|
118
|
+
)) {
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
127
121
|
|
|
128
122
|
// box test
|
|
129
123
|
if (!aabb3_array_intersects_ray(
|
|
@@ -183,13 +177,15 @@ export class MicronGeometry {
|
|
|
183
177
|
|
|
184
178
|
} else {
|
|
185
179
|
|
|
186
|
-
//
|
|
187
|
-
|
|
188
|
-
//
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
180
|
+
// using group bounds because it's conservative, as we want to be able to hit LOD_0
|
|
181
|
+
|
|
182
|
+
// sphere test
|
|
183
|
+
if (!sphere_array_intersects_ray(patch.group_bounding_sphere,
|
|
184
|
+
origin_x, origin_y, origin_z,
|
|
185
|
+
direction_x, direction_y, direction_z
|
|
186
|
+
)) {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
193
189
|
|
|
194
190
|
|
|
195
191
|
// box test (more expensive, different volume)
|
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.31",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"gl-matrix": "3.4.3",
|
|
11
11
|
"fast-levenshtein": "2.0.6",
|