@woosh/meep-engine 2.119.35 → 2.119.37

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.35",
8
+ "version": "2.119.37",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -80,7 +80,7 @@ export function computeTriangleClosestPointToPointBarycentric(
80
80
  }
81
81
 
82
82
  const vc = d1 * d4 - d3 * d2;
83
- if ( vc <= 0 && d1 >= 0 && d3 <= 0 ) {
83
+ if ( vc <= 0 && d1 >= 0 && d3 <= 0 && d1 !== d3) {
84
84
 
85
85
  v = d1 / ( d1 - d3 );
86
86
  // edge region of AB; barycentric coords (1-v, v, 0)
@@ -111,7 +111,7 @@ export function computeTriangleClosestPointToPointBarycentric(
111
111
  }
112
112
 
113
113
  const vb = d5 * d2 - d1 * d6;
114
- if ( vb <= 0 && d2 >= 0 && d6 <= 0 ) {
114
+ if ( vb <= 0 && d2 >= 0 && d6 <= 0 && d2 !== d6 ) {
115
115
 
116
116
  w = d2 / ( d2 - d6 );
117
117
 
@@ -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":"AAuBA;;;;;;;;;;;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;
@@ -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
  }