@woosh/meep-engine 2.117.34 → 2.117.35

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.117.34",
8
+ "version": "2.117.35",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"ebvh_build_hierarchy.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/ebvh_build_hierarchy.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,kEAPW,MAAM,EAAE,GAAC,WAAW,oBACpB,MAAM,aACN,MAAM,EAAE,GAAC,WAAW,oBACpB,MAAM,2BACN,MAAM,GACJ,MAAM,CAwElB"}
1
+ {"version":3,"file":"ebvh_build_hierarchy.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/ebvh_build_hierarchy.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,kEAPW,MAAM,EAAE,GAAC,WAAW,oBACpB,MAAM,aACN,MAAM,EAAE,GAAC,WAAW,oBACpB,MAAM,2BACN,MAAM,GACJ,MAAM,CAsElB"}
@@ -32,17 +32,15 @@ export function ebvh_build_hierarchy(
32
32
  // Assemble hierarchy
33
33
  let unprocessed_node_count = input_node_count;
34
34
 
35
- let optimization_cycle_limit = sah_optimization_level;
36
-
37
35
  while (unprocessed_node_count > 1) {
38
36
 
39
- for (let i = 0; i < optimization_cycle_limit; i++) {
37
+ for (let i = 0; i < sah_optimization_level; i++) {
40
38
  // sort intermediate nodes using small locality and SAH metric
41
- let swap_count = ebvh_nodes_sort_sah_local4(bvh, unprocessed_nodes, 0, unprocessed_node_count);
42
- swap_count += ebvh_nodes_sort_sah_local4(bvh, unprocessed_nodes, 2, unprocessed_node_count - 2);
39
+ const offset = (i<<1) & 3;
40
+ const swap_count = ebvh_nodes_sort_sah_local4(bvh, unprocessed_nodes, offset, unprocessed_node_count - offset);
43
41
 
44
42
  if(swap_count === 0){
45
- optimization_cycle_limit = 0;
43
+ break;
46
44
  }
47
45
  }
48
46