@woosh/meep-engine 2.126.33 → 2.126.34

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": "Pure JavaScript game engine. Fully featured and production ready.",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.126.33",
8
+ "version": "2.126.34",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -0,0 +1,9 @@
1
+ /**
2
+ *
3
+ * @param {number[]} output
4
+ * @param {number} output_offset
5
+ * @param {number[]} frustum
6
+ * @param {number} frustum_offset
7
+ */
8
+ export function frustum_compute_center(output: number[], output_offset: number, frustum: number[], frustum_offset: number): void;
9
+ //# sourceMappingURL=frustum_compute_center.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frustum_compute_center.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/frustum/frustum_compute_center.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,+CALW,MAAM,EAAE,iBACR,MAAM,WACN,MAAM,EAAE,kBACR,MAAM,QA0BhB"}
@@ -0,0 +1,36 @@
1
+ import { frustum_compute_corners } from "./frustum_compute_corners.js";
2
+
3
+ const scratch_corners = new Float32Array(24);
4
+
5
+ /**
6
+ *
7
+ * @param {number[]} output
8
+ * @param {number} output_offset
9
+ * @param {number[]} frustum
10
+ * @param {number} frustum_offset
11
+ */
12
+ export function frustum_compute_center(
13
+ output,
14
+ output_offset,
15
+ frustum,
16
+ frustum_offset
17
+ ) {
18
+
19
+ frustum_compute_corners(scratch_corners, 0, frustum, frustum_offset);
20
+
21
+ let x = 0;
22
+ let y = 0;
23
+ let z = 0;
24
+
25
+ for (let i = 0; i < 8; i++) {
26
+ const i3 = i * 3;
27
+
28
+ x += scratch_corners[i3]
29
+ y += scratch_corners[i3 + 1]
30
+ z += scratch_corners[i3 + 2]
31
+ }
32
+
33
+ output[output_offset] = x / 8;
34
+ output[output_offset + 1] = y / 8;
35
+ output[output_offset + 2] = z / 8;
36
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This function operates in 3D.
3
+ * Write 8 frustum corners out into the output.
4
+ * Assumes frustum is convex and has no parallel planes except those in the same axis.
5
+ * @param {number[]|Float32Array} output where to write results to
6
+ * @param {number} output_offset where to start writing results
7
+ * @param {number[]|Float32Array} frustum defined as [plane_normal_x, plane_normal_y, plane_normal_z, plane_offset], planes should be in the following order [x0, x1, y0, y1, z0, z1]
8
+ * @param {number} frustum_offset where to start reading from
9
+ */
10
+ export function frustum_compute_corners(output: number[] | Float32Array, output_offset: number, frustum: number[] | Float32Array, frustum_offset: number): void;
11
+ //# sourceMappingURL=frustum_compute_corners.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frustum_compute_corners.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/frustum/frustum_compute_corners.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,gDALW,MAAM,EAAE,GAAC,YAAY,iBACrB,MAAM,WACN,MAAM,EAAE,GAAC,YAAY,kBACrB,MAAM,QAuEhB"}
@@ -0,0 +1,81 @@
1
+ import { plane3_compute_convex_3_plane_intersection } from "../plane/plane3_compute_convex_3_plane_intersection.js";
2
+
3
+ /**
4
+ * This function operates in 3D.
5
+ * Write 8 frustum corners out into the output.
6
+ * Assumes frustum is convex and has no parallel planes except those in the same axis.
7
+ * @param {number[]|Float32Array} output where to write results to
8
+ * @param {number} output_offset where to start writing results
9
+ * @param {number[]|Float32Array} frustum defined as [plane_normal_x, plane_normal_y, plane_normal_z, plane_offset], planes should be in the following order [x0, x1, y0, y1, z0, z1]
10
+ * @param {number} frustum_offset where to start reading from
11
+ */
12
+ export function frustum_compute_corners(output, output_offset, frustum, frustum_offset) {
13
+
14
+ const f = frustum;
15
+ const o = frustum_offset;
16
+
17
+ // plane_x0, plane_y0, plane_z0
18
+ plane3_compute_convex_3_plane_intersection(
19
+ output, output_offset,
20
+ f[o], f[o + 1], f[o + 2], f[o + 3],
21
+ f[o + 8], f[o + 9], f[o + 10], f[o + 11],
22
+ f[o + 16], f[o + 17], f[o + 18], f[o + 19],
23
+ );
24
+
25
+ // plane_x0, plane_y0, plane_z1
26
+ plane3_compute_convex_3_plane_intersection(
27
+ output, output_offset + 3,
28
+ f[o], f[o + 1], f[o + 2], f[o + 3],
29
+ f[o + 8], f[o + 9], f[o + 10], f[o + 11],
30
+ f[o + 20], f[o + 21], f[o + 22], f[o + 23],
31
+ );
32
+
33
+ // plane_x0, plane_y1, plane_z0
34
+ plane3_compute_convex_3_plane_intersection(
35
+ output, output_offset + 6,
36
+ f[o], f[o + 1], f[o + 2], f[o + 3],
37
+ f[o + 12], f[o + 13], f[o + 14], f[o + 15],
38
+ f[o + 16], f[o + 17], f[o + 18], f[o + 19],
39
+ );
40
+
41
+ // plane_x0, plane_y1, plane_z1
42
+ plane3_compute_convex_3_plane_intersection(
43
+ output, output_offset + 9,
44
+ f[o], f[o + 1], f[o + 2], f[o + 3],
45
+ f[o + 12], f[o + 13], f[o + 14], f[o + 15],
46
+ f[o + 20], f[o + 21], f[o + 22], f[o + 23],
47
+ );
48
+
49
+ // plane_x1, plane_y0, plane_z0
50
+ plane3_compute_convex_3_plane_intersection(
51
+ output, output_offset + 12,
52
+ f[o + 4], f[o + 5], f[o + 6], f[o + 7],
53
+ f[o + 8], f[o + 9], f[o + 10], f[o + 11],
54
+ f[o + 16], f[o + 17], f[o + 18], f[o + 19],
55
+ );
56
+
57
+ // plane_x1, plane_y0, plane_z1
58
+ plane3_compute_convex_3_plane_intersection(
59
+ output, output_offset + 15,
60
+ f[o + 4], f[o + 5], f[o + 6], f[o + 7],
61
+ f[o + 8], f[o + 9], f[o + 10], f[o + 11],
62
+ f[o + 20], f[o + 21], f[o + 22], f[o + 23],
63
+ );
64
+
65
+ // plane_x1, plane_y1, plane_z0
66
+ plane3_compute_convex_3_plane_intersection(
67
+ output, output_offset + 18,
68
+ f[o + 4], f[o + 5], f[o + 6], f[o + 7],
69
+ f[o + 12], f[o + 13], f[o + 14], f[o + 15],
70
+ f[o + 16], f[o + 17], f[o + 18], f[o + 19],
71
+ );
72
+
73
+ // plane_x1, plane_y1, plane_z1
74
+ plane3_compute_convex_3_plane_intersection(
75
+ output, output_offset + 21,
76
+ f[o + 4], f[o + 5], f[o + 6], f[o + 7],
77
+ f[o + 12], f[o + 13], f[o + 14], f[o + 15],
78
+ f[o + 20], f[o + 21], f[o + 22], f[o + 23],
79
+ );
80
+
81
+ }
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Get frustum corners from a set of planes
3
+ * see {@link frustum_compute_corners} for a non-three.js version
3
4
  * @param {Float32Array|number[]} result
4
5
  * @param {Plane[]} planes
5
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"computeFrustumCorners.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/forward_plus/computeFrustumCorners.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,8CAHW,YAAY,GAAC,MAAM,EAAE,UACrB,KAAK,EAAE,QA6DjB"}
1
+ {"version":3,"file":"computeFrustumCorners.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/forward_plus/computeFrustumCorners.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,8CAHW,YAAY,GAAC,MAAM,EAAE,UACrB,KAAK,EAAE,QA6DjB"}
@@ -4,6 +4,7 @@ import {
4
4
 
5
5
  /**
6
6
  * Get frustum corners from a set of planes
7
+ * see {@link frustum_compute_corners} for a non-three.js version
7
8
  * @param {Float32Array|number[]} result
8
9
  * @param {Plane[]} planes
9
10
  */
@@ -117,6 +117,11 @@ export class RenderGraph {
117
117
  * @return {string}
118
118
  */
119
119
  exportToDot(): string;
120
+ /**
121
+ * @readonly
122
+ * @type {boolean}
123
+ */
124
+ readonly isRenderGraph: boolean;
120
125
  }
121
126
  import { ResourceEntry } from "./ResourceEntry.js";
122
127
  import { ResourceNode } from "./ResourceNode.js";
@@ -1 +1 @@
1
- {"version":3,"file":"RenderGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraph.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH;IA6BI;;;OAGG;IACH,mBAFW,MAAM,EAOhB;IArCD;;;;OAIG;IACH,MAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAyB;IAazB;;;;OAIG;IACH,qBAHW,MAAM,sBAahB;IAED;;;;OAIG;IACH,oBAHW,MAAM,qBAmBhB;IAED;;;;OAIG;IACH,cAJa,CAAC,MACH,MAAM,GACJ,CAAC,CAIb;IAED;;;;OAIG;IACH,gBAJa,CAAC,QACH,MAAM,cACN,CAAC,UAUX;IAED;;;;;OAKG;IACH,6BAYC;IAED;;;;;;OAMG;IACH,4BAeC;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,MAAM,CAkBlB;IAED;;;;;;OAMG;IACH,gBANa,CAAC,QACH,MAAM,eACN,kBAAkB,CAAC,CAAC,CAAC,YACrB,CAAC,GACC,MAAM,CAUlB;IAED;;;OAGG;IACH,4BAHa,OAAO,CAQnB;IAED;;;;;;OAMG;IACH,IANa,CAAC,QACH,MAAM,QACN,CAAC,iBAEC,kBAAkB,CA2B9B;IAED;;;;;;OAMG;IACH,2DAHW,GAAC,GACC,OAAO,CAOnB;IAED,gBA6FC;IAED;;;OAGG;IACH,iBAFW,cAAc,QA6CxB;IAED;;;OAGG;IACH,eAFY,MAAM,CAiEjB;CACJ;8BAld6B,oBAAoB;6BACrB,mBAAmB;mCAJb,yBAAyB"}
1
+ {"version":3,"file":"RenderGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraph.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH;IA6BI;;;OAGG;IACH,mBAFW,MAAM,EAOhB;IArCD;;;;OAIG;IACH,MAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAyB;IAazB;;;;OAIG;IACH,qBAHW,MAAM,sBAahB;IAED;;;;OAIG;IACH,oBAHW,MAAM,qBAmBhB;IAED;;;;OAIG;IACH,cAJa,CAAC,MACH,MAAM,GACJ,CAAC,CAIb;IAED;;;;OAIG;IACH,gBAJa,CAAC,QACH,MAAM,cACN,CAAC,UAUX;IAED;;;;;OAKG;IACH,6BAYC;IAED;;;;;;OAMG;IACH,4BAeC;IAED;;;;OAIG;IACH,oBAHW,MAAM,GACJ,MAAM,CAkBlB;IAED;;;;;;OAMG;IACH,gBANa,CAAC,QACH,MAAM,eACN,kBAAkB,CAAC,CAAC,CAAC,YACrB,CAAC,GACC,MAAM,CAUlB;IAED;;;OAGG;IACH,4BAHa,OAAO,CAQnB;IAED;;;;;;OAMG;IACH,IANa,CAAC,QACH,MAAM,QACN,CAAC,iBAEC,kBAAkB,CA2B9B;IAED;;;;;;OAMG;IACH,2DAHW,GAAC,GACC,OAAO,CAOnB;IAED,gBA6FC;IAED;;;OAGG;IACH,iBAFW,cAAc,QA6CxB;IAED;;;OAGG;IACH,eAFY,MAAM,CAiEjB;IAGL;;;OAGG;IACH,wBAFU,OAAO,CAEkB;CANlC;8BAld6B,oBAAoB;6BACrB,mBAAmB;mCAJb,yBAAyB"}
@@ -470,3 +470,9 @@ export class RenderGraph {
470
470
  return out.build();
471
471
  }
472
472
  }
473
+
474
+ /**
475
+ * @readonly
476
+ * @type {boolean}
477
+ */
478
+ RenderGraph.prototype.isRenderGraph = true;