@woosh/meep-engine 2.119.38 → 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
CHANGED
|
@@ -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"}
|
|
@@ -115,23 +115,23 @@ export function query_bvh_geometry_nearest(
|
|
|
115
115
|
|
|
116
116
|
if (distance_sqr_to_child1 < distance_sqr_to_child2) {
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
if (distance_sqr_to_child2 < nearest_distance_sqr) {
|
|
119
119
|
stack[pointer++] = child_2;
|
|
120
|
-
|
|
120
|
+
}
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
if (distance_sqr_to_child1 < nearest_distance_sqr) {
|
|
123
123
|
stack[pointer++] = child_1;
|
|
124
|
-
|
|
124
|
+
}
|
|
125
125
|
|
|
126
126
|
} else {
|
|
127
127
|
|
|
128
|
-
|
|
128
|
+
if (distance_sqr_to_child1 < nearest_distance_sqr) {
|
|
129
129
|
stack[pointer++] = child_1;
|
|
130
|
-
|
|
130
|
+
}
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
if (distance_sqr_to_child2 < nearest_distance_sqr) {
|
|
133
133
|
stack[pointer++] = child_2;
|
|
134
|
-
|
|
134
|
+
}
|
|
135
135
|
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -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
|
|