@woosh/meep-engine 2.119.119 → 2.119.121

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.119",
8
+ "version": "2.119.121",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"ebvh_nodes_sort_sah_local4.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/ebvh_nodes_sort_sah_local4.js"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,gDAPW,GAAG,SACH,MAAM,EAAE,GAAC,WAAW,oBACpB,MAAM,EAAE,GAAC,WAAW,UACpB,MAAM,YACN,MAAM,SACN,MAAM,UAqGhB"}
1
+ {"version":3,"file":"ebvh_nodes_sort_sah_local4.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/ebvh_nodes_sort_sah_local4.js"],"names":[],"mappings":"AAGA;;;;;;;;;GASG;AACH,gDAPW,GAAG,SACH,MAAM,EAAE,GAAC,WAAW,oBACpB,MAAM,EAAE,GAAC,WAAW,UACpB,MAAM,YACN,MAAM,SACN,MAAM,UAwGhB"}
@@ -78,7 +78,7 @@ export function ebvh_nodes_sort_sah_local4(
78
78
 
79
79
  if (cost0 <= cost1 && cost0 <= cost2) {
80
80
  // no change
81
- post_swap = cost_cd < cost_ab;
81
+ post_swap = cost_cd > cost_ab;
82
82
 
83
83
  } else if (cost1 <= cost2) {
84
84
  // swap C and B
@@ -90,7 +90,7 @@ export function ebvh_nodes_sort_sah_local4(
90
90
 
91
91
  swap_count++;
92
92
 
93
- post_swap = cost_bd < cost_ac;
93
+ post_swap = cost_bd > cost_ac;
94
94
  } else {
95
95
  // swap B and D
96
96
  nodes[index_b] = node_d;
@@ -101,12 +101,15 @@ export function ebvh_nodes_sort_sah_local4(
101
101
 
102
102
  swap_count++;
103
103
 
104
- post_swap = cost_cb < cost_ad;
104
+ post_swap = cost_cb > cost_ad;
105
+ }
106
+
107
+ if (post_swap) {
108
+ // put node pairs in their cost order
109
+ array_swap(nodes, index_a, nodes, index_c, 2);
110
+ array_swap(primitive_counts, index_a, primitive_counts, index_c, 2);
105
111
  }
106
112
 
107
- // put node pairs in their cost order
108
- array_swap(nodes, index_a, nodes, index_c, 2);
109
- array_swap(primitive_counts, index_a, primitive_counts, index_c, 2);
110
113
  }
111
114
 
112
115
  return swap_count;