@woosh/meep-engine 2.119.37 → 2.119.39
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/package.json +1 -1
- package/src/core/geom/3d/aabb/aabb3_unsigned_distance_sqr_to_point.d.ts +1 -1
- package/src/core/geom/3d/aabb/aabb3_unsigned_distance_sqr_to_point.js +1 -1
- package/src/core/geom/3d/triangle/computeTriangleClosestPointToPointBarycentric.js +1 -0
- package/src/engine/graphics/geometry/buffered/query/query_bvh_geometry_nearest.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/query/query_bvh_geometry_nearest.js +4 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { max3 } from "../../../math/max3.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Compute squared distance to point, value is
|
|
4
|
+
* Compute squared distance to point, value is 0 if the point is inside the box
|
|
5
5
|
* @param {number} x0
|
|
6
6
|
* @param {number} y0
|
|
7
7
|
* @param {number} z0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query_bvh_geometry_nearest.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/geometry/buffered/query/query_bvh_geometry_nearest.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;GAWG;AACH,uFARW,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,EAAE,GAAC,WAAW,GAAC,WAAW,KAChC,MAAM,KACN,MAAM,KACN,MAAM,gBACN,MAAM,GACL,OAAO,
|
|
1
|
+
{"version":3,"file":"query_bvh_geometry_nearest.d.ts","sourceRoot":"","sources":["../../../../../../../src/engine/graphics/geometry/buffered/query/query_bvh_geometry_nearest.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;GAWG;AACH,uFARW,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,EAAE,GAAC,WAAW,GAAC,WAAW,KAChC,MAAM,KACN,MAAM,KACN,MAAM,gBACN,MAAM,GACL,OAAO,CA2KlB"}
|
|
@@ -172,12 +172,13 @@ export function query_bvh_geometry_nearest(
|
|
|
172
172
|
|
|
173
173
|
const u = v3_scratch_0[0];
|
|
174
174
|
const v = v3_scratch_0[1];
|
|
175
|
+
const w = 1 - u - v;
|
|
175
176
|
|
|
176
177
|
// construct edge
|
|
177
178
|
|
|
178
|
-
const contact_x = (bx - ax) *
|
|
179
|
-
const contact_y = (by - ay) *
|
|
180
|
-
const contact_z = (bz - az) *
|
|
179
|
+
const contact_x = (bx - ax) * v + (cx - ax) * w + ax;
|
|
180
|
+
const contact_y = (by - ay) * v + (cy - ay) * w + ay;
|
|
181
|
+
const contact_z = (bz - az) * v + (cz - az) * w + az;
|
|
181
182
|
|
|
182
183
|
const distance_to_triangle_sqr = v3_distance_sqr(contact_x, contact_y, contact_z, x, y, z);
|
|
183
184
|
|