@woosh/meep-engine 2.119.112 → 2.119.113

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.112",
8
+ "version": "2.119.113",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"build_triangle_morton_codes.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/build_triangle_morton_codes.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,0DAXW,MAAM,EAAE,GAAC,WAAW,aACpB,MAAM,eACN,MAAM,EAAE,GAAC,UAAU,GAAC,WAAW,GAAC,WAAW,kBAC3C,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,WACN,MAAM,WACN,MAAM,WACN,MAAM,WACN,MAAM,WACN,MAAM,QAyEhB"}
1
+ {"version":3,"file":"build_triangle_morton_codes.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/build_triangle_morton_codes.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,0DAXW,MAAM,EAAE,GAAC,WAAW,aACpB,MAAM,eACN,MAAM,EAAE,GAAC,UAAU,GAAC,WAAW,GAAC,WAAW,kBAC3C,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,WACN,MAAM,WACN,MAAM,WACN,MAAM,WACN,MAAM,WACN,MAAM,QAoFhB"}
@@ -78,10 +78,21 @@ export function build_triangle_morton_codes(
78
78
  const ncy = (center_y - aabb_3_y0) * morton_scale_y;
79
79
  const ncz = (center_z - aabb_3_z0) * morton_scale_z;
80
80
 
81
- morton_codes[i] = morton(
81
+ const ix = Math.round(ncx);
82
+ const iz = Math.round(ncz);
83
+
84
+ const m30 = morton(
82
85
  Math.round(ncy),
83
- Math.round(ncx),
84
- Math.round(ncz),
86
+ ix,
87
+ iz,
85
88
  );
89
+
90
+ // mix in remaining bits
91
+ const m32 = m30
92
+ | ((ix & (1 << 10)) << 20)
93
+ | ((iz & (1 << 10)) << 21)
94
+ ;
95
+
96
+ morton_codes[i] = m32;
86
97
  }
87
98
  }