@woosh/meep-engine 2.126.41 → 2.126.42

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.41",
8
+ "version": "2.126.42",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -1 +1 @@
1
- {"version":3,"file":"aabb3_from_v3_array_transformed.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/aabb/aabb3_from_v3_array_transformed.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wDALW,KAAK,SACL,MAAM,EAAE,GAAC,SAAS,CAAC,MAAM,CAAC,gBAC1B,MAAM,UACN,SAAS,CAAC,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,YAAY,QA8BjD"}
1
+ {"version":3,"file":"aabb3_from_v3_array_transformed.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/aabb/aabb3_from_v3_array_transformed.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wDALW,KAAK,SACL,MAAM,EAAE,GAAC,SAAS,CAAC,MAAM,CAAC,gBAC1B,MAAM,UACN,SAAS,CAAC,MAAM,CAAC,GAAC,MAAM,EAAE,GAAC,YAAY,QAiCjD"}
@@ -22,10 +22,13 @@ export function aabb3_from_v3_array_transformed(result, input, input_length, mat
22
22
  const y = input[i + 1];
23
23
  const z = input[i + 2];
24
24
 
25
- const _x = matrix[0] * x + matrix[4] * y + matrix[8] * z + matrix[12];
26
- const _y = matrix[1] * x + matrix[5] * y + matrix[9] * z + matrix[13];
27
- const _z = matrix[2] * x + matrix[6] * y + matrix[10] * z + matrix[14];
25
+ // perform matrix multiplication
26
+ const _w = 1 / (matrix[3] * x + matrix[7] * y + matrix[11] * z + matrix[15]);
28
27
 
28
+ const _x = (matrix[0] * x + matrix[4] * y + matrix[8] * z + matrix[12]) * _w;
29
+ const _y = (matrix[1] * x + matrix[5] * y + matrix[9] * z + matrix[13]) * _w;
30
+ const _z = (matrix[2] * x + matrix[6] * y + matrix[10] * z + matrix[14]) * _w;
31
+
29
32
  x0 = min2(_x, x0);
30
33
  y0 = min2(_y, y0);
31
34
  z0 = min2(_z, z0);
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Identity 4x4 matrix, also called "eye" matrix sometimes.
3
+ * @type {number[]|mat4}
4
+ */
5
+ export const M4_IDENTITY: number[] | mat4;
6
+ //# sourceMappingURL=M4_IDENTITY.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"M4_IDENTITY.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/mat4/M4_IDENTITY.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,0BAFU,MAAM,EAAE,GAAC,IAAI,CAOpB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Identity 4x4 matrix, also called "eye" matrix sometimes.
3
+ * @type {number[]|mat4}
4
+ */
5
+ export const M4_IDENTITY = Object.freeze([
6
+ 1, 0, 0, 0,
7
+ 0, 1, 0, 0,
8
+ 0, 0, 1, 0,
9
+ 0, 0, 0, 1
10
+ ]);
11
+
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Identity 4x4 matrix, also called "eye" matrix sometimes.
3
- * @type {number[]|mat4}
2
+ * Alias
3
+ * @deprecated use {@link M4_IDENTITY} directly instead
4
4
  */
5
- export const MATRIX_4_IDENTITY: number[] | mat4;
5
+ export const MATRIX_4_IDENTITY: any;
6
6
  //# sourceMappingURL=MATRIX_4_IDENTITY.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MATRIX_4_IDENTITY.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/mat4/MATRIX_4_IDENTITY.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,gCAFU,MAAM,EAAE,GAAC,IAAI,CAOpB"}
1
+ {"version":3,"file":"MATRIX_4_IDENTITY.d.ts","sourceRoot":"","sources":["../../../../../../src/core/geom/3d/mat4/MATRIX_4_IDENTITY.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,oCAA6C"}
@@ -1,10 +1,7 @@
1
+ import { M4_IDENTITY } from "./M4_IDENTITY.js";
2
+
1
3
  /**
2
- * Identity 4x4 matrix, also called "eye" matrix sometimes.
3
- * @type {number[]|mat4}
4
+ * Alias
5
+ * @deprecated use {@link M4_IDENTITY} directly instead
4
6
  */
5
- export const MATRIX_4_IDENTITY = Object.freeze([
6
- 1, 0, 0, 0,
7
- 0, 1, 0, 0,
8
- 0, 0, 1, 0,
9
- 0, 0, 0, 1
10
- ]);
7
+ export const MATRIX_4_IDENTITY = M4_IDENTITY;
@@ -1,5 +1,5 @@
1
1
  import { array_copy } from "../../../collection/array/array_copy.js";
2
- import { MATRIX_4_IDENTITY } from "./MATRIX_4_IDENTITY.js";
2
+ import { M4_IDENTITY } from "./M4_IDENTITY.js";
3
3
 
4
4
  /**
5
5
  * Create a 4x4 matrix that corresponds to translation transform
@@ -7,7 +7,7 @@ import { MATRIX_4_IDENTITY } from "./MATRIX_4_IDENTITY.js";
7
7
  * @param {ArrayLike<number>} translation 3d vector
8
8
  */
9
9
  export function m4_make_translation(output, translation) {
10
- array_copy(MATRIX_4_IDENTITY, 0, output, 0, 16);
10
+ array_copy(M4_IDENTITY, 0, output, 0, 16);
11
11
 
12
12
  output[12] = translation[0];
13
13
  output[13] = translation[1];
@@ -1,6 +1,6 @@
1
1
  import { BvhClient } from "../../../core/bvh2/bvh3/BvhClient.js";
2
2
  import { AABB3 } from "../../../core/geom/3d/aabb/AABB3.js";
3
- import { MATRIX_4_IDENTITY } from "../../../core/geom/3d/mat4/MATRIX_4_IDENTITY.js";
3
+ import { M4_IDENTITY } from "../../../core/geom/3d/mat4/M4_IDENTITY.js";
4
4
  import {
5
5
  expand_aabb_by_transformed_three_object
6
6
  } from "../../graphics/three/expand_aabb_by_transformed_three_object.js";
@@ -146,7 +146,7 @@ class Renderable {
146
146
  -Infinity, -Infinity, -Infinity
147
147
  ]);
148
148
 
149
- expand_aabb_by_transformed_three_object(aabb, object, MATRIX_4_IDENTITY);
149
+ expand_aabb_by_transformed_three_object(aabb, object, M4_IDENTITY);
150
150
 
151
151
  // sanity checks to ensure valid bounds
152
152
  if (!Number.isFinite(aabb[0])) {
@@ -6,7 +6,7 @@ import {
6
6
 
7
7
  import { noop } from "../../../../core/function/noop.js";
8
8
  import { read_three_planes_to_array } from "../../../../core/geom/3d/frustum/read_three_planes_to_array.js";
9
- import { MATRIX_4_IDENTITY } from "../../../../core/geom/3d/mat4/MATRIX_4_IDENTITY.js";
9
+ import { M4_IDENTITY } from "../../../../core/geom/3d/mat4/M4_IDENTITY.js";
10
10
  import { ImageRGBADataLoader } from "../../../asset/loaders/image/ImageRGBADataLoader.js";
11
11
  import { TextureAssetLoader } from "../../../asset/loaders/texture/TextureAssetLoader.js";
12
12
  import { CameraSystem } from '../../../graphics/ecs/camera/CameraSystem.js';
@@ -220,7 +220,7 @@ class TerrainSystem extends System {
220
220
  // terrain has a transform
221
221
  terrain.transform = transform.matrix;
222
222
  } else {
223
- terrain.transform = MATRIX_4_IDENTITY;
223
+ terrain.transform = M4_IDENTITY;
224
224
  }
225
225
 
226
226
  terrain.update(this.__time_delta);
@@ -3,7 +3,7 @@ import { allocate_m4 } from "../../../core/geom/3d/mat4/allocate_m4.js";
3
3
  import { compose_matrix4_array } from "../../../core/geom/3d/mat4/compose_matrix4_array.js";
4
4
  import { decompose_matrix_4_array } from "../../../core/geom/3d/mat4/decompose_matrix_4_array.js";
5
5
  import { m4_multiply } from "../../../core/geom/3d/mat4/m4_multiply.js";
6
- import { MATRIX_4_IDENTITY } from "../../../core/geom/3d/mat4/MATRIX_4_IDENTITY.js";
6
+ import { M4_IDENTITY } from "../../../core/geom/3d/mat4/M4_IDENTITY.js";
7
7
  import Quaternion from "../../../core/geom/Quaternion.js";
8
8
  import Vector3 from "../../../core/geom/Vector3.js";
9
9
  import { TransformFlags } from "./TransformFlags.js";
@@ -400,7 +400,7 @@ export class Transform {
400
400
  * - scale: [1,1,1]
401
401
  */
402
402
  makeIdentity() {
403
- this.fromMatrix(MATRIX_4_IDENTITY);
403
+ this.fromMatrix(M4_IDENTITY);
404
404
  }
405
405
 
406
406
  /**
@@ -3,14 +3,14 @@ import { mergeBufferGeometries } from "three/examples/jsm/utils/BufferGeometryUt
3
3
  import { array_copy } from "../../../../../core/collection/array/array_copy.js";
4
4
  import { HashMap } from "../../../../../core/collection/map/HashMap.js";
5
5
  import { m4_multiply } from "../../../../../core/geom/3d/mat4/m4_multiply.js";
6
- import { MATRIX_4_IDENTITY } from "../../../../../core/geom/3d/mat4/MATRIX_4_IDENTITY.js";
6
+ import { M4_IDENTITY } from "../../../../../core/geom/3d/mat4/M4_IDENTITY.js";
7
7
  import { StaticMaterialCache } from "../../../../asset/loaders/material/StaticMaterialCache.js";
8
8
  import { computeGeometryEquality } from "../../buffered/computeGeometryEquality.js";
9
9
  import { computeGeometryHash } from "../../buffered/computeGeometryHash.js";
10
10
 
11
11
  class GeometryContext {
12
12
  constructor() {
13
- this.matrix = new Float32Array(MATRIX_4_IDENTITY);
13
+ this.matrix = new Float32Array(M4_IDENTITY);
14
14
  this.material = null;
15
15
  this.geometry = null;
16
16
  }
@@ -52,7 +52,7 @@ function compute_transform_matrix(object, ancestor_root, result) {
52
52
  //
53
53
  path.reverse();
54
54
 
55
- result.set(MATRIX_4_IDENTITY);
55
+ result.set(M4_IDENTITY);
56
56
 
57
57
  for (let i = 0; i < path.length; i++) {
58
58
  const el = path[i];