@woosh/meep-engine 2.119.113 → 2.119.115
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
|
@@ -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,
|
|
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,QAwEhB"}
|
|
@@ -36,10 +36,9 @@ export function build_triangle_morton_codes(
|
|
|
36
36
|
const aabb_3_z0 = aabb_z0 * 3;
|
|
37
37
|
|
|
38
38
|
// compute multipliers to bring normalized values in range of 10bit unsigned integer each
|
|
39
|
-
|
|
40
|
-
const morton_scale_x = aabb_size_x === 0 ? 0 : 2047 / (aabb_size_x * 3);
|
|
39
|
+
const morton_scale_x = aabb_size_x === 0 ? 0 : 1023 / (aabb_size_x * 3);
|
|
41
40
|
const morton_scale_y = aabb_size_y === 0 ? 0 : 1023 / (aabb_size_y * 3);
|
|
42
|
-
const morton_scale_z = aabb_size_z === 0 ? 0 :
|
|
41
|
+
const morton_scale_z = aabb_size_z === 0 ? 0 : 1023 / (aabb_size_z * 3);
|
|
43
42
|
|
|
44
43
|
// compute morton codes
|
|
45
44
|
for (let i = 0; i < tri_count; i++) {
|
|
@@ -78,21 +77,10 @@ export function build_triangle_morton_codes(
|
|
|
78
77
|
const ncy = (center_y - aabb_3_y0) * morton_scale_y;
|
|
79
78
|
const ncz = (center_z - aabb_3_z0) * morton_scale_z;
|
|
80
79
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const m30 = morton(
|
|
80
|
+
morton_codes[i] = morton(
|
|
81
|
+
Math.round(ncx),
|
|
85
82
|
Math.round(ncy),
|
|
86
|
-
|
|
87
|
-
iz,
|
|
83
|
+
Math.round(ncz),
|
|
88
84
|
);
|
|
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;
|
|
97
85
|
}
|
|
98
86
|
}
|
|
@@ -44,7 +44,7 @@ export function ebvh_build_hierarchy(
|
|
|
44
44
|
|
|
45
45
|
// sort intermediate nodes using small locality and SAH metric
|
|
46
46
|
|
|
47
|
-
const offset = (i << 1) &
|
|
47
|
+
const offset = (i << 1) & 2; // cycle between 0 and 2
|
|
48
48
|
|
|
49
49
|
const swap_count = ebvh_nodes_sort_sah_local4(
|
|
50
50
|
bvh,
|