@dcl/ecs 1.0.0-20220601102612.commit-8b31ac4 → 1.0.0-2448628808.commit-1a55b7a

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 (99) hide show
  1. package/dist/index.d.ts +1676 -3
  2. package/dist/index.js +5815 -3
  3. package/dist/index.min.js +1 -0
  4. package/dist/index.min.js.map +1 -0
  5. package/package.json +8 -5
  6. package/dist/Math.d.ts +0 -2
  7. package/dist/Math.js +0 -2
  8. package/dist/built-in-types/ArrayType.d.ts +0 -5
  9. package/dist/built-in-types/ArrayType.js +0 -21
  10. package/dist/built-in-types/EcsType.d.ts +0 -8
  11. package/dist/built-in-types/EcsType.js +0 -1
  12. package/dist/built-in-types/MapType.d.ts +0 -18
  13. package/dist/built-in-types/MapType.js +0 -22
  14. package/dist/built-in-types/Optional.d.ts +0 -5
  15. package/dist/built-in-types/Optional.js +0 -22
  16. package/dist/built-in-types/basic/Boolean.d.ts +0 -5
  17. package/dist/built-in-types/basic/Boolean.js +0 -11
  18. package/dist/built-in-types/basic/Enum.d.ts +0 -5
  19. package/dist/built-in-types/basic/Enum.js +0 -13
  20. package/dist/built-in-types/basic/Float.d.ts +0 -9
  21. package/dist/built-in-types/basic/Float.js +0 -22
  22. package/dist/built-in-types/basic/Integer.d.ts +0 -17
  23. package/dist/built-in-types/basic/Integer.js +0 -44
  24. package/dist/built-in-types/basic/String.d.ts +0 -9
  25. package/dist/built-in-types/basic/String.js +0 -15
  26. package/dist/built-in-types/index.d.ts +0 -9
  27. package/dist/built-in-types/index.js +0 -9
  28. package/dist/built-in-types/typing.d.ts +0 -16
  29. package/dist/built-in-types/typing.js +0 -1
  30. package/dist/components/generated/AudioSource.d.ts +0 -1
  31. package/dist/components/generated/AudioSource.js +0 -19
  32. package/dist/components/generated/AudioStream.d.ts +0 -1
  33. package/dist/components/generated/AudioStream.js +0 -19
  34. package/dist/components/generated/BoxShape.d.ts +0 -1
  35. package/dist/components/generated/BoxShape.js +0 -19
  36. package/dist/components/generated/CylinderShape.d.ts +0 -1
  37. package/dist/components/generated/CylinderShape.js +0 -19
  38. package/dist/components/generated/PlaneShape.d.ts +0 -1
  39. package/dist/components/generated/PlaneShape.js +0 -19
  40. package/dist/components/generated/SphereShape.d.ts +0 -1
  41. package/dist/components/generated/SphereShape.js +0 -19
  42. package/dist/components/generated/index.d.ts +0 -9
  43. package/dist/components/generated/index.js +0 -16
  44. package/dist/components/generated/pb/AudioSource.d.ts +0 -8
  45. package/dist/components/generated/pb/AudioSource.js +0 -74
  46. package/dist/components/generated/pb/AudioStream.d.ts +0 -5
  47. package/dist/components/generated/pb/AudioStream.js +0 -49
  48. package/dist/components/generated/pb/BoxShape.d.ts +0 -6
  49. package/dist/components/generated/pb/BoxShape.js +0 -70
  50. package/dist/components/generated/pb/CylinderShape.d.ts +0 -7
  51. package/dist/components/generated/pb/CylinderShape.js +0 -67
  52. package/dist/components/generated/pb/PlaneShape.d.ts +0 -6
  53. package/dist/components/generated/pb/PlaneShape.js +0 -70
  54. package/dist/components/generated/pb/SphereShape.d.ts +0 -5
  55. package/dist/components/generated/pb/SphereShape.js +0 -49
  56. package/dist/components/index.d.ts +0 -15
  57. package/dist/components/index.js +0 -7
  58. package/dist/components/legacy/Transform.d.ts +0 -14
  59. package/dist/components/legacy/Transform.js +0 -28
  60. package/dist/components/legacy/index.d.ts +0 -11
  61. package/dist/components/legacy/index.js +0 -9
  62. package/dist/components/legacy/types.d.ts +0 -51
  63. package/dist/components/legacy/types.js +0 -53
  64. package/dist/components/types.d.ts +0 -3
  65. package/dist/components/types.js +0 -4
  66. package/dist/engine/component.d.ts +0 -34
  67. package/dist/engine/component.js +0 -98
  68. package/dist/engine/entity-utils.d.ts +0 -7
  69. package/dist/engine/entity-utils.js +0 -18
  70. package/dist/engine/entity.d.ts +0 -20
  71. package/dist/engine/entity.js +0 -75
  72. package/dist/engine/index.d.ts +0 -11
  73. package/dist/engine/index.js +0 -132
  74. package/dist/engine/types.d.ts +0 -34
  75. package/dist/engine/types.js +0 -1
  76. package/dist/engine/utils.d.ts +0 -4
  77. package/dist/engine/utils.js +0 -11
  78. package/dist/proto-definitions/AudioSource.proto +0 -16
  79. package/dist/proto-definitions/AudioStream.proto +0 -13
  80. package/dist/proto-definitions/BoxShape.proto +0 -14
  81. package/dist/proto-definitions/CylinderShape.proto +0 -15
  82. package/dist/proto-definitions/PlaneShape.proto +0 -14
  83. package/dist/proto-definitions/README.md +0 -0
  84. package/dist/proto-definitions/SphereShape.proto +0 -13
  85. package/dist/proto-definitions/Transform.md +0 -23
  86. package/dist/serialization/ByteBuffer/index.d.ts +0 -130
  87. package/dist/serialization/ByteBuffer/index.js +0 -281
  88. package/dist/serialization/crdt/componentOperation.d.ts +0 -25
  89. package/dist/serialization/crdt/componentOperation.js +0 -39
  90. package/dist/serialization/wireMessage.d.ts +0 -39
  91. package/dist/serialization/wireMessage.js +0 -53
  92. package/dist/systems/crdt/index.d.ts +0 -6
  93. package/dist/systems/crdt/index.js +0 -147
  94. package/dist/systems/crdt/transport.d.ts +0 -8
  95. package/dist/systems/crdt/transport.js +0 -21
  96. package/dist/systems/crdt/types.d.ts +0 -10
  97. package/dist/systems/crdt/types.js +0 -1
  98. package/dist/systems/crdt/utils.d.ts +0 -11
  99. package/dist/systems/crdt/utils.js +0 -51
package/dist/index.d.ts CHANGED
@@ -1,3 +1,1676 @@
1
- export * from './Math';
2
- export * from './engine';
3
- export * from './built-in-types';
1
+ /**
2
+ * @public
3
+ */
4
+ export declare function ArrayType<T>(type: EcsType<T>): EcsType<Array<T>>;
5
+
6
+ /**
7
+ * @public
8
+ */
9
+ export declare type ByteBuffer = ReturnType<typeof createByteBuffer>;
10
+
11
+ /**
12
+ * @public
13
+ */
14
+ export declare type ComponentDefinition<T extends EcsType = EcsType<any>> = {
15
+ _id: number;
16
+ has(entity: Entity): boolean;
17
+ getFrom(entity: Entity): DeepReadonly<ComponentType<T>>;
18
+ getOrNull(entity: Entity): DeepReadonly<ComponentType<T>> | null;
19
+ create(entity: Entity, val: ComponentType<T>): ComponentType<T>;
20
+ mutable(entity: Entity): ComponentType<T>;
21
+ createOrReplace(entity: Entity, val: ComponentType<T>): ComponentType<T>;
22
+ deleteFrom(entity: Entity): ComponentType<T> | null;
23
+ upsertFromBinary(entity: Entity, data: ByteBuffer): ComponentType<T> | null;
24
+ updateFromBinary(entity: Entity, data: ByteBuffer): ComponentType<T> | null;
25
+ toBinary(entity: Entity): ByteBuffer;
26
+ writeToByteBuffer(entity: Entity, buffer: ByteBuffer): void;
27
+ iterator(): Iterable<[Entity, ComponentType<T>]>;
28
+ dirtyIterator(): Iterable<Entity>;
29
+ clearDirty(): void;
30
+ isDirty(entity: Entity): boolean;
31
+ };
32
+
33
+ /**
34
+ * @public
35
+ */
36
+ export declare type ComponentEcsType<T extends [ComponentDefinition, ...ComponentDefinition[]]> = {
37
+ [K in keyof T]: T[K] extends ComponentDefinition ? ReturnType<T[K]['mutable']> : never;
38
+ };
39
+
40
+ /**
41
+ * @public
42
+ */
43
+ export declare type ComponentType<T extends EcsType> = EcsResult<T>;
44
+
45
+ /**
46
+ * ByteBuffer is a wrapper of DataView which also adds a read and write offset.
47
+ * Also in a write operation it resizes the buffer is being used if it needs.
48
+ *
49
+ * - Use read and write function to generate or consume data.
50
+ * - Use set and get only if you are sure that you're doing.
51
+ */
52
+ declare function createByteBuffer(options?: CreateByteBufferOptions): {
53
+ /**
54
+ * @returns The entire current Uint8Array.
55
+ *
56
+ * WARNING: if the buffer grows, the view had changed itself,
57
+ * and the reference will be a invalid one.
58
+ */
59
+ buffer(): Uint8Array;
60
+ /**
61
+ * @returns The capacity of the current buffer
62
+ */
63
+ bufferLength(): number;
64
+ /**
65
+ * Resets byteBuffer to avoid creating a new one
66
+ */
67
+ resetBuffer(): void;
68
+ /**
69
+ * @returns The current read offset
70
+ */
71
+ currentReadOffset(): number;
72
+ /**
73
+ * @returns The current write offset
74
+ */
75
+ currentWriteOffset(): number;
76
+ /**
77
+ * Reading purpose
78
+ * Returns the previuos offsset size before incrementing
79
+ */
80
+ incrementReadOffset(amount: number): number;
81
+ /**
82
+ * @returns How many bytes are available to read.
83
+ */
84
+ remainingBytes(): number;
85
+ readFloat32(): number;
86
+ readFloat64(): number;
87
+ readInt8(): number;
88
+ readInt16(): number;
89
+ readInt32(): number;
90
+ readInt64(): bigint;
91
+ readUint8(): number;
92
+ readUint16(): number;
93
+ readUint32(): number;
94
+ readUint64(): bigint;
95
+ readBuffer(): Uint8Array;
96
+ /**
97
+ * Writing purpose
98
+ */
99
+ /**
100
+ * Increment offset
101
+ * @param amount - how many bytes
102
+ * @returns The offset when this reserving starts.
103
+ */
104
+ incrementWriteOffset(amount: number): number;
105
+ /**
106
+ * @returns The total number of bytes writen in the buffer.
107
+ */
108
+ size(): number;
109
+ /**
110
+ * @returns The subarray from 0 to offset.
111
+ */
112
+ toBinary(): Uint8Array;
113
+ writeBuffer(value: Uint8Array, writeLength?: boolean): void;
114
+ writeFloat32(value: number): void;
115
+ writeFloat64(value: number): void;
116
+ writeInt8(value: number): void;
117
+ writeInt16(value: number): void;
118
+ writeInt32(value: number): void;
119
+ writeInt64(value: bigint): void;
120
+ writeUint8(value: number): void;
121
+ writeUint16(value: number): void;
122
+ writeUint32(value: number): void;
123
+ writeUint64(value: bigint): void;
124
+ getFloat32(offset: number): number;
125
+ getFloat64(offset: number): number;
126
+ getInt8(offset: number): number;
127
+ getInt16(offset: number): number;
128
+ getInt32(offset: number): number;
129
+ getInt64(offset: number): bigint;
130
+ getUint8(offset: number): number;
131
+ getUint16(offset: number): number;
132
+ getUint32(offset: number): number;
133
+ getUint64(offset: number): bigint;
134
+ setFloat32(offset: number, value: number): void;
135
+ setFloat64(offset: number, value: number): void;
136
+ setInt8(offset: number, value: number): void;
137
+ setInt16(offset: number, value: number): void;
138
+ setInt32(offset: number, value: number): void;
139
+ setInt64(offset: number, value: bigint): void;
140
+ setUint8(offset: number, value: number): void;
141
+ setUint16(offset: number, value: number): void;
142
+ setUint32(offset: number, value: number): void;
143
+ setUint64(offset: number, value: bigint): void;
144
+ };
145
+
146
+ /**
147
+ * @param writing - writing option, see object specs.
148
+ * @param reading - reading option, see object specs.
149
+ * @param initialCapacity - Initial capacity of buffer to allocate, ignored if you use writing or reading options
150
+ */
151
+ declare interface CreateByteBufferOptions {
152
+ /**
153
+ * @param buffer - a buffer already allocated to read from there.
154
+ * @param currentOffset - set the cursor where begins to read. Default 0
155
+ * @param length - delimite where the valid data ends. Default: buffer.length
156
+ */
157
+ reading?: {
158
+ buffer: Uint8Array;
159
+ length?: number;
160
+ currentOffset: number;
161
+ };
162
+ /**
163
+ * @param buffer - a buffer already allocated to write there.
164
+ * @param currentOffset - set the cursor to not start writing from the begin of it. Default 0
165
+ */
166
+ writing?: {
167
+ buffer: Uint8Array;
168
+ currentOffset?: number;
169
+ };
170
+ initialCapacity?: number;
171
+ }
172
+
173
+ /**
174
+ * Make each field readonly deeply
175
+ * @public
176
+ */
177
+ export declare type DeepReadonly<T> = {
178
+ readonly [P in keyof T]: DeepReadonly<T[P]>;
179
+ };
180
+
181
+ declare function defineSdkComponents(engine: Pick<IEngine, 'defineComponent'>): {
182
+ AudioSource: ComponentDefinition<EcsType<PBAudioSource>>;
183
+ AudioStream: ComponentDefinition<EcsType<PBAudioStream>>;
184
+ BoxShape: ComponentDefinition<EcsType<PBBoxShape>>;
185
+ CylinderShape: ComponentDefinition<EcsType<PBCylinderShape>>;
186
+ PlaneShape: ComponentDefinition<EcsType<PBPlaneShape>>;
187
+ SphereShape: ComponentDefinition<EcsType<PBSphereShape>>;
188
+ Transform: ComponentDefinition<EcsType<Transform>>;
189
+ };
190
+
191
+ /**
192
+ * Constant used to convert from Euler degrees to radians
193
+ * @public
194
+ */
195
+ export declare const DEG2RAD: number;
196
+
197
+ /** @public */
198
+ export declare type double = number;
199
+
200
+ /**
201
+ * @public
202
+ */
203
+ export declare const EcsBoolean: EcsType<boolean>;
204
+
205
+ /**
206
+ * @public
207
+ */
208
+ declare type EcsResult<T extends EcsType> = T extends EcsType ? ReturnType<T['deserialize']> : never;
209
+
210
+ /**
211
+ * @public
212
+ */
213
+ export declare const EcsString: EcsType<string>;
214
+
215
+ /**
216
+ * @public
217
+ */
218
+ export declare type EcsType<T = any> = {
219
+ serialize(value: T, builder: ByteBuffer): void;
220
+ deserialize(reader: ByteBuffer): T;
221
+ };
222
+
223
+ /**
224
+ * @public
225
+ */
226
+ export declare function Engine(): IEngine;
227
+
228
+ /**
229
+ * @public
230
+ */
231
+ export declare type Entity = number & {
232
+ [entitySymbol]: true;
233
+ };
234
+
235
+ declare const entitySymbol: unique symbol;
236
+
237
+ /**
238
+ * @public
239
+ */
240
+ export declare function Enum<T>(type: EcsType<any>): EcsType<T>;
241
+
242
+ /**
243
+ * Constant used to define the minimal number value in Babylon.js
244
+ * @public
245
+ */
246
+ export declare const Epsilon = 0.000001;
247
+
248
+ /** Excludes property keys from T where the property is assignable to U */
249
+ declare type ExcludeUndefined<T> = {
250
+ [P in keyof T]: undefined extends T[P] ? never : P;
251
+ }[keyof T];
252
+
253
+ /**
254
+ * @public
255
+ */
256
+ export declare const FlatString: EcsType<string>;
257
+
258
+ /** @public */
259
+ export declare type float = number;
260
+
261
+ /**
262
+ * @public
263
+ */
264
+ export declare const Float32: EcsType<number>;
265
+
266
+ /**
267
+ * @public
268
+ */
269
+ export declare const Float64: EcsType<number>;
270
+
271
+ /** @public */
272
+ export declare type FloatArray = number[];
273
+
274
+ /**
275
+ * @public
276
+ */
277
+ export declare type IEngine = {
278
+ addEntity(dynamic?: boolean): Entity;
279
+ addDynamicEntity(): Entity;
280
+ removeEntity(entity: Entity): void;
281
+ addSystem(system: Update): void;
282
+ defineComponent<T extends EcsType>(componentId: number, spec: T): ComponentDefinition<T>;
283
+ mutableGroupOf<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...ComponentEcsType<T>]>;
284
+ groupOf<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...DeepReadonly<ComponentEcsType<T>>]>;
285
+ getComponent<T extends EcsType>(componentId: number): ComponentDefinition<T>;
286
+ update(dt: number): void;
287
+ baseComponents: SdkComponetns;
288
+ };
289
+
290
+ /** Include property keys from T where the property is assignable to U */
291
+ declare type IncludeUndefined<T> = {
292
+ [P in keyof T]: undefined extends T[P] ? P : never;
293
+ }[keyof T];
294
+
295
+ /**
296
+ * @public
297
+ */
298
+ export declare const Int16: EcsType<number>;
299
+
300
+ /**
301
+ * @public
302
+ */
303
+ export declare const Int32: EcsType<number>;
304
+
305
+ /**
306
+ * @public
307
+ */
308
+ export declare const Int64: EcsType<number>;
309
+
310
+ /**
311
+ * @public
312
+ */
313
+ export declare const Int8: EcsType<number>;
314
+
315
+ /**
316
+ * Interface for the size containing width and height
317
+ * @public
318
+ */
319
+ export declare interface ISize {
320
+ /**
321
+ * Width
322
+ */
323
+ width: number;
324
+ /**
325
+ * Heighht
326
+ */
327
+ height: number;
328
+ }
329
+
330
+ /**
331
+ * @public
332
+ */
333
+ export declare function MapType<T extends Spec>(spec: T): EcsType<Result<T>>;
334
+
335
+ /**
336
+ * Class used to store matrix data (4x4)
337
+ * @public
338
+ */
339
+ declare namespace Matrix {
340
+ type Matrix4x4 = [
341
+ number,
342
+ number,
343
+ number,
344
+ number,
345
+ number,
346
+ number,
347
+ number,
348
+ number,
349
+ number,
350
+ number,
351
+ number,
352
+ number,
353
+ number,
354
+ number,
355
+ number,
356
+ number
357
+ ];
358
+ type MutableMatrix = {
359
+ /**
360
+ * Gets the update flag of the matrix which is an unique number for the matrix.
361
+ * It will be incremented every time the matrix data change.
362
+ * You can use it to speed the comparison between two versions of the same matrix.
363
+ */
364
+ updateFlag: number;
365
+ isIdentity: boolean;
366
+ isIdentity3x2: boolean;
367
+ _isIdentityDirty: boolean;
368
+ _isIdentity3x2Dirty: boolean;
369
+ _m: Matrix4x4;
370
+ };
371
+ type ReadonlyMatrix = DeepReadonly<MutableMatrix>;
372
+ /**
373
+ * Gets the internal data of the matrix
374
+ */
375
+ function m(self: MutableMatrix): Readonly<Matrix4x4>;
376
+ /**
377
+ * Gets an identity matrix that must not be updated
378
+ */
379
+ function IdentityReadOnly(): ReadonlyMatrix;
380
+ /**
381
+ * Creates an empty matrix (filled with zeros)
382
+ */
383
+ function create(): MutableMatrix;
384
+ /**
385
+ * Creates a matrix from an array
386
+ * @param array - defines the source array
387
+ * @param offset - defines an offset in the source array
388
+ * @returns a new Matrix set from the starting index of the given array
389
+ */
390
+ function fromArray(array: ArrayLike<number>, offset?: number): MutableMatrix;
391
+ /**
392
+ * Copy the content of an array into a given matrix
393
+ * @param array - defines the source array
394
+ * @param offset - defines an offset in the source array
395
+ * @param result - defines the target matrix
396
+ */
397
+ function fromArrayToRef(array: ArrayLike<number>, offset: number, result: MutableMatrix): void;
398
+ /**
399
+ * Stores an array into a matrix after having multiplied each component by a given factor
400
+ * @param array - defines the source array
401
+ * @param offset - defines the offset in the source array
402
+ * @param scale - defines the scaling factor
403
+ * @param result - defines the target matrix
404
+ */
405
+ function fromFloatArrayToRefScaled(array: FloatArray, offset: number, scale: number, result: MutableMatrix): void;
406
+ /**
407
+ * Stores a list of values (16) inside a given matrix
408
+ * @param initialM11 - defines 1st value of 1st row
409
+ * @param initialM12 - defines 2nd value of 1st row
410
+ * @param initialM13 - defines 3rd value of 1st row
411
+ * @param initialM14 - defines 4th value of 1st row
412
+ * @param initialM21 - defines 1st value of 2nd row
413
+ * @param initialM22 - defines 2nd value of 2nd row
414
+ * @param initialM23 - defines 3rd value of 2nd row
415
+ * @param initialM24 - defines 4th value of 2nd row
416
+ * @param initialM31 - defines 1st value of 3rd row
417
+ * @param initialM32 - defines 2nd value of 3rd row
418
+ * @param initialM33 - defines 3rd value of 3rd row
419
+ * @param initialM34 - defines 4th value of 3rd row
420
+ * @param initialM41 - defines 1st value of 4th row
421
+ * @param initialM42 - defines 2nd value of 4th row
422
+ * @param initialM43 - defines 3rd value of 4th row
423
+ * @param initialM44 - defines 4th value of 4th row
424
+ * @param result - defines the target matrix
425
+ */
426
+ function fromValuesToRef(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number, result: MutableMatrix): void;
427
+ /**
428
+ * Creates new matrix from a list of values (16)
429
+ * @param initialM11 - defines 1st value of 1st row
430
+ * @param initialM12 - defines 2nd value of 1st row
431
+ * @param initialM13 - defines 3rd value of 1st row
432
+ * @param initialM14 - defines 4th value of 1st row
433
+ * @param initialM21 - defines 1st value of 2nd row
434
+ * @param initialM22 - defines 2nd value of 2nd row
435
+ * @param initialM23 - defines 3rd value of 2nd row
436
+ * @param initialM24 - defines 4th value of 2nd row
437
+ * @param initialM31 - defines 1st value of 3rd row
438
+ * @param initialM32 - defines 2nd value of 3rd row
439
+ * @param initialM33 - defines 3rd value of 3rd row
440
+ * @param initialM34 - defines 4th value of 3rd row
441
+ * @param initialM41 - defines 1st value of 4th row
442
+ * @param initialM42 - defines 2nd value of 4th row
443
+ * @param initialM43 - defines 3rd value of 4th row
444
+ * @param initialM44 - defines 4th value of 4th row
445
+ * @returns the new matrix
446
+ */
447
+ function fromValues(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number): MutableMatrix;
448
+ /**
449
+ * Creates a new matrix composed by merging scale (vector3), rotation (quaternion) and translation (vector3)
450
+ * @param scale - defines the scale vector3
451
+ * @param rotation - defines the rotation quaternion
452
+ * @param translation - defines the translation vector3
453
+ * @returns a new matrix
454
+ */
455
+ function compose(scale: Vector3.ReadonlyVector3, rotation: Quaternion.ReadonlyQuaternion, translation: Vector3.ReadonlyVector3): MutableMatrix;
456
+ /**
457
+ * Sets a matrix to a value composed by merging scale (vector3), rotation (quaternion) and translation (vector3)
458
+ * @param scale - defines the scale vector3
459
+ * @param rotation - defines the rotation quaternion
460
+ * @param translation - defines the translation vector3
461
+ * @param result - defines the target matrix
462
+ */
463
+ function composeToRef(scale: Vector3.ReadonlyVector3, rotation: Quaternion.ReadonlyQuaternion, translation: Vector3.ReadonlyVector3, result: MutableMatrix): void;
464
+ /**
465
+ * Creates a new identity matrix
466
+ * @returns a new identity matrix
467
+ */
468
+ function Identity(): MutableMatrix;
469
+ /**
470
+ * Creates a new identity matrix and stores the result in a given matrix
471
+ * @param result - defines the target matrix
472
+ */
473
+ function IdentityToRef(result: MutableMatrix): void;
474
+ /**
475
+ * Creates a new zero matrix
476
+ * @returns a new zero matrix
477
+ */
478
+ function Zero(): MutableMatrix;
479
+ /**
480
+ * Creates a new rotation matrix for "angle" radians around the X axis
481
+ * @param angle - defines the angle (in radians) to use
482
+ * @returns the new matrix
483
+ */
484
+ function RotationX(angle: number): MutableMatrix;
485
+ /**
486
+ * Creates a new rotation matrix for "angle" radians around the X axis and stores it in a given matrix
487
+ * @param angle - defines the angle (in radians) to use
488
+ * @param result - defines the target matrix
489
+ */
490
+ function rotationXToRef(angle: number, result: MutableMatrix): void;
491
+ /**
492
+ * Creates a new rotation matrix for "angle" radians around the Y axis
493
+ * @param angle - defines the angle (in radians) to use
494
+ * @returns the new matrix
495
+ */
496
+ function rotationY(angle: number): MutableMatrix;
497
+ /**
498
+ * Creates a new rotation matrix for "angle" radians around the Y axis and stores it in a given matrix
499
+ * @param angle - defines the angle (in radians) to use
500
+ * @param result - defines the target matrix
501
+ */
502
+ function rotationYToRef(angle: number, result: MutableMatrix): void;
503
+ /**
504
+ * Creates a new rotation matrix for "angle" radians around the Z axis
505
+ * @param angle - defines the angle (in radians) to use
506
+ * @returns the new matrix
507
+ */
508
+ function rotationZ(angle: number): MutableMatrix;
509
+ /**
510
+ * Creates a new rotation matrix for "angle" radians around the Z axis and stores it in a given matrix
511
+ * @param angle - defines the angle (in radians) to use
512
+ * @param result - defines the target matrix
513
+ */
514
+ function rotationZToRef(angle: number, result: MutableMatrix): void;
515
+ /**
516
+ * Creates a new rotation matrix for "angle" radians around the given axis
517
+ * @param axis - defines the axis to use
518
+ * @param angle - defines the angle (in radians) to use
519
+ * @returns the new matrix
520
+ */
521
+ function rotationAxis(axis: Vector3.ReadonlyVector3, angle: number): MutableMatrix;
522
+ /**
523
+ * Creates a new rotation matrix for "angle" radians around the given axis and stores it in a given matrix
524
+ * @param axis - defines the axis to use
525
+ * @param angle - defines the angle (in radians) to use
526
+ * @param result - defines the target matrix
527
+ */
528
+ function rotationAxisToRef(_axis: Vector3.ReadonlyVector3, angle: number, result: MutableMatrix): void;
529
+ /**
530
+ * Creates a rotation matrix
531
+ * @param yaw - defines the yaw angle in radians (Y axis)
532
+ * @param pitch - defines the pitch angle in radians (X axis)
533
+ * @param roll - defines the roll angle in radians (X axis)
534
+ * @returns the new rotation matrix
535
+ */
536
+ function rotationYawPitchRoll(yaw: number, pitch: number, roll: number): MutableMatrix;
537
+ /**
538
+ * Creates a rotation matrix and stores it in a given matrix
539
+ * @param yaw - defines the yaw angle in radians (Y axis)
540
+ * @param pitch - defines the pitch angle in radians (X axis)
541
+ * @param roll - defines the roll angle in radians (X axis)
542
+ * @param result - defines the target matrix
543
+ */
544
+ function rotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: MutableMatrix): void;
545
+ /**
546
+ * Creates a scaling matrix
547
+ * @param x - defines the scale factor on X axis
548
+ * @param y - defines the scale factor on Y axis
549
+ * @param z - defines the scale factor on Z axis
550
+ * @returns the new matrix
551
+ */
552
+ function scaling(x: number, y: number, z: number): MutableMatrix;
553
+ /**
554
+ * Creates a scaling matrix and stores it in a given matrix
555
+ * @param x - defines the scale factor on X axis
556
+ * @param y - defines the scale factor on Y axis
557
+ * @param z - defines the scale factor on Z axis
558
+ * @param result - defines the target matrix
559
+ */
560
+ function scalingToRef(x: number, y: number, z: number, result: MutableMatrix): void;
561
+ /**
562
+ * Creates a translation matrix
563
+ * @param x - defines the translation on X axis
564
+ * @param y - defines the translation on Y axis
565
+ * @param z - defines the translationon Z axis
566
+ * @returns the new matrix
567
+ */
568
+ function translation(x: number, y: number, z: number): MutableMatrix;
569
+ /**
570
+ * Creates a translation matrix and stores it in a given matrix
571
+ * @param x - defines the translation on X axis
572
+ * @param y - defines the translation on Y axis
573
+ * @param z - defines the translationon Z axis
574
+ * @param result - defines the target matrix
575
+ */
576
+ function translationToRef(x: number, y: number, z: number, result: MutableMatrix): void;
577
+ /**
578
+ * Returns a new Matrix whose values are the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
579
+ * @param startValue - defines the start value
580
+ * @param endValue - defines the end value
581
+ * @param gradient - defines the gradient factor
582
+ * @returns the new matrix
583
+ */
584
+ function lerp(startValue: ReadonlyMatrix, endValue: ReadonlyMatrix, gradient: number): MutableMatrix;
585
+ /**
586
+ * Set the given matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
587
+ * @param startValue - defines the start value
588
+ * @param endValue - defines the end value
589
+ * @param gradient - defines the gradient factor
590
+ * @param result - defines the Matrix object where to store data
591
+ */
592
+ function lerpToRef(startValue: ReadonlyMatrix, endValue: ReadonlyMatrix, gradient: number, result: MutableMatrix): void;
593
+ /**
594
+ * Builds a new matrix whose values are computed by:
595
+ * * decomposing the the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
596
+ * * interpolating for "gradient" (float) the values between each of these decomposed matrices between the start and the end
597
+ * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices
598
+ * @param startValue - defines the first matrix
599
+ * @param endValue - defines the second matrix
600
+ * @param gradient - defines the gradient between the two matrices
601
+ * @returns the new matrix
602
+ */
603
+ function decomposeLerp(startValue: ReadonlyMatrix, endValue: ReadonlyMatrix, gradient: number): MutableMatrix;
604
+ /**
605
+ * Update a matrix to values which are computed by:
606
+ * * decomposing the the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
607
+ * * interpolating for "gradient" (float) the values between each of these decomposed matrices between the start and the end
608
+ * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices
609
+ * @param startValue - defines the first matrix
610
+ * @param endValue - defines the second matrix
611
+ * @param gradient - defines the gradient between the two matrices
612
+ * @param result - defines the target matrix
613
+ */
614
+ function decomposeLerpToRef(startValue: ReadonlyMatrix, endValue: ReadonlyMatrix, gradient: number, result: MutableMatrix): void;
615
+ /**
616
+ * Gets a new rotation matrix used to rotate an entity so as it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up"
617
+ * self function works in left handed mode
618
+ * @param eye - defines the final position of the entity
619
+ * @param target - defines where the entity should look at
620
+ * @param up - defines the up vector for the entity
621
+ * @returns the new matrix
622
+ */
623
+ function LookAtLH(eye: Vector3.ReadonlyVector3, target: Vector3.ReadonlyVector3, up: Vector3.ReadonlyVector3): MutableMatrix;
624
+ /**
625
+ * Sets the given "result" Matrix to a rotation matrix used to rotate an entity so that it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up".
626
+ * self function works in left handed mode
627
+ * @param eye - defines the final position of the entity
628
+ * @param target - defines where the entity should look at
629
+ * @param up - defines the up vector for the entity
630
+ * @param result - defines the target matrix
631
+ */
632
+ function lookAtLHToRef(eye: Vector3.ReadonlyVector3, target: Vector3.ReadonlyVector3, up: Vector3.ReadonlyVector3, result: MutableMatrix): void;
633
+ /**
634
+ * Gets a new rotation matrix used to rotate an entity so as it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up"
635
+ * self function works in right handed mode
636
+ * @param eye - defines the final position of the entity
637
+ * @param target - defines where the entity should look at
638
+ * @param up - defines the up vector for the entity
639
+ * @returns the new matrix
640
+ */
641
+ function lookAtRH(eye: Vector3.ReadonlyVector3, target: Vector3.ReadonlyVector3, up: Vector3.ReadonlyVector3): MutableMatrix;
642
+ /**
643
+ * Sets the given "result" Matrix to a rotation matrix used to rotate an entity so that it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up".
644
+ * self function works in right handed mode
645
+ * @param eye - defines the final position of the entity
646
+ * @param target - defines where the entity should look at
647
+ * @param up - defines the up vector for the entity
648
+ * @param result - defines the target matrix
649
+ */
650
+ function lookAtRHToRef(eye: Vector3.ReadonlyVector3, target: Vector3.ReadonlyVector3, up: Vector3.ReadonlyVector3, result: MutableMatrix): void;
651
+ /**
652
+ * Create a left-handed orthographic projection matrix
653
+ * @param width - defines the viewport width
654
+ * @param height - defines the viewport height
655
+ * @param znear - defines the near clip plane
656
+ * @param zfar - defines the far clip plane
657
+ * @returns a new matrix as a left-handed orthographic projection matrix
658
+ */
659
+ function orthoLH(width: number, height: number, znear: number, zfar: number): MutableMatrix;
660
+ /**
661
+ * Store a left-handed orthographic projection to a given matrix
662
+ * @param width - defines the viewport width
663
+ * @param height - defines the viewport height
664
+ * @param znear - defines the near clip plane
665
+ * @param zfar - defines the far clip plane
666
+ * @param result - defines the target matrix
667
+ */
668
+ function orthoLHToRef(width: number, height: number, znear: number, zfar: number, result: MutableMatrix): void;
669
+ /**
670
+ * Create a left-handed orthographic projection matrix
671
+ * @param left - defines the viewport left coordinate
672
+ * @param right - defines the viewport right coordinate
673
+ * @param bottom - defines the viewport bottom coordinate
674
+ * @param top - defines the viewport top coordinate
675
+ * @param znear - defines the near clip plane
676
+ * @param zfar - defines the far clip plane
677
+ * @returns a new matrix as a left-handed orthographic projection matrix
678
+ */
679
+ function OrthoOffCenterLH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number): MutableMatrix;
680
+ /**
681
+ * Stores a left-handed orthographic projection into a given matrix
682
+ * @param left - defines the viewport left coordinate
683
+ * @param right - defines the viewport right coordinate
684
+ * @param bottom - defines the viewport bottom coordinate
685
+ * @param top - defines the viewport top coordinate
686
+ * @param znear - defines the near clip plane
687
+ * @param zfar - defines the far clip plane
688
+ * @param result - defines the target matrix
689
+ */
690
+ function orthoOffCenterLHToRef(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: MutableMatrix): void;
691
+ /**
692
+ * Creates a right-handed orthographic projection matrix
693
+ * @param left - defines the viewport left coordinate
694
+ * @param right - defines the viewport right coordinate
695
+ * @param bottom - defines the viewport bottom coordinate
696
+ * @param top - defines the viewport top coordinate
697
+ * @param znear - defines the near clip plane
698
+ * @param zfar - defines the far clip plane
699
+ * @returns a new matrix as a right-handed orthographic projection matrix
700
+ */
701
+ function orthoOffCenterRH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number): MutableMatrix;
702
+ /**
703
+ * Stores a right-handed orthographic projection into a given matrix
704
+ * @param left - defines the viewport left coordinate
705
+ * @param right - defines the viewport right coordinate
706
+ * @param bottom - defines the viewport bottom coordinate
707
+ * @param top - defines the viewport top coordinate
708
+ * @param znear - defines the near clip plane
709
+ * @param zfar - defines the far clip plane
710
+ * @param result - defines the target matrix
711
+ */
712
+ function orthoOffCenterRHToRef(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: MutableMatrix): void;
713
+ /**
714
+ * Creates a left-handed perspective projection matrix
715
+ * @param width - defines the viewport width
716
+ * @param height - defines the viewport height
717
+ * @param znear - defines the near clip plane
718
+ * @param zfar - defines the far clip plane
719
+ * @returns a new matrix as a left-handed perspective projection matrix
720
+ */
721
+ function perspectiveLH(width: number, height: number, znear: number, zfar: number): MutableMatrix;
722
+ /**
723
+ * Creates a left-handed perspective projection matrix
724
+ * @param fov - defines the horizontal field of view
725
+ * @param aspect - defines the aspect ratio
726
+ * @param znear - defines the near clip plane
727
+ * @param zfar - defines the far clip plane
728
+ * @returns a new matrix as a left-handed perspective projection matrix
729
+ */
730
+ function perspectiveFovLH(fov: number, aspect: number, znear: number, zfar: number): MutableMatrix;
731
+ /**
732
+ * Stores a left-handed perspective projection into a given matrix
733
+ * @param fov - defines the horizontal field of view
734
+ * @param aspect - defines the aspect ratio
735
+ * @param znear - defines the near clip plane
736
+ * @param zfar - defines the far clip plane
737
+ * @param result - defines the target matrix
738
+ * @param isVerticalFovFixed - defines it the fov is vertically fixed (default) or horizontally
739
+ */
740
+ function perspectiveFovLHToRef(fov: number, aspect: number, znear: number, zfar: number, result: MutableMatrix, isVerticalFovFixed?: boolean): void;
741
+ /**
742
+ * Creates a right-handed perspective projection matrix
743
+ * @param fov - defines the horizontal field of view
744
+ * @param aspect - defines the aspect ratio
745
+ * @param znear - defines the near clip plane
746
+ * @param zfar - defines the far clip plane
747
+ * @returns a new matrix as a right-handed perspective projection matrix
748
+ */
749
+ function PerspectiveFovRH(fov: number, aspect: number, znear: number, zfar: number): MutableMatrix;
750
+ /**
751
+ * Stores a right-handed perspective projection into a given matrix
752
+ * @param fov - defines the horizontal field of view
753
+ * @param aspect - defines the aspect ratio
754
+ * @param znear - defines the near clip plane
755
+ * @param zfar - defines the far clip plane
756
+ * @param result - defines the target matrix
757
+ * @param isVerticalFovFixed - defines it the fov is vertically fixed (default) or horizontally
758
+ */
759
+ function perspectiveFovRHToRef(fov: number, aspect: number, znear: number, zfar: number, result: MutableMatrix, isVerticalFovFixed?: boolean): void;
760
+ /**
761
+ * Stores a perspective projection for WebVR info a given matrix
762
+ * @param fov - defines the field of view
763
+ * @param znear - defines the near clip plane
764
+ * @param zfar - defines the far clip plane
765
+ * @param result - defines the target matrix
766
+ * @param rightHanded - defines if the matrix must be in right-handed mode (false by default)
767
+ */
768
+ function perspectiveFovWebVRToRef(fov: {
769
+ upDegrees: number;
770
+ downDegrees: number;
771
+ leftDegrees: number;
772
+ rightDegrees: number;
773
+ }, znear: number, zfar: number, result: MutableMatrix, rightHanded?: boolean): void;
774
+ /**
775
+ * Extracts a 2x2 matrix from a given matrix and store the result in a FloatArray
776
+ * @param matrix - defines the matrix to use
777
+ * @returns a new FloatArray array with 4 elements : the 2x2 matrix extracted from the given matrix
778
+ */
779
+ function GetAsMatrix2x2(matrix: ReadonlyMatrix): FloatArray;
780
+ /**
781
+ * Extracts a 3x3 matrix from a given matrix and store the result in a FloatArray
782
+ * @param matrix - defines the matrix to use
783
+ * @returns a new FloatArray array with 9 elements : the 3x3 matrix extracted from the given matrix
784
+ */
785
+ function GetAsMatrix3x3(matrix: ReadonlyMatrix): FloatArray;
786
+ /**
787
+ * Compute the transpose of a given matrix
788
+ * @param matrix - defines the matrix to transpose
789
+ * @returns the new matrix
790
+ */
791
+ function transpose(matrix: ReadonlyMatrix): MutableMatrix;
792
+ /**
793
+ * Compute the transpose of a matrix and store it in a target matrix
794
+ * @param matrix - defines the matrix to transpose
795
+ * @param result - defines the target matrix
796
+ */
797
+ function transposeToRef(matrix: ReadonlyMatrix, result: MutableMatrix): void;
798
+ /**
799
+ * Computes a reflection matrix from a plane
800
+ * @param plane - defines the reflection plane
801
+ * @returns a new matrix
802
+ */
803
+ function reflection(plane: Plane.ReadonlyPlane): MutableMatrix;
804
+ /**
805
+ * Computes a reflection matrix from a plane
806
+ * @param plane - defines the reflection plane
807
+ * @param result - defines the target matrix
808
+ */
809
+ function reflectionToRef(_plane: Plane.ReadonlyPlane, result: MutableMatrix): void;
810
+ /**
811
+ * Sets the given matrix as a rotation matrix composed from the 3 left handed axes
812
+ * @param xaxis - defines the value of the 1st axis
813
+ * @param yaxis - defines the value of the 2nd axis
814
+ * @param zaxis - defines the value of the 3rd axis
815
+ * @param result - defines the target matrix
816
+ */
817
+ function fromXYZAxesToRef(xaxis: Vector3.ReadonlyVector3, yaxis: Vector3.ReadonlyVector3, zaxis: Vector3.ReadonlyVector3, result: MutableMatrix): void;
818
+ /**
819
+ * Creates a rotation matrix from a quaternion and stores it in a target matrix
820
+ * @param quat - defines the quaternion to use
821
+ * @param result - defines the target matrix
822
+ */
823
+ function fromQuaternionToRef(quat: Quaternion.ReadonlyQuaternion, result: MutableMatrix): void;
824
+ /**
825
+ * Check if the current matrix is identity
826
+ * @returns true is the matrix is the identity matrix
827
+ */
828
+ function isIdentityUpdate(self: MutableMatrix): boolean;
829
+ /**
830
+ * Check if the current matrix is identity as a texture matrix (3x2 store in 4x4)
831
+ * @returns true is the matrix is the identity matrix
832
+ */
833
+ function isIdentityAs3x2Update(self: MutableMatrix): boolean;
834
+ /**
835
+ * Gets the determinant of the matrix
836
+ * @returns the matrix determinant
837
+ */
838
+ function determinant(self: ReadonlyMatrix): number;
839
+ /**
840
+ * Returns the matrix as a FloatArray
841
+ * @returns the matrix underlying array
842
+ */
843
+ function toArray(self: ReadonlyMatrix): Readonly<FloatArray>;
844
+ /**
845
+ * Returns the matrix as a FloatArray
846
+ * @returns the matrix underlying array.
847
+ */
848
+ function asArray(self: ReadonlyMatrix): Readonly<FloatArray>;
849
+ /**
850
+ * Sets all the matrix elements to zero
851
+ * @returns the current matrix
852
+ */
853
+ function reset(self: MutableMatrix): void;
854
+ /**
855
+ * Adds the current matrix with a second one
856
+ * @param other - defines the matrix to add
857
+ * @returns a new matrix as the addition of the current matrix and the given one
858
+ */
859
+ function add(self: ReadonlyMatrix, other: ReadonlyMatrix): MutableMatrix;
860
+ /**
861
+ * Sets the given matrix "result" to the addition of the current matrix and the given one
862
+ * @param other - defines the matrix to add
863
+ * @param result - defines the target matrix
864
+ * @returns the current matrix
865
+ */
866
+ function addToRef(self: ReadonlyMatrix, other: ReadonlyMatrix, result: MutableMatrix): void;
867
+ /**
868
+ * Adds in place the given matrix to the current matrix
869
+ * @param other - defines the second operand
870
+ * @returns the current updated matrix
871
+ */
872
+ function addToSelf(self: MutableMatrix, other: ReadonlyMatrix): void;
873
+ /**
874
+ * Creates a new matrix as the invert of a given matrix
875
+ * @param source - defines the source matrix
876
+ * @returns the new matrix
877
+ */
878
+ function invert(source: ReadonlyMatrix): MutableMatrix;
879
+ /**
880
+ * Sets the given matrix to the current inverted Matrix
881
+ * @param other - defines the target matrix
882
+ * @returns the unmodified current matrix
883
+ */
884
+ function invertToRef(source: ReadonlyMatrix, result: MutableMatrix): void;
885
+ /**
886
+ * add a value at the specified position in the current Matrix
887
+ * @param index - the index of the value within the matrix. between 0 and 15.
888
+ * @param value - the value to be added
889
+ * @returns the current updated matrix
890
+ */
891
+ function addAtIndex(self: MutableMatrix, index: number, value: number): void;
892
+ /**
893
+ * mutiply the specified position in the current Matrix by a value
894
+ * @param index - the index of the value within the matrix. between 0 and 15.
895
+ * @param value - the value to be added
896
+ * @returns the current updated matrix
897
+ */
898
+ function multiplyAtIndex(self: MutableMatrix, index: number, value: number): MutableMatrix;
899
+ /**
900
+ * Inserts the translation vector (using 3 floats) in the current matrix
901
+ * @param x - defines the 1st component of the translation
902
+ * @param y - defines the 2nd component of the translation
903
+ * @param z - defines the 3rd component of the translation
904
+ * @returns the current updated matrix
905
+ */
906
+ function setTranslationFromFloats(self: MutableMatrix, x: number, y: number, z: number): void;
907
+ /**
908
+ * Inserts the translation vector in the current matrix
909
+ * @param vector3 - defines the translation to insert
910
+ * @returns the current updated matrix
911
+ */
912
+ function setTranslation(self: MutableMatrix, vector3: Vector3.ReadonlyVector3): void;
913
+ /**
914
+ * Gets the translation value of the current matrix
915
+ * @returns a new Vector3 as the extracted translation from the matrix
916
+ */
917
+ function getTranslation(self: MutableMatrix): Vector3.MutableVector3;
918
+ /**
919
+ * Fill a Vector3 with the extracted translation from the matrix
920
+ * @param result - defines the Vector3 where to store the translation
921
+ * @returns the current matrix
922
+ */
923
+ function getTranslationToRef(self: MutableMatrix, result: Vector3.MutableVector3): void;
924
+ /**
925
+ * Remove rotation and scaling part from the matrix
926
+ * @returns the updated matrix
927
+ */
928
+ function removeRotationAndScaling(self: MutableMatrix): MutableMatrix;
929
+ /**
930
+ * Multiply two matrices
931
+ * @param other - defines the second operand
932
+ * @returns a new matrix set with the multiplication result of the current Matrix and the given one
933
+ */
934
+ function multiply(self: MutableMatrix, other: ReadonlyMatrix): MutableMatrix;
935
+ /**
936
+ * Copy the current matrix from the given one
937
+ * @param other - defines the source matrix
938
+ * @returns the current updated matrix
939
+ */
940
+ function copy(from: ReadonlyMatrix, dest: MutableMatrix): void;
941
+ /**
942
+ * Populates the given array from the starting index with the current matrix values
943
+ * @param array - defines the target array
944
+ * @param offset - defines the offset in the target array where to start storing values
945
+ * @returns the current matrix
946
+ */
947
+ function copyToArray(self: ReadonlyMatrix, arrayDest: FloatArray, offsetDest?: number): void;
948
+ /**
949
+ * Sets the given matrix "result" with the multiplication result of the current Matrix and the given one
950
+ * @param other - defines the second operand
951
+ * @param result - defines the matrix where to store the multiplication
952
+ * @returns the current matrix
953
+ */
954
+ function multiplyToRef(self: ReadonlyMatrix, other: ReadonlyMatrix, result: MutableMatrix): void;
955
+ /**
956
+ * Sets the FloatArray "result" from the given index "offset" with the multiplication of the current matrix and the given one
957
+ * @param other - defines the second operand
958
+ * @param result - defines the array where to store the multiplication
959
+ * @param offset - defines the offset in the target array where to start storing values
960
+ * @returns the current matrix
961
+ */
962
+ function multiplyToArray(self: ReadonlyMatrix, other: ReadonlyMatrix, result: FloatArray, offset: number): void;
963
+ /**
964
+ * Check equality between self matrix and a second one
965
+ * @param value - defines the second matrix to compare
966
+ * @returns true is the current matrix and the given one values are strictly equal
967
+ */
968
+ function equals(self: ReadonlyMatrix, value: ReadonlyMatrix): boolean;
969
+ /**
970
+ * Clone the current matrix
971
+ * @returns a new matrix from the current matrix
972
+ */
973
+ function clone(self: ReadonlyMatrix): MutableMatrix;
974
+ /**
975
+ * Gets the hash code of the current matrix
976
+ * @returns the hash code
977
+ */
978
+ function getHashCode(self: ReadonlyMatrix): number;
979
+ /**
980
+ * Decomposes the current Matrix into a translation, rotation and scaling components
981
+ * @param scale - defines the scale vector3 given as a reference to update
982
+ * @param rotation - defines the rotation quaternion given as a reference to update
983
+ * @param translation - defines the translation vector3 given as a reference to update
984
+ * @returns true if operation was successful
985
+ */
986
+ function decompose(self: ReadonlyMatrix, scale?: Vector3.MutableVector3, rotation?: Quaternion.MutableQuaternion, translation?: Vector3.MutableVector3): boolean;
987
+ /**
988
+ * Gets specific row of the matrix
989
+ * @param index - defines the number of the row to get
990
+ * @returns the index-th row of the current matrix as a new Vector4
991
+ */
992
+ /**
993
+ * Sets the index-th row of the current matrix to the vector4 values
994
+ * @param index - defines the number of the row to set
995
+ * @param row - defines the target vector4
996
+ * @returns the updated current matrix
997
+ */
998
+ /**
999
+ * Sets the index-th row of the current matrix with the given 4 x float values
1000
+ * @param index - defines the row index
1001
+ * @param x - defines the x component to set
1002
+ * @param y - defines the y component to set
1003
+ * @param z - defines the z component to set
1004
+ * @param w - defines the w component to set
1005
+ * @returns the updated current matrix
1006
+ */
1007
+ function setRowFromFloats(self: MutableMatrix, index: number, x: number, y: number, z: number, w: number): void;
1008
+ /**
1009
+ * Compute a new matrix set with the current matrix values multiplied by scale (float)
1010
+ * @param scale - defines the scale factor
1011
+ * @returns a new matrix
1012
+ */
1013
+ function scale(self: ReadonlyMatrix, scale: number): MutableMatrix;
1014
+ /**
1015
+ * Scale the current matrix values by a factor to a given result matrix
1016
+ * @param scale - defines the scale factor
1017
+ * @param result - defines the matrix to store the result
1018
+ * @returns the current matrix
1019
+ */
1020
+ function scaleToRef(self: ReadonlyMatrix, scale: number, result: MutableMatrix): void;
1021
+ /**
1022
+ * Scale the current matrix values by a factor and add the result to a given matrix
1023
+ * @param scale - defines the scale factor
1024
+ * @param result - defines the Matrix to store the result
1025
+ * @returns the current matrix
1026
+ */
1027
+ function scaleAndAddToRef(self: ReadonlyMatrix, scale: number, result: MutableMatrix): void;
1028
+ /**
1029
+ * Writes to the given matrix a normal matrix, computed from self one (using values from identity matrix for fourth row and column).
1030
+ * @param ref - matrix to store the result
1031
+ */
1032
+ function normalMatrixToRef(self: ReadonlyMatrix, ref: MutableMatrix): void;
1033
+ /**
1034
+ * Gets only rotation part of the current matrix
1035
+ * @returns a new matrix sets to the extracted rotation matrix from the current one
1036
+ */
1037
+ function getRotationMatrix(self: ReadonlyMatrix): MutableMatrix;
1038
+ /**
1039
+ * Extracts the rotation matrix from the current one and sets it as the given "result"
1040
+ * @param result - defines the target matrix to store data to
1041
+ * @returns the current matrix
1042
+ */
1043
+ function getRotationMatrixToRef(self: ReadonlyMatrix, result: MutableMatrix): void;
1044
+ /**
1045
+ * Toggles model matrix from being right handed to left handed in place and vice versa
1046
+ */
1047
+ function toggleModelMatrixHandInPlace(self: MutableMatrix): void;
1048
+ /**
1049
+ * Toggles projection matrix from being right handed to left handed in place and vice versa
1050
+ */
1051
+ function toggleProjectionMatrixHandInPlace(self: MutableMatrix): void;
1052
+ }
1053
+
1054
+ /** @public */
1055
+ export declare type Nullable<T> = T | null;
1056
+
1057
+ declare type OnlyNonUndefinedTypes<T> = {
1058
+ [K in ExcludeUndefined<T>]: T[K];
1059
+ };
1060
+
1061
+ declare type OnlyOptionalUndefinedTypes<T> = {
1062
+ [K in IncludeUndefined<T>]?: T[K];
1063
+ };
1064
+
1065
+ /**
1066
+ * @public
1067
+ */
1068
+ export declare function Optional<T>(spec: EcsType<T>): EcsType<T | undefined>;
1069
+
1070
+ /**
1071
+ * Defines potential orientation for back face culling
1072
+ * @public
1073
+ */
1074
+ export declare enum Orientation {
1075
+ /**
1076
+ * Clockwise
1077
+ */
1078
+ CW = 0,
1079
+ /** Counter clockwise */
1080
+ CCW = 1
1081
+ }
1082
+
1083
+ declare interface PBAudioSource {
1084
+ playing: boolean;
1085
+ volume: number;
1086
+ loop: boolean;
1087
+ pitch: number;
1088
+ playedAtTimestamp: number;
1089
+ audioClipUrl: string;
1090
+ }
1091
+
1092
+ declare interface PBAudioStream {
1093
+ playing: boolean;
1094
+ volume: number;
1095
+ url: string;
1096
+ }
1097
+
1098
+ declare interface PBBoxShape {
1099
+ withCollisions: boolean;
1100
+ isPointerBlocker: boolean;
1101
+ visible: boolean;
1102
+ uvs: number[];
1103
+ }
1104
+
1105
+ declare interface PBCylinderShape {
1106
+ withCollisions: boolean;
1107
+ isPointerBlocker: boolean;
1108
+ visible: boolean;
1109
+ radiusTop: number;
1110
+ radiusBottom: number;
1111
+ }
1112
+
1113
+ declare interface PBPlaneShape {
1114
+ withCollisions: boolean;
1115
+ isPointerBlocker: boolean;
1116
+ visible: boolean;
1117
+ uvs: number[];
1118
+ }
1119
+
1120
+ declare interface PBSphereShape {
1121
+ withCollisions: boolean;
1122
+ isPointerBlocker: boolean;
1123
+ visible: boolean;
1124
+ }
1125
+
1126
+ /**
1127
+ * Represens a plane by the equation ax + by + cz + d = 0
1128
+ * @public
1129
+ */
1130
+ declare namespace Plane {
1131
+ type MutablePlane = {
1132
+ /**
1133
+ * Normal of the plane (a,b,c)
1134
+ */
1135
+ normal: Vector3.MutableVector3;
1136
+ /**
1137
+ * d component of the plane
1138
+ */
1139
+ d: number;
1140
+ };
1141
+ type ReadonlyPlane = DeepReadonly<MutablePlane>;
1142
+ /**
1143
+ * Creates a Plane object according to the given floats a, b, c, d and the plane equation : ax + by + cz + d = 0
1144
+ * @param a - a component of the plane
1145
+ * @param b - b component of the plane
1146
+ * @param c - c component of the plane
1147
+ * @param d - d component of the plane
1148
+ */
1149
+ function create(a: number, b: number, c: number, d: number): {
1150
+ normal: Vector3.MutableVector3;
1151
+ d: number;
1152
+ };
1153
+ /**
1154
+ * Creates a plane from an array
1155
+ * @param array - the array to create a plane from
1156
+ * @returns a new Plane from the given array.
1157
+ */
1158
+ function fromArray(array: ArrayLike<number>): MutablePlane;
1159
+ /**
1160
+ * Creates a plane from three points
1161
+ * @param point1 - point used to create the plane
1162
+ * @param point2 - point used to create the plane
1163
+ * @param point3 - point used to create the plane
1164
+ * @returns a new Plane defined by the three given points.
1165
+ */
1166
+ function fromPoints(_point1: Vector3.ReadonlyVector3, _point2: Vector3.ReadonlyVector3, _point3: Vector3.ReadonlyVector3): MutablePlane;
1167
+ /**
1168
+ * Creates a plane from an origin point and a normal
1169
+ * @param origin - origin of the plane to be constructed
1170
+ * @param normal - normal of the plane to be constructed
1171
+ * @returns a new Plane the normal vector to this plane at the given origin point.
1172
+ * Note : the vector "normal" is updated because normalized.
1173
+ */
1174
+ function romPositionAndNormal(origin: Vector3.ReadonlyVector3, normal: Vector3.ReadonlyVector3): MutablePlane;
1175
+ /**
1176
+ * Calculates the distance from a plane and a point
1177
+ * @param origin - origin of the plane to be constructed
1178
+ * @param normal - normal of the plane to be constructed
1179
+ * @param point - point to calculate distance to
1180
+ * @returns the signed distance between the plane defined by the normal vector at the "origin"" point and the given other point.
1181
+ */
1182
+ function signedDistanceToPlaneFromPositionAndNormal(origin: Vector3.ReadonlyVector3, normal: Vector3.ReadonlyVector3, point: Vector3.ReadonlyVector3): number;
1183
+ /**
1184
+ * @returns the plane coordinates as a new array of 4 elements [a, b, c, d].
1185
+ */
1186
+ function asArray(plane: ReadonlyPlane): number[];
1187
+ /**
1188
+ * @returns a new plane copied from the current Plane.
1189
+ */
1190
+ function clone(plane: ReadonlyPlane): MutablePlane;
1191
+ /**
1192
+ * @returns the Plane hash code.
1193
+ */
1194
+ function getHashCode(_plane: ReadonlyPlane): number;
1195
+ /**
1196
+ * Normalize the current Plane in place.
1197
+ * @returns the updated Plane.
1198
+ */
1199
+ function normalize(plane: ReadonlyPlane): MutablePlane;
1200
+ /**
1201
+ * Applies a transformation the plane and returns the result
1202
+ * @param transformation - the transformation matrix to be applied to the plane
1203
+ * @returns a new Plane as the result of the transformation of the current Plane by the given matrix.
1204
+ */
1205
+ function transform(plane: ReadonlyPlane, transformation: Matrix.ReadonlyMatrix): MutablePlane;
1206
+ /**
1207
+ * Calcualtte the dot product between the point and the plane normal
1208
+ * @param point - point to calculate the dot product with
1209
+ * @returns the dot product (float) of the point coordinates and the plane normal.
1210
+ */
1211
+ function dotCoordinate(plane: ReadonlyPlane, point: Vector3.ReadonlyVector3): number;
1212
+ /**
1213
+ * Updates the current Plane from the plane defined by the three given points.
1214
+ * @param point1 - one of the points used to contruct the plane
1215
+ * @param point2 - one of the points used to contruct the plane
1216
+ * @param point3 - one of the points used to contruct the plane
1217
+ * @returns the updated Plane.
1218
+ */
1219
+ function copyFromPoints(point1: Vector3.ReadonlyVector3, point2: Vector3.ReadonlyVector3, point3: Vector3.ReadonlyVector3): MutablePlane;
1220
+ /**
1221
+ * Checks if the plane is facing a given direction
1222
+ * @param direction - the direction to check if the plane is facing
1223
+ * @param epsilon - value the dot product is compared against (returns true if dot &lt;= epsilon)
1224
+ * @returns True is the vector "direction" is the same side than the plane normal.
1225
+ */
1226
+ function isFrontFacingTo(plane: ReadonlyPlane, direction: Vector3.ReadonlyVector3, epsilon: number): boolean;
1227
+ /**
1228
+ * Calculates the distance to a point
1229
+ * @param point - point to calculate distance to
1230
+ * @returns the signed distance (float) from the given point to the Plane.
1231
+ */
1232
+ function signedDistanceTo(plane: ReadonlyPlane, point: Vector3.ReadonlyVector3): number;
1233
+ }
1234
+
1235
+ /**
1236
+ * @public
1237
+ */
1238
+ export declare namespace Quaternion {
1239
+ /**
1240
+ * @public
1241
+ */
1242
+ export type MutableQuaternion = {
1243
+ y: number;
1244
+ x: number;
1245
+ z: number;
1246
+ w: number;
1247
+ };
1248
+ /**
1249
+ * @public
1250
+ */
1251
+ export type ReadonlyQuaternion = DeepReadonly<MutableQuaternion>;
1252
+ /**
1253
+ * Creates a new Quaternion from the given floats
1254
+ * @param x - defines the first component (0 by default)
1255
+ * @param y - defines the second component (0 by default)
1256
+ * @param z - defines the third component (0 by default)
1257
+ * @param w - defines the fourth component (1.0 by default)
1258
+ */
1259
+ export function create(
1260
+ /** defines the first component (0 by default) */
1261
+ x?: number,
1262
+ /** defines the second component (0 by default) */
1263
+ y?: number,
1264
+ /** defines the third component (0 by default) */
1265
+ z?: number,
1266
+ /** defines the fourth component (1.0 by default) */
1267
+ w?: number): MutableQuaternion;
1268
+ /**
1269
+ * Returns a new Quaternion as the result of the addition of the two given quaternions.
1270
+ * @param q1 - the first quaternion
1271
+ * @param q2 - the second quaternion
1272
+ * @returns the resulting quaternion
1273
+ */
1274
+ export function add(q1: ReadonlyQuaternion, q2: ReadonlyQuaternion): MutableQuaternion;
1275
+ /**
1276
+ * Creates a new rotation from the given Euler float angles (y, x, z) and stores it in the target quaternion
1277
+ * @param yaw - defines the rotation around Y axis
1278
+ * @param pitch - defines the rotation around X axis
1279
+ * @param roll - defines the rotation around Z axis
1280
+ * @param result - defines the target quaternion
1281
+ */
1282
+ export function rotationYawPitchRoll(yaw: number, pitch: number, roll: number): MutableQuaternion;
1283
+ /**
1284
+ * Returns a rotation that rotates z degrees around the z axis, x degrees around the x axis, and y degrees around the y axis.
1285
+ * @param x - the rotation on the x axis in euler degrees
1286
+ * @param y - the rotation on the y axis in euler degrees
1287
+ * @param z - the rotation on the z axis in euler degrees
1288
+ */
1289
+ export function euler(x: number, y: number, z: number): MutableQuaternion;
1290
+ /**
1291
+ * Gets length of current quaternion
1292
+ * @returns the quaternion length (float)
1293
+ */
1294
+ export function length(q: ReadonlyQuaternion): number;
1295
+ /**
1296
+ * Gets length of current quaternion
1297
+ * @returns the quaternion length (float)
1298
+ */
1299
+ export function lengthSquared(q: ReadonlyQuaternion): number;
1300
+ /**
1301
+ * Returns the dot product (float) between the quaternions "left" and "right"
1302
+ * @param left - defines the left operand
1303
+ * @param right - defines the right operand
1304
+ * @returns the dot product
1305
+ */
1306
+ export function dot(left: ReadonlyQuaternion, right: ReadonlyQuaternion): number;
1307
+ /**
1308
+ * Returns the angle in degrees between two rotations a and b.
1309
+ * @param quat1 - defines the first quaternion
1310
+ * @param quat2 - defines the second quaternion
1311
+ */
1312
+ export function angle(quat1: ReadonlyQuaternion, quat2: ReadonlyQuaternion): number;
1313
+ /**
1314
+ * The from quaternion is rotated towards to by an angular step of maxDegreesDelta.
1315
+ * @param from - defines the first quaternion
1316
+ * @param to - defines the second quaternion
1317
+ * @param maxDegreesDelta - the interval step
1318
+ */
1319
+ export function rotateTowards(from: ReadonlyQuaternion, to: ReadonlyQuaternion, maxDegreesDelta: number): MutableQuaternion;
1320
+ /**
1321
+ * Creates a rotation with the specified forward and upwards directions.
1322
+ * @param forward - the direction to look in
1323
+ * @param up - the vector that defines in which direction up is
1324
+ */
1325
+ export function lookRotation(forward: Vector3.ReadonlyVector3, up?: Vector3.ReadonlyVector3): MutableQuaternion;
1326
+ /**
1327
+ * Normalize in place the current quaternion
1328
+ * @returns the current updated quaternion
1329
+ */
1330
+ export function normalize(q: ReadonlyQuaternion): MutableQuaternion;
1331
+ /**
1332
+ * Creates a rotation which rotates from fromDirection to toDirection.
1333
+ * @param from - defines the first direction Vector
1334
+ * @param to - defines the target direction Vector
1335
+ */
1336
+ export function fromToRotation(from: Vector3.ReadonlyVector3, to: Vector3.ReadonlyVector3, up?: Vector3.ReadonlyVector3): MutableQuaternion;
1337
+ /**
1338
+ * Creates an identity quaternion
1339
+ * @returns - the identity quaternion
1340
+ */
1341
+ export function Identity(): MutableQuaternion;
1342
+ /**
1343
+ * Gets or sets the euler angle representation of the rotation.
1344
+ * Implemented unity-based calculations from: https://stackoverflow.com/a/56055813
1345
+ */
1346
+ export function eulerAngles(q: MutableQuaternion): Vector3.MutableVector3;
1347
+ /**
1348
+ * Creates a new rotation from the given Euler float angles (y, x, z) and stores it in the target quaternion
1349
+ * @param yaw - defines the rotation around Y axis
1350
+ * @param pitch - defines the rotation around X axis
1351
+ * @param roll - defines the rotation around Z axis
1352
+ * @param result - defines the target quaternion
1353
+ */
1354
+ export function rotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Quaternion.MutableQuaternion): void;
1355
+ /**
1356
+ * Updates the given quaternion with the given rotation matrix values
1357
+ * @param matrix - defines the source matrix
1358
+ * @param result - defines the target quaternion
1359
+ */
1360
+ export function fromRotationMatrixToRef(matrix: Matrix.ReadonlyMatrix, result: Quaternion.MutableQuaternion): void;
1361
+ /**
1362
+ * Interpolates between two quaternions
1363
+ * @param left - defines first quaternion
1364
+ * @param right - defines second quaternion
1365
+ * @param amount - defines the gradient to use
1366
+ * @returns the new interpolated quaternion
1367
+ */
1368
+ export function slerp(left: ReadonlyQuaternion, right: ReadonlyQuaternion, amount: number): MutableQuaternion;
1369
+ /**
1370
+ * Interpolates between two quaternions and stores it into a target quaternion
1371
+ * @param left - defines first quaternion
1372
+ * @param right - defines second quaternion
1373
+ * @param amount - defines the gradient to use
1374
+ * @param result - defines the target quaternion
1375
+ */
1376
+ export function slerpToRef(left: ReadonlyQuaternion, right: ReadonlyQuaternion, amount: number, result: MutableQuaternion): void;
1377
+ /**
1378
+ * Multiplies two quaternions
1379
+ * @param self - defines the first operand
1380
+ * @param q1 - defines the second operand
1381
+ * @returns a new quaternion set as the multiplication result of the self one with the given one "q1"
1382
+ */
1383
+ export function multiply(self: ReadonlyQuaternion, q1: ReadonlyQuaternion): MutableQuaternion;
1384
+ /**
1385
+ * Sets the given "result" as the the multiplication result of the self one with the given one "q1"
1386
+ * @param self - defines the first operand
1387
+ * @param q1 - defines the second operand
1388
+ * @param result - defines the target quaternion
1389
+ * @returns the current quaternion
1390
+ */
1391
+ export function multiplyToRef(self: ReadonlyQuaternion, q1: ReadonlyQuaternion, result: MutableQuaternion): void;
1392
+ export function angleAxis(degress: number, axis: Vector3.ReadonlyVector3): MutableQuaternion;
1393
+ /**
1394
+ * Returns a zero filled quaternion
1395
+ */
1396
+ export function Zero(): MutableQuaternion;
1397
+ }
1398
+
1399
+ /**
1400
+ * Constant used to convert from radians to Euler degrees
1401
+ * @public
1402
+ */
1403
+ export declare const RAD2DEG: number;
1404
+
1405
+ /**
1406
+ * @public
1407
+ */
1408
+ export declare type Result<T extends Spec> = ToOptional<{
1409
+ [K in keyof T]: T[K] extends EcsType ? ReturnType<T[K]['deserialize']> : T[K] extends Spec ? Result<T[K]> : never;
1410
+ }>;
1411
+
1412
+ /**
1413
+ * @public
1414
+ */
1415
+ export declare type SdkComponetns = ReturnType<typeof defineSdkComponents>;
1416
+
1417
+ /**
1418
+ * Defines supported spaces
1419
+ * @public
1420
+ */
1421
+ export declare enum Space {
1422
+ /** Local (object) space */
1423
+ LOCAL = 0,
1424
+ /** World space */
1425
+ WORLD = 1,
1426
+ /** Bone space */
1427
+ BONE = 2
1428
+ }
1429
+
1430
+ /**
1431
+ * @public
1432
+ */
1433
+ export declare interface Spec {
1434
+ [key: string]: EcsType;
1435
+ }
1436
+
1437
+ /**
1438
+ * Constant used to convert a value to gamma space
1439
+ * @public
1440
+ */
1441
+ export declare const ToGammaSpace: number;
1442
+
1443
+ /**
1444
+ * Constant used to convert a value to linear space
1445
+ * @public
1446
+ */
1447
+ export declare const ToLinearSpace = 2.2;
1448
+
1449
+ declare type ToOptional<T> = OnlyOptionalUndefinedTypes<T> & OnlyNonUndefinedTypes<T>;
1450
+
1451
+ /**
1452
+ * @public
1453
+ */
1454
+ declare type Transform = {
1455
+ position: Vector3.MutableVector3;
1456
+ rotation: Quaternion.MutableQuaternion;
1457
+ scale: Vector3.MutableVector3;
1458
+ parent?: Entity;
1459
+ };
1460
+
1461
+ declare const Transform: EcsType<Transform>;
1462
+
1463
+ /**
1464
+ * @public
1465
+ */
1466
+ export declare type Unpacked<T> = T extends (infer U)[] ? U : T;
1467
+
1468
+ /**
1469
+ * @public
1470
+ */
1471
+ export declare type Update = (dt: number) => void;
1472
+
1473
+ /**
1474
+ * @public
1475
+ */
1476
+ export declare namespace Vector3 {
1477
+ /**
1478
+ * @public
1479
+ */
1480
+ export type MutableVector3 = {
1481
+ y: number;
1482
+ x: number;
1483
+ z: number;
1484
+ };
1485
+ /**
1486
+ * @public
1487
+ */
1488
+ export type ReadonlyVector3 = DeepReadonly<MutableVector3>;
1489
+ /**
1490
+ * Creates a new Vector3 object from the given x, y, z (floats) coordinates.
1491
+ * @param x - defines the first coordinates (on X axis)
1492
+ * @param y - defines the second coordinates (on Y axis)
1493
+ * @param z - defines the third coordinates (on Z axis)
1494
+ */
1495
+ export function create(
1496
+ /**
1497
+ * Defines the first coordinates (on X axis)
1498
+ */
1499
+ x?: number,
1500
+ /**
1501
+ * Defines the second coordinates (on Y axis)
1502
+ */
1503
+ y?: number,
1504
+ /**
1505
+ * Defines the third coordinates (on Z axis)
1506
+ */
1507
+ z?: number): MutableVector3;
1508
+ /**
1509
+ * Returns a new Vector3 as the result of the addition of the two given vectors.
1510
+ * @param vector1 - the first vector
1511
+ * @param vector2 - the second vector
1512
+ * @returns the resulting vector
1513
+ */
1514
+ export function add(vector1: ReadonlyVector3, vector2: ReadonlyVector3): MutableVector3;
1515
+ /**
1516
+ * Returns a new Vector3 as the result of the substraction of the two given vectors.
1517
+ * @returns the resulting vector
1518
+ */
1519
+ export function subtract(minuend: ReadonlyVector3, subtrahend: ReadonlyVector3): MutableVector3;
1520
+ /**
1521
+ * Returns a new Vector3 as the result of the substraction of the two given vectors.
1522
+ * @returns the resulting vector
1523
+ */
1524
+ export function subtractToRef(minuend: ReadonlyVector3, subtrahend: ReadonlyVector3, result: MutableVector3): void;
1525
+ /**
1526
+ * Returns a new Vector3 with the other sign
1527
+ * @returns the resulting vector
1528
+ */
1529
+ export function opposite(value: ReadonlyVector3): MutableVector3;
1530
+ /**
1531
+ * Copy source into dest
1532
+ *
1533
+ */
1534
+ export function copy(source: ReadonlyVector3, dest: MutableVector3): void;
1535
+ /**
1536
+ * Returns a new Vector3 with the same value
1537
+ * @returns the resulting vector
1538
+ */
1539
+ export function clone(source: ReadonlyVector3): MutableVector3;
1540
+ /**
1541
+ * Gets the length of the Vector3
1542
+ * @returns the length of the Vecto3
1543
+ */
1544
+ export function length(vector: ReadonlyVector3): number;
1545
+ /**
1546
+ * Gets the squared length of the Vector3
1547
+ * @returns squared length of the Vector3
1548
+ */
1549
+ export function lengthSquared(vector: ReadonlyVector3): number;
1550
+ /**
1551
+ * Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float "scale"
1552
+ * @param scale - defines the multiplier factor
1553
+ * @returns a new Vector3
1554
+ */
1555
+ export function scaleToRef(vector: ReadonlyVector3, scale: number, result: MutableVector3): void;
1556
+ /**
1557
+ * Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float "scale"
1558
+ * @param scale - defines the multiplier factor
1559
+ * @returns a new Vector3
1560
+ */
1561
+ export function scale(vector: ReadonlyVector3, scale: number): MutableVector3;
1562
+ /**
1563
+ * Normalize the current Vector3 with the given input length.
1564
+ * Please note that this is an in place operation.
1565
+ * @param len - the length of the vector
1566
+ * @returns the current updated Vector3
1567
+ */
1568
+ export function normalizeFromLength(vector: ReadonlyVector3, len: number): MutableVector3;
1569
+ /**
1570
+ * Normalize the current Vector3 with the given input length.
1571
+ * Please note that this is an in place operation.
1572
+ * @param len - the length of the vector
1573
+ * @returns the current updated Vector3
1574
+ */
1575
+ export function normalizeFromLengthToRef(vector: ReadonlyVector3, len: number, result: MutableVector3): void;
1576
+ /**
1577
+ * Normalize the current Vector3.
1578
+ * Please note that this is an in place operation.
1579
+ * @returns the current updated Vector3
1580
+ */
1581
+ export function normalize(vector: ReadonlyVector3): MutableVector3;
1582
+ /**
1583
+ * Normalize the current Vector3.
1584
+ * Please note that this is an in place operation.
1585
+ * @returns the current updated Vector3
1586
+ */
1587
+ export function normalizeToRef(vector: ReadonlyVector3, result: MutableVector3): void;
1588
+ /**
1589
+ * Returns the dot product (float) between the vectors "left" and "right"
1590
+ * @param left - defines the left operand
1591
+ * @param right - defines the right operand
1592
+ * @returns the dot product
1593
+ */
1594
+ export function dot(left: ReadonlyVector3, right: ReadonlyVector3): number;
1595
+ /**
1596
+ * Rotates current Vector3 based on the given quaternion, but applies the rotation to target Vector3.
1597
+ * @param q - defines the Quaternion
1598
+ * @param result - defines the target Vector3
1599
+ * @returns the current Vector3
1600
+ */
1601
+ export function rotate(vector: ReadonlyVector3, q: Quaternion.ReadonlyQuaternion): MutableVector3;
1602
+ /**
1603
+ * Returns a new Vector3 located for "amount" (float) on the linear interpolation between the vectors "start" and "end"
1604
+ * @param start - defines the start value
1605
+ * @param end - defines the end value
1606
+ * @param amount - max defines amount between both (between 0 and 1)
1607
+ * @returns the new Vector3
1608
+ */
1609
+ export function lerp(start: ReadonlyVector3, end: ReadonlyVector3, amount: number): MutableVector3;
1610
+ /**
1611
+ * Sets the given vector "result" with the result of the linear interpolation from the vector "start" for "amount" to the vector "end"
1612
+ * @param start - defines the start value
1613
+ * @param end - defines the end value
1614
+ * @param amount - max defines amount between both (between 0 and 1)
1615
+ * @param result - defines the Vector3 where to store the result
1616
+ */
1617
+ export function lerpToRef(start: ReadonlyVector3, end: ReadonlyVector3, amount: number, result: MutableVector3): void;
1618
+ /**
1619
+ * Returns a new Vector3 as the cross product of the vectors "left" and "right"
1620
+ * The cross product is then orthogonal to both "left" and "right"
1621
+ * @param left - defines the left operand
1622
+ * @param right - defines the right operand
1623
+ * @returns the cross product
1624
+ */
1625
+ export function cross(left: ReadonlyVector3, right: ReadonlyVector3): MutableVector3;
1626
+ /**
1627
+ * Sets the given vector "result" with the cross product of "left" and "right"
1628
+ * The cross product is then orthogonal to both "left" and "right"
1629
+ * @param left - defines the left operand
1630
+ * @param right - defines the right operand
1631
+ * @param result - defines the Vector3 where to store the result
1632
+ */
1633
+ export function crossToRef(left: ReadonlyVector3, right: ReadonlyVector3, result: MutableVector3): void;
1634
+ /**
1635
+ * Returns a new Vector3 set to (0.0, 0.0, 0.0)
1636
+ * @returns a new empty Vector3
1637
+ */
1638
+ export function Zero(): MutableVector3;
1639
+ /**
1640
+ * Returns a new Vector3 set to (1.0, 1.0, 1.0)
1641
+ * @returns a new unit Vector3
1642
+ */
1643
+ export function One(): MutableVector3;
1644
+ /**
1645
+ * Returns a new Vector3 set tolengthSquared (0.0, 1.0, 0.0)
1646
+ * @returns a new up Vector3
1647
+ */
1648
+ export function Up(): MutableVector3;
1649
+ /**
1650
+ * Returns a new Vector3 set to (0.0, -1.0, 0.0)
1651
+ * @returns a new down Vector3
1652
+ */
1653
+ export function Down(): MutableVector3;
1654
+ /**
1655
+ * Returns a new Vector3 set to (0.0, 0.0, 1.0)
1656
+ * @returns a new forward Vector3
1657
+ */
1658
+ export function Forward(): MutableVector3;
1659
+ /**
1660
+ * Returns a new Vector3 set to (0.0, 0.0, -1.0)
1661
+ * @returns a new forward Vector3
1662
+ */
1663
+ export function Backward(): MutableVector3;
1664
+ /**
1665
+ * Returns a new Vector3 set to (1.0, 0.0, 0.0)
1666
+ * @returns a new right Vector3
1667
+ */
1668
+ export function Right(): MutableVector3;
1669
+ /**
1670
+ * Returns a new Vector3 set to (-1.0, 0.0, 0.0)
1671
+ * @returns a new left Vector3
1672
+ */
1673
+ export function Left(): MutableVector3;
1674
+ }
1675
+
1676
+ export { }