@woosh/meep-engine 2.117.30 → 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
@@ -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.30",
8
+ "version": "2.117.32",
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_for_geometry_morton.d.ts","sourceRoot":"","sources":["../../../../../src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,sEALW,MAAM,EAAE,GAAC,WAAW,GAAC,WAAW,kBAChC,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,WAAW,WACX,KAAK,QAkHf;sBAlIqB,6BAA6B"}
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":"AAIA;;;;;;;;;;GAUG;AACH,kEANW,MAAM,EAAE,GAAC,WAAW,oBACpB,MAAM,aACN,MAAM,EAAE,GAAC,WAAW,oBACpB,MAAM,GACJ,MAAM,CA4DlB"}
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
 
@@ -3,12 +3,12 @@
3
3
  * This is a special case of tetrahedral tessellation, we can handle it much easier due to regular nature of the point distribution
4
4
  * Note that if resolution in every dimension should be >= 2
5
5
  * @param {TetrahedralMesh} mesh
6
- * @param {number[]} points point data is written here
6
+ * @param {number[]|Float32Array|Float64Array} points point data is written here
7
7
  * @param {AABB3} bounds
8
8
  * @param {number} resolution_x how many points to generate on the grid in X axis
9
9
  * @param {number} resolution_y how many points to generate on the grid in Y axis
10
10
  * @param {number} resolution_z how many points to generate on the grid in Y axis
11
11
  * @returns {number} number of added points
12
12
  */
13
- export function tetrahedral_mesh_build_from_grid(mesh: TetrahedralMesh, points: number[], bounds: AABB3, resolution_x?: number, resolution_y?: number, resolution_z?: number): number;
13
+ export function tetrahedral_mesh_build_from_grid(mesh: TetrahedralMesh, points: number[] | Float32Array | Float64Array, bounds: AABB3, resolution_x?: number, resolution_y?: number, resolution_z?: number): number;
14
14
  //# sourceMappingURL=tetrahedral_mesh_build_from_grid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tetrahedral_mesh_build_from_grid.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/tetrahedra/delaunay/grid/tetrahedral_mesh_build_from_grid.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,gFAPW,MAAM,EAAE,gCAER,MAAM,iBACN,MAAM,iBACN,MAAM,GACJ,MAAM,CAgNlB"}
1
+ {"version":3,"file":"tetrahedral_mesh_build_from_grid.d.ts","sourceRoot":"","sources":["../../../../../../../../src/core/geom/3d/tetrahedra/delaunay/grid/tetrahedral_mesh_build_from_grid.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,gFAPW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,gCAElC,MAAM,iBACN,MAAM,iBACN,MAAM,GACJ,MAAM,CA2NlB"}
@@ -6,7 +6,7 @@ import { assert } from "../../../../../assert.js";
6
6
  * This is a special case of tetrahedral tessellation, we can handle it much easier due to regular nature of the point distribution
7
7
  * Note that if resolution in every dimension should be >= 2
8
8
  * @param {TetrahedralMesh} mesh
9
- * @param {number[]} points point data is written here
9
+ * @param {number[]|Float32Array|Float64Array} points point data is written here
10
10
  * @param {AABB3} bounds
11
11
  * @param {number} resolution_x how many points to generate on the grid in X axis
12
12
  * @param {number} resolution_y how many points to generate on the grid in Y axis
@@ -14,7 +14,8 @@ import { assert } from "../../../../../assert.js";
14
14
  * @returns {number} number of added points
15
15
  */
16
16
  export function tetrahedral_mesh_build_from_grid(
17
- mesh, points,
17
+ mesh,
18
+ points,
18
19
  bounds,
19
20
  resolution_x = 2, resolution_y = 2, resolution_z = 2,
20
21
  ) {
@@ -23,6 +24,16 @@ export function tetrahedral_mesh_build_from_grid(
23
24
  assert.isNonNegativeInteger(resolution_y, 'resolution_y');
24
25
  assert.isNonNegativeInteger(resolution_z, 'resolution_z');
25
26
 
27
+ assert.defined(mesh, 'mesh');
28
+
29
+ assert.defined(bounds, 'bounds');
30
+ assert.notNull(bounds, 'bounds');
31
+ assert.equal(bounds.isAABB3, true, 'bounds.isAABB3 !== true');
32
+
33
+ assert.defined(points, 'points');
34
+ assert.notNull(points, 'points');
35
+ assert.isArrayLike(points, 'points');
36
+
26
37
  mesh.clear();
27
38
 
28
39
  const TETRAHEDRONS_PER_VOXEL = 6;