@woosh/meep-engine 2.117.37 → 2.118.0

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.
@@ -67475,19 +67475,24 @@ SGMesh.typeName = "SGMesh";
67475
67475
  /**
67476
67476
  *
67477
67477
  * @param {number[]|Float32Array} aabb
67478
+ * @param {number} aabb_offset
67478
67479
  * @param {number[]|Float32Array} frustum
67479
67480
  * @returns {number}
67480
67481
  */
67481
- function aabb3_array_intersects_frustum_degree(aabb, frustum) {
67482
+ function aabb3_array_intersects_frustum_degree(aabb, aabb_offset, frustum) {
67482
67483
 
67483
- const x0 = aabb[0];
67484
- const y0 = aabb[1];
67485
- const z0 = aabb[2];
67486
- const x1 = aabb[3];
67487
- const y1 = aabb[4];
67488
- const z1 = aabb[5];
67484
+ const x0 = aabb[aabb_offset];
67485
+ const y0 = aabb[aabb_offset + 1];
67486
+ const z0 = aabb[aabb_offset + 2];
67487
+ const x1 = aabb[aabb_offset + 3];
67488
+ const y1 = aabb[aabb_offset + 4];
67489
+ const z1 = aabb[aabb_offset + 5];
67489
67490
 
67490
- return aabb3_intersects_frustum_degree(x0, y0, z0, x1, y1, z1, frustum);
67491
+ return aabb3_intersects_frustum_degree(
67492
+ x0, y0, z0,
67493
+ x1, y1, z1,
67494
+ frustum
67495
+ );
67491
67496
  }
67492
67497
 
67493
67498
  //
@@ -67601,7 +67606,7 @@ function bvh_query_user_data_overlaps_frustum(
67601
67606
 
67602
67607
  // test node against the ray
67603
67608
  bvh.node_get_aabb(node, scratch_aabb$1);
67604
- const intersection = aabb3_array_intersects_frustum_degree(scratch_aabb$1, frustum);
67609
+ const intersection = aabb3_array_intersects_frustum_degree(scratch_aabb$1,0, frustum);
67605
67610
 
67606
67611
  if (intersection === 0) {
67607
67612
  // fully outside
@@ -106775,7 +106780,11 @@ function read_cluster_frustum_corners(output, i_z_0, tr_xy_1, i_y_0, tr_x_1, i_x
106775
106780
  * @param {number} tr_z slices in Z axis
106776
106781
  * @param {number[]} output_frustum_corners
106777
106782
  */
106778
- function slice_frustum_linear_to_points(input_frustum_corners, tr_x, tr_y, tr_z, output_frustum_corners) {
106783
+ function slice_frustum_linear_to_points(
106784
+ input_frustum_corners,
106785
+ tr_x, tr_y, tr_z,
106786
+ output_frustum_corners
106787
+ ) {
106779
106788
  // read out view frustum scratch_corners
106780
106789
  const x_000 = input_frustum_corners[0];
106781
106790
  const y_000 = input_frustum_corners[1];
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.37",
8
+ "version": "2.118.0",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -48,7 +48,7 @@ export function bvh_query_user_data_overlaps_frustum(
48
48
 
49
49
  // test node against the ray
50
50
  bvh.node_get_aabb(node, scratch_aabb);
51
- const intersection = aabb3_array_intersects_frustum_degree(scratch_aabb, frustum);
51
+ const intersection = aabb3_array_intersects_frustum_degree(scratch_aabb,0, frustum);
52
52
 
53
53
  if (intersection === 0) {
54
54
  // fully outside
@@ -121,7 +121,7 @@ export function compute_tight_near_far_clipping_planes(result, result_offset, co
121
121
 
122
122
  }
123
123
 
124
- const intersection = aabb3_array_intersects_frustum_degree(scratch_aabb, frustum);
124
+ const intersection = aabb3_array_intersects_frustum_degree(scratch_aabb, 0, frustum);
125
125
 
126
126
  if (intersection === 0) {
127
127
  // fully outside
@@ -1,8 +1,9 @@
1
1
  /**
2
2
  *
3
3
  * @param {number[]|Float32Array} aabb
4
+ * @param {number} aabb_offset
4
5
  * @param {number[]|Float32Array} frustum
5
6
  * @returns {number}
6
7
  */
7
- export function aabb3_array_intersects_frustum_degree(aabb: number[] | Float32Array, frustum: number[] | Float32Array): number;
8
+ export function aabb3_array_intersects_frustum_degree(aabb: number[] | Float32Array, aabb_offset: number, frustum: number[] | Float32Array): number;
8
9
  //# sourceMappingURL=aabb3_array_intersects_frustum_degree.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aabb3_array_intersects_frustum_degree.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/aabb/aabb3_array_intersects_frustum_degree.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,4DAJW,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,EAAE,GAAC,YAAY,GACnB,MAAM,CAYlB"}
1
+ {"version":3,"file":"aabb3_array_intersects_frustum_degree.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/aabb/aabb3_array_intersects_frustum_degree.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,4DALW,MAAM,EAAE,GAAC,YAAY,eACrB,MAAM,WACN,MAAM,EAAE,GAAC,YAAY,GACnB,MAAM,CAmBlB"}
@@ -1,20 +1,29 @@
1
+ import { assert } from "../../../assert.js";
1
2
  import { aabb3_intersects_frustum_degree } from "./aabb3_intersects_frustum_degree.js";
2
3
 
3
4
 
4
5
  /**
5
6
  *
6
7
  * @param {number[]|Float32Array} aabb
8
+ * @param {number} aabb_offset
7
9
  * @param {number[]|Float32Array} frustum
8
10
  * @returns {number}
9
11
  */
10
- export function aabb3_array_intersects_frustum_degree(aabb, frustum) {
12
+ export function aabb3_array_intersects_frustum_degree(aabb, aabb_offset, frustum) {
11
13
 
12
- const x0 = aabb[0];
13
- const y0 = aabb[1];
14
- const z0 = aabb[2];
15
- const x1 = aabb[3];
16
- const y1 = aabb[4];
17
- const z1 = aabb[5];
14
+ assert.defined(frustum, 'frustum');
15
+ assert.isNonNegativeInteger(aabb_offset, 'aabb_offset');
18
16
 
19
- return aabb3_intersects_frustum_degree(x0, y0, z0, x1, y1, z1, frustum);
17
+ const x0 = aabb[aabb_offset];
18
+ const y0 = aabb[aabb_offset + 1];
19
+ const z0 = aabb[aabb_offset + 2];
20
+ const x1 = aabb[aabb_offset + 3];
21
+ const y1 = aabb[aabb_offset + 4];
22
+ const z1 = aabb[aabb_offset + 5];
23
+
24
+ return aabb3_intersects_frustum_degree(
25
+ x0, y0, z0,
26
+ x1, y1, z1,
27
+ frustum
28
+ );
20
29
  }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Perform affine transform on a given frustum
3
+ * @param {number[]|Float32Array|Float64Array} output
4
+ * @param {number} output_offset
5
+ * @param {number[]|Float32Array|Float64Array} input
6
+ * @param {number} input_offset
7
+ * @param {number[]|Float32Array|Float64Array} matrix4
8
+ */
9
+ export function frustum_matrix4_project(output: number[] | Float32Array | Float64Array, output_offset: number, input: number[] | Float32Array | Float64Array, input_offset: number, matrix4: number[] | Float32Array | Float64Array): void;
10
+ //# sourceMappingURL=frustum_matrix4_project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frustum_matrix4_project.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/frustum/frustum_matrix4_project.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,gDANW,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,iBAClC,MAAM,SACN,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,gBAClC,MAAM,WACN,MAAM,EAAE,GAAC,YAAY,GAAC,YAAY,QAiC5C"}
@@ -0,0 +1,43 @@
1
+ import { assert } from "../../../assert.js";
2
+ import { plane3_matrix4_project } from "../plane/plane3_matrix4_project.js";
3
+
4
+ /**
5
+ * Perform affine transform on a given frustum
6
+ * @param {number[]|Float32Array|Float64Array} output
7
+ * @param {number} output_offset
8
+ * @param {number[]|Float32Array|Float64Array} input
9
+ * @param {number} input_offset
10
+ * @param {number[]|Float32Array|Float64Array} matrix4
11
+ */
12
+ export function frustum_matrix4_project(
13
+ output, output_offset,
14
+ input, input_offset,
15
+ matrix4
16
+ ) {
17
+ assert.isArrayLike(output, 'output');
18
+ assert.isNonNegativeInteger(output_offset, "output_offset");
19
+
20
+ assert.isArrayLike(input, 'input');
21
+ assert.greaterThanOrEqual(input.length, input_offset + 24, 'input too small');
22
+ assert.isNonNegativeInteger(input_offset, "input_offset");
23
+
24
+ assert.isArrayLike(matrix4, 'matrix4');
25
+
26
+ for (let plane_index = 0; plane_index < 6; plane_index++) {
27
+ const frustum_offset = plane_index * 4;
28
+
29
+ const i = input_offset + frustum_offset;
30
+ const o = output_offset + frustum_offset;
31
+
32
+ plane3_matrix4_project(
33
+ output, o,
34
+ matrix4,
35
+ input[i],
36
+ input[i + 1],
37
+ input[i + 2],
38
+ input[i + 3],
39
+ );
40
+
41
+ }
42
+
43
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"slice_frustum_linear_to_points.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/frustum/slice_frustum_linear_to_points.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,sEANW,MAAM,EAAE,QACR,MAAM,QACN,MAAM,QACN,MAAM,0BACN,MAAM,EAAE,QAqFlB"}
1
+ {"version":3,"file":"slice_frustum_linear_to_points.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/frustum/slice_frustum_linear_to_points.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,sEANW,MAAM,EAAE,QACR,MAAM,QACN,MAAM,QACN,MAAM,0BACN,MAAM,EAAE,QAyFlB"}
@@ -6,7 +6,11 @@
6
6
  * @param {number} tr_z slices in Z axis
7
7
  * @param {number[]} output_frustum_corners
8
8
  */
9
- export function slice_frustum_linear_to_points(input_frustum_corners, tr_x, tr_y, tr_z, output_frustum_corners) {
9
+ export function slice_frustum_linear_to_points(
10
+ input_frustum_corners,
11
+ tr_x, tr_y, tr_z,
12
+ output_frustum_corners
13
+ ) {
10
14
  // read out view frustum scratch_corners
11
15
  const x_000 = input_frustum_corners[0];
12
16
  const y_000 = input_frustum_corners[1];