@woosh/meep-engine 2.119.36 → 2.119.38

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
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.119.36",
8
+ "version": "2.119.38",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Compute squared distance to point, value is negative if the point is inside the box
2
+ * Compute squared distance to point, value is 0 if the point is inside the box
3
3
  * @param {number} x0
4
4
  * @param {number} y0
5
5
  * @param {number} z0
@@ -1,7 +1,7 @@
1
1
  import { max3 } from "../../../math/max3.js";
2
2
 
3
3
  /**
4
- * Compute squared distance to point, value is negative if the point is inside the box
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,CAuKlB"}
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,CA0KlB"}
@@ -72,6 +72,7 @@ export function query_bvh_geometry_nearest(
72
72
 
73
73
  let nearest_distance_sqr = max_distance * max_distance;
74
74
 
75
+ let got_a_hit = false;
75
76
 
76
77
  do {
77
78
  --pointer;
@@ -114,23 +115,23 @@ export function query_bvh_geometry_nearest(
114
115
 
115
116
  if (distance_sqr_to_child1 < distance_sqr_to_child2) {
116
117
 
117
- if (distance_sqr_to_child2 < nearest_distance_sqr) {
118
+ // if (distance_sqr_to_child2 < nearest_distance_sqr) {
118
119
  stack[pointer++] = child_2;
119
- }
120
+ // }
120
121
 
121
- if (distance_sqr_to_child1 < nearest_distance_sqr) {
122
+ // if (distance_sqr_to_child1 < nearest_distance_sqr) {
122
123
  stack[pointer++] = child_1;
123
- }
124
+ // }
124
125
 
125
126
  } else {
126
127
 
127
- if (distance_sqr_to_child1 < nearest_distance_sqr) {
128
+ // if (distance_sqr_to_child1 < nearest_distance_sqr) {
128
129
  stack[pointer++] = child_1;
129
- }
130
+ // }
130
131
 
131
- if (distance_sqr_to_child2 < nearest_distance_sqr) {
132
+ // if (distance_sqr_to_child2 < nearest_distance_sqr) {
132
133
  stack[pointer++] = child_2;
133
- }
134
+ // }
134
135
 
135
136
  }
136
137
 
@@ -195,8 +196,10 @@ export function query_bvh_geometry_nearest(
195
196
  );
196
197
 
197
198
  result.index = triangle_index;
199
+
200
+ got_a_hit = true;
198
201
  }
199
202
  } while (pointer > stack_top);
200
203
 
201
- return true;
204
+ return got_a_hit;
202
205
  }