@woosh/meep-engine 2.117.31 → 2.117.32
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":"ebvh_build_for_geometry_morton.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ebvh_build_for_geometry_morton.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,sEALW,MAAM,EAAE,GAAC,WAAW,GAAC,WAAW,kBAChC,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,WAAW,WACX,KAAK,QAiHf;sBAhIqB,6BAA6B"}
|
|
@@ -8,7 +8,6 @@ import { max2 } from "../../math/max2.js";
|
|
|
8
8
|
import { build_triangle_morton_codes } from "./build_triangle_morton_codes.js";
|
|
9
9
|
import { COLUMN_CHILD_1, COLUMN_HEIGHT, COLUMN_USER_DATA, ELEMENT_WORD_COUNT, NULL_NODE } from "./BVH.js";
|
|
10
10
|
import { ebvh_build_hierarchy } from "./ebvh_build_hierarchy.js";
|
|
11
|
-
import { ebvh_nodes_sort_sah_local4 } from "./ebvh_nodes_sort_sah_local4.js";
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Build the BVH bottom-up using spatial hash sorting
|
|
@@ -113,6 +112,7 @@ export function ebvh_build_for_geometry_morton(
|
|
|
113
112
|
const c_index = index_array[triangle_index3 + 2];
|
|
114
113
|
|
|
115
114
|
const node_address = ELEMENT_WORD_COUNT * node;
|
|
115
|
+
|
|
116
116
|
aabb3_compute_from_triangle(
|
|
117
117
|
bvh_float32, node_address,
|
|
118
118
|
position_array, a_index, b_index, c_index
|
|
@@ -123,8 +123,6 @@ export function ebvh_build_for_geometry_morton(
|
|
|
123
123
|
bvh_uint32[node_address + COLUMN_HEIGHT] = 0;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
ebvh_nodes_sort_sah_local4(bvh, nodes, 0, tri_count );
|
|
127
|
-
|
|
128
126
|
// record newly generated nodes as "unprocessed"
|
|
129
127
|
const unprocessed_nodes = new Uint32Array(tri_count);
|
|
130
128
|
array_copy(nodes, 0, unprocessed_nodes, 0, tri_count);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ebvh_build_hierarchy.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/ebvh_build_hierarchy.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ebvh_build_hierarchy.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/ebvh_build_hierarchy.js"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,kEANW,MAAM,EAAE,GAAC,WAAW,oBACpB,MAAM,aACN,MAAM,EAAE,GAAC,WAAW,oBACpB,MAAM,GACJ,MAAM,CAgElB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { assert } from "../../assert.js";
|
|
2
2
|
import { max2 } from "../../math/max2.js";
|
|
3
3
|
import { NULL_NODE } from "./BVH.js";
|
|
4
|
+
import { ebvh_nodes_sort_sah_local4 } from "./ebvh_nodes_sort_sah_local4.js";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Given a set of leaves, build intermediate node hierarchy on top, all the way up to the root
|
|
@@ -32,6 +33,10 @@ export function ebvh_build_hierarchy(
|
|
|
32
33
|
|
|
33
34
|
while (unprocessed_node_count > 1) {
|
|
34
35
|
|
|
36
|
+
// sort intermediate nodes using small locality and SAH metric
|
|
37
|
+
ebvh_nodes_sort_sah_local4(bvh, unprocessed_nodes, 0, unprocessed_node_count );
|
|
38
|
+
ebvh_nodes_sort_sah_local4(bvh, unprocessed_nodes, 2, unprocessed_node_count-2 );
|
|
39
|
+
|
|
35
40
|
let added_nodes = 0;
|
|
36
41
|
let cursor = 0;
|
|
37
42
|
|