@woosh/meep-engine 2.169.2 → 2.169.4

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.
Files changed (40) hide show
  1. package/package.json +1 -1
  2. package/src/core/geom/3d/mat4/m4_decompose.d.ts +5 -9
  3. package/src/core/geom/3d/mat4/m4_decompose.d.ts.map +1 -1
  4. package/src/core/geom/3d/mat4/m4_decompose.js +40 -60
  5. package/src/core/geom/3d/mat4/m4_decompose_array.d.ts +28 -0
  6. package/src/core/geom/3d/mat4/m4_decompose_array.d.ts.map +1 -0
  7. package/src/core/geom/3d/mat4/m4_decompose_array.js +157 -0
  8. package/src/core/primitives/strings/string_jaro_distance.d.ts +2 -2
  9. package/src/core/primitives/strings/string_jaro_distance.js +4 -4
  10. package/src/engine/Engine.d.ts.map +1 -1
  11. package/src/engine/Engine.js +0 -2
  12. package/src/engine/asset/loaders/SoundAssetLoader.d.ts.map +1 -1
  13. package/src/engine/asset/loaders/SoundAssetLoader.js +12 -1
  14. package/src/engine/ecs/gui/GUIElementSystem.d.ts +9 -0
  15. package/src/engine/ecs/gui/GUIElementSystem.d.ts.map +1 -1
  16. package/src/engine/ecs/gui/GUIElementSystem.js +23 -3
  17. package/src/engine/ecs/gui/position/ViewportPositionSystem.d.ts.map +1 -1
  18. package/src/engine/ecs/gui/position/ViewportPositionSystem.js +4 -2
  19. package/src/engine/ecs/transform/Transform64.d.ts +306 -0
  20. package/src/engine/ecs/transform/Transform64.d.ts.map +1 -0
  21. package/src/engine/ecs/transform/Transform64.js +591 -0
  22. package/src/engine/graphics/ecs/mesh/SkeletonUtils.d.ts +3 -3
  23. package/src/engine/graphics/ecs/mesh/SkeletonUtils.js +4 -4
  24. package/src/engine/graphics/ecs/mesh-v2/DeferredBoundsQueue.d.ts +48 -0
  25. package/src/engine/graphics/ecs/mesh-v2/DeferredBoundsQueue.d.ts.map +1 -0
  26. package/src/engine/graphics/ecs/mesh-v2/DeferredBoundsQueue.js +88 -0
  27. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.d.ts +28 -0
  28. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.d.ts.map +1 -1
  29. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +79 -0
  30. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometryFlags.js +21 -3
  31. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts +13 -1
  32. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
  33. package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +47 -10
  34. package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.d.ts +7 -0
  35. package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.d.ts.map +1 -1
  36. package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.js +28 -4
  37. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  38. package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
  39. package/src/view/minimap/gl/MinimapMarkersGL.d.ts.map +1 -1
  40. package/src/view/minimap/gl/MinimapMarkersGL.js +3 -1
@@ -0,0 +1,306 @@
1
+ /**
2
+ * Index of the first element of the 4x4 affine matrix inside a {@link Transform64}.
3
+ *
4
+ * It is 0, which means a `Transform64` can be passed to any `mat4` function directly,
5
+ * in place of the matrix - `m4_multiply(out, a_transform, b_transform)` and the like.
6
+ * @type {number}
7
+ */
8
+ export const TRANSFORM64_MATRIX_OFFSET: number;
9
+ /**
10
+ * Index of the first element of the translation (x, y, z) inside a {@link Transform64}
11
+ * @type {number}
12
+ */
13
+ export const TRANSFORM64_TRANSLATION_OFFSET: number;
14
+ /**
15
+ * Index of the first element of the rotation quaternion (x, y, z, w) inside a {@link Transform64}
16
+ * @type {number}
17
+ */
18
+ export const TRANSFORM64_ROTATION_OFFSET: number;
19
+ /**
20
+ * Index of the first element of the scale (x, y, z) inside a {@link Transform64}
21
+ * @type {number}
22
+ */
23
+ export const TRANSFORM64_SCALE_OFFSET: number;
24
+ /**
25
+ * Number of elements in a {@link Transform64}
26
+ * @type {number}
27
+ */
28
+ export const TRANSFORM64_SIZE: number;
29
+ /**
30
+ * Position, rotation and scale of an object in 3D space, along with the affine matrix they compose into,
31
+ * packed into a single `Float64Array`.
32
+ *
33
+ * This is the passive counterpart of {@link Transform}. There are no signals, no flags and no change
34
+ * detection: setting the translation, rotation or scale does **not** refresh {@link matrix}, you call
35
+ * {@link updateMatrix} yourself once you are done mutating. What you get for that is one allocation of one
36
+ * contiguous buffer per transform, plain array stores instead of setter dispatch, and double precision
37
+ * throughout.
38
+ *
39
+ * Every element is addressable directly, and the layout is part of the contract, so hot code can read and
40
+ * write the buffer without going through the accessors:
41
+ * ```
42
+ * [ 0..15] matrix, column-major
43
+ * [16..18] translation x, y, z
44
+ * [19..22] rotation x, y, z, w
45
+ * [23..25] scale x, y, z
46
+ * ```
47
+ *
48
+ * @example
49
+ * const t = new Transform64();
50
+ *
51
+ * t.setTranslation(1, 2, 3);
52
+ * t.setScale(2, 2, 2);
53
+ *
54
+ * // nothing has touched the matrix up to this point
55
+ * t.updateMatrix();
56
+ *
57
+ * @example
58
+ * // reading a component in a hot loop, without the accessors
59
+ * const x = t[TRANSFORM64_TRANSLATION_OFFSET];
60
+ *
61
+ * @author Alex Goldring
62
+ * @copyright Company Named Limited (c) 2026
63
+ */
64
+ export class Transform64 extends Float64Array {
65
+ /**
66
+ * Build a transform from loose components, with {@link matrix} already composed from them
67
+ * @param {number} translation_x
68
+ * @param {number} translation_y
69
+ * @param {number} translation_z
70
+ * @param {number} rotation_x
71
+ * @param {number} rotation_y
72
+ * @param {number} rotation_z
73
+ * @param {number} rotation_w
74
+ * @param {number} scale_x
75
+ * @param {number} scale_y
76
+ * @param {number} scale_z
77
+ * @returns {Transform64}
78
+ */
79
+ static from(translation_x: number, translation_y: number, translation_z: number, rotation_x: number, rotation_y: number, rotation_z: number, rotation_w: number, scale_x: number, scale_y: number, scale_z: number): Transform64;
80
+ /**
81
+ * Build a transform from an affine matrix, see {@link fromMatrix}
82
+ * @param {number[]|Float32Array|Float64Array|mat4} m4 4x4 affine matrix, column-major
83
+ * @returns {Transform64}
84
+ */
85
+ static fromMatrix(m4: number[] | Float32Array | Float64Array | mat4): Transform64;
86
+ /**
87
+ * Build a transform from its JSON form, see {@link fromJSON}
88
+ * @param json
89
+ * @returns {Transform64}
90
+ */
91
+ static fromJSON(json: any): Transform64;
92
+ /**
93
+ * Arrays derived from a transform (`slice`, `subarray`, `map`, ...) are plain `Float64Array`s
94
+ * @returns {Float64ArrayConstructor}
95
+ */
96
+ static get [Symbol.species](): Float64ArrayConstructor;
97
+ constructor();
98
+ /**
99
+ * Affine transform matrix, column-major.
100
+ *
101
+ * Unlike {@link Transform}, this is not maintained for you - it holds whatever {@link updateMatrix},
102
+ * {@link fromMatrix} or {@link multiply} last wrote, and goes stale the moment you set a component.
103
+ *
104
+ * NOTE: the returned array is a live view over the transform's own buffer, but a freshly allocated
105
+ * view on every access. Hold on to it rather than reading this property in a loop, or index the
106
+ * transform itself - the matrix starts at element 0.
107
+ * @returns {Float64Array}
108
+ */
109
+ get matrix(): Float64Array;
110
+ /**
111
+ * Reads 3 elements, does not update {@link matrix}
112
+ * @param {number[]|Float32Array|Float64Array} v
113
+ */
114
+ set translation(arg: Float64Array);
115
+ /**
116
+ * Position in 3D space.
117
+ * NOTE: live view over the transform's own buffer, freshly allocated on every access
118
+ * @returns {Float64Array}
119
+ */
120
+ get translation(): Float64Array;
121
+ get translation_x(): number;
122
+ get translation_y(): number;
123
+ get translation_z(): number;
124
+ /**
125
+ * Does not update {@link matrix}
126
+ * @param {number} x
127
+ * @param {number} y
128
+ * @param {number} z
129
+ */
130
+ setTranslation(x: number, y: number, z: number): void;
131
+ /**
132
+ * Reads 4 elements, does not update {@link matrix}
133
+ * @param {number[]|Float32Array|Float64Array} q
134
+ */
135
+ set rotation(arg: Float64Array);
136
+ /**
137
+ * Orientation, as a quaternion (x, y, z, w).
138
+ * NOTE: live view over the transform's own buffer, freshly allocated on every access
139
+ * @returns {Float64Array}
140
+ */
141
+ get rotation(): Float64Array;
142
+ get rotation_x(): number;
143
+ get rotation_y(): number;
144
+ get rotation_z(): number;
145
+ get rotation_w(): number;
146
+ /**
147
+ * The quaternion is expected to be of unit length, nothing here normalizes it.
148
+ * Does not update {@link matrix}.
149
+ * @param {number} x
150
+ * @param {number} y
151
+ * @param {number} z
152
+ * @param {number} w
153
+ */
154
+ setRotation(x: number, y: number, z: number, w: number): void;
155
+ /**
156
+ * Reads 3 elements, does not update {@link matrix}
157
+ * @param {number[]|Float32Array|Float64Array} v
158
+ */
159
+ set scale(arg: Float64Array);
160
+ /**
161
+ * Size along each local axis.
162
+ * NOTE: live view over the transform's own buffer, freshly allocated on every access
163
+ * @returns {Float64Array}
164
+ */
165
+ get scale(): Float64Array;
166
+ get scale_x(): number;
167
+ get scale_y(): number;
168
+ get scale_z(): number;
169
+ /**
170
+ * Does not update {@link matrix}
171
+ * @param {number} x
172
+ * @param {number} y
173
+ * @param {number} z
174
+ */
175
+ setScale(x: number, y: number, z: number): void;
176
+ /**
177
+ * Uniform scale. Does not update {@link matrix}.
178
+ * @param {number} s
179
+ */
180
+ setScaleScalar(s: number): void;
181
+ /**
182
+ * Write {@link matrix} from the current {@link translation}, {@link rotation} and {@link scale}.
183
+ * Nothing calls this for you, and until you do, the matrix is whatever it was before.
184
+ */
185
+ updateMatrix(): void;
186
+ /**
187
+ * Write {@link translation}, {@link rotation} and {@link scale} from the current {@link matrix}.
188
+ * The inverse of {@link updateMatrix}; call it after writing the matrix in place.
189
+ *
190
+ * A matrix carrying shear cannot be described by a translation, a rotation and a scale, so shear is
191
+ * dropped from the components. It survives in {@link matrix} until the next {@link updateMatrix}.
192
+ */
193
+ updateComponents(): void;
194
+ /**
195
+ * Set the whole transform, matrix and components both, from an affine matrix.
196
+ * See {@link updateComponents} for how shear is handled.
197
+ * @param {number[]|Float32Array|Float64Array|mat4} m4 4x4 affine matrix, column-major
198
+ * @returns {this}
199
+ */
200
+ fromMatrix(m4: number[] | Float32Array | Float64Array | mat4): this;
201
+ /**
202
+ * Post-multiplication, `this = this * other`. See {@link multiplyTransforms}.
203
+ * @param {Transform64} other
204
+ * @returns {this}
205
+ */
206
+ multiply(other: Transform64): this;
207
+ /**
208
+ * Multiply two transforms, writing the result into this one. Either operand may be this transform.
209
+ *
210
+ * Both operands are read through their matrices, not their components, so a stale matrix on either
211
+ * side produces a stale result - {@link updateMatrix} them first if you have been setting components.
212
+ * Both the matrix and the components of the result are left up to date.
213
+ *
214
+ * @param {Transform64} a
215
+ * @param {Transform64} b
216
+ * @returns {this}
217
+ */
218
+ multiplyTransforms(a: Transform64, b: Transform64): this;
219
+ /**
220
+ * Reset to the identity transform, matrix included:
221
+ * - translation: [0,0,0]
222
+ * - rotation: [0,0,0,1]
223
+ * - scale: [1,1,1]
224
+ */
225
+ makeIdentity(): void;
226
+ 0: number;
227
+ 5: number;
228
+ 10: number;
229
+ 15: number;
230
+ /**
231
+ * Whether the translation is exactly [0,0,0], the rotation exactly [0,0,0,1] and the scale exactly
232
+ * [1,1,1]. Says nothing about {@link matrix}, which only agrees after an {@link updateMatrix}.
233
+ * @returns {boolean}
234
+ */
235
+ isIdentity(): boolean;
236
+ /**
237
+ * Set this transform to match `other`, matrix included. The `other` is left unchanged.
238
+ * @param {Transform64} other
239
+ */
240
+ copy(other: Transform64): void;
241
+ /**
242
+ * A new transform equal to this one
243
+ * @returns {Transform64}
244
+ */
245
+ clone(): Transform64;
246
+ /**
247
+ * Strict equality across the whole transform, {@link matrix} included. Two transforms whose components
248
+ * match but whose matrices do not - because one of them is stale - are not equal.
249
+ * @param {Transform64} other
250
+ * @returns {boolean}
251
+ */
252
+ equals(other: Transform64): boolean;
253
+ /**
254
+ * Only the translation contributes, for speed - in most applications it is what varies the most.
255
+ *
256
+ * This is weaker than {@link equals}: transforms differing only in rotation, scale or matrix collide.
257
+ * Legal for a hash, but a poor key if your set varies along those axes alone.
258
+ * @returns {number}
259
+ */
260
+ hash(): number;
261
+ /**
262
+ * Read the components from `{translation, rotation, scale}`, each of them optional and defaulting to
263
+ * identity. Composes {@link matrix} from the result.
264
+ *
265
+ * NOTE: the translation is keyed `translation`, where {@link Transform} keys the same thing
266
+ * `position`. The two JSON forms are not interchangeable.
267
+ * @param json
268
+ */
269
+ fromJSON(json: any): void;
270
+ /**
271
+ * Writes out the components only; {@link matrix} is recomposed from them on the way back in
272
+ * @returns {{translation:{x:number,y:number,z:number}, rotation:{x:number,y:number,z:number,w:number}, scale:{x:number,y:number,z:number}}}
273
+ */
274
+ toJSON(): {
275
+ translation: {
276
+ x: number;
277
+ y: number;
278
+ z: number;
279
+ };
280
+ rotation: {
281
+ x: number;
282
+ y: number;
283
+ z: number;
284
+ w: number;
285
+ };
286
+ scale: {
287
+ x: number;
288
+ y: number;
289
+ z: number;
290
+ };
291
+ };
292
+ /**
293
+ * Enables a fast type check, without having to import the class separately.
294
+ * @readonly
295
+ * @type {boolean}
296
+ * @example
297
+ * if(t.isTransform64){
298
+ * // t is a Transform64, do stuff
299
+ * }
300
+ */
301
+ readonly isTransform64: boolean;
302
+ }
303
+ export namespace Transform64 {
304
+ let typeName: string;
305
+ }
306
+ //# sourceMappingURL=Transform64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transform64.d.ts","sourceRoot":"","sources":["../../../../../src/engine/ecs/transform/Transform64.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wCAFU,MAAM,CAE2B;AAE3C;;;GAGG;AACH,6CAFU,MAAM,CAEiC;AAEjD;;;GAGG;AACH,0CAFU,MAAM,CAE8B;AAE9C;;;GAGG;AACH,uCAFU,MAAM,CAE2B;AAE3C;;;GAGG;AACH,+BAFU,MAAM,CAEmB;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH;IA2bI;;;;;;;;;;;;;OAaG;IACH,2BAZW,MAAM,iBACN,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