@babylonjs/core 5.28.0 → 5.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Actions/actionManager.js +2 -0
- package/Actions/actionManager.js.map +1 -1
- package/Cameras/camera.js +4 -4
- package/Cameras/camera.js.map +1 -1
- package/Collisions/pickingInfo.d.ts +0 -2
- package/Collisions/pickingInfo.js +0 -2
- package/Collisions/pickingInfo.js.map +1 -1
- package/Culling/ray.js +5 -0
- package/Culling/ray.js.map +1 -1
- package/Engines/Extensions/engine.videoTexture.js +6 -3
- package/Engines/Extensions/engine.videoTexture.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +2 -1
- package/Engines/renderTargetWrapper.js +1 -0
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Events/pointerEvents.d.ts +11 -6
- package/Events/pointerEvents.js +24 -6
- package/Events/pointerEvents.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +9 -1
- package/Inputs/scene.inputManager.js +76 -37
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Layers/effectLayer.js +2 -6
- package/Layers/effectLayer.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.d.ts +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/Textures/htmlElementTexture.d.ts +5 -0
- package/Materials/Textures/htmlElementTexture.js +4 -1
- package/Materials/Textures/htmlElementTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +1 -1
- package/Materials/Textures/renderTargetTexture.js +2 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/videoTexture.d.ts +6 -1
- package/Materials/Textures/videoTexture.js +7 -2
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Maths/math.vector.d.ts +390 -319
- package/Maths/math.vector.js +298 -153
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/decalBuilder.d.ts +8 -0
- package/Meshes/Builders/decalBuilder.js +270 -51
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/mesh.js +40 -0
- package/Meshes/mesh.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.d.ts +14 -8
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +16 -6
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/blurPostProcess.d.ts +2 -1
- package/PostProcesses/blurPostProcess.js +3 -2
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.js +2 -1
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.js +3 -5
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldEffect.js +9 -4
- package/PostProcesses/depthOfFieldEffect.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js +2 -6
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/depthRenderer.js +2 -6
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +2 -6
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/renderingGroup.d.ts +4 -0
- package/Rendering/renderingGroup.js +7 -1
- package/Rendering/renderingGroup.js.map +1 -1
- package/Rendering/renderingManager.d.ts +5 -0
- package/Rendering/renderingManager.js +15 -0
- package/Rendering/renderingManager.js.map +1 -1
- package/Shaders/circleOfConfusion.fragment.js +1 -1
- package/Shaders/circleOfConfusion.fragment.js.map +1 -1
- package/Shaders/depthOfFieldMerge.fragment.js +1 -1
- package/Shaders/depthOfFieldMerge.fragment.js.map +1 -1
- package/Shaders/kernelBlur.fragment.js +2 -2
- package/Shaders/kernelBlur.fragment.js.map +1 -1
- package/XR/webXRRenderTargetTextureProvider.js +1 -0
- package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +5 -0
- package/scene.js +10 -6
- package/scene.js.map +1 -1
package/Maths/math.vector.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ import type { DeepImmutable, Nullable, FloatArray, float } from "../types";
|
|
|
3
3
|
import type { IPlaneLike } from "./math.like";
|
|
4
4
|
import type { Plane } from "./math.plane";
|
|
5
5
|
declare type TransformNode = import("../Meshes/transformNode").TransformNode;
|
|
6
|
+
export declare type Vector2Constructor<T extends Vector2> = new (...args: ConstructorParameters<typeof Vector2>) => T;
|
|
7
|
+
export declare type Vector3Constructor<T extends Vector3> = new (...args: ConstructorParameters<typeof Vector3>) => T;
|
|
8
|
+
export declare type Vector4Constructor<T extends Vector4> = new (...args: ConstructorParameters<typeof Vector4>) => T;
|
|
9
|
+
export declare type QuaternionConstructor<T extends Quaternion> = new (...args: ConstructorParameters<typeof Quaternion>) => T;
|
|
10
|
+
export declare type MatrixConstructor<T extends Matrix> = new () => T;
|
|
6
11
|
/**
|
|
7
12
|
* Class representing a vector containing 2 coordinates
|
|
8
13
|
* Example Playground - Overview - https://playground.babylonjs.com/#QYBWV4#9
|
|
@@ -45,15 +50,15 @@ export declare class Vector2 {
|
|
|
45
50
|
* @param index defines the offset in source array
|
|
46
51
|
* @returns the current Vector2
|
|
47
52
|
*/
|
|
48
|
-
toArray(array: FloatArray, index?: number):
|
|
53
|
+
toArray(array: FloatArray, index?: number): this;
|
|
49
54
|
/**
|
|
50
55
|
* Update the current vector from an array
|
|
51
56
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#39
|
|
52
57
|
* @param array defines the destination array
|
|
53
58
|
* @param index defines the offset in the destination array
|
|
54
|
-
* @returns the current
|
|
59
|
+
* @returns the current Vector2
|
|
55
60
|
*/
|
|
56
|
-
fromArray(array: FloatArray, index?: number):
|
|
61
|
+
fromArray(array: FloatArray, index?: number): this;
|
|
57
62
|
/**
|
|
58
63
|
* Copy the current vector to an array
|
|
59
64
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#40
|
|
@@ -66,7 +71,7 @@ export declare class Vector2 {
|
|
|
66
71
|
* @param source defines the source Vector2
|
|
67
72
|
* @returns the current updated Vector2
|
|
68
73
|
*/
|
|
69
|
-
copyFrom(source: DeepImmutable<Vector2>):
|
|
74
|
+
copyFrom(source: DeepImmutable<Vector2>): this;
|
|
70
75
|
/**
|
|
71
76
|
* Sets the Vector2 coordinates with the given floats
|
|
72
77
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#25
|
|
@@ -74,7 +79,7 @@ export declare class Vector2 {
|
|
|
74
79
|
* @param y defines the second coordinate
|
|
75
80
|
* @returns the current updated Vector2
|
|
76
81
|
*/
|
|
77
|
-
copyFromFloats(x: number, y: number):
|
|
82
|
+
copyFromFloats(x: number, y: number): this;
|
|
78
83
|
/**
|
|
79
84
|
* Sets the Vector2 coordinates with the given floats
|
|
80
85
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#62
|
|
@@ -82,80 +87,80 @@ export declare class Vector2 {
|
|
|
82
87
|
* @param y defines the second coordinate
|
|
83
88
|
* @returns the current updated Vector2
|
|
84
89
|
*/
|
|
85
|
-
set(x: number, y: number):
|
|
90
|
+
set(x: number, y: number): this;
|
|
86
91
|
/**
|
|
87
92
|
* Add another vector with the current one
|
|
88
93
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#11
|
|
89
94
|
* @param otherVector defines the other vector
|
|
90
95
|
* @returns a new Vector2 set with the addition of the current Vector2 and the given one coordinates
|
|
91
96
|
*/
|
|
92
|
-
add(otherVector: DeepImmutable<Vector2>):
|
|
97
|
+
add(otherVector: DeepImmutable<Vector2>): this;
|
|
93
98
|
/**
|
|
94
99
|
* Sets the "result" coordinates with the addition of the current Vector2 and the given one coordinates
|
|
95
100
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#12
|
|
96
101
|
* @param otherVector defines the other vector
|
|
97
102
|
* @param result defines the target vector
|
|
98
|
-
* @returns
|
|
103
|
+
* @returns result input
|
|
99
104
|
*/
|
|
100
|
-
addToRef(otherVector: DeepImmutable<Vector2>, result:
|
|
105
|
+
addToRef<T extends Vector2>(otherVector: DeepImmutable<Vector2>, result: T): T;
|
|
101
106
|
/**
|
|
102
107
|
* Set the Vector2 coordinates by adding the given Vector2 coordinates
|
|
103
108
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#13
|
|
104
109
|
* @param otherVector defines the other vector
|
|
105
110
|
* @returns the current updated Vector2
|
|
106
111
|
*/
|
|
107
|
-
addInPlace(otherVector: DeepImmutable<Vector2>):
|
|
112
|
+
addInPlace(otherVector: DeepImmutable<Vector2>): this;
|
|
108
113
|
/**
|
|
109
114
|
* Gets a new Vector2 by adding the current Vector2 coordinates to the given Vector3 x, y coordinates
|
|
110
115
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#14
|
|
111
116
|
* @param otherVector defines the other vector
|
|
112
117
|
* @returns a new Vector2
|
|
113
118
|
*/
|
|
114
|
-
addVector3(otherVector: Vector3):
|
|
119
|
+
addVector3(otherVector: Vector3): this;
|
|
115
120
|
/**
|
|
116
121
|
* Gets a new Vector2 set with the subtracted coordinates of the given one from the current Vector2
|
|
117
122
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#61
|
|
118
123
|
* @param otherVector defines the other vector
|
|
119
124
|
* @returns a new Vector2
|
|
120
125
|
*/
|
|
121
|
-
subtract(otherVector: Vector2):
|
|
126
|
+
subtract(otherVector: Vector2): this;
|
|
122
127
|
/**
|
|
123
128
|
* Sets the "result" coordinates with the subtraction of the given one from the current Vector2 coordinates.
|
|
124
129
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#63
|
|
125
130
|
* @param otherVector defines the other vector
|
|
126
131
|
* @param result defines the target vector
|
|
127
|
-
* @returns
|
|
132
|
+
* @returns result input
|
|
128
133
|
*/
|
|
129
|
-
subtractToRef(otherVector: DeepImmutable<Vector2>, result:
|
|
134
|
+
subtractToRef<T extends Vector2>(otherVector: DeepImmutable<Vector2>, result: T): T;
|
|
130
135
|
/**
|
|
131
136
|
* Sets the current Vector2 coordinates by subtracting from it the given one coordinates
|
|
132
137
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#88
|
|
133
138
|
* @param otherVector defines the other vector
|
|
134
139
|
* @returns the current updated Vector2
|
|
135
140
|
*/
|
|
136
|
-
subtractInPlace(otherVector: DeepImmutable<Vector2>):
|
|
141
|
+
subtractInPlace(otherVector: DeepImmutable<Vector2>): this;
|
|
137
142
|
/**
|
|
138
143
|
* Multiplies in place the current Vector2 coordinates by the given ones
|
|
139
144
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#43
|
|
140
145
|
* @param otherVector defines the other vector
|
|
141
146
|
* @returns the current updated Vector2
|
|
142
147
|
*/
|
|
143
|
-
multiplyInPlace(otherVector: DeepImmutable<Vector2>):
|
|
148
|
+
multiplyInPlace(otherVector: DeepImmutable<Vector2>): this;
|
|
144
149
|
/**
|
|
145
150
|
* Returns a new Vector2 set with the multiplication of the current Vector2 and the given one coordinates
|
|
146
151
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#42
|
|
147
152
|
* @param otherVector defines the other vector
|
|
148
153
|
* @returns a new Vector2
|
|
149
154
|
*/
|
|
150
|
-
multiply(otherVector: DeepImmutable<Vector2>):
|
|
155
|
+
multiply(otherVector: DeepImmutable<Vector2>): this;
|
|
151
156
|
/**
|
|
152
157
|
* Sets "result" coordinates with the multiplication of the current Vector2 and the given one coordinates
|
|
153
158
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#44
|
|
154
159
|
* @param otherVector defines the other vector
|
|
155
160
|
* @param result defines the target vector
|
|
156
|
-
* @returns
|
|
161
|
+
* @returns result input
|
|
157
162
|
*/
|
|
158
|
-
multiplyToRef(otherVector: DeepImmutable<Vector2>, result:
|
|
163
|
+
multiplyToRef<T extends Vector2>(otherVector: DeepImmutable<Vector2>, result: T): T;
|
|
159
164
|
/**
|
|
160
165
|
* Gets a new Vector2 set with the Vector2 coordinates multiplied by the given floats
|
|
161
166
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#89
|
|
@@ -163,78 +168,78 @@ export declare class Vector2 {
|
|
|
163
168
|
* @param y defines the second coordinate
|
|
164
169
|
* @returns a new Vector2
|
|
165
170
|
*/
|
|
166
|
-
multiplyByFloats(x: number, y: number):
|
|
171
|
+
multiplyByFloats(x: number, y: number): this;
|
|
167
172
|
/**
|
|
168
173
|
* Returns a new Vector2 set with the Vector2 coordinates divided by the given one coordinates
|
|
169
174
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#27
|
|
170
175
|
* @param otherVector defines the other vector
|
|
171
176
|
* @returns a new Vector2
|
|
172
177
|
*/
|
|
173
|
-
divide(otherVector: Vector2):
|
|
178
|
+
divide(otherVector: Vector2): this;
|
|
174
179
|
/**
|
|
175
180
|
* Sets the "result" coordinates with the Vector2 divided by the given one coordinates
|
|
176
181
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#30
|
|
177
182
|
* @param otherVector defines the other vector
|
|
178
183
|
* @param result defines the target vector
|
|
179
|
-
* @returns
|
|
184
|
+
* @returns result input
|
|
180
185
|
*/
|
|
181
|
-
divideToRef(otherVector: DeepImmutable<Vector2>, result:
|
|
186
|
+
divideToRef<T extends Vector2>(otherVector: DeepImmutable<Vector2>, result: T): T;
|
|
182
187
|
/**
|
|
183
188
|
* Divides the current Vector2 coordinates by the given ones
|
|
184
189
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#28
|
|
185
190
|
* @param otherVector defines the other vector
|
|
186
191
|
* @returns the current updated Vector2
|
|
187
192
|
*/
|
|
188
|
-
divideInPlace(otherVector: DeepImmutable<Vector2>):
|
|
193
|
+
divideInPlace(otherVector: DeepImmutable<Vector2>): this;
|
|
189
194
|
/**
|
|
190
195
|
* Gets a new Vector2 with current Vector2 negated coordinates
|
|
191
196
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#22
|
|
192
197
|
* @returns a new Vector2
|
|
193
198
|
*/
|
|
194
|
-
negate():
|
|
199
|
+
negate(): this;
|
|
195
200
|
/**
|
|
196
201
|
* Negate this vector in place
|
|
197
202
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#23
|
|
198
203
|
* @returns this
|
|
199
204
|
*/
|
|
200
|
-
negateInPlace():
|
|
205
|
+
negateInPlace(): this;
|
|
201
206
|
/**
|
|
202
207
|
* Negate the current Vector2 and stores the result in the given vector "result" coordinates
|
|
203
208
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#41
|
|
204
209
|
* @param result defines the Vector3 object where to store the result
|
|
205
210
|
* @returns the result
|
|
206
211
|
*/
|
|
207
|
-
negateToRef(result:
|
|
212
|
+
negateToRef<T extends Vector2>(result: T): T;
|
|
208
213
|
/**
|
|
209
214
|
* Multiply the Vector2 coordinates by
|
|
210
215
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#59
|
|
211
216
|
* @param scale defines the scaling factor
|
|
212
217
|
* @returns the current updated Vector2
|
|
213
218
|
*/
|
|
214
|
-
scaleInPlace(scale: number):
|
|
219
|
+
scaleInPlace(scale: number): this;
|
|
215
220
|
/**
|
|
216
221
|
* Returns a new Vector2 scaled by "scale" from the current Vector2
|
|
217
222
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#52
|
|
218
223
|
* @param scale defines the scaling factor
|
|
219
224
|
* @returns a new Vector2
|
|
220
225
|
*/
|
|
221
|
-
scale(scale: number):
|
|
226
|
+
scale(scale: number): this;
|
|
222
227
|
/**
|
|
223
228
|
* Scale the current Vector2 values by a factor to a given Vector2
|
|
224
229
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#57
|
|
225
230
|
* @param scale defines the scale factor
|
|
226
231
|
* @param result defines the Vector2 object where to store the result
|
|
227
|
-
* @returns
|
|
232
|
+
* @returns result input
|
|
228
233
|
*/
|
|
229
|
-
scaleToRef(scale: number, result:
|
|
234
|
+
scaleToRef<T extends Vector2>(scale: number, result: T): T;
|
|
230
235
|
/**
|
|
231
236
|
* Scale the current Vector2 values by a factor and add the result to a given Vector2
|
|
232
237
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#58
|
|
233
238
|
* @param scale defines the scale factor
|
|
234
239
|
* @param result defines the Vector2 object where to store the result
|
|
235
|
-
* @returns
|
|
240
|
+
* @returns result input
|
|
236
241
|
*/
|
|
237
|
-
scaleAndAddToRef(scale: number, result:
|
|
242
|
+
scaleAndAddToRef<T extends Vector2>(scale: number, result: T): T;
|
|
238
243
|
/**
|
|
239
244
|
* Gets a boolean if two vectors are equals
|
|
240
245
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#31
|
|
@@ -256,22 +261,22 @@ export declare class Vector2 {
|
|
|
256
261
|
* eg (1.2, 2.31) returns (1, 2)
|
|
257
262
|
* @returns a new Vector2
|
|
258
263
|
*/
|
|
259
|
-
floor():
|
|
264
|
+
floor(): this;
|
|
260
265
|
/**
|
|
261
266
|
* Gets a new Vector2 from current Vector2 fractional values
|
|
262
267
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#34
|
|
263
268
|
* eg (1.2, 2.31) returns (0.2, 0.31)
|
|
264
269
|
* @returns a new Vector2
|
|
265
270
|
*/
|
|
266
|
-
fract():
|
|
271
|
+
fract(): this;
|
|
267
272
|
/**
|
|
268
273
|
* Rotate the current vector into a given result vector
|
|
269
274
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#49
|
|
270
275
|
* @param angle defines the rotation angle
|
|
271
276
|
* @param result defines the result vector where to store the rotated vector
|
|
272
|
-
* @returns
|
|
277
|
+
* @returns result input
|
|
273
278
|
*/
|
|
274
|
-
rotateToRef(angle: number, result:
|
|
279
|
+
rotateToRef<T extends Vector2>(angle: number, result: T): T;
|
|
275
280
|
/**
|
|
276
281
|
* Gets the length of the vector
|
|
277
282
|
* @returns the vector length (float)
|
|
@@ -287,13 +292,13 @@ export declare class Vector2 {
|
|
|
287
292
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#48
|
|
288
293
|
* @returns the current updated Vector2
|
|
289
294
|
*/
|
|
290
|
-
normalize():
|
|
295
|
+
normalize(): this;
|
|
291
296
|
/**
|
|
292
297
|
* Gets a new Vector2 copied from the Vector2
|
|
293
298
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#20
|
|
294
299
|
* @returns a new Vector2
|
|
295
300
|
*/
|
|
296
|
-
clone():
|
|
301
|
+
clone(): this;
|
|
297
302
|
/**
|
|
298
303
|
* Gets a new Vector2(0, 0)
|
|
299
304
|
* @returns a new Vector2
|
|
@@ -322,8 +327,9 @@ export declare class Vector2 {
|
|
|
322
327
|
* @param array defines the data source
|
|
323
328
|
* @param offset defines the offset in the data source
|
|
324
329
|
* @param result defines the target vector
|
|
330
|
+
* @returns result input
|
|
325
331
|
*/
|
|
326
|
-
static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number, result:
|
|
332
|
+
static FromArrayToRef<T extends Vector2>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T;
|
|
327
333
|
/**
|
|
328
334
|
* Gets a new Vector2 located for "amount" (float) on the CatmullRom spline defined by the given four Vector2
|
|
329
335
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#65
|
|
@@ -334,7 +340,7 @@ export declare class Vector2 {
|
|
|
334
340
|
* @param amount defines the interpolation factor
|
|
335
341
|
* @returns a new Vector2
|
|
336
342
|
*/
|
|
337
|
-
static CatmullRom(value1: DeepImmutable<
|
|
343
|
+
static CatmullRom<T extends Vector2>(value1: DeepImmutable<T>, value2: DeepImmutable<Vector2>, value3: DeepImmutable<Vector2>, value4: DeepImmutable<Vector2>, amount: number): T;
|
|
338
344
|
/**
|
|
339
345
|
* Returns a new Vector2 set with same the coordinates than "value" ones if the vector "value" is in the square defined by "min" and "max".
|
|
340
346
|
* If a coordinate of "value" is lower than "min" coordinates, the returned Vector2 is given this "min" coordinate.
|
|
@@ -345,7 +351,7 @@ export declare class Vector2 {
|
|
|
345
351
|
* @param max defines the upper limit
|
|
346
352
|
* @returns a new Vector2
|
|
347
353
|
*/
|
|
348
|
-
static Clamp(value: DeepImmutable<
|
|
354
|
+
static Clamp<T extends Vector2>(value: DeepImmutable<T>, min: DeepImmutable<Vector2>, max: DeepImmutable<Vector2>): T;
|
|
349
355
|
/**
|
|
350
356
|
* Returns a new Vector2 located for "amount" (float) on the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2"
|
|
351
357
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#81
|
|
@@ -356,7 +362,7 @@ export declare class Vector2 {
|
|
|
356
362
|
* @param amount defines the interpolation factor
|
|
357
363
|
* @returns a new Vector2
|
|
358
364
|
*/
|
|
359
|
-
static Hermite(value1: DeepImmutable<
|
|
365
|
+
static Hermite<T extends Vector2>(value1: DeepImmutable<T>, tangent1: DeepImmutable<Vector2>, value2: DeepImmutable<Vector2>, tangent2: DeepImmutable<Vector2>, amount: number): T;
|
|
360
366
|
/**
|
|
361
367
|
* Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
|
|
362
368
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#82
|
|
@@ -367,7 +373,7 @@ export declare class Vector2 {
|
|
|
367
373
|
* @param time define where the derivative must be done
|
|
368
374
|
* @returns 1st derivative
|
|
369
375
|
*/
|
|
370
|
-
static Hermite1stDerivative(value1: DeepImmutable<
|
|
376
|
+
static Hermite1stDerivative<T extends Vector2>(value1: DeepImmutable<T>, tangent1: DeepImmutable<Vector2>, value2: DeepImmutable<Vector2>, tangent2: DeepImmutable<Vector2>, time: number): T;
|
|
371
377
|
/**
|
|
372
378
|
* Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
|
|
373
379
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#83
|
|
@@ -377,8 +383,9 @@ export declare class Vector2 {
|
|
|
377
383
|
* @param tangent2 defines the second tangent
|
|
378
384
|
* @param time define where the derivative must be done
|
|
379
385
|
* @param result define where the derivative will be stored
|
|
386
|
+
* @returns result input
|
|
380
387
|
*/
|
|
381
|
-
static Hermite1stDerivativeToRef(value1: DeepImmutable<Vector2>, tangent1: DeepImmutable<Vector2>, value2: DeepImmutable<Vector2>, tangent2: DeepImmutable<Vector2>, time: number, result:
|
|
388
|
+
static Hermite1stDerivativeToRef<T extends Vector2>(value1: DeepImmutable<Vector2>, tangent1: DeepImmutable<Vector2>, value2: DeepImmutable<Vector2>, tangent2: DeepImmutable<Vector2>, time: number, result: T): T;
|
|
382
389
|
/**
|
|
383
390
|
* Returns a new Vector2 located for "amount" (float) on the linear interpolation between the vector "start" adn the vector "end".
|
|
384
391
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#84
|
|
@@ -387,7 +394,7 @@ export declare class Vector2 {
|
|
|
387
394
|
* @param amount defines the interpolation factor
|
|
388
395
|
* @returns a new Vector2
|
|
389
396
|
*/
|
|
390
|
-
static Lerp(start: DeepImmutable<
|
|
397
|
+
static Lerp<T extends Vector2>(start: DeepImmutable<T>, end: DeepImmutable<Vector2>, amount: number): Vector2;
|
|
391
398
|
/**
|
|
392
399
|
* Gets the dot product of the vector "left" and the vector "right"
|
|
393
400
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#90
|
|
@@ -402,14 +409,15 @@ export declare class Vector2 {
|
|
|
402
409
|
* @param vector defines the vector to normalize
|
|
403
410
|
* @returns a new Vector2
|
|
404
411
|
*/
|
|
405
|
-
static Normalize(vector: DeepImmutable<
|
|
412
|
+
static Normalize<T extends Vector2>(vector: DeepImmutable<T>): T;
|
|
406
413
|
/**
|
|
407
414
|
* Normalize a given vector into a second one
|
|
408
415
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#50
|
|
409
416
|
* @param vector defines the vector to normalize
|
|
410
417
|
* @param result defines the vector where to store the result
|
|
418
|
+
* @returns result input
|
|
411
419
|
*/
|
|
412
|
-
static NormalizeToRef(vector: DeepImmutable<Vector2>, result:
|
|
420
|
+
static NormalizeToRef<T extends Vector2>(vector: DeepImmutable<Vector2>, result: T): T;
|
|
413
421
|
/**
|
|
414
422
|
* Gets a new Vector2 set with the minimal coordinate values from the "left" and "right" vectors
|
|
415
423
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#86
|
|
@@ -417,7 +425,7 @@ export declare class Vector2 {
|
|
|
417
425
|
* @param right defines 2nd vector
|
|
418
426
|
* @returns a new Vector2
|
|
419
427
|
*/
|
|
420
|
-
static Minimize(left: DeepImmutable<
|
|
428
|
+
static Minimize<T extends Vector2>(left: DeepImmutable<T>, right: DeepImmutable<Vector2>): T;
|
|
421
429
|
/**
|
|
422
430
|
* Gets a new Vector2 set with the maximal coordinate values from the "left" and "right" vectors
|
|
423
431
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#86
|
|
@@ -425,7 +433,7 @@ export declare class Vector2 {
|
|
|
425
433
|
* @param right defines 2nd vector
|
|
426
434
|
* @returns a new Vector2
|
|
427
435
|
*/
|
|
428
|
-
static Maximize(left: DeepImmutable<
|
|
436
|
+
static Maximize<T extends Vector2>(left: DeepImmutable<T>, right: DeepImmutable<Vector2>): T;
|
|
429
437
|
/**
|
|
430
438
|
* Gets a new Vector2 set with the transformed coordinates of the given vector by the given transformation matrix
|
|
431
439
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#17
|
|
@@ -433,15 +441,16 @@ export declare class Vector2 {
|
|
|
433
441
|
* @param transformation defines the matrix to apply
|
|
434
442
|
* @returns a new Vector2
|
|
435
443
|
*/
|
|
436
|
-
static Transform(vector: DeepImmutable<
|
|
444
|
+
static Transform<T extends Vector2>(vector: DeepImmutable<T>, transformation: DeepImmutable<Matrix>): T;
|
|
437
445
|
/**
|
|
438
446
|
* Transforms the given vector coordinates by the given transformation matrix and stores the result in the vector "result" coordinates
|
|
439
447
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#19
|
|
440
448
|
* @param vector defines the vector to transform
|
|
441
449
|
* @param transformation defines the matrix to apply
|
|
442
450
|
* @param result defines the target vector
|
|
451
|
+
* @returns result input
|
|
443
452
|
*/
|
|
444
|
-
static TransformToRef(vector: DeepImmutable<Vector2>, transformation: DeepImmutable<Matrix>, result:
|
|
453
|
+
static TransformToRef<T extends Vector2>(vector: DeepImmutable<Vector2>, transformation: DeepImmutable<Matrix>, result: T): T;
|
|
445
454
|
/**
|
|
446
455
|
* Determines if a given vector is included in a triangle
|
|
447
456
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#87
|
|
@@ -476,7 +485,7 @@ export declare class Vector2 {
|
|
|
476
485
|
* @param value2 defines second vector
|
|
477
486
|
* @returns a new Vector2
|
|
478
487
|
*/
|
|
479
|
-
static Center(value1: DeepImmutable<
|
|
488
|
+
static Center<T extends Vector2>(value1: DeepImmutable<T>, value2: DeepImmutable<Vector2>): T;
|
|
480
489
|
/**
|
|
481
490
|
* Gets the center of the vectors "value1" and "value2" and stores the result in the vector "ref"
|
|
482
491
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#66
|
|
@@ -485,7 +494,7 @@ export declare class Vector2 {
|
|
|
485
494
|
* @param ref defines third vector
|
|
486
495
|
* @returns ref
|
|
487
496
|
*/
|
|
488
|
-
static CenterToRef(value1: DeepImmutable<Vector2>, value2: DeepImmutable<Vector2>, ref:
|
|
497
|
+
static CenterToRef<T extends Vector2>(value1: DeepImmutable<Vector2>, value2: DeepImmutable<Vector2>, ref: T): T;
|
|
489
498
|
/**
|
|
490
499
|
* Gets the shortest distance (float) between the point "p" and the segment defined by the two points "segA" and "segB".
|
|
491
500
|
* Example Playground https://playground.babylonjs.com/#QYBWV4#77
|
|
@@ -564,7 +573,7 @@ export declare class Vector3 {
|
|
|
564
573
|
* @param index defines the offset in the destination array
|
|
565
574
|
* @returns the current Vector3
|
|
566
575
|
*/
|
|
567
|
-
toArray(array: FloatArray, index?: number):
|
|
576
|
+
toArray(array: FloatArray, index?: number): this;
|
|
568
577
|
/**
|
|
569
578
|
* Update the current vector from an array
|
|
570
579
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#24
|
|
@@ -572,7 +581,7 @@ export declare class Vector3 {
|
|
|
572
581
|
* @param index defines the offset in the destination array
|
|
573
582
|
* @returns the current Vector3
|
|
574
583
|
*/
|
|
575
|
-
fromArray(array: FloatArray, index?: number):
|
|
584
|
+
fromArray(array: FloatArray, index?: number): this;
|
|
576
585
|
/**
|
|
577
586
|
* Converts the current Vector3 into a quaternion (considering that the Vector3 contains Euler angles representation of a rotation)
|
|
578
587
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#66
|
|
@@ -585,7 +594,7 @@ export declare class Vector3 {
|
|
|
585
594
|
* @param otherVector defines the second operand
|
|
586
595
|
* @returns the current updated Vector3
|
|
587
596
|
*/
|
|
588
|
-
addInPlace(otherVector: DeepImmutable<Vector3>):
|
|
597
|
+
addInPlace(otherVector: DeepImmutable<Vector3>): this;
|
|
589
598
|
/**
|
|
590
599
|
* Adds the given coordinates to the current Vector3
|
|
591
600
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#5
|
|
@@ -594,14 +603,14 @@ export declare class Vector3 {
|
|
|
594
603
|
* @param z defines the z coordinate of the operand
|
|
595
604
|
* @returns the current updated Vector3
|
|
596
605
|
*/
|
|
597
|
-
addInPlaceFromFloats(x: number, y: number, z: number):
|
|
606
|
+
addInPlaceFromFloats(x: number, y: number, z: number): this;
|
|
598
607
|
/**
|
|
599
608
|
* Gets a new Vector3, result of the addition the current Vector3 and the given vector
|
|
600
609
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#3
|
|
601
610
|
* @param otherVector defines the second operand
|
|
602
611
|
* @returns the resulting Vector3
|
|
603
612
|
*/
|
|
604
|
-
add(otherVector: DeepImmutable<Vector3>):
|
|
613
|
+
add(otherVector: DeepImmutable<Vector3>): this;
|
|
605
614
|
/**
|
|
606
615
|
* Adds the current Vector3 to the given one and stores the result in the vector "result"
|
|
607
616
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#6
|
|
@@ -609,21 +618,21 @@ export declare class Vector3 {
|
|
|
609
618
|
* @param result defines the Vector3 object where to store the result
|
|
610
619
|
* @returns the result
|
|
611
620
|
*/
|
|
612
|
-
addToRef(otherVector: DeepImmutable<Vector3>, result:
|
|
621
|
+
addToRef<T extends Vector3>(otherVector: DeepImmutable<Vector3>, result: T): T;
|
|
613
622
|
/**
|
|
614
623
|
* Subtract the given vector from the current Vector3
|
|
615
624
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#61
|
|
616
625
|
* @param otherVector defines the second operand
|
|
617
626
|
* @returns the current updated Vector3
|
|
618
627
|
*/
|
|
619
|
-
subtractInPlace(otherVector: DeepImmutable<Vector3>):
|
|
628
|
+
subtractInPlace(otherVector: DeepImmutable<Vector3>): this;
|
|
620
629
|
/**
|
|
621
630
|
* Returns a new Vector3, result of the subtraction of the given vector from the current Vector3
|
|
622
631
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#60
|
|
623
632
|
* @param otherVector defines the second operand
|
|
624
633
|
* @returns the resulting Vector3
|
|
625
634
|
*/
|
|
626
|
-
subtract(otherVector: DeepImmutable<Vector3>):
|
|
635
|
+
subtract(otherVector: DeepImmutable<Vector3>): this;
|
|
627
636
|
/**
|
|
628
637
|
* Subtracts the given vector from the current Vector3 and stores the result in the vector "result".
|
|
629
638
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#63
|
|
@@ -631,7 +640,7 @@ export declare class Vector3 {
|
|
|
631
640
|
* @param result defines the Vector3 object where to store the result
|
|
632
641
|
* @returns the result
|
|
633
642
|
*/
|
|
634
|
-
subtractToRef(otherVector: DeepImmutable<Vector3>, result:
|
|
643
|
+
subtractToRef<T extends Vector3>(otherVector: DeepImmutable<Vector3>, result: T): T;
|
|
635
644
|
/**
|
|
636
645
|
* Returns a new Vector3 set with the subtraction of the given floats from the current Vector3 coordinates
|
|
637
646
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#62
|
|
@@ -640,7 +649,7 @@ export declare class Vector3 {
|
|
|
640
649
|
* @param z defines the z coordinate of the operand
|
|
641
650
|
* @returns the resulting Vector3
|
|
642
651
|
*/
|
|
643
|
-
subtractFromFloats(x: number, y: number, z: number):
|
|
652
|
+
subtractFromFloats(x: number, y: number, z: number): this;
|
|
644
653
|
/**
|
|
645
654
|
* Subtracts the given floats from the current Vector3 coordinates and set the given vector "result" with this result
|
|
646
655
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#64
|
|
@@ -650,40 +659,40 @@ export declare class Vector3 {
|
|
|
650
659
|
* @param result defines the Vector3 object where to store the result
|
|
651
660
|
* @returns the result
|
|
652
661
|
*/
|
|
653
|
-
subtractFromFloatsToRef(x: number, y: number, z: number, result:
|
|
662
|
+
subtractFromFloatsToRef<T extends Vector3>(x: number, y: number, z: number, result: T): T;
|
|
654
663
|
/**
|
|
655
664
|
* Gets a new Vector3 set with the current Vector3 negated coordinates
|
|
656
665
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#35
|
|
657
666
|
* @returns a new Vector3
|
|
658
667
|
*/
|
|
659
|
-
negate():
|
|
668
|
+
negate(): this;
|
|
660
669
|
/**
|
|
661
670
|
* Negate this vector in place
|
|
662
671
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#36
|
|
663
672
|
* @returns this
|
|
664
673
|
*/
|
|
665
|
-
negateInPlace():
|
|
674
|
+
negateInPlace(): this;
|
|
666
675
|
/**
|
|
667
676
|
* Negate the current Vector3 and stores the result in the given vector "result" coordinates
|
|
668
677
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#37
|
|
669
678
|
* @param result defines the Vector3 object where to store the result
|
|
670
679
|
* @returns the result
|
|
671
680
|
*/
|
|
672
|
-
negateToRef(result:
|
|
681
|
+
negateToRef<T extends Vector3 = Vector3>(result: T): T;
|
|
673
682
|
/**
|
|
674
683
|
* Multiplies the Vector3 coordinates by the float "scale"
|
|
675
684
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#56
|
|
676
685
|
* @param scale defines the multiplier factor
|
|
677
686
|
* @returns the current updated Vector3
|
|
678
687
|
*/
|
|
679
|
-
scaleInPlace(scale: number):
|
|
688
|
+
scaleInPlace(scale: number): this;
|
|
680
689
|
/**
|
|
681
690
|
* Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float "scale"
|
|
682
691
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#53
|
|
683
692
|
* @param scale defines the multiplier factor
|
|
684
693
|
* @returns a new Vector3
|
|
685
694
|
*/
|
|
686
|
-
scale(scale: number):
|
|
695
|
+
scale(scale: number): this;
|
|
687
696
|
/**
|
|
688
697
|
* Multiplies the current Vector3 coordinates by the float "scale" and stores the result in the given vector "result" coordinates
|
|
689
698
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#57
|
|
@@ -691,7 +700,7 @@ export declare class Vector3 {
|
|
|
691
700
|
* @param result defines the Vector3 object where to store the result
|
|
692
701
|
* @returns the result
|
|
693
702
|
*/
|
|
694
|
-
scaleToRef(scale: number, result:
|
|
703
|
+
scaleToRef<T extends Vector3>(scale: number, result: T): T;
|
|
695
704
|
/**
|
|
696
705
|
* Creates a vector normal (perpendicular) to the current Vector3 and stores the result in the given vector
|
|
697
706
|
* @param result defines the Vector3 object where to store the resultant normal
|
|
@@ -706,29 +715,29 @@ export declare class Vector3 {
|
|
|
706
715
|
* @param result the output vector
|
|
707
716
|
* @returns the result
|
|
708
717
|
*/
|
|
709
|
-
applyRotationQuaternionToRef(q: Quaternion, result:
|
|
718
|
+
applyRotationQuaternionToRef<T extends Vector3>(q: Quaternion, result: T): T;
|
|
710
719
|
/**
|
|
711
720
|
* Rotates the vector in place using the given unit quaternion
|
|
712
721
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#8
|
|
713
722
|
* @param q the unit quaternion representing the rotation
|
|
714
723
|
* @returns the current updated Vector3
|
|
715
724
|
*/
|
|
716
|
-
applyRotationQuaternionInPlace(q: Quaternion):
|
|
725
|
+
applyRotationQuaternionInPlace(q: Quaternion): this;
|
|
717
726
|
/**
|
|
718
727
|
* Rotates the vector using the given unit quaternion and returns the new vector
|
|
719
728
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#7
|
|
720
729
|
* @param q the unit quaternion representing the rotation
|
|
721
730
|
* @returns a new Vector3
|
|
722
731
|
*/
|
|
723
|
-
applyRotationQuaternion(q: Quaternion):
|
|
732
|
+
applyRotationQuaternion(q: Quaternion): this;
|
|
724
733
|
/**
|
|
725
734
|
* Scale the current Vector3 values by a factor and add the result to a given Vector3
|
|
726
735
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#55
|
|
727
736
|
* @param scale defines the scale factor
|
|
728
737
|
* @param result defines the Vector3 object where to store the result
|
|
729
|
-
* @returns
|
|
738
|
+
* @returns result input
|
|
730
739
|
*/
|
|
731
|
-
scaleAndAddToRef(scale: number, result:
|
|
740
|
+
scaleAndAddToRef<T extends Vector3>(scale: number, result: T): T;
|
|
732
741
|
/**
|
|
733
742
|
* Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
|
|
734
743
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#48
|
|
@@ -736,15 +745,16 @@ export declare class Vector3 {
|
|
|
736
745
|
* @param origin defines the origin of the projection ray
|
|
737
746
|
* @returns the projected vector3
|
|
738
747
|
*/
|
|
739
|
-
projectOnPlane(plane: Plane, origin: Vector3):
|
|
748
|
+
projectOnPlane<T extends Vector3>(plane: Plane, origin: Vector3): T;
|
|
740
749
|
/**
|
|
741
750
|
* Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
|
|
742
751
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#49
|
|
743
752
|
* @param plane defines the plane to project to
|
|
744
753
|
* @param origin defines the origin of the projection ray
|
|
745
754
|
* @param result defines the Vector3 where to store the result
|
|
755
|
+
* @returns result input
|
|
746
756
|
*/
|
|
747
|
-
projectOnPlaneToRef(plane: Plane, origin: Vector3, result:
|
|
757
|
+
projectOnPlaneToRef<T extends Vector3>(plane: Plane, origin: Vector3, result: T): T;
|
|
748
758
|
/**
|
|
749
759
|
* Returns true if the current Vector3 and the given vector coordinates are strictly equal
|
|
750
760
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#19
|
|
@@ -775,14 +785,14 @@ export declare class Vector3 {
|
|
|
775
785
|
* @param otherVector defines the second operand
|
|
776
786
|
* @returns the current updated Vector3
|
|
777
787
|
*/
|
|
778
|
-
multiplyInPlace(otherVector: DeepImmutable<Vector3>):
|
|
788
|
+
multiplyInPlace(otherVector: DeepImmutable<Vector3>): this;
|
|
779
789
|
/**
|
|
780
790
|
* Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector
|
|
781
791
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#31
|
|
782
792
|
* @param otherVector defines the second operand
|
|
783
793
|
* @returns the new Vector3
|
|
784
794
|
*/
|
|
785
|
-
multiply(otherVector: DeepImmutable<Vector3>):
|
|
795
|
+
multiply(otherVector: DeepImmutable<Vector3>): this;
|
|
786
796
|
/**
|
|
787
797
|
* Multiplies the current Vector3 by the given one and stores the result in the given vector "result"
|
|
788
798
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#33
|
|
@@ -790,7 +800,7 @@ export declare class Vector3 {
|
|
|
790
800
|
* @param result defines the Vector3 object where to store the result
|
|
791
801
|
* @returns the result
|
|
792
802
|
*/
|
|
793
|
-
multiplyToRef(otherVector: DeepImmutable<Vector3>, result:
|
|
803
|
+
multiplyToRef<T extends Vector3>(otherVector: DeepImmutable<Vector3>, result: T): T;
|
|
794
804
|
/**
|
|
795
805
|
* Returns a new Vector3 set with the result of the multiplication of the current Vector3 coordinates by the given floats
|
|
796
806
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#34
|
|
@@ -799,14 +809,14 @@ export declare class Vector3 {
|
|
|
799
809
|
* @param z defines the z coordinate of the operand
|
|
800
810
|
* @returns the new Vector3
|
|
801
811
|
*/
|
|
802
|
-
multiplyByFloats(x: number, y: number, z: number):
|
|
812
|
+
multiplyByFloats(x: number, y: number, z: number): this;
|
|
803
813
|
/**
|
|
804
814
|
* Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones
|
|
805
815
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#16
|
|
806
816
|
* @param otherVector defines the second operand
|
|
807
817
|
* @returns the new Vector3
|
|
808
818
|
*/
|
|
809
|
-
divide(otherVector: DeepImmutable<Vector3>):
|
|
819
|
+
divide(otherVector: DeepImmutable<Vector3>): this;
|
|
810
820
|
/**
|
|
811
821
|
* Divides the current Vector3 coordinates by the given ones and stores the result in the given vector "result"
|
|
812
822
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#18
|
|
@@ -814,28 +824,28 @@ export declare class Vector3 {
|
|
|
814
824
|
* @param result defines the Vector3 object where to store the result
|
|
815
825
|
* @returns the result
|
|
816
826
|
*/
|
|
817
|
-
divideToRef(otherVector: DeepImmutable<Vector3>, result:
|
|
827
|
+
divideToRef<T extends Vector3>(otherVector: DeepImmutable<Vector3>, result: T): T;
|
|
818
828
|
/**
|
|
819
829
|
* Divides the current Vector3 coordinates by the given ones.
|
|
820
830
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#17
|
|
821
831
|
* @param otherVector defines the second operand
|
|
822
832
|
* @returns the current updated Vector3
|
|
823
833
|
*/
|
|
824
|
-
divideInPlace(otherVector: Vector3):
|
|
834
|
+
divideInPlace(otherVector: Vector3): this;
|
|
825
835
|
/**
|
|
826
836
|
* Updates the current Vector3 with the minimal coordinate values between its and the given vector ones
|
|
827
837
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#29
|
|
828
838
|
* @param other defines the second operand
|
|
829
839
|
* @returns the current updated Vector3
|
|
830
840
|
*/
|
|
831
|
-
minimizeInPlace(other: DeepImmutable<Vector3>):
|
|
841
|
+
minimizeInPlace(other: DeepImmutable<Vector3>): this;
|
|
832
842
|
/**
|
|
833
843
|
* Updates the current Vector3 with the maximal coordinate values between its and the given vector ones.
|
|
834
844
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#27
|
|
835
845
|
* @param other defines the second operand
|
|
836
846
|
* @returns the current updated Vector3
|
|
837
847
|
*/
|
|
838
|
-
maximizeInPlace(other: DeepImmutable<Vector3>):
|
|
848
|
+
maximizeInPlace(other: DeepImmutable<Vector3>): this;
|
|
839
849
|
/**
|
|
840
850
|
* Updates the current Vector3 with the minimal coordinate values between its and the given coordinates
|
|
841
851
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#30
|
|
@@ -844,7 +854,7 @@ export declare class Vector3 {
|
|
|
844
854
|
* @param z defines the z coordinate of the operand
|
|
845
855
|
* @returns the current updated Vector3
|
|
846
856
|
*/
|
|
847
|
-
minimizeInPlaceFromFloats(x: number, y: number, z: number):
|
|
857
|
+
minimizeInPlaceFromFloats(x: number, y: number, z: number): this;
|
|
848
858
|
/**
|
|
849
859
|
* Updates the current Vector3 with the maximal coordinate values between its and the given coordinates.
|
|
850
860
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#28
|
|
@@ -853,7 +863,7 @@ export declare class Vector3 {
|
|
|
853
863
|
* @param z defines the z coordinate of the operand
|
|
854
864
|
* @returns the current updated Vector3
|
|
855
865
|
*/
|
|
856
|
-
maximizeInPlaceFromFloats(x: number, y: number, z: number):
|
|
866
|
+
maximizeInPlaceFromFloats(x: number, y: number, z: number): this;
|
|
857
867
|
/**
|
|
858
868
|
* Due to float precision, scale of a mesh could be uniform but float values are off by a small fraction
|
|
859
869
|
* Check if is non uniform within a certain amount of decimal places to account for this
|
|
@@ -870,13 +880,13 @@ export declare class Vector3 {
|
|
|
870
880
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#22
|
|
871
881
|
* @returns a new Vector3
|
|
872
882
|
*/
|
|
873
|
-
floor():
|
|
883
|
+
floor(): this;
|
|
874
884
|
/**
|
|
875
885
|
* Gets a new Vector3 from current Vector3 fractional values
|
|
876
886
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#23
|
|
877
887
|
* @returns a new Vector3
|
|
878
888
|
*/
|
|
879
|
-
fract():
|
|
889
|
+
fract(): this;
|
|
880
890
|
/**
|
|
881
891
|
* Gets the length of the Vector3
|
|
882
892
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#25
|
|
@@ -900,7 +910,7 @@ export declare class Vector3 {
|
|
|
900
910
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#122
|
|
901
911
|
* @returns the current updated Vector3
|
|
902
912
|
*/
|
|
903
|
-
normalize():
|
|
913
|
+
normalize(): this;
|
|
904
914
|
/**
|
|
905
915
|
* Reorders the x y z properties of the vector in place
|
|
906
916
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#44
|
|
@@ -915,7 +925,7 @@ export declare class Vector3 {
|
|
|
915
925
|
* @param result vector to store the result
|
|
916
926
|
* @returns the resulting vector
|
|
917
927
|
*/
|
|
918
|
-
rotateByQuaternionToRef(quaternion: Quaternion, result:
|
|
928
|
+
rotateByQuaternionToRef<T extends Vector3>(quaternion: Quaternion, result: T): T;
|
|
919
929
|
/**
|
|
920
930
|
* Rotates a vector around a given point
|
|
921
931
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#46
|
|
@@ -924,7 +934,7 @@ export declare class Vector3 {
|
|
|
924
934
|
* @param result vector to store the result
|
|
925
935
|
* @returns the resulting vector
|
|
926
936
|
*/
|
|
927
|
-
rotateByQuaternionAroundPointToRef(quaternion: Quaternion, point: Vector3, result:
|
|
937
|
+
rotateByQuaternionAroundPointToRef<T extends Vector3>(quaternion: Quaternion, point: Vector3, result: T): T;
|
|
928
938
|
/**
|
|
929
939
|
* Returns a new Vector3 as the cross product of the current vector and the "other" one
|
|
930
940
|
* The cross product is then orthogonal to both current and "other"
|
|
@@ -932,7 +942,7 @@ export declare class Vector3 {
|
|
|
932
942
|
* @param other defines the right operand
|
|
933
943
|
* @returns the cross product
|
|
934
944
|
*/
|
|
935
|
-
cross(other: Vector3):
|
|
945
|
+
cross(other: Vector3): this;
|
|
936
946
|
/**
|
|
937
947
|
* Normalize the current Vector3 with the given input length.
|
|
938
948
|
* Please note that this is an in place operation.
|
|
@@ -940,33 +950,33 @@ export declare class Vector3 {
|
|
|
940
950
|
* @param len the length of the vector
|
|
941
951
|
* @returns the current updated Vector3
|
|
942
952
|
*/
|
|
943
|
-
normalizeFromLength(len: number):
|
|
953
|
+
normalizeFromLength(len: number): this;
|
|
944
954
|
/**
|
|
945
955
|
* Normalize the current Vector3 to a new vector
|
|
946
956
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#124
|
|
947
957
|
* @returns the new Vector3
|
|
948
958
|
*/
|
|
949
|
-
normalizeToNew():
|
|
959
|
+
normalizeToNew(): this;
|
|
950
960
|
/**
|
|
951
961
|
* Normalize the current Vector3 to the reference
|
|
952
962
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#125
|
|
953
963
|
* @param reference define the Vector3 to update
|
|
954
964
|
* @returns the updated Vector3
|
|
955
965
|
*/
|
|
956
|
-
normalizeToRef(reference:
|
|
966
|
+
normalizeToRef<T extends Vector3>(reference: T): T;
|
|
957
967
|
/**
|
|
958
968
|
* Creates a new Vector3 copied from the current Vector3
|
|
959
969
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#11
|
|
960
970
|
* @returns the new Vector3
|
|
961
971
|
*/
|
|
962
|
-
clone():
|
|
972
|
+
clone(): this;
|
|
963
973
|
/**
|
|
964
974
|
* Copies the given vector coordinates to the current Vector3 ones
|
|
965
975
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#12
|
|
966
976
|
* @param source defines the source Vector3
|
|
967
977
|
* @returns the current updated Vector3
|
|
968
978
|
*/
|
|
969
|
-
copyFrom(source: DeepImmutable<Vector3>):
|
|
979
|
+
copyFrom(source: DeepImmutable<Vector3>): this;
|
|
970
980
|
/**
|
|
971
981
|
* Copies the given floats to the current Vector3 coordinates
|
|
972
982
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#13
|
|
@@ -975,7 +985,7 @@ export declare class Vector3 {
|
|
|
975
985
|
* @param z defines the z coordinate of the operand
|
|
976
986
|
* @returns the current updated Vector3
|
|
977
987
|
*/
|
|
978
|
-
copyFromFloats(x: number, y: number, z: number):
|
|
988
|
+
copyFromFloats(x: number, y: number, z: number): this;
|
|
979
989
|
/**
|
|
980
990
|
* Copies the given floats to the current Vector3 coordinates
|
|
981
991
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#58
|
|
@@ -984,14 +994,14 @@ export declare class Vector3 {
|
|
|
984
994
|
* @param z defines the z coordinate of the operand
|
|
985
995
|
* @returns the current updated Vector3
|
|
986
996
|
*/
|
|
987
|
-
set(x: number, y: number, z: number):
|
|
997
|
+
set(x: number, y: number, z: number): this;
|
|
988
998
|
/**
|
|
989
999
|
* Copies the given float to the current Vector3 coordinates
|
|
990
1000
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#59
|
|
991
1001
|
* @param v defines the x, y and z coordinates of the operand
|
|
992
1002
|
* @returns the current updated Vector3
|
|
993
1003
|
*/
|
|
994
|
-
setAll(v: number):
|
|
1004
|
+
setAll(v: number): this;
|
|
995
1005
|
/**
|
|
996
1006
|
* Get the clip factor between two vectors
|
|
997
1007
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#126
|
|
@@ -1029,7 +1039,7 @@ export declare class Vector3 {
|
|
|
1029
1039
|
* @param ref the vector3 to store the result
|
|
1030
1040
|
* @returns ref in the form (pitch, yaw, 0)
|
|
1031
1041
|
*/
|
|
1032
|
-
static PitchYawRollToMoveBetweenPointsToRef(start: Vector3, target: Vector3, ref:
|
|
1042
|
+
static PitchYawRollToMoveBetweenPointsToRef<T extends Vector3>(start: Vector3, target: Vector3, ref: T): T;
|
|
1033
1043
|
/**
|
|
1034
1044
|
* Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point
|
|
1035
1045
|
* Example PG https://playground.babylonjs.com/#R1F8YU#188
|
|
@@ -1049,7 +1059,7 @@ export declare class Vector3 {
|
|
|
1049
1059
|
* @param slerp amount (will be clamped between 0 and 1)
|
|
1050
1060
|
* @param result The slerped vector
|
|
1051
1061
|
*/
|
|
1052
|
-
static SlerpToRef(vector0: Vector3, vector1: Vector3, slerp: number, result:
|
|
1062
|
+
static SlerpToRef<T extends Vector3 = Vector3>(vector0: Vector3, vector1: Vector3, slerp: number, result: T): T;
|
|
1053
1063
|
/**
|
|
1054
1064
|
* Smooth interpolation between two vectors using Slerp
|
|
1055
1065
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#110
|
|
@@ -1059,7 +1069,7 @@ export declare class Vector3 {
|
|
|
1059
1069
|
* @param lerpTime total interpolation time
|
|
1060
1070
|
* @param result the smoothed vector
|
|
1061
1071
|
*/
|
|
1062
|
-
static SmoothToRef(source: Vector3, goal: Vector3, deltaTime: number, lerpTime: number, result:
|
|
1072
|
+
static SmoothToRef<T extends Vector3 = Vector3>(source: Vector3, goal: Vector3, deltaTime: number, lerpTime: number, result: T): T;
|
|
1063
1073
|
/**
|
|
1064
1074
|
* Returns a new Vector3 set from the index "offset" of the given array
|
|
1065
1075
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#83
|
|
@@ -1082,8 +1092,9 @@ export declare class Vector3 {
|
|
|
1082
1092
|
* @param array defines the source array
|
|
1083
1093
|
* @param offset defines the offset in the source array
|
|
1084
1094
|
* @param result defines the Vector3 where to store the result
|
|
1095
|
+
* @returns result input
|
|
1085
1096
|
*/
|
|
1086
|
-
static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number, result:
|
|
1097
|
+
static FromArrayToRef<T extends Vector3>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T;
|
|
1087
1098
|
/**
|
|
1088
1099
|
* Sets the given vector "result" with the element values from the index "offset" of the given Float32Array
|
|
1089
1100
|
* @param array defines the source array
|
|
@@ -1091,7 +1102,7 @@ export declare class Vector3 {
|
|
|
1091
1102
|
* @param result defines the Vector3 where to store the result
|
|
1092
1103
|
* @deprecated Please use FromArrayToRef instead.
|
|
1093
1104
|
*/
|
|
1094
|
-
static FromFloatArrayToRef(array: DeepImmutable<Float32Array>, offset: number, result:
|
|
1105
|
+
static FromFloatArrayToRef<T extends Vector3>(array: DeepImmutable<Float32Array>, offset: number, result: T): T;
|
|
1095
1106
|
/**
|
|
1096
1107
|
* Sets the given vector "result" with the given floats.
|
|
1097
1108
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#85
|
|
@@ -1100,7 +1111,7 @@ export declare class Vector3 {
|
|
|
1100
1111
|
* @param z defines the z coordinate of the source
|
|
1101
1112
|
* @param result defines the Vector3 where to store the result
|
|
1102
1113
|
*/
|
|
1103
|
-
static FromFloatsToRef(x: number, y: number, z: number, result:
|
|
1114
|
+
static FromFloatsToRef<T extends Vector3 = Vector3>(x: number, y: number, z: number, result: T): T;
|
|
1104
1115
|
/**
|
|
1105
1116
|
* Returns a new Vector3 set to (0.0, 0.0, 0.0)
|
|
1106
1117
|
* @returns a new empty Vector3
|
|
@@ -1185,7 +1196,7 @@ export declare class Vector3 {
|
|
|
1185
1196
|
* @param transformation defines the transformation matrix
|
|
1186
1197
|
* @returns the transformed Vector3
|
|
1187
1198
|
*/
|
|
1188
|
-
static TransformCoordinates(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>): Vector3;
|
|
1199
|
+
static TransformCoordinates<T extends Vector3>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>): Vector3;
|
|
1189
1200
|
/**
|
|
1190
1201
|
* Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector
|
|
1191
1202
|
* This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
|
|
@@ -1193,8 +1204,9 @@ export declare class Vector3 {
|
|
|
1193
1204
|
* @param vector defines the Vector3 to transform
|
|
1194
1205
|
* @param transformation defines the transformation matrix
|
|
1195
1206
|
* @param result defines the Vector3 where to store the result
|
|
1207
|
+
* @returns result input
|
|
1196
1208
|
*/
|
|
1197
|
-
static TransformCoordinatesToRef(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result:
|
|
1209
|
+
static TransformCoordinatesToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T;
|
|
1198
1210
|
/**
|
|
1199
1211
|
* Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
|
|
1200
1212
|
* This method computes transformed coordinates only, not transformed direction vectors
|
|
@@ -1204,8 +1216,9 @@ export declare class Vector3 {
|
|
|
1204
1216
|
* @param z define the z coordinate of the source vector
|
|
1205
1217
|
* @param transformation defines the transformation matrix
|
|
1206
1218
|
* @param result defines the Vector3 where to store the result
|
|
1219
|
+
* @returns result input
|
|
1207
1220
|
*/
|
|
1208
|
-
static TransformCoordinatesFromFloatsToRef(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result:
|
|
1221
|
+
static TransformCoordinatesFromFloatsToRef<T extends Vector3>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T;
|
|
1209
1222
|
/**
|
|
1210
1223
|
* Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector
|
|
1211
1224
|
* This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
|
|
@@ -1222,8 +1235,9 @@ export declare class Vector3 {
|
|
|
1222
1235
|
* @param vector defines the Vector3 to transform
|
|
1223
1236
|
* @param transformation defines the transformation matrix
|
|
1224
1237
|
* @param result defines the Vector3 where to store the result
|
|
1238
|
+
* @returns result input
|
|
1225
1239
|
*/
|
|
1226
|
-
static TransformNormalToRef(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result:
|
|
1240
|
+
static TransformNormalToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T;
|
|
1227
1241
|
/**
|
|
1228
1242
|
* Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z)
|
|
1229
1243
|
* This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
|
|
@@ -1233,8 +1247,9 @@ export declare class Vector3 {
|
|
|
1233
1247
|
* @param z define the z coordinate of the source vector
|
|
1234
1248
|
* @param transformation defines the transformation matrix
|
|
1235
1249
|
* @param result defines the Vector3 where to store the result
|
|
1250
|
+
* @returns result input
|
|
1236
1251
|
*/
|
|
1237
|
-
static TransformNormalFromFloatsToRef(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result:
|
|
1252
|
+
static TransformNormalFromFloatsToRef<T extends Vector3>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T;
|
|
1238
1253
|
/**
|
|
1239
1254
|
* Returns a new Vector3 located for "amount" on the CatmullRom interpolation spline defined by the vectors "value1", "value2", "value3", "value4"
|
|
1240
1255
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#69
|
|
@@ -1245,7 +1260,7 @@ export declare class Vector3 {
|
|
|
1245
1260
|
* @param amount defines the amount on the spline to use
|
|
1246
1261
|
* @returns the new Vector3
|
|
1247
1262
|
*/
|
|
1248
|
-
static CatmullRom(value1: DeepImmutable<
|
|
1263
|
+
static CatmullRom<T extends Vector3>(value1: DeepImmutable<T>, value2: DeepImmutable<Vector3>, value3: DeepImmutable<Vector3>, value4: DeepImmutable<Vector3>, amount: number): T;
|
|
1249
1264
|
/**
|
|
1250
1265
|
* Returns a new Vector3 set with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max"
|
|
1251
1266
|
* If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
|
|
@@ -1256,7 +1271,7 @@ export declare class Vector3 {
|
|
|
1256
1271
|
* @param max defines the upper range value
|
|
1257
1272
|
* @returns the new Vector3
|
|
1258
1273
|
*/
|
|
1259
|
-
static Clamp(value: DeepImmutable<
|
|
1274
|
+
static Clamp<T extends Vector3>(value: DeepImmutable<T>, min: DeepImmutable<Vector3>, max: DeepImmutable<Vector3>): T;
|
|
1260
1275
|
/**
|
|
1261
1276
|
* Sets the given vector "result" with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max"
|
|
1262
1277
|
* If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
|
|
@@ -1266,8 +1281,9 @@ export declare class Vector3 {
|
|
|
1266
1281
|
* @param min defines the lower range value
|
|
1267
1282
|
* @param max defines the upper range value
|
|
1268
1283
|
* @param result defines the Vector3 where to store the result
|
|
1284
|
+
* @returns result input
|
|
1269
1285
|
*/
|
|
1270
|
-
static ClampToRef(value: DeepImmutable<Vector3>, min: DeepImmutable<Vector3>, max: DeepImmutable<Vector3>, result:
|
|
1286
|
+
static ClampToRef<T extends Vector3>(value: DeepImmutable<Vector3>, min: DeepImmutable<Vector3>, max: DeepImmutable<Vector3>, result: T): T;
|
|
1271
1287
|
/**
|
|
1272
1288
|
* Checks if a given vector is inside a specific range
|
|
1273
1289
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#75
|
|
@@ -1286,7 +1302,7 @@ export declare class Vector3 {
|
|
|
1286
1302
|
* @param amount defines the amount on the interpolation spline (between 0 and 1)
|
|
1287
1303
|
* @returns the new Vector3
|
|
1288
1304
|
*/
|
|
1289
|
-
static Hermite(value1: DeepImmutable<
|
|
1305
|
+
static Hermite<T extends Vector3>(value1: DeepImmutable<T>, tangent1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, tangent2: DeepImmutable<Vector3>, amount: number): T;
|
|
1290
1306
|
/**
|
|
1291
1307
|
* Returns a new Vector3 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
|
|
1292
1308
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#90
|
|
@@ -1297,7 +1313,7 @@ export declare class Vector3 {
|
|
|
1297
1313
|
* @param time define where the derivative must be done
|
|
1298
1314
|
* @returns 1st derivative
|
|
1299
1315
|
*/
|
|
1300
|
-
static Hermite1stDerivative(value1: DeepImmutable<
|
|
1316
|
+
static Hermite1stDerivative<T extends Vector3>(value1: DeepImmutable<T>, tangent1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, tangent2: DeepImmutable<Vector3>, time: number): T;
|
|
1301
1317
|
/**
|
|
1302
1318
|
* Update a Vector3 with the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
|
|
1303
1319
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#91
|
|
@@ -1307,8 +1323,9 @@ export declare class Vector3 {
|
|
|
1307
1323
|
* @param tangent2 defines the second tangent
|
|
1308
1324
|
* @param time define where the derivative must be done
|
|
1309
1325
|
* @param result define where to store the derivative
|
|
1326
|
+
* @returns result input
|
|
1310
1327
|
*/
|
|
1311
|
-
static Hermite1stDerivativeToRef(value1: DeepImmutable<Vector3>, tangent1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, tangent2: DeepImmutable<Vector3>, time: number, result:
|
|
1328
|
+
static Hermite1stDerivativeToRef<T extends Vector3>(value1: DeepImmutable<Vector3>, tangent1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, tangent2: DeepImmutable<Vector3>, time: number, result: T): T;
|
|
1312
1329
|
/**
|
|
1313
1330
|
* Returns a new Vector3 located for "amount" (float) on the linear interpolation between the vectors "start" and "end"
|
|
1314
1331
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#95
|
|
@@ -1317,7 +1334,7 @@ export declare class Vector3 {
|
|
|
1317
1334
|
* @param amount max defines amount between both (between 0 and 1)
|
|
1318
1335
|
* @returns the new Vector3
|
|
1319
1336
|
*/
|
|
1320
|
-
static Lerp(start: DeepImmutable<
|
|
1337
|
+
static Lerp<T extends Vector3>(start: DeepImmutable<T>, end: DeepImmutable<Vector3>, amount: number): T;
|
|
1321
1338
|
/**
|
|
1322
1339
|
* Sets the given vector "result" with the result of the linear interpolation from the vector "start" for "amount" to the vector "end"
|
|
1323
1340
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#93
|
|
@@ -1325,8 +1342,9 @@ export declare class Vector3 {
|
|
|
1325
1342
|
* @param end defines the end value
|
|
1326
1343
|
* @param amount max defines amount between both (between 0 and 1)
|
|
1327
1344
|
* @param result defines the Vector3 where to store the result
|
|
1345
|
+
* @returns result input
|
|
1328
1346
|
*/
|
|
1329
|
-
static LerpToRef(start: DeepImmutable<Vector3>, end: DeepImmutable<Vector3>, amount: number, result:
|
|
1347
|
+
static LerpToRef<T extends Vector3>(start: DeepImmutable<Vector3>, end: DeepImmutable<Vector3>, amount: number, result: T): T;
|
|
1330
1348
|
/**
|
|
1331
1349
|
* Returns the dot product (float) between the vectors "left" and "right"
|
|
1332
1350
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#82
|
|
@@ -1343,7 +1361,7 @@ export declare class Vector3 {
|
|
|
1343
1361
|
* @param right defines the right operand
|
|
1344
1362
|
* @returns the cross product
|
|
1345
1363
|
*/
|
|
1346
|
-
static Cross(left: DeepImmutable<
|
|
1364
|
+
static Cross<T extends Vector3>(left: DeepImmutable<T>, right: DeepImmutable<Vector3>): T;
|
|
1347
1365
|
/**
|
|
1348
1366
|
* Sets the given vector "result" with the cross product of "left" and "right"
|
|
1349
1367
|
* The cross product is then orthogonal to both "left" and "right"
|
|
@@ -1351,8 +1369,9 @@ export declare class Vector3 {
|
|
|
1351
1369
|
* @param left defines the left operand
|
|
1352
1370
|
* @param right defines the right operand
|
|
1353
1371
|
* @param result defines the Vector3 where to store the result
|
|
1372
|
+
* @returns result input
|
|
1354
1373
|
*/
|
|
1355
|
-
static CrossToRef(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>, result:
|
|
1374
|
+
static CrossToRef<T extends Vector3>(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>, result: T): T;
|
|
1356
1375
|
/**
|
|
1357
1376
|
* Returns a new Vector3 as the normalization of the given vector
|
|
1358
1377
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#98
|
|
@@ -1365,8 +1384,9 @@ export declare class Vector3 {
|
|
|
1365
1384
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#98
|
|
1366
1385
|
* @param vector defines the Vector3 to normalize
|
|
1367
1386
|
* @param result defines the Vector3 where to store the result
|
|
1387
|
+
* @returns result input
|
|
1368
1388
|
*/
|
|
1369
|
-
static NormalizeToRef(vector: DeepImmutable<Vector3>, result:
|
|
1389
|
+
static NormalizeToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, result: T): T;
|
|
1370
1390
|
/**
|
|
1371
1391
|
* Project a Vector3 onto screen space
|
|
1372
1392
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#101
|
|
@@ -1376,7 +1396,7 @@ export declare class Vector3 {
|
|
|
1376
1396
|
* @param viewport defines the screen viewport to use
|
|
1377
1397
|
* @returns the new Vector3
|
|
1378
1398
|
*/
|
|
1379
|
-
static Project(vector: DeepImmutable<
|
|
1399
|
+
static Project<T extends Vector3>(vector: DeepImmutable<T>, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>, viewport: DeepImmutable<Viewport>): T;
|
|
1380
1400
|
/**
|
|
1381
1401
|
* Project a Vector3 onto screen space to reference
|
|
1382
1402
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#102
|
|
@@ -1385,13 +1405,13 @@ export declare class Vector3 {
|
|
|
1385
1405
|
* @param transform defines the transform (view x projection) matrix to use
|
|
1386
1406
|
* @param viewport defines the screen viewport to use
|
|
1387
1407
|
* @param result the vector in which the screen space will be stored
|
|
1388
|
-
* @returns
|
|
1408
|
+
* @returns result input
|
|
1389
1409
|
*/
|
|
1390
|
-
static ProjectToRef(vector: DeepImmutable<Vector3>, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>, viewport: DeepImmutable<Viewport>, result:
|
|
1410
|
+
static ProjectToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>, viewport: DeepImmutable<Viewport>, result: T): T;
|
|
1391
1411
|
/**
|
|
1392
1412
|
* @internal
|
|
1393
1413
|
*/
|
|
1394
|
-
static _UnprojectFromInvertedMatrixToRef(source: DeepImmutable<Vector3>, matrix: DeepImmutable<Matrix>, result:
|
|
1414
|
+
static _UnprojectFromInvertedMatrixToRef<T extends Vector3>(source: DeepImmutable<Vector3>, matrix: DeepImmutable<Matrix>, result: T): T;
|
|
1395
1415
|
/**
|
|
1396
1416
|
* Unproject from screen space to object space
|
|
1397
1417
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#121
|
|
@@ -1402,7 +1422,7 @@ export declare class Vector3 {
|
|
|
1402
1422
|
* @param transform defines the transform (view x projection) matrix to use
|
|
1403
1423
|
* @returns the new Vector3
|
|
1404
1424
|
*/
|
|
1405
|
-
static UnprojectFromTransform(source:
|
|
1425
|
+
static UnprojectFromTransform<T extends Vector3>(source: DeepImmutable<T>, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>): T;
|
|
1406
1426
|
/**
|
|
1407
1427
|
* Unproject from screen space to object space
|
|
1408
1428
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#117
|
|
@@ -1414,7 +1434,7 @@ export declare class Vector3 {
|
|
|
1414
1434
|
* @param projection defines the projection matrix to use
|
|
1415
1435
|
* @returns the new Vector3
|
|
1416
1436
|
*/
|
|
1417
|
-
static Unproject(source: DeepImmutable<
|
|
1437
|
+
static Unproject<T extends Vector3>(source: DeepImmutable<T>, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>): T;
|
|
1418
1438
|
/**
|
|
1419
1439
|
* Unproject from screen space to object space
|
|
1420
1440
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#119
|
|
@@ -1425,8 +1445,9 @@ export declare class Vector3 {
|
|
|
1425
1445
|
* @param view defines the view matrix to use
|
|
1426
1446
|
* @param projection defines the projection matrix to use
|
|
1427
1447
|
* @param result defines the Vector3 where to store the result
|
|
1448
|
+
* @returns result input
|
|
1428
1449
|
*/
|
|
1429
|
-
static UnprojectToRef(source: DeepImmutable<Vector3>, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>, result:
|
|
1450
|
+
static UnprojectToRef<T extends Vector3>(source: DeepImmutable<Vector3>, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>, result: T): T;
|
|
1430
1451
|
/**
|
|
1431
1452
|
* Unproject from screen space to object space
|
|
1432
1453
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#120
|
|
@@ -1439,8 +1460,9 @@ export declare class Vector3 {
|
|
|
1439
1460
|
* @param view defines the view matrix to use
|
|
1440
1461
|
* @param projection defines the projection matrix to use
|
|
1441
1462
|
* @param result defines the Vector3 where to store the result
|
|
1463
|
+
* @returns result input
|
|
1442
1464
|
*/
|
|
1443
|
-
static UnprojectFloatsToRef(sourceX: float, sourceY: float, sourceZ: float, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>, result:
|
|
1465
|
+
static UnprojectFloatsToRef<T extends Vector3>(sourceX: float, sourceY: float, sourceZ: float, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>, result: T): T;
|
|
1444
1466
|
/**
|
|
1445
1467
|
* Gets the minimal coordinate values between two Vector3
|
|
1446
1468
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#97
|
|
@@ -1448,7 +1470,7 @@ export declare class Vector3 {
|
|
|
1448
1470
|
* @param right defines the second operand
|
|
1449
1471
|
* @returns the new Vector3
|
|
1450
1472
|
*/
|
|
1451
|
-
static Minimize(left: DeepImmutable<
|
|
1473
|
+
static Minimize<T extends Vector3>(left: DeepImmutable<T>, right: DeepImmutable<Vector3>): T;
|
|
1452
1474
|
/**
|
|
1453
1475
|
* Gets the maximal coordinate values between two Vector3
|
|
1454
1476
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#96
|
|
@@ -1456,7 +1478,7 @@ export declare class Vector3 {
|
|
|
1456
1478
|
* @param right defines the second operand
|
|
1457
1479
|
* @returns the new Vector3
|
|
1458
1480
|
*/
|
|
1459
|
-
static Maximize(left: DeepImmutable<
|
|
1481
|
+
static Maximize<T extends Vector3>(left: DeepImmutable<T>, right: DeepImmutable<Vector3>): T;
|
|
1460
1482
|
/**
|
|
1461
1483
|
* Returns the distance between the vectors "value1" and "value2"
|
|
1462
1484
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#81
|
|
@@ -1503,7 +1525,7 @@ export declare class Vector3 {
|
|
|
1503
1525
|
* @param ref defines third vector
|
|
1504
1526
|
* @returns ref
|
|
1505
1527
|
*/
|
|
1506
|
-
static CenterToRef(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, ref:
|
|
1528
|
+
static CenterToRef<T extends Vector3>(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, ref: T): T;
|
|
1507
1529
|
/**
|
|
1508
1530
|
* Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system),
|
|
1509
1531
|
* RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply
|
|
@@ -1516,7 +1538,7 @@ export declare class Vector3 {
|
|
|
1516
1538
|
* @returns a new Vector3
|
|
1517
1539
|
* @see https://doc.babylonjs.com/divingDeeper/mesh/transforms/center_origin/target_align
|
|
1518
1540
|
*/
|
|
1519
|
-
static RotationFromAxis(axis1: DeepImmutable<
|
|
1541
|
+
static RotationFromAxis<T extends Vector3>(axis1: DeepImmutable<T>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>): T;
|
|
1520
1542
|
/**
|
|
1521
1543
|
* The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3
|
|
1522
1544
|
* Example Playground https://playground.babylonjs.com/#R1F8YU#107
|
|
@@ -1524,8 +1546,9 @@ export declare class Vector3 {
|
|
|
1524
1546
|
* @param axis2 defines the second axis
|
|
1525
1547
|
* @param axis3 defines the third axis
|
|
1526
1548
|
* @param ref defines the Vector3 where to store the result
|
|
1549
|
+
* @returns result input
|
|
1527
1550
|
*/
|
|
1528
|
-
static RotationFromAxisToRef(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref:
|
|
1551
|
+
static RotationFromAxisToRef<T extends Vector3>(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref: T): T;
|
|
1529
1552
|
}
|
|
1530
1553
|
/**
|
|
1531
1554
|
* Vector4 class created for EulerAngle class conversion to Quaternion
|
|
@@ -1549,13 +1572,13 @@ export declare class Vector4 {
|
|
|
1549
1572
|
*/
|
|
1550
1573
|
constructor(
|
|
1551
1574
|
/** x value of the vector */
|
|
1552
|
-
x
|
|
1575
|
+
x?: number,
|
|
1553
1576
|
/** y value of the vector */
|
|
1554
|
-
y
|
|
1577
|
+
y?: number,
|
|
1555
1578
|
/** z value of the vector */
|
|
1556
|
-
z
|
|
1579
|
+
z?: number,
|
|
1557
1580
|
/** w value of the vector */
|
|
1558
|
-
w
|
|
1581
|
+
w?: number);
|
|
1559
1582
|
/**
|
|
1560
1583
|
* Returns the string with the Vector4 coordinates.
|
|
1561
1584
|
* @returns a string containing all the vector values
|
|
@@ -1582,52 +1605,52 @@ export declare class Vector4 {
|
|
|
1582
1605
|
* @param index index of the array to start at (default: 0)
|
|
1583
1606
|
* @returns the Vector4.
|
|
1584
1607
|
*/
|
|
1585
|
-
toArray(array: FloatArray, index?: number):
|
|
1608
|
+
toArray(array: FloatArray, index?: number): this;
|
|
1586
1609
|
/**
|
|
1587
1610
|
* Update the current vector from an array
|
|
1588
1611
|
* @param array defines the destination array
|
|
1589
1612
|
* @param index defines the offset in the destination array
|
|
1590
1613
|
* @returns the current Vector3
|
|
1591
1614
|
*/
|
|
1592
|
-
fromArray(array: FloatArray, index?: number):
|
|
1615
|
+
fromArray(array: FloatArray, index?: number): this;
|
|
1593
1616
|
/**
|
|
1594
1617
|
* Adds the given vector to the current Vector4.
|
|
1595
1618
|
* @param otherVector the vector to add
|
|
1596
1619
|
* @returns the updated Vector4.
|
|
1597
1620
|
*/
|
|
1598
|
-
addInPlace(otherVector: DeepImmutable<Vector4>):
|
|
1621
|
+
addInPlace(otherVector: DeepImmutable<Vector4>): this;
|
|
1599
1622
|
/**
|
|
1600
1623
|
* Returns a new Vector4 as the result of the addition of the current Vector4 and the given one.
|
|
1601
1624
|
* @param otherVector the vector to add
|
|
1602
1625
|
* @returns the resulting vector
|
|
1603
1626
|
*/
|
|
1604
|
-
add(otherVector: DeepImmutable<Vector4>):
|
|
1627
|
+
add(otherVector: DeepImmutable<Vector4>): this;
|
|
1605
1628
|
/**
|
|
1606
1629
|
* Updates the given vector "result" with the result of the addition of the current Vector4 and the given one.
|
|
1607
1630
|
* @param otherVector the vector to add
|
|
1608
1631
|
* @param result the vector to store the result
|
|
1609
|
-
* @returns
|
|
1632
|
+
* @returns result input
|
|
1610
1633
|
*/
|
|
1611
|
-
addToRef(otherVector: DeepImmutable<Vector4>, result:
|
|
1634
|
+
addToRef<T extends Vector4>(otherVector: DeepImmutable<Vector4>, result: T): T;
|
|
1612
1635
|
/**
|
|
1613
1636
|
* Subtract in place the given vector from the current Vector4.
|
|
1614
1637
|
* @param otherVector the vector to subtract
|
|
1615
1638
|
* @returns the updated Vector4.
|
|
1616
1639
|
*/
|
|
1617
|
-
subtractInPlace(otherVector: DeepImmutable<Vector4>):
|
|
1640
|
+
subtractInPlace(otherVector: DeepImmutable<Vector4>): this;
|
|
1618
1641
|
/**
|
|
1619
1642
|
* Returns a new Vector4 with the result of the subtraction of the given vector from the current Vector4.
|
|
1620
1643
|
* @param otherVector the vector to add
|
|
1621
1644
|
* @returns the new vector with the result
|
|
1622
1645
|
*/
|
|
1623
|
-
subtract(otherVector: DeepImmutable<Vector4>):
|
|
1646
|
+
subtract(otherVector: DeepImmutable<Vector4>): this;
|
|
1624
1647
|
/**
|
|
1625
1648
|
* Sets the given vector "result" with the result of the subtraction of the given vector from the current Vector4.
|
|
1626
1649
|
* @param otherVector the vector to subtract
|
|
1627
1650
|
* @param result the vector to store the result
|
|
1628
|
-
* @returns
|
|
1651
|
+
* @returns result input
|
|
1629
1652
|
*/
|
|
1630
|
-
subtractToRef(otherVector: DeepImmutable<Vector4>, result:
|
|
1653
|
+
subtractToRef<T extends Vector4>(otherVector: DeepImmutable<Vector4>, result: T): T;
|
|
1631
1654
|
/**
|
|
1632
1655
|
* Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates.
|
|
1633
1656
|
*/
|
|
@@ -1639,7 +1662,7 @@ export declare class Vector4 {
|
|
|
1639
1662
|
* @param w value to subtract
|
|
1640
1663
|
* @returns new vector containing the result
|
|
1641
1664
|
*/
|
|
1642
|
-
subtractFromFloats(x: number, y: number, z: number, w: number):
|
|
1665
|
+
subtractFromFloats(x: number, y: number, z: number, w: number): this;
|
|
1643
1666
|
/**
|
|
1644
1667
|
* Sets the given vector "result" set with the result of the subtraction of the given floats from the current Vector4 coordinates.
|
|
1645
1668
|
* @param x value to subtract
|
|
@@ -1647,51 +1670,51 @@ export declare class Vector4 {
|
|
|
1647
1670
|
* @param z value to subtract
|
|
1648
1671
|
* @param w value to subtract
|
|
1649
1672
|
* @param result the vector to store the result in
|
|
1650
|
-
* @returns
|
|
1673
|
+
* @returns result input
|
|
1651
1674
|
*/
|
|
1652
|
-
subtractFromFloatsToRef(x: number, y: number, z: number, w: number, result:
|
|
1675
|
+
subtractFromFloatsToRef<T extends Vector4>(x: number, y: number, z: number, w: number, result: T): T;
|
|
1653
1676
|
/**
|
|
1654
1677
|
* Returns a new Vector4 set with the current Vector4 negated coordinates.
|
|
1655
1678
|
* @returns a new vector with the negated values
|
|
1656
1679
|
*/
|
|
1657
|
-
negate():
|
|
1680
|
+
negate(): this;
|
|
1658
1681
|
/**
|
|
1659
1682
|
* Negate this vector in place
|
|
1660
1683
|
* @returns this
|
|
1661
1684
|
*/
|
|
1662
|
-
negateInPlace():
|
|
1685
|
+
negateInPlace(): this;
|
|
1663
1686
|
/**
|
|
1664
1687
|
* Negate the current Vector4 and stores the result in the given vector "result" coordinates
|
|
1665
1688
|
* @param result defines the Vector3 object where to store the result
|
|
1666
1689
|
* @returns the result
|
|
1667
1690
|
*/
|
|
1668
|
-
negateToRef(result:
|
|
1691
|
+
negateToRef<T extends Vector4>(result: T): T;
|
|
1669
1692
|
/**
|
|
1670
1693
|
* Multiplies the current Vector4 coordinates by scale (float).
|
|
1671
1694
|
* @param scale the number to scale with
|
|
1672
1695
|
* @returns the updated Vector4.
|
|
1673
1696
|
*/
|
|
1674
|
-
scaleInPlace(scale: number):
|
|
1697
|
+
scaleInPlace(scale: number): this;
|
|
1675
1698
|
/**
|
|
1676
1699
|
* Returns a new Vector4 set with the current Vector4 coordinates multiplied by scale (float).
|
|
1677
1700
|
* @param scale the number to scale with
|
|
1678
1701
|
* @returns a new vector with the result
|
|
1679
1702
|
*/
|
|
1680
|
-
scale(scale: number):
|
|
1703
|
+
scale(scale: number): this;
|
|
1681
1704
|
/**
|
|
1682
1705
|
* Sets the given vector "result" with the current Vector4 coordinates multiplied by scale (float).
|
|
1683
1706
|
* @param scale the number to scale with
|
|
1684
1707
|
* @param result a vector to store the result in
|
|
1685
|
-
* @returns
|
|
1708
|
+
* @returns result input
|
|
1686
1709
|
*/
|
|
1687
|
-
scaleToRef(scale: number, result:
|
|
1710
|
+
scaleToRef<T extends Vector4>(scale: number, result: T): T;
|
|
1688
1711
|
/**
|
|
1689
1712
|
* Scale the current Vector4 values by a factor and add the result to a given Vector4
|
|
1690
1713
|
* @param scale defines the scale factor
|
|
1691
1714
|
* @param result defines the Vector4 object where to store the result
|
|
1692
|
-
* @returns
|
|
1715
|
+
* @returns result input
|
|
1693
1716
|
*/
|
|
1694
|
-
scaleAndAddToRef(scale: number, result:
|
|
1717
|
+
scaleAndAddToRef<T extends Vector4>(scale: number, result: T): T;
|
|
1695
1718
|
/**
|
|
1696
1719
|
* Boolean : True if the current Vector4 coordinates are stricly equal to the given ones.
|
|
1697
1720
|
* @param otherVector the vector to compare against
|
|
@@ -1719,20 +1742,20 @@ export declare class Vector4 {
|
|
|
1719
1742
|
* @param otherVector vector to multiple with
|
|
1720
1743
|
* @returns the updated Vector4.
|
|
1721
1744
|
*/
|
|
1722
|
-
multiplyInPlace(otherVector: Vector4):
|
|
1745
|
+
multiplyInPlace(otherVector: Vector4): this;
|
|
1723
1746
|
/**
|
|
1724
1747
|
* Returns a new Vector4 set with the multiplication result of the current Vector4 and the given one.
|
|
1725
1748
|
* @param otherVector vector to multiple with
|
|
1726
1749
|
* @returns resulting new vector
|
|
1727
1750
|
*/
|
|
1728
|
-
multiply(otherVector: DeepImmutable<Vector4>):
|
|
1751
|
+
multiply(otherVector: DeepImmutable<Vector4>): this;
|
|
1729
1752
|
/**
|
|
1730
1753
|
* Updates the given vector "result" with the multiplication result of the current Vector4 and the given one.
|
|
1731
1754
|
* @param otherVector vector to multiple with
|
|
1732
1755
|
* @param result vector to store the result
|
|
1733
|
-
* @returns
|
|
1756
|
+
* @returns result input
|
|
1734
1757
|
*/
|
|
1735
|
-
multiplyToRef(otherVector: DeepImmutable<Vector4>, result:
|
|
1758
|
+
multiplyToRef<T extends Vector4>(otherVector: DeepImmutable<Vector4>, result: T): T;
|
|
1736
1759
|
/**
|
|
1737
1760
|
* Returns a new Vector4 set with the multiplication result of the given floats and the current Vector4 coordinates.
|
|
1738
1761
|
* @param x x value multiply with
|
|
@@ -1741,48 +1764,48 @@ export declare class Vector4 {
|
|
|
1741
1764
|
* @param w w value multiply with
|
|
1742
1765
|
* @returns resulting new vector
|
|
1743
1766
|
*/
|
|
1744
|
-
multiplyByFloats(x: number, y: number, z: number, w: number):
|
|
1767
|
+
multiplyByFloats(x: number, y: number, z: number, w: number): this;
|
|
1745
1768
|
/**
|
|
1746
1769
|
* Returns a new Vector4 set with the division result of the current Vector4 by the given one.
|
|
1747
1770
|
* @param otherVector vector to devide with
|
|
1748
1771
|
* @returns resulting new vector
|
|
1749
1772
|
*/
|
|
1750
|
-
divide(otherVector: DeepImmutable<Vector4>):
|
|
1773
|
+
divide(otherVector: DeepImmutable<Vector4>): this;
|
|
1751
1774
|
/**
|
|
1752
1775
|
* Updates the given vector "result" with the division result of the current Vector4 by the given one.
|
|
1753
1776
|
* @param otherVector vector to devide with
|
|
1754
1777
|
* @param result vector to store the result
|
|
1755
|
-
* @returns
|
|
1778
|
+
* @returns result input
|
|
1756
1779
|
*/
|
|
1757
|
-
divideToRef(otherVector: DeepImmutable<Vector4>, result:
|
|
1780
|
+
divideToRef<T extends Vector4>(otherVector: DeepImmutable<Vector4>, result: T): T;
|
|
1758
1781
|
/**
|
|
1759
1782
|
* Divides the current Vector3 coordinates by the given ones.
|
|
1760
1783
|
* @param otherVector vector to devide with
|
|
1761
1784
|
* @returns the updated Vector3.
|
|
1762
1785
|
*/
|
|
1763
|
-
divideInPlace(otherVector: DeepImmutable<Vector4>):
|
|
1786
|
+
divideInPlace(otherVector: DeepImmutable<Vector4>): this;
|
|
1764
1787
|
/**
|
|
1765
1788
|
* Updates the Vector4 coordinates with the minimum values between its own and the given vector ones
|
|
1766
1789
|
* @param other defines the second operand
|
|
1767
1790
|
* @returns the current updated Vector4
|
|
1768
1791
|
*/
|
|
1769
|
-
minimizeInPlace(other: DeepImmutable<Vector4>):
|
|
1792
|
+
minimizeInPlace(other: DeepImmutable<Vector4>): this;
|
|
1770
1793
|
/**
|
|
1771
1794
|
* Updates the Vector4 coordinates with the maximum values between its own and the given vector ones
|
|
1772
1795
|
* @param other defines the second operand
|
|
1773
1796
|
* @returns the current updated Vector4
|
|
1774
1797
|
*/
|
|
1775
|
-
maximizeInPlace(other: DeepImmutable<Vector4>):
|
|
1798
|
+
maximizeInPlace(other: DeepImmutable<Vector4>): this;
|
|
1776
1799
|
/**
|
|
1777
1800
|
* Gets a new Vector4 from current Vector4 floored values
|
|
1778
1801
|
* @returns a new Vector4
|
|
1779
1802
|
*/
|
|
1780
|
-
floor():
|
|
1803
|
+
floor(): this;
|
|
1781
1804
|
/**
|
|
1782
1805
|
* Gets a new Vector4 from current Vector4 fractional values
|
|
1783
1806
|
* @returns a new Vector4
|
|
1784
1807
|
*/
|
|
1785
|
-
fract():
|
|
1808
|
+
fract(): this;
|
|
1786
1809
|
/**
|
|
1787
1810
|
* Returns the Vector4 length (float).
|
|
1788
1811
|
* @returns the length
|
|
@@ -1797,7 +1820,7 @@ export declare class Vector4 {
|
|
|
1797
1820
|
* Normalizes in place the Vector4.
|
|
1798
1821
|
* @returns the updated Vector4.
|
|
1799
1822
|
*/
|
|
1800
|
-
normalize():
|
|
1823
|
+
normalize(): this;
|
|
1801
1824
|
/**
|
|
1802
1825
|
* Returns a new Vector3 from the Vector4 (x, y, z) coordinates.
|
|
1803
1826
|
* @returns this converted to a new vector3
|
|
@@ -1807,13 +1830,13 @@ export declare class Vector4 {
|
|
|
1807
1830
|
* Returns a new Vector4 copied from the current one.
|
|
1808
1831
|
* @returns the new cloned vector
|
|
1809
1832
|
*/
|
|
1810
|
-
clone():
|
|
1833
|
+
clone(): this;
|
|
1811
1834
|
/**
|
|
1812
1835
|
* Updates the current Vector4 with the given one coordinates.
|
|
1813
1836
|
* @param source the source vector to copy from
|
|
1814
1837
|
* @returns the updated Vector4.
|
|
1815
1838
|
*/
|
|
1816
|
-
copyFrom(source: DeepImmutable<Vector4>):
|
|
1839
|
+
copyFrom(source: DeepImmutable<Vector4>): this;
|
|
1817
1840
|
/**
|
|
1818
1841
|
* Updates the current Vector4 coordinates with the given floats.
|
|
1819
1842
|
* @param x float to copy from
|
|
@@ -1822,7 +1845,7 @@ export declare class Vector4 {
|
|
|
1822
1845
|
* @param w float to copy from
|
|
1823
1846
|
* @returns the updated Vector4.
|
|
1824
1847
|
*/
|
|
1825
|
-
copyFromFloats(x: number, y: number, z: number, w: number):
|
|
1848
|
+
copyFromFloats(x: number, y: number, z: number, w: number): this;
|
|
1826
1849
|
/**
|
|
1827
1850
|
* Updates the current Vector4 coordinates with the given floats.
|
|
1828
1851
|
* @param x float to set from
|
|
@@ -1831,13 +1854,13 @@ export declare class Vector4 {
|
|
|
1831
1854
|
* @param w float to set from
|
|
1832
1855
|
* @returns the updated Vector4.
|
|
1833
1856
|
*/
|
|
1834
|
-
set(x: number, y: number, z: number, w: number):
|
|
1857
|
+
set(x: number, y: number, z: number, w: number): this;
|
|
1835
1858
|
/**
|
|
1836
1859
|
* Copies the given float to the current Vector3 coordinates
|
|
1837
1860
|
* @param v defines the x, y, z and w coordinates of the operand
|
|
1838
1861
|
* @returns the current updated Vector3
|
|
1839
1862
|
*/
|
|
1840
|
-
setAll(v: number):
|
|
1863
|
+
setAll(v: number): this;
|
|
1841
1864
|
/**
|
|
1842
1865
|
* Returns a new Vector4 set from the starting index of the given array.
|
|
1843
1866
|
* @param array the array to pull values from
|
|
@@ -1850,15 +1873,17 @@ export declare class Vector4 {
|
|
|
1850
1873
|
* @param array the array to pull values from
|
|
1851
1874
|
* @param offset the offset into the array to start at
|
|
1852
1875
|
* @param result the vector to store the result in
|
|
1876
|
+
* @returns result input
|
|
1853
1877
|
*/
|
|
1854
|
-
static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number, result:
|
|
1878
|
+
static FromArrayToRef<T extends Vector4>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T;
|
|
1855
1879
|
/**
|
|
1856
1880
|
* Updates the given vector "result" from the starting index of the given Float32Array.
|
|
1857
1881
|
* @param array the array to pull values from
|
|
1858
1882
|
* @param offset the offset into the array to start at
|
|
1859
1883
|
* @param result the vector to store the result in
|
|
1884
|
+
* @returns result input
|
|
1860
1885
|
*/
|
|
1861
|
-
static FromFloatArrayToRef(array: DeepImmutable<Float32Array>, offset: number, result:
|
|
1886
|
+
static FromFloatArrayToRef<T extends Vector4>(array: DeepImmutable<Float32Array>, offset: number, result: T): T;
|
|
1862
1887
|
/**
|
|
1863
1888
|
* Updates the given vector "result" coordinates from the given floats.
|
|
1864
1889
|
* @param x float to set from
|
|
@@ -1866,8 +1891,9 @@ export declare class Vector4 {
|
|
|
1866
1891
|
* @param z float to set from
|
|
1867
1892
|
* @param w float to set from
|
|
1868
1893
|
* @param result the vector to the floats in
|
|
1894
|
+
* @returns result input
|
|
1869
1895
|
*/
|
|
1870
|
-
static FromFloatsToRef(x: number, y: number, z: number, w: number, result:
|
|
1896
|
+
static FromFloatsToRef<T extends Vector4>(x: number, y: number, z: number, w: number, result: T): T;
|
|
1871
1897
|
/**
|
|
1872
1898
|
* Returns a new Vector4 set to (0.0, 0.0, 0.0, 0.0)
|
|
1873
1899
|
* @returns the new vector
|
|
@@ -1892,22 +1918,23 @@ export declare class Vector4 {
|
|
|
1892
1918
|
* Updates the given vector "result" from the normalization of the given one.
|
|
1893
1919
|
* @param vector the vector to normalize
|
|
1894
1920
|
* @param result the vector to store the result in
|
|
1921
|
+
* @returns result input
|
|
1895
1922
|
*/
|
|
1896
|
-
static NormalizeToRef(vector: DeepImmutable<Vector4>, result:
|
|
1923
|
+
static NormalizeToRef<T extends Vector4>(vector: DeepImmutable<Vector4>, result: T): T;
|
|
1897
1924
|
/**
|
|
1898
1925
|
* Returns a vector with the minimum values from the left and right vectors
|
|
1899
1926
|
* @param left left vector to minimize
|
|
1900
1927
|
* @param right right vector to minimize
|
|
1901
1928
|
* @returns a new vector with the minimum of the left and right vector values
|
|
1902
1929
|
*/
|
|
1903
|
-
static Minimize(left: DeepImmutable<
|
|
1930
|
+
static Minimize<T extends Vector4>(left: DeepImmutable<T>, right: DeepImmutable<Vector4>): T;
|
|
1904
1931
|
/**
|
|
1905
1932
|
* Returns a vector with the maximum values from the left and right vectors
|
|
1906
1933
|
* @param left left vector to maximize
|
|
1907
1934
|
* @param right right vector to maximize
|
|
1908
1935
|
* @returns a new vector with the maximum of the left and right vector values
|
|
1909
1936
|
*/
|
|
1910
|
-
static Maximize(left: DeepImmutable<
|
|
1937
|
+
static Maximize<T extends Vector4>(left: DeepImmutable<T>, right: DeepImmutable<Vector4>): T;
|
|
1911
1938
|
/**
|
|
1912
1939
|
* Returns the distance (float) between the vectors "value1" and "value2".
|
|
1913
1940
|
* @param value1 value to calulate the distance between
|
|
@@ -1936,7 +1963,7 @@ export declare class Vector4 {
|
|
|
1936
1963
|
* @param ref defines third vector
|
|
1937
1964
|
* @returns ref
|
|
1938
1965
|
*/
|
|
1939
|
-
static CenterToRef(value1: DeepImmutable<Vector4>, value2: DeepImmutable<Vector4>, ref:
|
|
1966
|
+
static CenterToRef<T extends Vector4>(value1: DeepImmutable<Vector4>, value2: DeepImmutable<Vector4>, ref: T): T;
|
|
1940
1967
|
/**
|
|
1941
1968
|
* Returns a new Vector4 set with the result of the transformation by the given matrix of the given vector.
|
|
1942
1969
|
* This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
|
|
@@ -1953,8 +1980,9 @@ export declare class Vector4 {
|
|
|
1953
1980
|
* @param vector defines the Vector3 to transform
|
|
1954
1981
|
* @param transformation defines the transformation matrix
|
|
1955
1982
|
* @param result defines the Vector4 where to store the result
|
|
1983
|
+
* @returns result input
|
|
1956
1984
|
*/
|
|
1957
|
-
static TransformCoordinatesToRef(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result:
|
|
1985
|
+
static TransformCoordinatesToRef<T extends Vector4>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T;
|
|
1958
1986
|
/**
|
|
1959
1987
|
* Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
|
|
1960
1988
|
* This method computes tranformed coordinates only, not transformed direction vectors
|
|
@@ -1964,8 +1992,9 @@ export declare class Vector4 {
|
|
|
1964
1992
|
* @param z define the z coordinate of the source vector
|
|
1965
1993
|
* @param transformation defines the transformation matrix
|
|
1966
1994
|
* @param result defines the Vector4 where to store the result
|
|
1995
|
+
* @returns result input
|
|
1967
1996
|
*/
|
|
1968
|
-
static TransformCoordinatesFromFloatsToRef(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result:
|
|
1997
|
+
static TransformCoordinatesFromFloatsToRef<T extends Vector4>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T;
|
|
1969
1998
|
/**
|
|
1970
1999
|
* Returns a new Vector4 set with the result of the normal transformation by the given matrix of the given vector.
|
|
1971
2000
|
* This methods computes transformed normalized direction vectors only.
|
|
@@ -1973,15 +2002,16 @@ export declare class Vector4 {
|
|
|
1973
2002
|
* @param transformation the transformation matrix to apply
|
|
1974
2003
|
* @returns the new vector
|
|
1975
2004
|
*/
|
|
1976
|
-
static TransformNormal(vector: DeepImmutable<
|
|
2005
|
+
static TransformNormal<T extends Vector4>(vector: DeepImmutable<T>, transformation: DeepImmutable<Matrix>): T;
|
|
1977
2006
|
/**
|
|
1978
2007
|
* Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector.
|
|
1979
2008
|
* This methods computes transformed normalized direction vectors only.
|
|
1980
2009
|
* @param vector the vector to transform
|
|
1981
2010
|
* @param transformation the transformation matrix to apply
|
|
1982
2011
|
* @param result the vector to store the result in
|
|
2012
|
+
* @returns result input
|
|
1983
2013
|
*/
|
|
1984
|
-
static TransformNormalToRef(vector: DeepImmutable<Vector4>, transformation: DeepImmutable<Matrix>, result:
|
|
2014
|
+
static TransformNormalToRef<T extends Vector4>(vector: DeepImmutable<Vector4>, transformation: DeepImmutable<Matrix>, result: T): T;
|
|
1985
2015
|
/**
|
|
1986
2016
|
* Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z, w).
|
|
1987
2017
|
* This methods computes transformed normalized direction vectors only.
|
|
@@ -1991,8 +2021,9 @@ export declare class Vector4 {
|
|
|
1991
2021
|
* @param w value to transform
|
|
1992
2022
|
* @param transformation the transformation matrix to apply
|
|
1993
2023
|
* @param result the vector to store the results in
|
|
2024
|
+
* @returns result input
|
|
1994
2025
|
*/
|
|
1995
|
-
static TransformNormalFromFloatsToRef(x: number, y: number, z: number, w: number, transformation: DeepImmutable<Matrix>, result:
|
|
2026
|
+
static TransformNormalFromFloatsToRef<T extends Vector4>(x: number, y: number, z: number, w: number, transformation: DeepImmutable<Matrix>, result: T): T;
|
|
1996
2027
|
/**
|
|
1997
2028
|
* Creates a new Vector4 from a Vector3
|
|
1998
2029
|
* @param source defines the source data
|
|
@@ -2081,13 +2112,13 @@ export declare class Quaternion {
|
|
|
2081
2112
|
* Clone the current quaternion
|
|
2082
2113
|
* @returns a new quaternion copied from the current one
|
|
2083
2114
|
*/
|
|
2084
|
-
clone():
|
|
2115
|
+
clone(): this;
|
|
2085
2116
|
/**
|
|
2086
2117
|
* Copy a quaternion to the current one
|
|
2087
2118
|
* @param other defines the other quaternion
|
|
2088
2119
|
* @returns the updated current quaternion
|
|
2089
2120
|
*/
|
|
2090
|
-
copyFrom(other: DeepImmutable<Quaternion>):
|
|
2121
|
+
copyFrom(other: DeepImmutable<Quaternion>): this;
|
|
2091
2122
|
/**
|
|
2092
2123
|
* Updates the current quaternion with the given float coordinates
|
|
2093
2124
|
* @param x defines the x coordinate
|
|
@@ -2096,7 +2127,7 @@ export declare class Quaternion {
|
|
|
2096
2127
|
* @param w defines the w coordinate
|
|
2097
2128
|
* @returns the updated current quaternion
|
|
2098
2129
|
*/
|
|
2099
|
-
copyFromFloats(x: number, y: number, z: number, w: number):
|
|
2130
|
+
copyFromFloats(x: number, y: number, z: number, w: number): this;
|
|
2100
2131
|
/**
|
|
2101
2132
|
* Updates the current quaternion from the given float coordinates
|
|
2102
2133
|
* @param x defines the x coordinate
|
|
@@ -2105,102 +2136,102 @@ export declare class Quaternion {
|
|
|
2105
2136
|
* @param w defines the w coordinate
|
|
2106
2137
|
* @returns the updated current quaternion
|
|
2107
2138
|
*/
|
|
2108
|
-
set(x: number, y: number, z: number, w: number):
|
|
2139
|
+
set(x: number, y: number, z: number, w: number): this;
|
|
2109
2140
|
/**
|
|
2110
2141
|
* Adds two quaternions
|
|
2111
2142
|
* @param other defines the second operand
|
|
2112
2143
|
* @returns a new quaternion as the addition result of the given one and the current quaternion
|
|
2113
2144
|
*/
|
|
2114
|
-
add(other: DeepImmutable<Quaternion>):
|
|
2145
|
+
add(other: DeepImmutable<Quaternion>): this;
|
|
2115
2146
|
/**
|
|
2116
2147
|
* Add a quaternion to the current one
|
|
2117
2148
|
* @param other defines the quaternion to add
|
|
2118
2149
|
* @returns the current quaternion
|
|
2119
2150
|
*/
|
|
2120
|
-
addInPlace(other: DeepImmutable<Quaternion>):
|
|
2151
|
+
addInPlace(other: DeepImmutable<Quaternion>): this;
|
|
2121
2152
|
/**
|
|
2122
2153
|
* Subtract two quaternions
|
|
2123
2154
|
* @param other defines the second operand
|
|
2124
2155
|
* @returns a new quaternion as the subtraction result of the given one from the current one
|
|
2125
2156
|
*/
|
|
2126
|
-
subtract(other: Quaternion):
|
|
2157
|
+
subtract(other: Quaternion): this;
|
|
2127
2158
|
/**
|
|
2128
2159
|
* Subtract a quaternion to the current one
|
|
2129
2160
|
* @param other defines the quaternion to subtract
|
|
2130
2161
|
* @returns the current quaternion
|
|
2131
2162
|
*/
|
|
2132
|
-
subtractInPlace(other: DeepImmutable<Quaternion>):
|
|
2163
|
+
subtractInPlace(other: DeepImmutable<Quaternion>): this;
|
|
2133
2164
|
/**
|
|
2134
2165
|
* Multiplies the current quaternion by a scale factor
|
|
2135
2166
|
* @param value defines the scale factor
|
|
2136
2167
|
* @returns a new quaternion set by multiplying the current quaternion coordinates by the float "scale"
|
|
2137
2168
|
*/
|
|
2138
|
-
scale(value: number):
|
|
2169
|
+
scale(value: number): this;
|
|
2139
2170
|
/**
|
|
2140
2171
|
* Scale the current quaternion values by a factor and stores the result to a given quaternion
|
|
2141
2172
|
* @param scale defines the scale factor
|
|
2142
2173
|
* @param result defines the Quaternion object where to store the result
|
|
2143
|
-
* @returns
|
|
2174
|
+
* @returns result input
|
|
2144
2175
|
*/
|
|
2145
|
-
scaleToRef(scale: number, result:
|
|
2176
|
+
scaleToRef<T extends Quaternion>(scale: number, result: T): T;
|
|
2146
2177
|
/**
|
|
2147
2178
|
* Multiplies in place the current quaternion by a scale factor
|
|
2148
2179
|
* @param value defines the scale factor
|
|
2149
2180
|
* @returns the current modified quaternion
|
|
2150
2181
|
*/
|
|
2151
|
-
scaleInPlace(value: number):
|
|
2182
|
+
scaleInPlace(value: number): this;
|
|
2152
2183
|
/**
|
|
2153
2184
|
* Scale the current quaternion values by a factor and add the result to a given quaternion
|
|
2154
2185
|
* @param scale defines the scale factor
|
|
2155
2186
|
* @param result defines the Quaternion object where to store the result
|
|
2156
|
-
* @returns
|
|
2187
|
+
* @returns result input
|
|
2157
2188
|
*/
|
|
2158
|
-
scaleAndAddToRef(scale: number, result:
|
|
2189
|
+
scaleAndAddToRef<T extends Quaternion>(scale: number, result: T): T;
|
|
2159
2190
|
/**
|
|
2160
2191
|
* Multiplies two quaternions
|
|
2161
2192
|
* @param q1 defines the second operand
|
|
2162
2193
|
* @returns a new quaternion set as the multiplication result of the current one with the given one "q1"
|
|
2163
2194
|
*/
|
|
2164
|
-
multiply(q1: DeepImmutable<Quaternion>):
|
|
2195
|
+
multiply(q1: DeepImmutable<Quaternion>): this;
|
|
2165
2196
|
/**
|
|
2166
2197
|
* Sets the given "result" as the the multiplication result of the current one with the given one "q1"
|
|
2167
2198
|
* @param q1 defines the second operand
|
|
2168
2199
|
* @param result defines the target quaternion
|
|
2169
2200
|
* @returns the current quaternion
|
|
2170
2201
|
*/
|
|
2171
|
-
multiplyToRef(q1: DeepImmutable<Quaternion>, result:
|
|
2202
|
+
multiplyToRef<T extends Quaternion>(q1: DeepImmutable<Quaternion>, result: T): T;
|
|
2172
2203
|
/**
|
|
2173
2204
|
* Updates the current quaternion with the multiplication of itself with the given one "q1"
|
|
2174
2205
|
* @param q1 defines the second operand
|
|
2175
2206
|
* @returns the currentupdated quaternion
|
|
2176
2207
|
*/
|
|
2177
|
-
multiplyInPlace(q1: DeepImmutable<Quaternion>):
|
|
2208
|
+
multiplyInPlace(q1: DeepImmutable<Quaternion>): this;
|
|
2178
2209
|
/**
|
|
2179
2210
|
* Conjugates the current quaternion and stores the result in the given quaternion
|
|
2180
2211
|
* @param ref defines the target quaternion
|
|
2181
|
-
* @returns
|
|
2212
|
+
* @returns result input
|
|
2182
2213
|
*/
|
|
2183
|
-
conjugateToRef(ref:
|
|
2214
|
+
conjugateToRef<T extends Quaternion>(ref: T): T;
|
|
2184
2215
|
/**
|
|
2185
2216
|
* Conjugates in place the current quaternion
|
|
2186
2217
|
* @returns the current updated quaternion
|
|
2187
2218
|
*/
|
|
2188
|
-
conjugateInPlace():
|
|
2219
|
+
conjugateInPlace(): this;
|
|
2189
2220
|
/**
|
|
2190
2221
|
* Conjugates (1-q) the current quaternion
|
|
2191
2222
|
* @returns a new quaternion
|
|
2192
2223
|
*/
|
|
2193
|
-
conjugate():
|
|
2224
|
+
conjugate(): this;
|
|
2194
2225
|
/**
|
|
2195
2226
|
* Returns the inverse of the current quaternion
|
|
2196
2227
|
* @returns a new quaternion
|
|
2197
2228
|
*/
|
|
2198
|
-
invert():
|
|
2229
|
+
invert(): this;
|
|
2199
2230
|
/**
|
|
2200
2231
|
* Invert in place the current quaternion
|
|
2201
2232
|
* @returns this quaternion
|
|
2202
2233
|
*/
|
|
2203
|
-
invertInPlace():
|
|
2234
|
+
invertInPlace(): this;
|
|
2204
2235
|
/**
|
|
2205
2236
|
* Gets squared length of current quaternion
|
|
2206
2237
|
* @returns the quaternion length (float)
|
|
@@ -2215,12 +2246,12 @@ export declare class Quaternion {
|
|
|
2215
2246
|
* Normalize in place the current quaternion
|
|
2216
2247
|
* @returns the current updated quaternion
|
|
2217
2248
|
*/
|
|
2218
|
-
normalize():
|
|
2249
|
+
normalize(): this;
|
|
2219
2250
|
/**
|
|
2220
2251
|
* Normalize a copy of the current quaternion
|
|
2221
2252
|
* @returns the normalized quaternion
|
|
2222
2253
|
*/
|
|
2223
|
-
normalizeToNew():
|
|
2254
|
+
normalizeToNew(): this;
|
|
2224
2255
|
/**
|
|
2225
2256
|
* Returns a new Vector3 set with the Euler angles translated from the current quaternion
|
|
2226
2257
|
* @returns a new Vector3 containing the Euler angles
|
|
@@ -2230,22 +2261,22 @@ export declare class Quaternion {
|
|
|
2230
2261
|
/**
|
|
2231
2262
|
* Sets the given vector3 "result" with the Euler angles translated from the current quaternion
|
|
2232
2263
|
* @param result defines the vector which will be filled with the Euler angles
|
|
2233
|
-
* @returns
|
|
2264
|
+
* @returns result input
|
|
2234
2265
|
* @see https://doc.babylonjs.com/divingDeeper/mesh/transforms/center_origin/rotation_conventions
|
|
2235
2266
|
*/
|
|
2236
|
-
toEulerAnglesToRef(result:
|
|
2267
|
+
toEulerAnglesToRef<T extends Vector3>(result: T): T;
|
|
2237
2268
|
/**
|
|
2238
2269
|
* Updates the given rotation matrix with the current quaternion values
|
|
2239
2270
|
* @param result defines the target matrix
|
|
2240
2271
|
* @returns the current unchanged quaternion
|
|
2241
2272
|
*/
|
|
2242
|
-
toRotationMatrix(result:
|
|
2273
|
+
toRotationMatrix<T extends Matrix>(result: T): T;
|
|
2243
2274
|
/**
|
|
2244
2275
|
* Updates the current quaternion from the given rotation matrix values
|
|
2245
2276
|
* @param matrix defines the source matrix
|
|
2246
2277
|
* @returns the current updated quaternion
|
|
2247
2278
|
*/
|
|
2248
|
-
fromRotationMatrix(matrix: DeepImmutable<Matrix>):
|
|
2279
|
+
fromRotationMatrix(matrix: DeepImmutable<Matrix>): this;
|
|
2249
2280
|
/**
|
|
2250
2281
|
* Creates a new quaternion from a rotation matrix
|
|
2251
2282
|
* @param matrix defines the source matrix
|
|
@@ -2256,8 +2287,9 @@ export declare class Quaternion {
|
|
|
2256
2287
|
* Updates the given quaternion with the given rotation matrix values
|
|
2257
2288
|
* @param matrix defines the source matrix
|
|
2258
2289
|
* @param result defines the target quaternion
|
|
2290
|
+
* @returns result input
|
|
2259
2291
|
*/
|
|
2260
|
-
static FromRotationMatrixToRef(matrix: DeepImmutable<Matrix>, result:
|
|
2292
|
+
static FromRotationMatrixToRef<T extends Quaternion>(matrix: DeepImmutable<Matrix>, result: T): T;
|
|
2261
2293
|
/**
|
|
2262
2294
|
* Creates the rotation quaternion needed to rotate from one Vector3 onto another Vector3
|
|
2263
2295
|
* Example PG https://playground.babylonjs.com/#L49EJ7#2
|
|
@@ -2265,7 +2297,7 @@ export declare class Quaternion {
|
|
|
2265
2297
|
* @param toVector the ending vector
|
|
2266
2298
|
* @returns the rotation quaternion needed
|
|
2267
2299
|
*/
|
|
2268
|
-
static RotationQuaternionFromOnto(fromVector: DeepImmutable<Vector3>, toVector: DeepImmutable<Vector3>): Quaternion
|
|
2300
|
+
static RotationQuaternionFromOnto(fromVector: DeepImmutable<Vector3>, toVector: DeepImmutable<Vector3>): import("../types").DeepImmutableObject<Quaternion>;
|
|
2269
2301
|
/**
|
|
2270
2302
|
* Creates the rotation quaternion needed to rotate from one Vector3 onto another Vector3 and stores in a result Quaternion
|
|
2271
2303
|
* Example PG https://playground.babylonjs.com/#L49EJ7#3
|
|
@@ -2274,7 +2306,7 @@ export declare class Quaternion {
|
|
|
2274
2306
|
* @param result the rotation quaternion needed
|
|
2275
2307
|
* @returns the result
|
|
2276
2308
|
*/
|
|
2277
|
-
static RotationQuaternionFromOntoToRef(fromVector: DeepImmutable<Vector3>, toVector: DeepImmutable<Vector3>, result: DeepImmutable<Quaternion>): Quaternion
|
|
2309
|
+
static RotationQuaternionFromOntoToRef(fromVector: DeepImmutable<Vector3>, toVector: DeepImmutable<Vector3>, result: DeepImmutable<Quaternion>): import("../types").DeepImmutableObject<Quaternion>;
|
|
2278
2310
|
/**
|
|
2279
2311
|
* Returns the dot product (float) between the quaternions "left" and "right"
|
|
2280
2312
|
* @param left defines the left operand
|
|
@@ -2299,7 +2331,7 @@ export declare class Quaternion {
|
|
|
2299
2331
|
* @param lerpTime total interpolation time
|
|
2300
2332
|
* @param result the smoothed quaternion
|
|
2301
2333
|
*/
|
|
2302
|
-
static SmoothToRef(source: Quaternion, goal: Quaternion, deltaTime: number, lerpTime: number, result:
|
|
2334
|
+
static SmoothToRef<T extends Quaternion>(source: Quaternion, goal: Quaternion, deltaTime: number, lerpTime: number, result: T): T;
|
|
2303
2335
|
/**
|
|
2304
2336
|
* Creates an empty quaternion
|
|
2305
2337
|
* @returns a new quaternion set to (0.0, 0.0, 0.0)
|
|
@@ -2310,14 +2342,14 @@ export declare class Quaternion {
|
|
|
2310
2342
|
* @param q defines the source quaternion
|
|
2311
2343
|
* @returns a new quaternion as the inverted current quaternion
|
|
2312
2344
|
*/
|
|
2313
|
-
static Inverse(q: DeepImmutable<
|
|
2345
|
+
static Inverse<T extends Quaternion>(q: DeepImmutable<T>): T;
|
|
2314
2346
|
/**
|
|
2315
2347
|
* Inverse a given quaternion
|
|
2316
2348
|
* @param q defines the source quaternion
|
|
2317
2349
|
* @param result the quaternion the result will be stored in
|
|
2318
2350
|
* @returns the result quaternion
|
|
2319
2351
|
*/
|
|
2320
|
-
static InverseToRef(q: Quaternion, result:
|
|
2352
|
+
static InverseToRef<T extends Quaternion>(q: Quaternion, result: T): T;
|
|
2321
2353
|
/**
|
|
2322
2354
|
* Creates an identity quaternion
|
|
2323
2355
|
* @returns the identity quaternion
|
|
@@ -2343,7 +2375,7 @@ export declare class Quaternion {
|
|
|
2343
2375
|
* @param result defines the target quaternion
|
|
2344
2376
|
* @returns the target quaternion
|
|
2345
2377
|
*/
|
|
2346
|
-
static RotationAxisToRef(axis: DeepImmutable<Vector3>, angle: number, result:
|
|
2378
|
+
static RotationAxisToRef<T extends Quaternion>(axis: DeepImmutable<Vector3>, angle: number, result: T): T;
|
|
2347
2379
|
/**
|
|
2348
2380
|
* Creates a new quaternion from data stored into an array
|
|
2349
2381
|
* @param array defines the data source
|
|
@@ -2356,8 +2388,9 @@ export declare class Quaternion {
|
|
|
2356
2388
|
* @param array the array to pull values from
|
|
2357
2389
|
* @param offset the offset into the array to start at
|
|
2358
2390
|
* @param result the quaternion to store the result in
|
|
2391
|
+
* @returns result input
|
|
2359
2392
|
*/
|
|
2360
|
-
static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number, result:
|
|
2393
|
+
static FromArrayToRef<T extends Quaternion>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T;
|
|
2361
2394
|
/**
|
|
2362
2395
|
* Create a quaternion from Euler rotation angles
|
|
2363
2396
|
* @param x Pitch
|
|
@@ -2374,7 +2407,7 @@ export declare class Quaternion {
|
|
|
2374
2407
|
* @param result the quaternion to store the result
|
|
2375
2408
|
* @returns the updated quaternion
|
|
2376
2409
|
*/
|
|
2377
|
-
static FromEulerAnglesToRef(x: number, y: number, z: number, result:
|
|
2410
|
+
static FromEulerAnglesToRef<T extends Quaternion>(x: number, y: number, z: number, result: T): T;
|
|
2378
2411
|
/**
|
|
2379
2412
|
* Create a quaternion from Euler rotation vector
|
|
2380
2413
|
* @param vec the Euler vector (x Pitch, y Yaw, z Roll)
|
|
@@ -2387,7 +2420,7 @@ export declare class Quaternion {
|
|
|
2387
2420
|
* @param result the quaternion to store the result
|
|
2388
2421
|
* @returns the updated quaternion
|
|
2389
2422
|
*/
|
|
2390
|
-
static FromEulerVectorToRef(vec: DeepImmutable<Vector3>, result:
|
|
2423
|
+
static FromEulerVectorToRef<T extends Quaternion>(vec: DeepImmutable<Vector3>, result: T): T;
|
|
2391
2424
|
/**
|
|
2392
2425
|
* Updates a quaternion so that it rotates vector vecFrom to vector vecTo
|
|
2393
2426
|
* @param vecFrom defines the direction vector from which to rotate
|
|
@@ -2395,7 +2428,7 @@ export declare class Quaternion {
|
|
|
2395
2428
|
* @param result the quaternion to store the result
|
|
2396
2429
|
* @returns the updated quaternion
|
|
2397
2430
|
*/
|
|
2398
|
-
static FromUnitVectorsToRef(vecFrom: DeepImmutable<Vector3>, vecTo: DeepImmutable<Vector3>, result:
|
|
2431
|
+
static FromUnitVectorsToRef<T extends Quaternion>(vecFrom: DeepImmutable<Vector3>, vecTo: DeepImmutable<Vector3>, result: T): T;
|
|
2399
2432
|
/**
|
|
2400
2433
|
* Creates a new quaternion from the given Euler float angles (y, x, z)
|
|
2401
2434
|
* @param yaw defines the rotation around Y axis
|
|
@@ -2410,8 +2443,9 @@ export declare class Quaternion {
|
|
|
2410
2443
|
* @param pitch defines the rotation around X axis
|
|
2411
2444
|
* @param roll defines the rotation around Z axis
|
|
2412
2445
|
* @param result defines the target quaternion
|
|
2446
|
+
* @returns result input
|
|
2413
2447
|
*/
|
|
2414
|
-
static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result:
|
|
2448
|
+
static RotationYawPitchRollToRef<T extends Quaternion>(yaw: number, pitch: number, roll: number, result: T): T;
|
|
2415
2449
|
/**
|
|
2416
2450
|
* Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation
|
|
2417
2451
|
* @param alpha defines the rotation around first axis
|
|
@@ -2426,8 +2460,9 @@ export declare class Quaternion {
|
|
|
2426
2460
|
* @param beta defines the rotation around second axis
|
|
2427
2461
|
* @param gamma defines the rotation around third axis
|
|
2428
2462
|
* @param result defines the target quaternion
|
|
2463
|
+
* @returns result input
|
|
2429
2464
|
*/
|
|
2430
|
-
static RotationAlphaBetaGammaToRef(alpha: number, beta: number, gamma: number, result:
|
|
2465
|
+
static RotationAlphaBetaGammaToRef<T extends Quaternion>(alpha: number, beta: number, gamma: number, result: T): T;
|
|
2431
2466
|
/**
|
|
2432
2467
|
* Creates a new quaternion containing the rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation)
|
|
2433
2468
|
* @param axis1 defines the first axis
|
|
@@ -2442,8 +2477,9 @@ export declare class Quaternion {
|
|
|
2442
2477
|
* @param axis2 defines the second axis
|
|
2443
2478
|
* @param axis3 defines the third axis
|
|
2444
2479
|
* @param ref defines the target quaternion
|
|
2480
|
+
* @returns result input
|
|
2445
2481
|
*/
|
|
2446
|
-
static RotationQuaternionFromAxisToRef(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref:
|
|
2482
|
+
static RotationQuaternionFromAxisToRef<T extends Quaternion>(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref: T): T;
|
|
2447
2483
|
/**
|
|
2448
2484
|
* Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up".
|
|
2449
2485
|
* This function works in left handed mode
|
|
@@ -2458,8 +2494,9 @@ export declare class Quaternion {
|
|
|
2458
2494
|
* @param forward defines the forward direction - Must be normalized and orthogonal to up.
|
|
2459
2495
|
* @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
|
|
2460
2496
|
* @param ref defines the target quaternion.
|
|
2497
|
+
* @returns result input
|
|
2461
2498
|
*/
|
|
2462
|
-
static FromLookDirectionLHToRef(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref:
|
|
2499
|
+
static FromLookDirectionLHToRef<T extends Quaternion>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref: T): T;
|
|
2463
2500
|
/**
|
|
2464
2501
|
* Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up".
|
|
2465
2502
|
* This function works in right handed mode
|
|
@@ -2474,8 +2511,9 @@ export declare class Quaternion {
|
|
|
2474
2511
|
* @param forward defines the forward direction - Must be normalized and orthogonal to up.
|
|
2475
2512
|
* @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
|
|
2476
2513
|
* @param ref defines the target quaternion.
|
|
2514
|
+
* @returns result input
|
|
2477
2515
|
*/
|
|
2478
|
-
static FromLookDirectionRHToRef(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref:
|
|
2516
|
+
static FromLookDirectionRHToRef<T extends Quaternion>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref: T): T;
|
|
2479
2517
|
/**
|
|
2480
2518
|
* Interpolates between two quaternions
|
|
2481
2519
|
* @param left defines first quaternion
|
|
@@ -2490,8 +2528,9 @@ export declare class Quaternion {
|
|
|
2490
2528
|
* @param right defines second quaternion
|
|
2491
2529
|
* @param amount defines the gradient to use
|
|
2492
2530
|
* @param result defines the target quaternion
|
|
2531
|
+
* @returns result input
|
|
2493
2532
|
*/
|
|
2494
|
-
static SlerpToRef(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>, amount: number, result:
|
|
2533
|
+
static SlerpToRef<T extends Quaternion>(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>, amount: number, result: T): T;
|
|
2495
2534
|
/**
|
|
2496
2535
|
* Interpolate between two quaternions using Hermite interpolation
|
|
2497
2536
|
* @param value1 defines first quaternion
|
|
@@ -2501,7 +2540,7 @@ export declare class Quaternion {
|
|
|
2501
2540
|
* @param amount defines the target quaternion
|
|
2502
2541
|
* @returns the new interpolated quaternion
|
|
2503
2542
|
*/
|
|
2504
|
-
static Hermite(value1: DeepImmutable<
|
|
2543
|
+
static Hermite<T extends Quaternion>(value1: DeepImmutable<T>, tangent1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, tangent2: DeepImmutable<Quaternion>, amount: number): T;
|
|
2505
2544
|
/**
|
|
2506
2545
|
* Returns a new Quaternion which is the 1st derivative of the Hermite spline defined by the quaternions "value1", "value2", "tangent1", "tangent2".
|
|
2507
2546
|
* @param value1 defines the first control point
|
|
@@ -2511,7 +2550,7 @@ export declare class Quaternion {
|
|
|
2511
2550
|
* @param time define where the derivative must be done
|
|
2512
2551
|
* @returns 1st derivative
|
|
2513
2552
|
*/
|
|
2514
|
-
static Hermite1stDerivative(value1: DeepImmutable<
|
|
2553
|
+
static Hermite1stDerivative<T extends Quaternion>(value1: DeepImmutable<T>, tangent1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, tangent2: DeepImmutable<Quaternion>, time: number): T;
|
|
2515
2554
|
/**
|
|
2516
2555
|
* Update a Quaternion with the 1st derivative of the Hermite spline defined by the quaternions "value1", "value2", "tangent1", "tangent2".
|
|
2517
2556
|
* @param value1 defines the first control point
|
|
@@ -2520,8 +2559,9 @@ export declare class Quaternion {
|
|
|
2520
2559
|
* @param tangent2 defines the second tangent
|
|
2521
2560
|
* @param time define where the derivative must be done
|
|
2522
2561
|
* @param result define where to store the derivative
|
|
2562
|
+
* @returns result input
|
|
2523
2563
|
*/
|
|
2524
|
-
static Hermite1stDerivativeToRef(value1: DeepImmutable<Quaternion>, tangent1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, tangent2: DeepImmutable<Quaternion>, time: number, result:
|
|
2564
|
+
static Hermite1stDerivativeToRef<T extends Quaternion>(value1: DeepImmutable<Quaternion>, tangent1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, tangent2: DeepImmutable<Quaternion>, time: number, result: T): T;
|
|
2525
2565
|
}
|
|
2526
2566
|
/**
|
|
2527
2567
|
* Class used to store matrix data (4x4)
|
|
@@ -2586,51 +2626,51 @@ export declare class Matrix {
|
|
|
2586
2626
|
* Inverts the current matrix in place
|
|
2587
2627
|
* @returns the current inverted matrix
|
|
2588
2628
|
*/
|
|
2589
|
-
invert():
|
|
2629
|
+
invert(): this;
|
|
2590
2630
|
/**
|
|
2591
2631
|
* Sets all the matrix elements to zero
|
|
2592
2632
|
* @returns the current matrix
|
|
2593
2633
|
*/
|
|
2594
|
-
reset():
|
|
2634
|
+
reset(): this;
|
|
2595
2635
|
/**
|
|
2596
2636
|
* Adds the current matrix with a second one
|
|
2597
2637
|
* @param other defines the matrix to add
|
|
2598
2638
|
* @returns a new matrix as the addition of the current matrix and the given one
|
|
2599
2639
|
*/
|
|
2600
|
-
add(other: DeepImmutable<Matrix>):
|
|
2640
|
+
add(other: DeepImmutable<Matrix>): this;
|
|
2601
2641
|
/**
|
|
2602
2642
|
* Sets the given matrix "result" to the addition of the current matrix and the given one
|
|
2603
2643
|
* @param other defines the matrix to add
|
|
2604
2644
|
* @param result defines the target matrix
|
|
2605
|
-
* @returns
|
|
2645
|
+
* @returns result input
|
|
2606
2646
|
*/
|
|
2607
|
-
addToRef(other: DeepImmutable<Matrix>, result:
|
|
2647
|
+
addToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T;
|
|
2608
2648
|
/**
|
|
2609
2649
|
* Adds in place the given matrix to the current matrix
|
|
2610
2650
|
* @param other defines the second operand
|
|
2611
2651
|
* @returns the current updated matrix
|
|
2612
2652
|
*/
|
|
2613
|
-
addToSelf(other: DeepImmutable<Matrix>):
|
|
2653
|
+
addToSelf(other: DeepImmutable<Matrix>): this;
|
|
2614
2654
|
/**
|
|
2615
2655
|
* Sets the given matrix to the current inverted Matrix
|
|
2616
2656
|
* @param other defines the target matrix
|
|
2617
|
-
* @returns
|
|
2657
|
+
* @returns result input
|
|
2618
2658
|
*/
|
|
2619
|
-
invertToRef(other:
|
|
2659
|
+
invertToRef<T extends Matrix>(other: T): T;
|
|
2620
2660
|
/**
|
|
2621
2661
|
* add a value at the specified position in the current Matrix
|
|
2622
2662
|
* @param index the index of the value within the matrix. between 0 and 15.
|
|
2623
2663
|
* @param value the value to be added
|
|
2624
2664
|
* @returns the current updated matrix
|
|
2625
2665
|
*/
|
|
2626
|
-
addAtIndex(index: number, value: number):
|
|
2666
|
+
addAtIndex(index: number, value: number): this;
|
|
2627
2667
|
/**
|
|
2628
2668
|
* mutiply the specified position in the current Matrix by a value
|
|
2629
2669
|
* @param index the index of the value within the matrix. between 0 and 15.
|
|
2630
2670
|
* @param value the value to be added
|
|
2631
2671
|
* @returns the current updated matrix
|
|
2632
2672
|
*/
|
|
2633
|
-
multiplyAtIndex(index: number, value: number):
|
|
2673
|
+
multiplyAtIndex(index: number, value: number): this;
|
|
2634
2674
|
/**
|
|
2635
2675
|
* Inserts the translation vector (using 3 floats) in the current matrix
|
|
2636
2676
|
* @param x defines the 1st component of the translation
|
|
@@ -2638,7 +2678,7 @@ export declare class Matrix {
|
|
|
2638
2678
|
* @param z defines the 3rd component of the translation
|
|
2639
2679
|
* @returns the current updated matrix
|
|
2640
2680
|
*/
|
|
2641
|
-
setTranslationFromFloats(x: number, y: number, z: number):
|
|
2681
|
+
setTranslationFromFloats(x: number, y: number, z: number): this;
|
|
2642
2682
|
/**
|
|
2643
2683
|
* Adds the translation vector (using 3 floats) in the current matrix
|
|
2644
2684
|
* @param x defines the 1st component of the translation
|
|
@@ -2646,13 +2686,13 @@ export declare class Matrix {
|
|
|
2646
2686
|
* @param z defines the 3rd component of the translation
|
|
2647
2687
|
* @returns the current updated matrix
|
|
2648
2688
|
*/
|
|
2649
|
-
addTranslationFromFloats(x: number, y: number, z: number):
|
|
2689
|
+
addTranslationFromFloats(x: number, y: number, z: number): this;
|
|
2650
2690
|
/**
|
|
2651
2691
|
* Inserts the translation vector in the current matrix
|
|
2652
2692
|
* @param vector3 defines the translation to insert
|
|
2653
2693
|
* @returns the current updated matrix
|
|
2654
2694
|
*/
|
|
2655
|
-
setTranslation(vector3: DeepImmutable<Vector3>):
|
|
2695
|
+
setTranslation(vector3: DeepImmutable<Vector3>): this;
|
|
2656
2696
|
/**
|
|
2657
2697
|
* Gets the translation value of the current matrix
|
|
2658
2698
|
* @returns a new Vector3 as the extracted translation from the matrix
|
|
@@ -2663,38 +2703,38 @@ export declare class Matrix {
|
|
|
2663
2703
|
* @param result defines the Vector3 where to store the translation
|
|
2664
2704
|
* @returns the current matrix
|
|
2665
2705
|
*/
|
|
2666
|
-
getTranslationToRef(result:
|
|
2706
|
+
getTranslationToRef<T extends Vector3>(result: T): T;
|
|
2667
2707
|
/**
|
|
2668
2708
|
* Remove rotation and scaling part from the matrix
|
|
2669
2709
|
* @returns the updated matrix
|
|
2670
2710
|
*/
|
|
2671
|
-
removeRotationAndScaling():
|
|
2711
|
+
removeRotationAndScaling(): this;
|
|
2672
2712
|
/**
|
|
2673
2713
|
* Multiply two matrices
|
|
2674
2714
|
* @param other defines the second operand
|
|
2675
2715
|
* @returns a new matrix set with the multiplication result of the current Matrix and the given one
|
|
2676
2716
|
*/
|
|
2677
|
-
multiply(other: DeepImmutable<Matrix>):
|
|
2717
|
+
multiply(other: DeepImmutable<Matrix>): this;
|
|
2678
2718
|
/**
|
|
2679
2719
|
* Copy the current matrix from the given one
|
|
2680
2720
|
* @param other defines the source matrix
|
|
2681
2721
|
* @returns the current updated matrix
|
|
2682
2722
|
*/
|
|
2683
|
-
copyFrom(other: DeepImmutable<Matrix>):
|
|
2723
|
+
copyFrom(other: DeepImmutable<Matrix>): this;
|
|
2684
2724
|
/**
|
|
2685
2725
|
* Populates the given array from the starting index with the current matrix values
|
|
2686
2726
|
* @param array defines the target array
|
|
2687
2727
|
* @param offset defines the offset in the target array where to start storing values
|
|
2688
2728
|
* @returns the current matrix
|
|
2689
2729
|
*/
|
|
2690
|
-
copyToArray(array: Float32Array | Array<number>, offset?: number):
|
|
2730
|
+
copyToArray(array: Float32Array | Array<number>, offset?: number): this;
|
|
2691
2731
|
/**
|
|
2692
2732
|
* Sets the given matrix "result" with the multiplication result of the current Matrix and the given one
|
|
2693
2733
|
* @param other defines the second operand
|
|
2694
2734
|
* @param result defines the matrix where to store the multiplication
|
|
2695
|
-
* @returns
|
|
2735
|
+
* @returns result input
|
|
2696
2736
|
*/
|
|
2697
|
-
multiplyToRef(other: DeepImmutable<Matrix>, result:
|
|
2737
|
+
multiplyToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T;
|
|
2698
2738
|
/**
|
|
2699
2739
|
* Sets the Float32Array "result" from the given index "offset" with the multiplication of the current matrix and the given one
|
|
2700
2740
|
* @param other defines the second operand
|
|
@@ -2702,7 +2742,7 @@ export declare class Matrix {
|
|
|
2702
2742
|
* @param offset defines the offset in the target array where to start storing values
|
|
2703
2743
|
* @returns the current matrix
|
|
2704
2744
|
*/
|
|
2705
|
-
multiplyToArray(other: DeepImmutable<Matrix>, result: Float32Array | Array<number>, offset: number):
|
|
2745
|
+
multiplyToArray(other: DeepImmutable<Matrix>, result: Float32Array | Array<number>, offset: number): this;
|
|
2706
2746
|
/**
|
|
2707
2747
|
* Check equality between this matrix and a second one
|
|
2708
2748
|
* @param value defines the second matrix to compare
|
|
@@ -2713,7 +2753,7 @@ export declare class Matrix {
|
|
|
2713
2753
|
* Clone the current matrix
|
|
2714
2754
|
* @returns a new matrix from the current matrix
|
|
2715
2755
|
*/
|
|
2716
|
-
clone():
|
|
2756
|
+
clone(): this;
|
|
2717
2757
|
/**
|
|
2718
2758
|
* Returns the name of the current matrix class
|
|
2719
2759
|
* @returns the string "Matrix"
|
|
@@ -2749,27 +2789,27 @@ export declare class Matrix {
|
|
|
2749
2789
|
* Gets specific row of the matrix to ref
|
|
2750
2790
|
* @param index defines the number of the row to get
|
|
2751
2791
|
* @param rowVector vector to store the index-th row of the current matrix
|
|
2752
|
-
* @returns
|
|
2792
|
+
* @returns result input
|
|
2753
2793
|
*/
|
|
2754
|
-
getRowToRef(index: number, rowVector:
|
|
2794
|
+
getRowToRef<T extends Vector4>(index: number, rowVector: T): T;
|
|
2755
2795
|
/**
|
|
2756
2796
|
* Sets the index-th row of the current matrix to the vector4 values
|
|
2757
2797
|
* @param index defines the number of the row to set
|
|
2758
2798
|
* @param row defines the target vector4
|
|
2759
2799
|
* @returns the updated current matrix
|
|
2760
2800
|
*/
|
|
2761
|
-
setRow(index: number, row: Vector4):
|
|
2801
|
+
setRow(index: number, row: Vector4): this;
|
|
2762
2802
|
/**
|
|
2763
2803
|
* Compute the transpose of the matrix
|
|
2764
2804
|
* @returns the new transposed matrix
|
|
2765
2805
|
*/
|
|
2766
|
-
transpose():
|
|
2806
|
+
transpose(): this;
|
|
2767
2807
|
/**
|
|
2768
2808
|
* Compute the transpose of the matrix and store it in a given matrix
|
|
2769
2809
|
* @param result defines the target matrix
|
|
2770
|
-
* @returns
|
|
2810
|
+
* @returns result input
|
|
2771
2811
|
*/
|
|
2772
|
-
transposeToRef(result:
|
|
2812
|
+
transposeToRef<T extends Matrix>(result: T): T;
|
|
2773
2813
|
/**
|
|
2774
2814
|
* Sets the index-th row of the current matrix with the given 4 x float values
|
|
2775
2815
|
* @param index defines the row index
|
|
@@ -2779,51 +2819,51 @@ export declare class Matrix {
|
|
|
2779
2819
|
* @param w defines the w component to set
|
|
2780
2820
|
* @returns the updated current matrix
|
|
2781
2821
|
*/
|
|
2782
|
-
setRowFromFloats(index: number, x: number, y: number, z: number, w: number):
|
|
2822
|
+
setRowFromFloats(index: number, x: number, y: number, z: number, w: number): this;
|
|
2783
2823
|
/**
|
|
2784
2824
|
* Compute a new matrix set with the current matrix values multiplied by scale (float)
|
|
2785
2825
|
* @param scale defines the scale factor
|
|
2786
2826
|
* @returns a new matrix
|
|
2787
2827
|
*/
|
|
2788
|
-
scale(scale: number):
|
|
2828
|
+
scale(scale: number): this;
|
|
2789
2829
|
/**
|
|
2790
2830
|
* Scale the current matrix values by a factor to a given result matrix
|
|
2791
2831
|
* @param scale defines the scale factor
|
|
2792
2832
|
* @param result defines the matrix to store the result
|
|
2793
|
-
* @returns
|
|
2833
|
+
* @returns result input
|
|
2794
2834
|
*/
|
|
2795
|
-
scaleToRef(scale: number, result:
|
|
2835
|
+
scaleToRef<T extends Matrix>(scale: number, result: T): T;
|
|
2796
2836
|
/**
|
|
2797
2837
|
* Scale the current matrix values by a factor and add the result to a given matrix
|
|
2798
2838
|
* @param scale defines the scale factor
|
|
2799
2839
|
* @param result defines the Matrix to store the result
|
|
2800
|
-
* @returns
|
|
2840
|
+
* @returns result input
|
|
2801
2841
|
*/
|
|
2802
|
-
scaleAndAddToRef(scale: number, result:
|
|
2842
|
+
scaleAndAddToRef<T extends Matrix>(scale: number, result: T): T;
|
|
2803
2843
|
/**
|
|
2804
2844
|
* Writes to the given matrix a normal matrix, computed from this one (using values from identity matrix for fourth row and column).
|
|
2805
2845
|
* @param ref matrix to store the result
|
|
2806
2846
|
*/
|
|
2807
|
-
toNormalMatrix(ref:
|
|
2847
|
+
toNormalMatrix<T extends Matrix>(ref: T): T;
|
|
2808
2848
|
/**
|
|
2809
2849
|
* Gets only rotation part of the current matrix
|
|
2810
2850
|
* @returns a new matrix sets to the extracted rotation matrix from the current one
|
|
2811
2851
|
*/
|
|
2812
|
-
getRotationMatrix():
|
|
2852
|
+
getRotationMatrix(): this;
|
|
2813
2853
|
/**
|
|
2814
2854
|
* Extracts the rotation matrix from the current one and sets it as the given "result"
|
|
2815
2855
|
* @param result defines the target matrix to store data to
|
|
2816
|
-
* @returns
|
|
2856
|
+
* @returns result input
|
|
2817
2857
|
*/
|
|
2818
|
-
getRotationMatrixToRef(result:
|
|
2858
|
+
getRotationMatrixToRef<T extends Matrix>(result: T): T;
|
|
2819
2859
|
/**
|
|
2820
2860
|
* Toggles model matrix from being right handed to left handed in place and vice versa
|
|
2821
2861
|
*/
|
|
2822
|
-
toggleModelMatrixHandInPlace():
|
|
2862
|
+
toggleModelMatrixHandInPlace(): this;
|
|
2823
2863
|
/**
|
|
2824
2864
|
* Toggles projection matrix from being right handed to left handed in place and vice versa
|
|
2825
2865
|
*/
|
|
2826
|
-
toggleProjectionMatrixHandInPlace():
|
|
2866
|
+
toggleProjectionMatrixHandInPlace(): this;
|
|
2827
2867
|
/**
|
|
2828
2868
|
* Creates a matrix from an array
|
|
2829
2869
|
* @param array defines the source array
|
|
@@ -2836,16 +2876,18 @@ export declare class Matrix {
|
|
|
2836
2876
|
* @param array defines the source array
|
|
2837
2877
|
* @param offset defines an offset in the source array
|
|
2838
2878
|
* @param result defines the target matrix
|
|
2879
|
+
* @returns result input
|
|
2839
2880
|
*/
|
|
2840
|
-
static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number, result:
|
|
2881
|
+
static FromArrayToRef<T extends Matrix>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T;
|
|
2841
2882
|
/**
|
|
2842
2883
|
* Stores an array into a matrix after having multiplied each component by a given factor
|
|
2843
2884
|
* @param array defines the source array
|
|
2844
2885
|
* @param offset defines the offset in the source array
|
|
2845
2886
|
* @param scale defines the scaling factor
|
|
2846
2887
|
* @param result defines the target matrix
|
|
2888
|
+
* @returns result input
|
|
2847
2889
|
*/
|
|
2848
|
-
static FromFloat32ArrayToRefScaled(array: DeepImmutable<Float32Array | Array<number>>, offset: number, scale: number, result:
|
|
2890
|
+
static FromFloat32ArrayToRefScaled<T extends Matrix>(array: DeepImmutable<Float32Array | Array<number>>, offset: number, scale: number, result: T): T;
|
|
2849
2891
|
/**
|
|
2850
2892
|
* Gets an identity matrix that must not be updated
|
|
2851
2893
|
*/
|
|
@@ -2869,6 +2911,7 @@ export declare class Matrix {
|
|
|
2869
2911
|
* @param initialM43 defines 3rd value of 4th row
|
|
2870
2912
|
* @param initialM44 defines 4th value of 4th row
|
|
2871
2913
|
* @param result defines the target matrix
|
|
2914
|
+
* @returns result input
|
|
2872
2915
|
*/
|
|
2873
2916
|
static 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: Matrix): void;
|
|
2874
2917
|
/**
|
|
@@ -2906,8 +2949,9 @@ export declare class Matrix {
|
|
|
2906
2949
|
* @param rotation defines the rotation quaternion
|
|
2907
2950
|
* @param translation defines the translation vector3
|
|
2908
2951
|
* @param result defines the target matrix
|
|
2952
|
+
* @returns result input
|
|
2909
2953
|
*/
|
|
2910
|
-
static ComposeToRef(scale: DeepImmutable<Vector3>, rotation: DeepImmutable<Quaternion>, translation: DeepImmutable<Vector3>, result:
|
|
2954
|
+
static ComposeToRef<T extends Matrix>(scale: DeepImmutable<Vector3>, rotation: DeepImmutable<Quaternion>, translation: DeepImmutable<Vector3>, result: T): T;
|
|
2911
2955
|
/**
|
|
2912
2956
|
* Creates a new identity matrix
|
|
2913
2957
|
* @returns a new identity matrix
|
|
@@ -2916,8 +2960,9 @@ export declare class Matrix {
|
|
|
2916
2960
|
/**
|
|
2917
2961
|
* Creates a new identity matrix and stores the result in a given matrix
|
|
2918
2962
|
* @param result defines the target matrix
|
|
2963
|
+
* @returns result input
|
|
2919
2964
|
*/
|
|
2920
|
-
static IdentityToRef(result:
|
|
2965
|
+
static IdentityToRef<T extends Matrix>(result: T): T;
|
|
2921
2966
|
/**
|
|
2922
2967
|
* Creates a new zero matrix
|
|
2923
2968
|
* @returns a new zero matrix
|
|
@@ -2934,13 +2979,14 @@ export declare class Matrix {
|
|
|
2934
2979
|
* @param source defines the source matrix
|
|
2935
2980
|
* @returns the new matrix
|
|
2936
2981
|
*/
|
|
2937
|
-
static Invert(source: DeepImmutable<
|
|
2982
|
+
static Invert<T extends Matrix>(source: DeepImmutable<T>): T;
|
|
2938
2983
|
/**
|
|
2939
2984
|
* Creates a new rotation matrix for "angle" radians around the X axis and stores it in a given matrix
|
|
2940
2985
|
* @param angle defines the angle (in radians) to use
|
|
2941
2986
|
* @param result defines the target matrix
|
|
2987
|
+
* @returns result input
|
|
2942
2988
|
*/
|
|
2943
|
-
static RotationXToRef(angle: number, result:
|
|
2989
|
+
static RotationXToRef<T extends Matrix>(angle: number, result: T): T;
|
|
2944
2990
|
/**
|
|
2945
2991
|
* Creates a new rotation matrix for "angle" radians around the Y axis
|
|
2946
2992
|
* @param angle defines the angle (in radians) to use
|
|
@@ -2951,8 +2997,9 @@ export declare class Matrix {
|
|
|
2951
2997
|
* Creates a new rotation matrix for "angle" radians around the Y axis and stores it in a given matrix
|
|
2952
2998
|
* @param angle defines the angle (in radians) to use
|
|
2953
2999
|
* @param result defines the target matrix
|
|
3000
|
+
* @returns result input
|
|
2954
3001
|
*/
|
|
2955
|
-
static RotationYToRef(angle: number, result:
|
|
3002
|
+
static RotationYToRef<T extends Matrix>(angle: number, result: T): T;
|
|
2956
3003
|
/**
|
|
2957
3004
|
* Creates a new rotation matrix for "angle" radians around the Z axis
|
|
2958
3005
|
* @param angle defines the angle (in radians) to use
|
|
@@ -2963,8 +3010,9 @@ export declare class Matrix {
|
|
|
2963
3010
|
* Creates a new rotation matrix for "angle" radians around the Z axis and stores it in a given matrix
|
|
2964
3011
|
* @param angle defines the angle (in radians) to use
|
|
2965
3012
|
* @param result defines the target matrix
|
|
3013
|
+
* @returns result input
|
|
2966
3014
|
*/
|
|
2967
|
-
static RotationZToRef(angle: number, result:
|
|
3015
|
+
static RotationZToRef<T extends Matrix>(angle: number, result: T): T;
|
|
2968
3016
|
/**
|
|
2969
3017
|
* Creates a new rotation matrix for "angle" radians around the given axis
|
|
2970
3018
|
* @param axis defines the axis to use
|
|
@@ -2977,16 +3025,18 @@ export declare class Matrix {
|
|
|
2977
3025
|
* @param axis defines the axis to use
|
|
2978
3026
|
* @param angle defines the angle (in radians) to use
|
|
2979
3027
|
* @param result defines the target matrix
|
|
3028
|
+
* @returns result input
|
|
2980
3029
|
*/
|
|
2981
|
-
static RotationAxisToRef(axis: DeepImmutable<Vector3>, angle: number, result:
|
|
3030
|
+
static RotationAxisToRef<T extends Matrix>(axis: DeepImmutable<Vector3>, angle: number, result: T): T;
|
|
2982
3031
|
/**
|
|
2983
3032
|
* Takes normalised vectors and returns a rotation matrix to align "from" with "to".
|
|
2984
3033
|
* Taken from http://www.iquilezles.org/www/articles/noacos/noacos.htm
|
|
2985
3034
|
* @param from defines the vector to align
|
|
2986
3035
|
* @param to defines the vector to align to
|
|
2987
3036
|
* @param result defines the target matrix
|
|
3037
|
+
* @returns result input
|
|
2988
3038
|
*/
|
|
2989
|
-
static RotationAlignToRef(from: DeepImmutable<Vector3>, to: DeepImmutable<Vector3>, result:
|
|
3039
|
+
static RotationAlignToRef<T extends Matrix>(from: DeepImmutable<Vector3>, to: DeepImmutable<Vector3>, result: T): T;
|
|
2990
3040
|
/**
|
|
2991
3041
|
* Creates a rotation matrix
|
|
2992
3042
|
* @param yaw defines the yaw angle in radians (Y axis)
|
|
@@ -3001,8 +3051,9 @@ export declare class Matrix {
|
|
|
3001
3051
|
* @param pitch defines the pitch angle in radians (X axis)
|
|
3002
3052
|
* @param roll defines the roll angle in radians (Z axis)
|
|
3003
3053
|
* @param result defines the target matrix
|
|
3054
|
+
* @returns result input
|
|
3004
3055
|
*/
|
|
3005
|
-
static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result:
|
|
3056
|
+
static RotationYawPitchRollToRef<T extends Matrix>(yaw: number, pitch: number, roll: number, result: T): T;
|
|
3006
3057
|
/**
|
|
3007
3058
|
* Creates a scaling matrix
|
|
3008
3059
|
* @param x defines the scale factor on X axis
|
|
@@ -3017,8 +3068,9 @@ export declare class Matrix {
|
|
|
3017
3068
|
* @param y defines the scale factor on Y axis
|
|
3018
3069
|
* @param z defines the scale factor on Z axis
|
|
3019
3070
|
* @param result defines the target matrix
|
|
3071
|
+
* @returns result input
|
|
3020
3072
|
*/
|
|
3021
|
-
static ScalingToRef(x: number, y: number, z: number, result:
|
|
3073
|
+
static ScalingToRef<T extends Matrix>(x: number, y: number, z: number, result: T): T;
|
|
3022
3074
|
/**
|
|
3023
3075
|
* Creates a translation matrix
|
|
3024
3076
|
* @param x defines the translation on X axis
|
|
@@ -3033,8 +3085,9 @@ export declare class Matrix {
|
|
|
3033
3085
|
* @param y defines the translation on Y axis
|
|
3034
3086
|
* @param z defines the translationon Z axis
|
|
3035
3087
|
* @param result defines the target matrix
|
|
3088
|
+
* @returns result input
|
|
3036
3089
|
*/
|
|
3037
|
-
static TranslationToRef(x: number, y: number, z: number, result:
|
|
3090
|
+
static TranslationToRef<T extends Matrix>(x: number, y: number, z: number, result: T): T;
|
|
3038
3091
|
/**
|
|
3039
3092
|
* Returns a new Matrix whose values are the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
|
|
3040
3093
|
* @param startValue defines the start value
|
|
@@ -3042,15 +3095,16 @@ export declare class Matrix {
|
|
|
3042
3095
|
* @param gradient defines the gradient factor
|
|
3043
3096
|
* @returns the new matrix
|
|
3044
3097
|
*/
|
|
3045
|
-
static Lerp(startValue: DeepImmutable<
|
|
3098
|
+
static Lerp<T extends Matrix>(startValue: DeepImmutable<T>, endValue: DeepImmutable<Matrix>, gradient: number): T;
|
|
3046
3099
|
/**
|
|
3047
3100
|
* Set the given matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
|
|
3048
3101
|
* @param startValue defines the start value
|
|
3049
3102
|
* @param endValue defines the end value
|
|
3050
3103
|
* @param gradient defines the gradient factor
|
|
3051
3104
|
* @param result defines the Matrix object where to store data
|
|
3105
|
+
* @returns result input
|
|
3052
3106
|
*/
|
|
3053
|
-
static LerpToRef(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result:
|
|
3107
|
+
static LerpToRef<T extends Matrix>(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result: T): T;
|
|
3054
3108
|
/**
|
|
3055
3109
|
* Builds a new matrix whose values are computed by:
|
|
3056
3110
|
* * decomposing the the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
|
|
@@ -3061,7 +3115,7 @@ export declare class Matrix {
|
|
|
3061
3115
|
* @param gradient defines the gradient between the two matrices
|
|
3062
3116
|
* @returns the new matrix
|
|
3063
3117
|
*/
|
|
3064
|
-
static DecomposeLerp(startValue: DeepImmutable<
|
|
3118
|
+
static DecomposeLerp<T extends Matrix>(startValue: DeepImmutable<T>, endValue: DeepImmutable<Matrix>, gradient: number): T;
|
|
3065
3119
|
/**
|
|
3066
3120
|
* Update a matrix to values which are computed by:
|
|
3067
3121
|
* * decomposing the the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
|
|
@@ -3071,8 +3125,9 @@ export declare class Matrix {
|
|
|
3071
3125
|
* @param endValue defines the second matrix
|
|
3072
3126
|
* @param gradient defines the gradient between the two matrices
|
|
3073
3127
|
* @param result defines the target matrix
|
|
3128
|
+
* @returns result input
|
|
3074
3129
|
*/
|
|
3075
|
-
static DecomposeLerpToRef(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result:
|
|
3130
|
+
static DecomposeLerpToRef<T extends Matrix>(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result: T): T;
|
|
3076
3131
|
/**
|
|
3077
3132
|
* 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"
|
|
3078
3133
|
* This function works in left handed mode
|
|
@@ -3089,6 +3144,7 @@ export declare class Matrix {
|
|
|
3089
3144
|
* @param target defines where the entity should look at
|
|
3090
3145
|
* @param up defines the up vector for the entity
|
|
3091
3146
|
* @param result defines the target matrix
|
|
3147
|
+
* @returns result input
|
|
3092
3148
|
*/
|
|
3093
3149
|
static LookAtLHToRef(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: Matrix): void;
|
|
3094
3150
|
/**
|
|
@@ -3107,8 +3163,9 @@ export declare class Matrix {
|
|
|
3107
3163
|
* @param target defines where the entity should look at
|
|
3108
3164
|
* @param up defines the up vector for the entity
|
|
3109
3165
|
* @param result defines the target matrix
|
|
3166
|
+
* @returns result input
|
|
3110
3167
|
*/
|
|
3111
|
-
static LookAtRHToRef(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result:
|
|
3168
|
+
static LookAtRHToRef<T extends Matrix>(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T;
|
|
3112
3169
|
/**
|
|
3113
3170
|
* Gets a new rotation matrix used to rotate an entity so as it looks in the direction specified by forward from the eye position, the up direction being oriented like "up".
|
|
3114
3171
|
* This function works in left handed mode
|
|
@@ -3123,8 +3180,9 @@ export declare class Matrix {
|
|
|
3123
3180
|
* @param forward defines the forward direction - Must be normalized and orthogonal to up.
|
|
3124
3181
|
* @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
|
|
3125
3182
|
* @param result defines the target matrix
|
|
3183
|
+
* @returns result input
|
|
3126
3184
|
*/
|
|
3127
|
-
static LookDirectionLHToRef(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result:
|
|
3185
|
+
static LookDirectionLHToRef<T extends Matrix>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T;
|
|
3128
3186
|
/**
|
|
3129
3187
|
* Gets a new rotation matrix used to rotate an entity so as it looks in the direction specified by forward from the eye position, the up Vector3 being oriented like "up".
|
|
3130
3188
|
* This function works in right handed mode
|
|
@@ -3139,8 +3197,9 @@ export declare class Matrix {
|
|
|
3139
3197
|
* @param forward defines the forward direction - Must be normalized and orthogonal to up.
|
|
3140
3198
|
* @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
|
|
3141
3199
|
* @param result defines the target matrix
|
|
3200
|
+
* @returns result input
|
|
3142
3201
|
*/
|
|
3143
|
-
static LookDirectionRHToRef(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result:
|
|
3202
|
+
static LookDirectionRHToRef<T extends Matrix>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T;
|
|
3144
3203
|
/**
|
|
3145
3204
|
* Create a left-handed orthographic projection matrix
|
|
3146
3205
|
* @param width defines the viewport width
|
|
@@ -3159,8 +3218,9 @@ export declare class Matrix {
|
|
|
3159
3218
|
* @param zfar defines the far clip plane
|
|
3160
3219
|
* @param result defines the target matrix
|
|
3161
3220
|
* @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
|
|
3221
|
+
* @returns result input
|
|
3162
3222
|
*/
|
|
3163
|
-
static OrthoLHToRef(width: number, height: number, znear: number, zfar: number, result:
|
|
3223
|
+
static OrthoLHToRef<T extends Matrix>(width: number, height: number, znear: number, zfar: number, result: T, halfZRange?: boolean): T;
|
|
3164
3224
|
/**
|
|
3165
3225
|
* Create a left-handed orthographic projection matrix
|
|
3166
3226
|
* @param left defines the viewport left coordinate
|
|
@@ -3183,8 +3243,9 @@ export declare class Matrix {
|
|
|
3183
3243
|
* @param zfar defines the far clip plane
|
|
3184
3244
|
* @param result defines the target matrix
|
|
3185
3245
|
* @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
|
|
3246
|
+
* @returns result input
|
|
3186
3247
|
*/
|
|
3187
|
-
static OrthoOffCenterLHToRef(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result:
|
|
3248
|
+
static OrthoOffCenterLHToRef<T extends Matrix>(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: T, halfZRange?: boolean): T;
|
|
3188
3249
|
/**
|
|
3189
3250
|
* Creates a right-handed orthographic projection matrix
|
|
3190
3251
|
* @param left defines the viewport left coordinate
|
|
@@ -3207,8 +3268,9 @@ export declare class Matrix {
|
|
|
3207
3268
|
* @param zfar defines the far clip plane
|
|
3208
3269
|
* @param result defines the target matrix
|
|
3209
3270
|
* @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
|
|
3271
|
+
* @returns result input
|
|
3210
3272
|
*/
|
|
3211
|
-
static OrthoOffCenterRHToRef(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result:
|
|
3273
|
+
static OrthoOffCenterRHToRef<T extends Matrix>(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: T, halfZRange?: boolean): T;
|
|
3212
3274
|
/**
|
|
3213
3275
|
* Creates a left-handed perspective projection matrix
|
|
3214
3276
|
* @param width defines the viewport width
|
|
@@ -3243,8 +3305,9 @@ export declare class Matrix {
|
|
|
3243
3305
|
* @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
|
|
3244
3306
|
* @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
|
|
3245
3307
|
* @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)
|
|
3308
|
+
* @returns result input
|
|
3246
3309
|
*/
|
|
3247
|
-
static PerspectiveFovLHToRef(fov: number, aspect: number, znear: number, zfar: number, result:
|
|
3310
|
+
static PerspectiveFovLHToRef<T extends Matrix>(fov: number, aspect: number, znear: number, zfar: number, result: T, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number, reverseDepthBufferMode?: boolean): T;
|
|
3248
3311
|
/**
|
|
3249
3312
|
* Stores a left-handed perspective projection into a given matrix with depth reversed
|
|
3250
3313
|
* @param fov defines the horizontal field of view
|
|
@@ -3255,8 +3318,9 @@ export declare class Matrix {
|
|
|
3255
3318
|
* @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
|
|
3256
3319
|
* @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
|
|
3257
3320
|
* @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
|
|
3321
|
+
* @returns result input
|
|
3258
3322
|
*/
|
|
3259
|
-
static PerspectiveFovReverseLHToRef(fov: number, aspect: number, znear: number, zfar: number, result:
|
|
3323
|
+
static PerspectiveFovReverseLHToRef<T extends Matrix>(fov: number, aspect: number, znear: number, zfar: number, result: T, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): T;
|
|
3260
3324
|
/**
|
|
3261
3325
|
* Creates a right-handed perspective projection matrix
|
|
3262
3326
|
* @param fov defines the horizontal field of view
|
|
@@ -3280,8 +3344,9 @@ export declare class Matrix {
|
|
|
3280
3344
|
* @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
|
|
3281
3345
|
* @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
|
|
3282
3346
|
* @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)
|
|
3347
|
+
* @returns result input
|
|
3283
3348
|
*/
|
|
3284
|
-
static PerspectiveFovRHToRef(fov: number, aspect: number, znear: number, zfar: number, result:
|
|
3349
|
+
static PerspectiveFovRHToRef<T extends Matrix>(fov: number, aspect: number, znear: number, zfar: number, result: T, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number, reverseDepthBufferMode?: boolean): T;
|
|
3285
3350
|
/**
|
|
3286
3351
|
* Stores a right-handed perspective projection into a given matrix
|
|
3287
3352
|
* @param fov defines the horizontal field of view
|
|
@@ -3292,8 +3357,9 @@ export declare class Matrix {
|
|
|
3292
3357
|
* @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
|
|
3293
3358
|
* @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
|
|
3294
3359
|
* @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
|
|
3360
|
+
* @returns result input
|
|
3295
3361
|
*/
|
|
3296
|
-
static PerspectiveFovReverseRHToRef(fov: number, aspect: number, znear: number, zfar: number, result:
|
|
3362
|
+
static PerspectiveFovReverseRHToRef<T extends Matrix>(fov: number, aspect: number, znear: number, zfar: number, result: T, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): T;
|
|
3297
3363
|
/**
|
|
3298
3364
|
* Stores a perspective projection for WebVR info a given matrix
|
|
3299
3365
|
* @param fov defines the field of view
|
|
@@ -3307,13 +3373,14 @@ export declare class Matrix {
|
|
|
3307
3373
|
* @param rightHanded defines if the matrix must be in right-handed mode (false by default)
|
|
3308
3374
|
* @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
|
|
3309
3375
|
* @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
|
|
3376
|
+
* @returns result input
|
|
3310
3377
|
*/
|
|
3311
|
-
static PerspectiveFovWebVRToRef(fov: {
|
|
3378
|
+
static PerspectiveFovWebVRToRef<T extends Matrix>(fov: {
|
|
3312
3379
|
upDegrees: number;
|
|
3313
3380
|
downDegrees: number;
|
|
3314
3381
|
leftDegrees: number;
|
|
3315
3382
|
rightDegrees: number;
|
|
3316
|
-
}, znear: number, zfar: number, result:
|
|
3383
|
+
}, znear: number, zfar: number, result: T, rightHanded?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): T;
|
|
3317
3384
|
/**
|
|
3318
3385
|
* Computes a complete transformation matrix
|
|
3319
3386
|
* @param viewport defines the viewport to use
|
|
@@ -3324,7 +3391,7 @@ export declare class Matrix {
|
|
|
3324
3391
|
* @param zmax defines the far clip plane
|
|
3325
3392
|
* @returns the transformation matrix
|
|
3326
3393
|
*/
|
|
3327
|
-
static GetFinalMatrix(viewport: DeepImmutable<Viewport>, world: DeepImmutable<
|
|
3394
|
+
static GetFinalMatrix<T extends Matrix>(viewport: DeepImmutable<Viewport>, world: DeepImmutable<T>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>, zmin: number, zmax: number): T;
|
|
3328
3395
|
/**
|
|
3329
3396
|
* Extracts a 2x2 matrix from a given matrix and store the result in a Float32Array
|
|
3330
3397
|
* @param matrix defines the matrix to use
|
|
@@ -3342,13 +3409,14 @@ export declare class Matrix {
|
|
|
3342
3409
|
* @param matrix defines the matrix to transpose
|
|
3343
3410
|
* @returns the new matrix
|
|
3344
3411
|
*/
|
|
3345
|
-
static Transpose(matrix: DeepImmutable<
|
|
3412
|
+
static Transpose<T extends Matrix>(matrix: DeepImmutable<T>): T;
|
|
3346
3413
|
/**
|
|
3347
3414
|
* Compute the transpose of a matrix and store it in a target matrix
|
|
3348
3415
|
* @param matrix defines the matrix to transpose
|
|
3349
3416
|
* @param result defines the target matrix
|
|
3417
|
+
* @returns result input
|
|
3350
3418
|
*/
|
|
3351
|
-
static TransposeToRef(matrix: DeepImmutable<Matrix>, result:
|
|
3419
|
+
static TransposeToRef<T extends Matrix>(matrix: DeepImmutable<Matrix>, result: T): T;
|
|
3352
3420
|
/**
|
|
3353
3421
|
* Computes a reflection matrix from a plane
|
|
3354
3422
|
* @param plane defines the reflection plane
|
|
@@ -3359,22 +3427,25 @@ export declare class Matrix {
|
|
|
3359
3427
|
* Computes a reflection matrix from a plane
|
|
3360
3428
|
* @param plane defines the reflection plane
|
|
3361
3429
|
* @param result defines the target matrix
|
|
3430
|
+
* @returns result input
|
|
3362
3431
|
*/
|
|
3363
|
-
static ReflectionToRef(plane: DeepImmutable<IPlaneLike>, result:
|
|
3432
|
+
static ReflectionToRef<T extends Matrix>(plane: DeepImmutable<IPlaneLike>, result: T): T;
|
|
3364
3433
|
/**
|
|
3365
3434
|
* Sets the given matrix as a rotation matrix composed from the 3 left handed axes
|
|
3366
3435
|
* @param xaxis defines the value of the 1st axis
|
|
3367
3436
|
* @param yaxis defines the value of the 2nd axis
|
|
3368
3437
|
* @param zaxis defines the value of the 3rd axis
|
|
3369
3438
|
* @param result defines the target matrix
|
|
3439
|
+
* @returns result input
|
|
3370
3440
|
*/
|
|
3371
|
-
static FromXYZAxesToRef(xaxis: DeepImmutable<Vector3>, yaxis: DeepImmutable<Vector3>, zaxis: DeepImmutable<Vector3>, result:
|
|
3441
|
+
static FromXYZAxesToRef<T extends Matrix>(xaxis: DeepImmutable<Vector3>, yaxis: DeepImmutable<Vector3>, zaxis: DeepImmutable<Vector3>, result: T): T;
|
|
3372
3442
|
/**
|
|
3373
3443
|
* Creates a rotation matrix from a quaternion and stores it in a target matrix
|
|
3374
3444
|
* @param quat defines the quaternion to use
|
|
3375
3445
|
* @param result defines the target matrix
|
|
3446
|
+
* @returns result input
|
|
3376
3447
|
*/
|
|
3377
|
-
static FromQuaternionToRef(quat: DeepImmutable<Quaternion>, result:
|
|
3448
|
+
static FromQuaternionToRef<T extends Matrix>(quat: DeepImmutable<Quaternion>, result: T): T;
|
|
3378
3449
|
}
|
|
3379
3450
|
/**
|
|
3380
3451
|
* @internal
|