@babylonjs/core 5.28.0 → 5.30.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.
Files changed (154) hide show
  1. package/Actions/actionManager.js +2 -0
  2. package/Actions/actionManager.js.map +1 -1
  3. package/Cameras/camera.js +4 -4
  4. package/Cameras/camera.js.map +1 -1
  5. package/Collisions/pickingInfo.d.ts +1 -2
  6. package/Collisions/pickingInfo.js +7 -4
  7. package/Collisions/pickingInfo.js.map +1 -1
  8. package/Culling/ray.d.ts +1 -1
  9. package/Culling/ray.js +5 -6
  10. package/Culling/ray.js.map +1 -1
  11. package/Debug/debugLayer.d.ts +5 -0
  12. package/Debug/debugLayer.js.map +1 -1
  13. package/Engines/Extensions/engine.renderTarget.js +5 -1
  14. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  15. package/Engines/Extensions/engine.videoTexture.js +6 -3
  16. package/Engines/Extensions/engine.videoTexture.js.map +1 -1
  17. package/Engines/WebGPU/Extensions/engine.renderTarget.js +4 -1
  18. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  19. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +2 -0
  20. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  21. package/Engines/WebGPU/webgpuShaderProcessor.js +3 -7
  22. package/Engines/WebGPU/webgpuShaderProcessor.js.map +1 -1
  23. package/Engines/WebGPU/webgpuTextureHelper.js +2 -0
  24. package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
  25. package/Engines/WebGPU/webgpuTintWASM.d.ts +1 -0
  26. package/Engines/WebGPU/webgpuTintWASM.js +7 -1
  27. package/Engines/WebGPU/webgpuTintWASM.js.map +1 -1
  28. package/Engines/constants.d.ts +4 -0
  29. package/Engines/constants.js +4 -0
  30. package/Engines/constants.js.map +1 -1
  31. package/Engines/engine.d.ts +45 -12
  32. package/Engines/renderTargetWrapper.d.ts +2 -1
  33. package/Engines/renderTargetWrapper.js +1 -0
  34. package/Engines/renderTargetWrapper.js.map +1 -1
  35. package/Engines/thinEngine.js +6 -3
  36. package/Engines/thinEngine.js.map +1 -1
  37. package/Engines/webgpuEngine.d.ts +0 -2
  38. package/Engines/webgpuEngine.js +15 -14
  39. package/Engines/webgpuEngine.js.map +1 -1
  40. package/Events/pointerEvents.d.ts +11 -6
  41. package/Events/pointerEvents.js +24 -6
  42. package/Events/pointerEvents.js.map +1 -1
  43. package/IAccessibilityTag.d.ts +29 -0
  44. package/IAccessibilityTag.js +2 -0
  45. package/IAccessibilityTag.js.map +1 -0
  46. package/Inputs/scene.inputManager.d.ts +9 -1
  47. package/Inputs/scene.inputManager.js +83 -37
  48. package/Inputs/scene.inputManager.js.map +1 -1
  49. package/Layers/effectLayer.js +2 -6
  50. package/Layers/effectLayer.js.map +1 -1
  51. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.d.ts +24 -3
  52. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +92 -21
  53. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -1
  54. package/Materials/PBR/pbrMetallicRoughnessMaterial.d.ts +1 -1
  55. package/Materials/PBR/pbrMetallicRoughnessMaterial.js +1 -1
  56. package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
  57. package/Materials/Textures/htmlElementTexture.d.ts +5 -0
  58. package/Materials/Textures/htmlElementTexture.js +4 -1
  59. package/Materials/Textures/htmlElementTexture.js.map +1 -1
  60. package/Materials/Textures/renderTargetTexture.d.ts +1 -1
  61. package/Materials/Textures/renderTargetTexture.js +2 -2
  62. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  63. package/Materials/Textures/videoTexture.d.ts +6 -1
  64. package/Materials/Textures/videoTexture.js +7 -2
  65. package/Materials/Textures/videoTexture.js.map +1 -1
  66. package/Maths/math.vector.d.ts +460 -337
  67. package/Maths/math.vector.js +370 -184
  68. package/Maths/math.vector.js.map +1 -1
  69. package/Meshes/Builders/decalBuilder.d.ts +8 -0
  70. package/Meshes/Builders/decalBuilder.js +270 -51
  71. package/Meshes/Builders/decalBuilder.js.map +1 -1
  72. package/Meshes/mesh.d.ts +1 -1
  73. package/Meshes/mesh.js +42 -1
  74. package/Meshes/mesh.js.map +1 -1
  75. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.d.ts +17 -4
  76. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +49 -9
  77. package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
  78. package/Misc/iInspectable.d.ts +5 -1
  79. package/Misc/iInspectable.js +4 -0
  80. package/Misc/iInspectable.js.map +1 -1
  81. package/Misc/index.d.ts +1 -1
  82. package/Misc/index.js +1 -1
  83. package/Misc/index.js.map +1 -1
  84. package/Misc/khronosTextureContainer2.js +41 -46
  85. package/Misc/khronosTextureContainer2.js.map +1 -1
  86. package/Misc/observable.js +4 -4
  87. package/Misc/observable.js.map +1 -1
  88. package/Misc/pressureObserverWrapper.d.ts +36 -0
  89. package/Misc/pressureObserverWrapper.js +68 -0
  90. package/Misc/pressureObserverWrapper.js.map +1 -0
  91. package/Misc/screenshotTools.js +0 -1
  92. package/Misc/screenshotTools.js.map +1 -1
  93. package/Particles/particleSystem.d.ts +4 -0
  94. package/Particles/particleSystem.js +12 -4
  95. package/Particles/particleSystem.js.map +1 -1
  96. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.d.ts +14 -8
  97. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +16 -6
  98. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  99. package/PostProcesses/blurPostProcess.d.ts +2 -1
  100. package/PostProcesses/blurPostProcess.js +3 -2
  101. package/PostProcesses/blurPostProcess.js.map +1 -1
  102. package/PostProcesses/circleOfConfusionPostProcess.js +2 -1
  103. package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
  104. package/PostProcesses/depthOfFieldBlurPostProcess.d.ts +2 -1
  105. package/PostProcesses/depthOfFieldBlurPostProcess.js +3 -5
  106. package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
  107. package/PostProcesses/depthOfFieldEffect.js +9 -4
  108. package/PostProcesses/depthOfFieldEffect.js.map +1 -1
  109. package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
  110. package/PostProcesses/postProcess.js +4 -4
  111. package/PostProcesses/postProcess.js.map +1 -1
  112. package/PostProcesses/volumetricLightScatteringPostProcess.js +2 -6
  113. package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
  114. package/Rendering/depthPeelingRenderer.js +4 -0
  115. package/Rendering/depthPeelingRenderer.js.map +1 -1
  116. package/Rendering/depthRenderer.js +2 -6
  117. package/Rendering/depthRenderer.js.map +1 -1
  118. package/Rendering/geometryBufferRenderer.js +2 -6
  119. package/Rendering/geometryBufferRenderer.js.map +1 -1
  120. package/Rendering/renderingGroup.d.ts +4 -0
  121. package/Rendering/renderingGroup.js +7 -1
  122. package/Rendering/renderingGroup.js.map +1 -1
  123. package/Rendering/renderingManager.d.ts +8 -0
  124. package/Rendering/renderingManager.js +18 -0
  125. package/Rendering/renderingManager.js.map +1 -1
  126. package/Shaders/ShadersInclude/shadowsFragmentFunctions.js +18 -13
  127. package/Shaders/ShadersInclude/shadowsFragmentFunctions.js.map +1 -1
  128. package/Shaders/circleOfConfusion.fragment.js +1 -1
  129. package/Shaders/circleOfConfusion.fragment.js.map +1 -1
  130. package/Shaders/depthOfFieldMerge.fragment.js +1 -1
  131. package/Shaders/depthOfFieldMerge.fragment.js.map +1 -1
  132. package/Shaders/fxaa.fragment.js +10 -5
  133. package/Shaders/fxaa.fragment.js.map +1 -1
  134. package/Shaders/kernelBlur.fragment.js +2 -2
  135. package/Shaders/kernelBlur.fragment.js.map +1 -1
  136. package/Shaders/particles.vertex.js +4 -1
  137. package/Shaders/particles.vertex.js.map +1 -1
  138. package/Shaders/spriteMap.fragment.js +7 -2
  139. package/Shaders/spriteMap.fragment.js.map +1 -1
  140. package/XR/features/WebXRControllerPointerSelection.js +1 -0
  141. package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
  142. package/XR/features/WebXRNearInteraction.js.map +1 -1
  143. package/XR/webXRRenderTargetTextureProvider.js +1 -0
  144. package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
  145. package/node.d.ts +8 -0
  146. package/node.js +13 -1
  147. package/node.js.map +1 -1
  148. package/package.json +1 -1
  149. package/scene.d.ts +6 -8
  150. package/scene.js +11 -30
  151. package/scene.js.map +1 -1
  152. package/Misc/computePressure.d.ts +0 -57
  153. package/Misc/computePressure.js +0 -48
  154. package/Misc/computePressure.js.map +0 -1
@@ -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): Vector2;
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 Vector3
59
+ * @returns the current Vector2
55
60
  */
56
- fromArray(array: FloatArray, index?: number): Vector2;
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>): 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): Vector2;
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): Vector2;
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>): 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 the unmodified current Vector2
103
+ * @returns result input
99
104
  */
100
- addToRef(otherVector: DeepImmutable<Vector2>, result: Vector2): Vector2;
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>): 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): Vector2;
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): 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 the unmodified current Vector2
132
+ * @returns result input
128
133
  */
129
- subtractToRef(otherVector: DeepImmutable<Vector2>, result: Vector2): Vector2;
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>): 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>): 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>): 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 the unmodified current Vector2
161
+ * @returns result input
157
162
  */
158
- multiplyToRef(otherVector: DeepImmutable<Vector2>, result: Vector2): Vector2;
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): Vector2;
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): 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 the unmodified current Vector2
184
+ * @returns result input
180
185
  */
181
- divideToRef(otherVector: DeepImmutable<Vector2>, result: Vector2): Vector2;
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>): 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(): Vector2;
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(): Vector2;
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: Vector2): Vector2;
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): Vector2;
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): Vector2;
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 the unmodified current Vector2
232
+ * @returns result input
228
233
  */
229
- scaleToRef(scale: number, result: Vector2): Vector2;
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 the unmodified current Vector2
240
+ * @returns result input
236
241
  */
237
- scaleAndAddToRef(scale: number, result: Vector2): Vector2;
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(): Vector2;
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(): Vector2;
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 the current vector
277
+ * @returns result input
273
278
  */
274
- rotateToRef(angle: number, result: Vector2): this;
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(): Vector2;
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(): Vector2;
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: Vector2): void;
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<Vector2>, value2: DeepImmutable<Vector2>, value3: DeepImmutable<Vector2>, value4: DeepImmutable<Vector2>, amount: number): Vector2;
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<Vector2>, min: DeepImmutable<Vector2>, max: DeepImmutable<Vector2>): Vector2;
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<Vector2>, tangent1: DeepImmutable<Vector2>, value2: DeepImmutable<Vector2>, tangent2: DeepImmutable<Vector2>, amount: number): Vector2;
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<Vector2>, tangent1: DeepImmutable<Vector2>, value2: DeepImmutable<Vector2>, tangent2: DeepImmutable<Vector2>, time: number): Vector2;
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: Vector2): void;
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<Vector2>, end: DeepImmutable<Vector2>, amount: number): Vector2;
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<Vector2>): Vector2;
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: Vector2): void;
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<Vector2>, right: DeepImmutable<Vector2>): Vector2;
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<Vector2>, right: DeepImmutable<Vector2>): Vector2;
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<Vector2>, transformation: DeepImmutable<Matrix>): Vector2;
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: Vector2): void;
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<Vector2>, value2: DeepImmutable<Vector2>): Vector2;
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: DeepImmutable<Vector2>): Vector2;
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): Vector3;
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): Vector3;
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>): 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): Vector3;
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>): 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: Vector3): Vector3;
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>): 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>): 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: Vector3): Vector3;
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): Vector3;
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: Vector3): Vector3;
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(): Vector3;
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(): Vector3;
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: Vector3): Vector3;
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): Vector3;
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): Vector3;
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,14 +700,19 @@ 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: Vector3): Vector3;
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
706
+ * Out of the infinite possibilities the normal chosen is the one formed by rotating the current vector
707
+ * 90 degrees about an axis which lies perpendicular to the current vector
708
+ * and its projection on the xz plane. In the case of a current vector in the xz plane
709
+ * the normal is calculated to be along the y axis.
710
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#230
711
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#231
697
712
  * @param result defines the Vector3 object where to store the resultant normal
698
713
  * returns the result
699
- * @hidden
700
714
  */
701
- _getNormalToRef(result: DeepImmutable<Vector3>): Vector3;
715
+ getNormalToRef(result: DeepImmutable<Vector3>): Vector3;
702
716
  /**
703
717
  * Rotates the vector using the given unit quaternion and stores the new vector in result
704
718
  * Example Playground https://playground.babylonjs.com/#R1F8YU#9
@@ -706,29 +720,29 @@ export declare class Vector3 {
706
720
  * @param result the output vector
707
721
  * @returns the result
708
722
  */
709
- applyRotationQuaternionToRef(q: Quaternion, result: Vector3): Vector3;
723
+ applyRotationQuaternionToRef<T extends Vector3>(q: Quaternion, result: T): T;
710
724
  /**
711
725
  * Rotates the vector in place using the given unit quaternion
712
726
  * Example Playground https://playground.babylonjs.com/#R1F8YU#8
713
727
  * @param q the unit quaternion representing the rotation
714
728
  * @returns the current updated Vector3
715
729
  */
716
- applyRotationQuaternionInPlace(q: Quaternion): Vector3;
730
+ applyRotationQuaternionInPlace(q: Quaternion): this;
717
731
  /**
718
732
  * Rotates the vector using the given unit quaternion and returns the new vector
719
733
  * Example Playground https://playground.babylonjs.com/#R1F8YU#7
720
734
  * @param q the unit quaternion representing the rotation
721
735
  * @returns a new Vector3
722
736
  */
723
- applyRotationQuaternion(q: Quaternion): Vector3;
737
+ applyRotationQuaternion(q: Quaternion): this;
724
738
  /**
725
739
  * Scale the current Vector3 values by a factor and add the result to a given Vector3
726
740
  * Example Playground https://playground.babylonjs.com/#R1F8YU#55
727
741
  * @param scale defines the scale factor
728
742
  * @param result defines the Vector3 object where to store the result
729
- * @returns the unmodified current Vector3
743
+ * @returns result input
730
744
  */
731
- scaleAndAddToRef(scale: number, result: Vector3): Vector3;
745
+ scaleAndAddToRef<T extends Vector3>(scale: number, result: T): T;
732
746
  /**
733
747
  * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
734
748
  * Example Playground https://playground.babylonjs.com/#R1F8YU#48
@@ -736,15 +750,16 @@ export declare class Vector3 {
736
750
  * @param origin defines the origin of the projection ray
737
751
  * @returns the projected vector3
738
752
  */
739
- projectOnPlane(plane: Plane, origin: Vector3): Vector3;
753
+ projectOnPlane<T extends Vector3>(plane: Plane, origin: Vector3): T;
740
754
  /**
741
755
  * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
742
756
  * Example Playground https://playground.babylonjs.com/#R1F8YU#49
743
757
  * @param plane defines the plane to project to
744
758
  * @param origin defines the origin of the projection ray
745
759
  * @param result defines the Vector3 where to store the result
760
+ * @returns result input
746
761
  */
747
- projectOnPlaneToRef(plane: Plane, origin: Vector3, result: Vector3): void;
762
+ projectOnPlaneToRef<T extends Vector3>(plane: Plane, origin: Vector3, result: T): T;
748
763
  /**
749
764
  * Returns true if the current Vector3 and the given vector coordinates are strictly equal
750
765
  * Example Playground https://playground.babylonjs.com/#R1F8YU#19
@@ -775,14 +790,14 @@ export declare class Vector3 {
775
790
  * @param otherVector defines the second operand
776
791
  * @returns the current updated Vector3
777
792
  */
778
- multiplyInPlace(otherVector: DeepImmutable<Vector3>): Vector3;
793
+ multiplyInPlace(otherVector: DeepImmutable<Vector3>): this;
779
794
  /**
780
795
  * Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector
781
796
  * Example Playground https://playground.babylonjs.com/#R1F8YU#31
782
797
  * @param otherVector defines the second operand
783
798
  * @returns the new Vector3
784
799
  */
785
- multiply(otherVector: DeepImmutable<Vector3>): Vector3;
800
+ multiply(otherVector: DeepImmutable<Vector3>): this;
786
801
  /**
787
802
  * Multiplies the current Vector3 by the given one and stores the result in the given vector "result"
788
803
  * Example Playground https://playground.babylonjs.com/#R1F8YU#33
@@ -790,7 +805,7 @@ export declare class Vector3 {
790
805
  * @param result defines the Vector3 object where to store the result
791
806
  * @returns the result
792
807
  */
793
- multiplyToRef(otherVector: DeepImmutable<Vector3>, result: Vector3): Vector3;
808
+ multiplyToRef<T extends Vector3>(otherVector: DeepImmutable<Vector3>, result: T): T;
794
809
  /**
795
810
  * Returns a new Vector3 set with the result of the multiplication of the current Vector3 coordinates by the given floats
796
811
  * Example Playground https://playground.babylonjs.com/#R1F8YU#34
@@ -799,14 +814,14 @@ export declare class Vector3 {
799
814
  * @param z defines the z coordinate of the operand
800
815
  * @returns the new Vector3
801
816
  */
802
- multiplyByFloats(x: number, y: number, z: number): Vector3;
817
+ multiplyByFloats(x: number, y: number, z: number): this;
803
818
  /**
804
819
  * Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones
805
820
  * Example Playground https://playground.babylonjs.com/#R1F8YU#16
806
821
  * @param otherVector defines the second operand
807
822
  * @returns the new Vector3
808
823
  */
809
- divide(otherVector: DeepImmutable<Vector3>): Vector3;
824
+ divide(otherVector: DeepImmutable<Vector3>): this;
810
825
  /**
811
826
  * Divides the current Vector3 coordinates by the given ones and stores the result in the given vector "result"
812
827
  * Example Playground https://playground.babylonjs.com/#R1F8YU#18
@@ -814,28 +829,28 @@ export declare class Vector3 {
814
829
  * @param result defines the Vector3 object where to store the result
815
830
  * @returns the result
816
831
  */
817
- divideToRef(otherVector: DeepImmutable<Vector3>, result: Vector3): Vector3;
832
+ divideToRef<T extends Vector3>(otherVector: DeepImmutable<Vector3>, result: T): T;
818
833
  /**
819
834
  * Divides the current Vector3 coordinates by the given ones.
820
835
  * Example Playground https://playground.babylonjs.com/#R1F8YU#17
821
836
  * @param otherVector defines the second operand
822
837
  * @returns the current updated Vector3
823
838
  */
824
- divideInPlace(otherVector: Vector3): Vector3;
839
+ divideInPlace(otherVector: Vector3): this;
825
840
  /**
826
841
  * Updates the current Vector3 with the minimal coordinate values between its and the given vector ones
827
842
  * Example Playground https://playground.babylonjs.com/#R1F8YU#29
828
843
  * @param other defines the second operand
829
844
  * @returns the current updated Vector3
830
845
  */
831
- minimizeInPlace(other: DeepImmutable<Vector3>): Vector3;
846
+ minimizeInPlace(other: DeepImmutable<Vector3>): this;
832
847
  /**
833
848
  * Updates the current Vector3 with the maximal coordinate values between its and the given vector ones.
834
849
  * Example Playground https://playground.babylonjs.com/#R1F8YU#27
835
850
  * @param other defines the second operand
836
851
  * @returns the current updated Vector3
837
852
  */
838
- maximizeInPlace(other: DeepImmutable<Vector3>): Vector3;
853
+ maximizeInPlace(other: DeepImmutable<Vector3>): this;
839
854
  /**
840
855
  * Updates the current Vector3 with the minimal coordinate values between its and the given coordinates
841
856
  * Example Playground https://playground.babylonjs.com/#R1F8YU#30
@@ -844,7 +859,7 @@ export declare class Vector3 {
844
859
  * @param z defines the z coordinate of the operand
845
860
  * @returns the current updated Vector3
846
861
  */
847
- minimizeInPlaceFromFloats(x: number, y: number, z: number): Vector3;
862
+ minimizeInPlaceFromFloats(x: number, y: number, z: number): this;
848
863
  /**
849
864
  * Updates the current Vector3 with the maximal coordinate values between its and the given coordinates.
850
865
  * Example Playground https://playground.babylonjs.com/#R1F8YU#28
@@ -853,7 +868,7 @@ export declare class Vector3 {
853
868
  * @param z defines the z coordinate of the operand
854
869
  * @returns the current updated Vector3
855
870
  */
856
- maximizeInPlaceFromFloats(x: number, y: number, z: number): Vector3;
871
+ maximizeInPlaceFromFloats(x: number, y: number, z: number): this;
857
872
  /**
858
873
  * Due to float precision, scale of a mesh could be uniform but float values are off by a small fraction
859
874
  * Check if is non uniform within a certain amount of decimal places to account for this
@@ -870,13 +885,13 @@ export declare class Vector3 {
870
885
  * Example Playground https://playground.babylonjs.com/#R1F8YU#22
871
886
  * @returns a new Vector3
872
887
  */
873
- floor(): Vector3;
888
+ floor(): this;
874
889
  /**
875
890
  * Gets a new Vector3 from current Vector3 fractional values
876
891
  * Example Playground https://playground.babylonjs.com/#R1F8YU#23
877
892
  * @returns a new Vector3
878
893
  */
879
- fract(): Vector3;
894
+ fract(): this;
880
895
  /**
881
896
  * Gets the length of the Vector3
882
897
  * Example Playground https://playground.babylonjs.com/#R1F8YU#25
@@ -900,7 +915,7 @@ export declare class Vector3 {
900
915
  * Example Playground https://playground.babylonjs.com/#R1F8YU#122
901
916
  * @returns the current updated Vector3
902
917
  */
903
- normalize(): Vector3;
918
+ normalize(): this;
904
919
  /**
905
920
  * Reorders the x y z properties of the vector in place
906
921
  * Example Playground https://playground.babylonjs.com/#R1F8YU#44
@@ -915,7 +930,7 @@ export declare class Vector3 {
915
930
  * @param result vector to store the result
916
931
  * @returns the resulting vector
917
932
  */
918
- rotateByQuaternionToRef(quaternion: Quaternion, result: Vector3): Vector3;
933
+ rotateByQuaternionToRef<T extends Vector3>(quaternion: Quaternion, result: T): T;
919
934
  /**
920
935
  * Rotates a vector around a given point
921
936
  * Example Playground https://playground.babylonjs.com/#R1F8YU#46
@@ -924,7 +939,7 @@ export declare class Vector3 {
924
939
  * @param result vector to store the result
925
940
  * @returns the resulting vector
926
941
  */
927
- rotateByQuaternionAroundPointToRef(quaternion: Quaternion, point: Vector3, result: Vector3): Vector3;
942
+ rotateByQuaternionAroundPointToRef<T extends Vector3>(quaternion: Quaternion, point: Vector3, result: T): T;
928
943
  /**
929
944
  * Returns a new Vector3 as the cross product of the current vector and the "other" one
930
945
  * The cross product is then orthogonal to both current and "other"
@@ -932,7 +947,7 @@ export declare class Vector3 {
932
947
  * @param other defines the right operand
933
948
  * @returns the cross product
934
949
  */
935
- cross(other: Vector3): Vector3;
950
+ cross(other: Vector3): this;
936
951
  /**
937
952
  * Normalize the current Vector3 with the given input length.
938
953
  * Please note that this is an in place operation.
@@ -940,33 +955,33 @@ export declare class Vector3 {
940
955
  * @param len the length of the vector
941
956
  * @returns the current updated Vector3
942
957
  */
943
- normalizeFromLength(len: number): Vector3;
958
+ normalizeFromLength(len: number): this;
944
959
  /**
945
960
  * Normalize the current Vector3 to a new vector
946
961
  * Example Playground https://playground.babylonjs.com/#R1F8YU#124
947
962
  * @returns the new Vector3
948
963
  */
949
- normalizeToNew(): Vector3;
964
+ normalizeToNew(): this;
950
965
  /**
951
966
  * Normalize the current Vector3 to the reference
952
967
  * Example Playground https://playground.babylonjs.com/#R1F8YU#125
953
968
  * @param reference define the Vector3 to update
954
969
  * @returns the updated Vector3
955
970
  */
956
- normalizeToRef(reference: Vector3): Vector3;
971
+ normalizeToRef<T extends Vector3>(reference: T): T;
957
972
  /**
958
973
  * Creates a new Vector3 copied from the current Vector3
959
974
  * Example Playground https://playground.babylonjs.com/#R1F8YU#11
960
975
  * @returns the new Vector3
961
976
  */
962
- clone(): Vector3;
977
+ clone(): this;
963
978
  /**
964
979
  * Copies the given vector coordinates to the current Vector3 ones
965
980
  * Example Playground https://playground.babylonjs.com/#R1F8YU#12
966
981
  * @param source defines the source Vector3
967
982
  * @returns the current updated Vector3
968
983
  */
969
- copyFrom(source: DeepImmutable<Vector3>): Vector3;
984
+ copyFrom(source: DeepImmutable<Vector3>): this;
970
985
  /**
971
986
  * Copies the given floats to the current Vector3 coordinates
972
987
  * Example Playground https://playground.babylonjs.com/#R1F8YU#13
@@ -975,7 +990,7 @@ export declare class Vector3 {
975
990
  * @param z defines the z coordinate of the operand
976
991
  * @returns the current updated Vector3
977
992
  */
978
- copyFromFloats(x: number, y: number, z: number): Vector3;
993
+ copyFromFloats(x: number, y: number, z: number): this;
979
994
  /**
980
995
  * Copies the given floats to the current Vector3 coordinates
981
996
  * Example Playground https://playground.babylonjs.com/#R1F8YU#58
@@ -984,14 +999,14 @@ export declare class Vector3 {
984
999
  * @param z defines the z coordinate of the operand
985
1000
  * @returns the current updated Vector3
986
1001
  */
987
- set(x: number, y: number, z: number): Vector3;
1002
+ set(x: number, y: number, z: number): this;
988
1003
  /**
989
1004
  * Copies the given float to the current Vector3 coordinates
990
1005
  * Example Playground https://playground.babylonjs.com/#R1F8YU#59
991
1006
  * @param v defines the x, y and z coordinates of the operand
992
1007
  * @returns the current updated Vector3
993
1008
  */
994
- setAll(v: number): Vector3;
1009
+ setAll(v: number): this;
995
1010
  /**
996
1011
  * Get the clip factor between two vectors
997
1012
  * Example Playground https://playground.babylonjs.com/#R1F8YU#126
@@ -1029,7 +1044,7 @@ export declare class Vector3 {
1029
1044
  * @param ref the vector3 to store the result
1030
1045
  * @returns ref in the form (pitch, yaw, 0)
1031
1046
  */
1032
- static PitchYawRollToMoveBetweenPointsToRef(start: Vector3, target: Vector3, ref: Vector3): Vector3;
1047
+ static PitchYawRollToMoveBetweenPointsToRef<T extends Vector3>(start: Vector3, target: Vector3, ref: T): T;
1033
1048
  /**
1034
1049
  * Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point
1035
1050
  * Example PG https://playground.babylonjs.com/#R1F8YU#188
@@ -1049,7 +1064,7 @@ export declare class Vector3 {
1049
1064
  * @param slerp amount (will be clamped between 0 and 1)
1050
1065
  * @param result The slerped vector
1051
1066
  */
1052
- static SlerpToRef(vector0: Vector3, vector1: Vector3, slerp: number, result: Vector3): void;
1067
+ static SlerpToRef<T extends Vector3 = Vector3>(vector0: Vector3, vector1: Vector3, slerp: number, result: T): T;
1053
1068
  /**
1054
1069
  * Smooth interpolation between two vectors using Slerp
1055
1070
  * Example Playground https://playground.babylonjs.com/#R1F8YU#110
@@ -1059,7 +1074,7 @@ export declare class Vector3 {
1059
1074
  * @param lerpTime total interpolation time
1060
1075
  * @param result the smoothed vector
1061
1076
  */
1062
- static SmoothToRef(source: Vector3, goal: Vector3, deltaTime: number, lerpTime: number, result: Vector3): void;
1077
+ static SmoothToRef<T extends Vector3 = Vector3>(source: Vector3, goal: Vector3, deltaTime: number, lerpTime: number, result: T): T;
1063
1078
  /**
1064
1079
  * Returns a new Vector3 set from the index "offset" of the given array
1065
1080
  * Example Playground https://playground.babylonjs.com/#R1F8YU#83
@@ -1082,8 +1097,9 @@ export declare class Vector3 {
1082
1097
  * @param array defines the source array
1083
1098
  * @param offset defines the offset in the source array
1084
1099
  * @param result defines the Vector3 where to store the result
1100
+ * @returns result input
1085
1101
  */
1086
- static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number, result: Vector3): void;
1102
+ static FromArrayToRef<T extends Vector3>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T;
1087
1103
  /**
1088
1104
  * Sets the given vector "result" with the element values from the index "offset" of the given Float32Array
1089
1105
  * @param array defines the source array
@@ -1091,7 +1107,7 @@ export declare class Vector3 {
1091
1107
  * @param result defines the Vector3 where to store the result
1092
1108
  * @deprecated Please use FromArrayToRef instead.
1093
1109
  */
1094
- static FromFloatArrayToRef(array: DeepImmutable<Float32Array>, offset: number, result: Vector3): void;
1110
+ static FromFloatArrayToRef<T extends Vector3>(array: DeepImmutable<Float32Array>, offset: number, result: T): T;
1095
1111
  /**
1096
1112
  * Sets the given vector "result" with the given floats.
1097
1113
  * Example Playground https://playground.babylonjs.com/#R1F8YU#85
@@ -1100,7 +1116,7 @@ export declare class Vector3 {
1100
1116
  * @param z defines the z coordinate of the source
1101
1117
  * @param result defines the Vector3 where to store the result
1102
1118
  */
1103
- static FromFloatsToRef(x: number, y: number, z: number, result: Vector3): void;
1119
+ static FromFloatsToRef<T extends Vector3 = Vector3>(x: number, y: number, z: number, result: T): T;
1104
1120
  /**
1105
1121
  * Returns a new Vector3 set to (0.0, 0.0, 0.0)
1106
1122
  * @returns a new empty Vector3
@@ -1185,7 +1201,7 @@ export declare class Vector3 {
1185
1201
  * @param transformation defines the transformation matrix
1186
1202
  * @returns the transformed Vector3
1187
1203
  */
1188
- static TransformCoordinates(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>): Vector3;
1204
+ static TransformCoordinates<T extends Vector3>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>): Vector3;
1189
1205
  /**
1190
1206
  * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector
1191
1207
  * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
@@ -1193,8 +1209,9 @@ export declare class Vector3 {
1193
1209
  * @param vector defines the Vector3 to transform
1194
1210
  * @param transformation defines the transformation matrix
1195
1211
  * @param result defines the Vector3 where to store the result
1212
+ * @returns result input
1196
1213
  */
1197
- static TransformCoordinatesToRef(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: Vector3): void;
1214
+ static TransformCoordinatesToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T;
1198
1215
  /**
1199
1216
  * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
1200
1217
  * This method computes transformed coordinates only, not transformed direction vectors
@@ -1204,8 +1221,9 @@ export declare class Vector3 {
1204
1221
  * @param z define the z coordinate of the source vector
1205
1222
  * @param transformation defines the transformation matrix
1206
1223
  * @param result defines the Vector3 where to store the result
1224
+ * @returns result input
1207
1225
  */
1208
- static TransformCoordinatesFromFloatsToRef(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: Vector3): void;
1226
+ static TransformCoordinatesFromFloatsToRef<T extends Vector3>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T;
1209
1227
  /**
1210
1228
  * Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector
1211
1229
  * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
@@ -1222,8 +1240,9 @@ export declare class Vector3 {
1222
1240
  * @param vector defines the Vector3 to transform
1223
1241
  * @param transformation defines the transformation matrix
1224
1242
  * @param result defines the Vector3 where to store the result
1243
+ * @returns result input
1225
1244
  */
1226
- static TransformNormalToRef(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: Vector3): void;
1245
+ static TransformNormalToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T;
1227
1246
  /**
1228
1247
  * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z)
1229
1248
  * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
@@ -1233,8 +1252,9 @@ export declare class Vector3 {
1233
1252
  * @param z define the z coordinate of the source vector
1234
1253
  * @param transformation defines the transformation matrix
1235
1254
  * @param result defines the Vector3 where to store the result
1255
+ * @returns result input
1236
1256
  */
1237
- static TransformNormalFromFloatsToRef(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: Vector3): void;
1257
+ static TransformNormalFromFloatsToRef<T extends Vector3>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T;
1238
1258
  /**
1239
1259
  * Returns a new Vector3 located for "amount" on the CatmullRom interpolation spline defined by the vectors "value1", "value2", "value3", "value4"
1240
1260
  * Example Playground https://playground.babylonjs.com/#R1F8YU#69
@@ -1245,7 +1265,7 @@ export declare class Vector3 {
1245
1265
  * @param amount defines the amount on the spline to use
1246
1266
  * @returns the new Vector3
1247
1267
  */
1248
- static CatmullRom(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, value3: DeepImmutable<Vector3>, value4: DeepImmutable<Vector3>, amount: number): Vector3;
1268
+ static CatmullRom<T extends Vector3>(value1: DeepImmutable<T>, value2: DeepImmutable<Vector3>, value3: DeepImmutable<Vector3>, value4: DeepImmutable<Vector3>, amount: number): T;
1249
1269
  /**
1250
1270
  * 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
1271
  * 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 +1276,7 @@ export declare class Vector3 {
1256
1276
  * @param max defines the upper range value
1257
1277
  * @returns the new Vector3
1258
1278
  */
1259
- static Clamp(value: DeepImmutable<Vector3>, min: DeepImmutable<Vector3>, max: DeepImmutable<Vector3>): Vector3;
1279
+ static Clamp<T extends Vector3>(value: DeepImmutable<T>, min: DeepImmutable<Vector3>, max: DeepImmutable<Vector3>): T;
1260
1280
  /**
1261
1281
  * 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
1282
  * 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 +1286,9 @@ export declare class Vector3 {
1266
1286
  * @param min defines the lower range value
1267
1287
  * @param max defines the upper range value
1268
1288
  * @param result defines the Vector3 where to store the result
1289
+ * @returns result input
1269
1290
  */
1270
- static ClampToRef(value: DeepImmutable<Vector3>, min: DeepImmutable<Vector3>, max: DeepImmutable<Vector3>, result: Vector3): void;
1291
+ static ClampToRef<T extends Vector3>(value: DeepImmutable<Vector3>, min: DeepImmutable<Vector3>, max: DeepImmutable<Vector3>, result: T): T;
1271
1292
  /**
1272
1293
  * Checks if a given vector is inside a specific range
1273
1294
  * Example Playground https://playground.babylonjs.com/#R1F8YU#75
@@ -1286,7 +1307,7 @@ export declare class Vector3 {
1286
1307
  * @param amount defines the amount on the interpolation spline (between 0 and 1)
1287
1308
  * @returns the new Vector3
1288
1309
  */
1289
- static Hermite(value1: DeepImmutable<Vector3>, tangent1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, tangent2: DeepImmutable<Vector3>, amount: number): Vector3;
1310
+ static Hermite<T extends Vector3>(value1: DeepImmutable<T>, tangent1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, tangent2: DeepImmutable<Vector3>, amount: number): T;
1290
1311
  /**
1291
1312
  * Returns a new Vector3 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
1292
1313
  * Example Playground https://playground.babylonjs.com/#R1F8YU#90
@@ -1297,7 +1318,7 @@ export declare class Vector3 {
1297
1318
  * @param time define where the derivative must be done
1298
1319
  * @returns 1st derivative
1299
1320
  */
1300
- static Hermite1stDerivative(value1: DeepImmutable<Vector3>, tangent1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, tangent2: DeepImmutable<Vector3>, time: number): Vector3;
1321
+ static Hermite1stDerivative<T extends Vector3>(value1: DeepImmutable<T>, tangent1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, tangent2: DeepImmutable<Vector3>, time: number): T;
1301
1322
  /**
1302
1323
  * Update a Vector3 with the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
1303
1324
  * Example Playground https://playground.babylonjs.com/#R1F8YU#91
@@ -1307,8 +1328,9 @@ export declare class Vector3 {
1307
1328
  * @param tangent2 defines the second tangent
1308
1329
  * @param time define where the derivative must be done
1309
1330
  * @param result define where to store the derivative
1331
+ * @returns result input
1310
1332
  */
1311
- static Hermite1stDerivativeToRef(value1: DeepImmutable<Vector3>, tangent1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, tangent2: DeepImmutable<Vector3>, time: number, result: Vector3): void;
1333
+ static Hermite1stDerivativeToRef<T extends Vector3>(value1: DeepImmutable<Vector3>, tangent1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, tangent2: DeepImmutable<Vector3>, time: number, result: T): T;
1312
1334
  /**
1313
1335
  * Returns a new Vector3 located for "amount" (float) on the linear interpolation between the vectors "start" and "end"
1314
1336
  * Example Playground https://playground.babylonjs.com/#R1F8YU#95
@@ -1317,7 +1339,7 @@ export declare class Vector3 {
1317
1339
  * @param amount max defines amount between both (between 0 and 1)
1318
1340
  * @returns the new Vector3
1319
1341
  */
1320
- static Lerp(start: DeepImmutable<Vector3>, end: DeepImmutable<Vector3>, amount: number): Vector3;
1342
+ static Lerp<T extends Vector3>(start: DeepImmutable<T>, end: DeepImmutable<Vector3>, amount: number): T;
1321
1343
  /**
1322
1344
  * Sets the given vector "result" with the result of the linear interpolation from the vector "start" for "amount" to the vector "end"
1323
1345
  * Example Playground https://playground.babylonjs.com/#R1F8YU#93
@@ -1325,8 +1347,9 @@ export declare class Vector3 {
1325
1347
  * @param end defines the end value
1326
1348
  * @param amount max defines amount between both (between 0 and 1)
1327
1349
  * @param result defines the Vector3 where to store the result
1350
+ * @returns result input
1328
1351
  */
1329
- static LerpToRef(start: DeepImmutable<Vector3>, end: DeepImmutable<Vector3>, amount: number, result: Vector3): void;
1352
+ static LerpToRef<T extends Vector3>(start: DeepImmutable<Vector3>, end: DeepImmutable<Vector3>, amount: number, result: T): T;
1330
1353
  /**
1331
1354
  * Returns the dot product (float) between the vectors "left" and "right"
1332
1355
  * Example Playground https://playground.babylonjs.com/#R1F8YU#82
@@ -1343,7 +1366,7 @@ export declare class Vector3 {
1343
1366
  * @param right defines the right operand
1344
1367
  * @returns the cross product
1345
1368
  */
1346
- static Cross(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): Vector3;
1369
+ static Cross<T extends Vector3>(left: DeepImmutable<T>, right: DeepImmutable<Vector3>): T;
1347
1370
  /**
1348
1371
  * Sets the given vector "result" with the cross product of "left" and "right"
1349
1372
  * The cross product is then orthogonal to both "left" and "right"
@@ -1351,8 +1374,9 @@ export declare class Vector3 {
1351
1374
  * @param left defines the left operand
1352
1375
  * @param right defines the right operand
1353
1376
  * @param result defines the Vector3 where to store the result
1377
+ * @returns result input
1354
1378
  */
1355
- static CrossToRef(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>, result: Vector3): void;
1379
+ static CrossToRef<T extends Vector3>(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>, result: T): T;
1356
1380
  /**
1357
1381
  * Returns a new Vector3 as the normalization of the given vector
1358
1382
  * Example Playground https://playground.babylonjs.com/#R1F8YU#98
@@ -1365,8 +1389,9 @@ export declare class Vector3 {
1365
1389
  * Example Playground https://playground.babylonjs.com/#R1F8YU#98
1366
1390
  * @param vector defines the Vector3 to normalize
1367
1391
  * @param result defines the Vector3 where to store the result
1392
+ * @returns result input
1368
1393
  */
1369
- static NormalizeToRef(vector: DeepImmutable<Vector3>, result: Vector3): void;
1394
+ static NormalizeToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, result: T): T;
1370
1395
  /**
1371
1396
  * Project a Vector3 onto screen space
1372
1397
  * Example Playground https://playground.babylonjs.com/#R1F8YU#101
@@ -1376,7 +1401,7 @@ export declare class Vector3 {
1376
1401
  * @param viewport defines the screen viewport to use
1377
1402
  * @returns the new Vector3
1378
1403
  */
1379
- static Project(vector: DeepImmutable<Vector3>, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>, viewport: DeepImmutable<Viewport>): Vector3;
1404
+ static Project<T extends Vector3>(vector: DeepImmutable<T>, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>, viewport: DeepImmutable<Viewport>): T;
1380
1405
  /**
1381
1406
  * Project a Vector3 onto screen space to reference
1382
1407
  * Example Playground https://playground.babylonjs.com/#R1F8YU#102
@@ -1385,13 +1410,13 @@ export declare class Vector3 {
1385
1410
  * @param transform defines the transform (view x projection) matrix to use
1386
1411
  * @param viewport defines the screen viewport to use
1387
1412
  * @param result the vector in which the screen space will be stored
1388
- * @returns the new Vector3
1413
+ * @returns result input
1389
1414
  */
1390
- static ProjectToRef(vector: DeepImmutable<Vector3>, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>, viewport: DeepImmutable<Viewport>, result: DeepImmutable<Vector3>): Vector3;
1415
+ static ProjectToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>, viewport: DeepImmutable<Viewport>, result: T): T;
1391
1416
  /**
1392
1417
  * @internal
1393
1418
  */
1394
- static _UnprojectFromInvertedMatrixToRef(source: DeepImmutable<Vector3>, matrix: DeepImmutable<Matrix>, result: Vector3): void;
1419
+ static _UnprojectFromInvertedMatrixToRef<T extends Vector3>(source: DeepImmutable<Vector3>, matrix: DeepImmutable<Matrix>, result: T): T;
1395
1420
  /**
1396
1421
  * Unproject from screen space to object space
1397
1422
  * Example Playground https://playground.babylonjs.com/#R1F8YU#121
@@ -1402,7 +1427,7 @@ export declare class Vector3 {
1402
1427
  * @param transform defines the transform (view x projection) matrix to use
1403
1428
  * @returns the new Vector3
1404
1429
  */
1405
- static UnprojectFromTransform(source: Vector3, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>): Vector3;
1430
+ static UnprojectFromTransform<T extends Vector3>(source: DeepImmutable<T>, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>): T;
1406
1431
  /**
1407
1432
  * Unproject from screen space to object space
1408
1433
  * Example Playground https://playground.babylonjs.com/#R1F8YU#117
@@ -1414,7 +1439,7 @@ export declare class Vector3 {
1414
1439
  * @param projection defines the projection matrix to use
1415
1440
  * @returns the new Vector3
1416
1441
  */
1417
- static Unproject(source: DeepImmutable<Vector3>, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>): Vector3;
1442
+ static Unproject<T extends Vector3>(source: DeepImmutable<T>, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>): T;
1418
1443
  /**
1419
1444
  * Unproject from screen space to object space
1420
1445
  * Example Playground https://playground.babylonjs.com/#R1F8YU#119
@@ -1425,8 +1450,9 @@ export declare class Vector3 {
1425
1450
  * @param view defines the view matrix to use
1426
1451
  * @param projection defines the projection matrix to use
1427
1452
  * @param result defines the Vector3 where to store the result
1453
+ * @returns result input
1428
1454
  */
1429
- static UnprojectToRef(source: DeepImmutable<Vector3>, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>, result: Vector3): void;
1455
+ 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
1456
  /**
1431
1457
  * Unproject from screen space to object space
1432
1458
  * Example Playground https://playground.babylonjs.com/#R1F8YU#120
@@ -1439,8 +1465,9 @@ export declare class Vector3 {
1439
1465
  * @param view defines the view matrix to use
1440
1466
  * @param projection defines the projection matrix to use
1441
1467
  * @param result defines the Vector3 where to store the result
1468
+ * @returns result input
1442
1469
  */
1443
- static UnprojectFloatsToRef(sourceX: float, sourceY: float, sourceZ: float, viewportWidth: number, viewportHeight: number, world: DeepImmutable<Matrix>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>, result: Vector3): void;
1470
+ 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
1471
  /**
1445
1472
  * Gets the minimal coordinate values between two Vector3
1446
1473
  * Example Playground https://playground.babylonjs.com/#R1F8YU#97
@@ -1448,7 +1475,7 @@ export declare class Vector3 {
1448
1475
  * @param right defines the second operand
1449
1476
  * @returns the new Vector3
1450
1477
  */
1451
- static Minimize(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): Vector3;
1478
+ static Minimize<T extends Vector3>(left: DeepImmutable<T>, right: DeepImmutable<Vector3>): T;
1452
1479
  /**
1453
1480
  * Gets the maximal coordinate values between two Vector3
1454
1481
  * Example Playground https://playground.babylonjs.com/#R1F8YU#96
@@ -1456,7 +1483,7 @@ export declare class Vector3 {
1456
1483
  * @param right defines the second operand
1457
1484
  * @returns the new Vector3
1458
1485
  */
1459
- static Maximize(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): Vector3;
1486
+ static Maximize<T extends Vector3>(left: DeepImmutable<T>, right: DeepImmutable<Vector3>): T;
1460
1487
  /**
1461
1488
  * Returns the distance between the vectors "value1" and "value2"
1462
1489
  * Example Playground https://playground.babylonjs.com/#R1F8YU#81
@@ -1503,7 +1530,7 @@ export declare class Vector3 {
1503
1530
  * @param ref defines third vector
1504
1531
  * @returns ref
1505
1532
  */
1506
- static CenterToRef(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, ref: DeepImmutable<Vector3>): Vector3;
1533
+ static CenterToRef<T extends Vector3>(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, ref: T): T;
1507
1534
  /**
1508
1535
  * Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system),
1509
1536
  * RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply
@@ -1516,7 +1543,7 @@ export declare class Vector3 {
1516
1543
  * @returns a new Vector3
1517
1544
  * @see https://doc.babylonjs.com/divingDeeper/mesh/transforms/center_origin/target_align
1518
1545
  */
1519
- static RotationFromAxis(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>): Vector3;
1546
+ static RotationFromAxis<T extends Vector3>(axis1: DeepImmutable<T>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>): T;
1520
1547
  /**
1521
1548
  * The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3
1522
1549
  * Example Playground https://playground.babylonjs.com/#R1F8YU#107
@@ -1524,8 +1551,9 @@ export declare class Vector3 {
1524
1551
  * @param axis2 defines the second axis
1525
1552
  * @param axis3 defines the third axis
1526
1553
  * @param ref defines the Vector3 where to store the result
1554
+ * @returns result input
1527
1555
  */
1528
- static RotationFromAxisToRef(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref: Vector3): void;
1556
+ static RotationFromAxisToRef<T extends Vector3>(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref: T): T;
1529
1557
  }
1530
1558
  /**
1531
1559
  * Vector4 class created for EulerAngle class conversion to Quaternion
@@ -1549,13 +1577,13 @@ export declare class Vector4 {
1549
1577
  */
1550
1578
  constructor(
1551
1579
  /** x value of the vector */
1552
- x: number,
1580
+ x?: number,
1553
1581
  /** y value of the vector */
1554
- y: number,
1582
+ y?: number,
1555
1583
  /** z value of the vector */
1556
- z: number,
1584
+ z?: number,
1557
1585
  /** w value of the vector */
1558
- w: number);
1586
+ w?: number);
1559
1587
  /**
1560
1588
  * Returns the string with the Vector4 coordinates.
1561
1589
  * @returns a string containing all the vector values
@@ -1582,52 +1610,52 @@ export declare class Vector4 {
1582
1610
  * @param index index of the array to start at (default: 0)
1583
1611
  * @returns the Vector4.
1584
1612
  */
1585
- toArray(array: FloatArray, index?: number): Vector4;
1613
+ toArray(array: FloatArray, index?: number): this;
1586
1614
  /**
1587
1615
  * Update the current vector from an array
1588
1616
  * @param array defines the destination array
1589
1617
  * @param index defines the offset in the destination array
1590
1618
  * @returns the current Vector3
1591
1619
  */
1592
- fromArray(array: FloatArray, index?: number): Vector4;
1620
+ fromArray(array: FloatArray, index?: number): this;
1593
1621
  /**
1594
1622
  * Adds the given vector to the current Vector4.
1595
1623
  * @param otherVector the vector to add
1596
1624
  * @returns the updated Vector4.
1597
1625
  */
1598
- addInPlace(otherVector: DeepImmutable<Vector4>): Vector4;
1626
+ addInPlace(otherVector: DeepImmutable<Vector4>): this;
1599
1627
  /**
1600
1628
  * Returns a new Vector4 as the result of the addition of the current Vector4 and the given one.
1601
1629
  * @param otherVector the vector to add
1602
1630
  * @returns the resulting vector
1603
1631
  */
1604
- add(otherVector: DeepImmutable<Vector4>): Vector4;
1632
+ add(otherVector: DeepImmutable<Vector4>): this;
1605
1633
  /**
1606
1634
  * Updates the given vector "result" with the result of the addition of the current Vector4 and the given one.
1607
1635
  * @param otherVector the vector to add
1608
1636
  * @param result the vector to store the result
1609
- * @returns the current Vector4.
1637
+ * @returns result input
1610
1638
  */
1611
- addToRef(otherVector: DeepImmutable<Vector4>, result: Vector4): Vector4;
1639
+ addToRef<T extends Vector4>(otherVector: DeepImmutable<Vector4>, result: T): T;
1612
1640
  /**
1613
1641
  * Subtract in place the given vector from the current Vector4.
1614
1642
  * @param otherVector the vector to subtract
1615
1643
  * @returns the updated Vector4.
1616
1644
  */
1617
- subtractInPlace(otherVector: DeepImmutable<Vector4>): Vector4;
1645
+ subtractInPlace(otherVector: DeepImmutable<Vector4>): this;
1618
1646
  /**
1619
1647
  * Returns a new Vector4 with the result of the subtraction of the given vector from the current Vector4.
1620
1648
  * @param otherVector the vector to add
1621
1649
  * @returns the new vector with the result
1622
1650
  */
1623
- subtract(otherVector: DeepImmutable<Vector4>): Vector4;
1651
+ subtract(otherVector: DeepImmutable<Vector4>): this;
1624
1652
  /**
1625
1653
  * Sets the given vector "result" with the result of the subtraction of the given vector from the current Vector4.
1626
1654
  * @param otherVector the vector to subtract
1627
1655
  * @param result the vector to store the result
1628
- * @returns the current Vector4.
1656
+ * @returns result input
1629
1657
  */
1630
- subtractToRef(otherVector: DeepImmutable<Vector4>, result: Vector4): Vector4;
1658
+ subtractToRef<T extends Vector4>(otherVector: DeepImmutable<Vector4>, result: T): T;
1631
1659
  /**
1632
1660
  * Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates.
1633
1661
  */
@@ -1639,7 +1667,7 @@ export declare class Vector4 {
1639
1667
  * @param w value to subtract
1640
1668
  * @returns new vector containing the result
1641
1669
  */
1642
- subtractFromFloats(x: number, y: number, z: number, w: number): Vector4;
1670
+ subtractFromFloats(x: number, y: number, z: number, w: number): this;
1643
1671
  /**
1644
1672
  * Sets the given vector "result" set with the result of the subtraction of the given floats from the current Vector4 coordinates.
1645
1673
  * @param x value to subtract
@@ -1647,51 +1675,51 @@ export declare class Vector4 {
1647
1675
  * @param z value to subtract
1648
1676
  * @param w value to subtract
1649
1677
  * @param result the vector to store the result in
1650
- * @returns the current Vector4.
1678
+ * @returns result input
1651
1679
  */
1652
- subtractFromFloatsToRef(x: number, y: number, z: number, w: number, result: Vector4): Vector4;
1680
+ subtractFromFloatsToRef<T extends Vector4>(x: number, y: number, z: number, w: number, result: T): T;
1653
1681
  /**
1654
1682
  * Returns a new Vector4 set with the current Vector4 negated coordinates.
1655
1683
  * @returns a new vector with the negated values
1656
1684
  */
1657
- negate(): Vector4;
1685
+ negate(): this;
1658
1686
  /**
1659
1687
  * Negate this vector in place
1660
1688
  * @returns this
1661
1689
  */
1662
- negateInPlace(): Vector4;
1690
+ negateInPlace(): this;
1663
1691
  /**
1664
1692
  * Negate the current Vector4 and stores the result in the given vector "result" coordinates
1665
1693
  * @param result defines the Vector3 object where to store the result
1666
1694
  * @returns the result
1667
1695
  */
1668
- negateToRef(result: Vector4): Vector4;
1696
+ negateToRef<T extends Vector4>(result: T): T;
1669
1697
  /**
1670
1698
  * Multiplies the current Vector4 coordinates by scale (float).
1671
1699
  * @param scale the number to scale with
1672
1700
  * @returns the updated Vector4.
1673
1701
  */
1674
- scaleInPlace(scale: number): Vector4;
1702
+ scaleInPlace(scale: number): this;
1675
1703
  /**
1676
1704
  * Returns a new Vector4 set with the current Vector4 coordinates multiplied by scale (float).
1677
1705
  * @param scale the number to scale with
1678
1706
  * @returns a new vector with the result
1679
1707
  */
1680
- scale(scale: number): Vector4;
1708
+ scale(scale: number): this;
1681
1709
  /**
1682
1710
  * Sets the given vector "result" with the current Vector4 coordinates multiplied by scale (float).
1683
1711
  * @param scale the number to scale with
1684
1712
  * @param result a vector to store the result in
1685
- * @returns the current Vector4.
1713
+ * @returns result input
1686
1714
  */
1687
- scaleToRef(scale: number, result: Vector4): Vector4;
1715
+ scaleToRef<T extends Vector4>(scale: number, result: T): T;
1688
1716
  /**
1689
1717
  * Scale the current Vector4 values by a factor and add the result to a given Vector4
1690
1718
  * @param scale defines the scale factor
1691
1719
  * @param result defines the Vector4 object where to store the result
1692
- * @returns the unmodified current Vector4
1720
+ * @returns result input
1693
1721
  */
1694
- scaleAndAddToRef(scale: number, result: Vector4): Vector4;
1722
+ scaleAndAddToRef<T extends Vector4>(scale: number, result: T): T;
1695
1723
  /**
1696
1724
  * Boolean : True if the current Vector4 coordinates are stricly equal to the given ones.
1697
1725
  * @param otherVector the vector to compare against
@@ -1719,20 +1747,20 @@ export declare class Vector4 {
1719
1747
  * @param otherVector vector to multiple with
1720
1748
  * @returns the updated Vector4.
1721
1749
  */
1722
- multiplyInPlace(otherVector: Vector4): Vector4;
1750
+ multiplyInPlace(otherVector: Vector4): this;
1723
1751
  /**
1724
1752
  * Returns a new Vector4 set with the multiplication result of the current Vector4 and the given one.
1725
1753
  * @param otherVector vector to multiple with
1726
1754
  * @returns resulting new vector
1727
1755
  */
1728
- multiply(otherVector: DeepImmutable<Vector4>): Vector4;
1756
+ multiply(otherVector: DeepImmutable<Vector4>): this;
1729
1757
  /**
1730
1758
  * Updates the given vector "result" with the multiplication result of the current Vector4 and the given one.
1731
1759
  * @param otherVector vector to multiple with
1732
1760
  * @param result vector to store the result
1733
- * @returns the current Vector4.
1761
+ * @returns result input
1734
1762
  */
1735
- multiplyToRef(otherVector: DeepImmutable<Vector4>, result: Vector4): Vector4;
1763
+ multiplyToRef<T extends Vector4>(otherVector: DeepImmutable<Vector4>, result: T): T;
1736
1764
  /**
1737
1765
  * Returns a new Vector4 set with the multiplication result of the given floats and the current Vector4 coordinates.
1738
1766
  * @param x x value multiply with
@@ -1741,48 +1769,48 @@ export declare class Vector4 {
1741
1769
  * @param w w value multiply with
1742
1770
  * @returns resulting new vector
1743
1771
  */
1744
- multiplyByFloats(x: number, y: number, z: number, w: number): Vector4;
1772
+ multiplyByFloats(x: number, y: number, z: number, w: number): this;
1745
1773
  /**
1746
1774
  * Returns a new Vector4 set with the division result of the current Vector4 by the given one.
1747
1775
  * @param otherVector vector to devide with
1748
1776
  * @returns resulting new vector
1749
1777
  */
1750
- divide(otherVector: DeepImmutable<Vector4>): Vector4;
1778
+ divide(otherVector: DeepImmutable<Vector4>): this;
1751
1779
  /**
1752
1780
  * Updates the given vector "result" with the division result of the current Vector4 by the given one.
1753
1781
  * @param otherVector vector to devide with
1754
1782
  * @param result vector to store the result
1755
- * @returns the current Vector4.
1783
+ * @returns result input
1756
1784
  */
1757
- divideToRef(otherVector: DeepImmutable<Vector4>, result: Vector4): Vector4;
1785
+ divideToRef<T extends Vector4>(otherVector: DeepImmutable<Vector4>, result: T): T;
1758
1786
  /**
1759
1787
  * Divides the current Vector3 coordinates by the given ones.
1760
1788
  * @param otherVector vector to devide with
1761
1789
  * @returns the updated Vector3.
1762
1790
  */
1763
- divideInPlace(otherVector: DeepImmutable<Vector4>): Vector4;
1791
+ divideInPlace(otherVector: DeepImmutable<Vector4>): this;
1764
1792
  /**
1765
1793
  * Updates the Vector4 coordinates with the minimum values between its own and the given vector ones
1766
1794
  * @param other defines the second operand
1767
1795
  * @returns the current updated Vector4
1768
1796
  */
1769
- minimizeInPlace(other: DeepImmutable<Vector4>): Vector4;
1797
+ minimizeInPlace(other: DeepImmutable<Vector4>): this;
1770
1798
  /**
1771
1799
  * Updates the Vector4 coordinates with the maximum values between its own and the given vector ones
1772
1800
  * @param other defines the second operand
1773
1801
  * @returns the current updated Vector4
1774
1802
  */
1775
- maximizeInPlace(other: DeepImmutable<Vector4>): Vector4;
1803
+ maximizeInPlace(other: DeepImmutable<Vector4>): this;
1776
1804
  /**
1777
1805
  * Gets a new Vector4 from current Vector4 floored values
1778
1806
  * @returns a new Vector4
1779
1807
  */
1780
- floor(): Vector4;
1808
+ floor(): this;
1781
1809
  /**
1782
1810
  * Gets a new Vector4 from current Vector4 fractional values
1783
1811
  * @returns a new Vector4
1784
1812
  */
1785
- fract(): Vector4;
1813
+ fract(): this;
1786
1814
  /**
1787
1815
  * Returns the Vector4 length (float).
1788
1816
  * @returns the length
@@ -1797,7 +1825,7 @@ export declare class Vector4 {
1797
1825
  * Normalizes in place the Vector4.
1798
1826
  * @returns the updated Vector4.
1799
1827
  */
1800
- normalize(): Vector4;
1828
+ normalize(): this;
1801
1829
  /**
1802
1830
  * Returns a new Vector3 from the Vector4 (x, y, z) coordinates.
1803
1831
  * @returns this converted to a new vector3
@@ -1807,13 +1835,13 @@ export declare class Vector4 {
1807
1835
  * Returns a new Vector4 copied from the current one.
1808
1836
  * @returns the new cloned vector
1809
1837
  */
1810
- clone(): Vector4;
1838
+ clone(): this;
1811
1839
  /**
1812
1840
  * Updates the current Vector4 with the given one coordinates.
1813
1841
  * @param source the source vector to copy from
1814
1842
  * @returns the updated Vector4.
1815
1843
  */
1816
- copyFrom(source: DeepImmutable<Vector4>): Vector4;
1844
+ copyFrom(source: DeepImmutable<Vector4>): this;
1817
1845
  /**
1818
1846
  * Updates the current Vector4 coordinates with the given floats.
1819
1847
  * @param x float to copy from
@@ -1822,7 +1850,7 @@ export declare class Vector4 {
1822
1850
  * @param w float to copy from
1823
1851
  * @returns the updated Vector4.
1824
1852
  */
1825
- copyFromFloats(x: number, y: number, z: number, w: number): Vector4;
1853
+ copyFromFloats(x: number, y: number, z: number, w: number): this;
1826
1854
  /**
1827
1855
  * Updates the current Vector4 coordinates with the given floats.
1828
1856
  * @param x float to set from
@@ -1831,13 +1859,13 @@ export declare class Vector4 {
1831
1859
  * @param w float to set from
1832
1860
  * @returns the updated Vector4.
1833
1861
  */
1834
- set(x: number, y: number, z: number, w: number): Vector4;
1862
+ set(x: number, y: number, z: number, w: number): this;
1835
1863
  /**
1836
1864
  * Copies the given float to the current Vector3 coordinates
1837
1865
  * @param v defines the x, y, z and w coordinates of the operand
1838
1866
  * @returns the current updated Vector3
1839
1867
  */
1840
- setAll(v: number): Vector4;
1868
+ setAll(v: number): this;
1841
1869
  /**
1842
1870
  * Returns a new Vector4 set from the starting index of the given array.
1843
1871
  * @param array the array to pull values from
@@ -1850,15 +1878,17 @@ export declare class Vector4 {
1850
1878
  * @param array the array to pull values from
1851
1879
  * @param offset the offset into the array to start at
1852
1880
  * @param result the vector to store the result in
1881
+ * @returns result input
1853
1882
  */
1854
- static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number, result: Vector4): void;
1883
+ static FromArrayToRef<T extends Vector4>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T;
1855
1884
  /**
1856
1885
  * Updates the given vector "result" from the starting index of the given Float32Array.
1857
1886
  * @param array the array to pull values from
1858
1887
  * @param offset the offset into the array to start at
1859
1888
  * @param result the vector to store the result in
1889
+ * @returns result input
1860
1890
  */
1861
- static FromFloatArrayToRef(array: DeepImmutable<Float32Array>, offset: number, result: Vector4): void;
1891
+ static FromFloatArrayToRef<T extends Vector4>(array: DeepImmutable<Float32Array>, offset: number, result: T): T;
1862
1892
  /**
1863
1893
  * Updates the given vector "result" coordinates from the given floats.
1864
1894
  * @param x float to set from
@@ -1866,8 +1896,9 @@ export declare class Vector4 {
1866
1896
  * @param z float to set from
1867
1897
  * @param w float to set from
1868
1898
  * @param result the vector to the floats in
1899
+ * @returns result input
1869
1900
  */
1870
- static FromFloatsToRef(x: number, y: number, z: number, w: number, result: Vector4): void;
1901
+ static FromFloatsToRef<T extends Vector4>(x: number, y: number, z: number, w: number, result: T): T;
1871
1902
  /**
1872
1903
  * Returns a new Vector4 set to (0.0, 0.0, 0.0, 0.0)
1873
1904
  * @returns the new vector
@@ -1892,22 +1923,23 @@ export declare class Vector4 {
1892
1923
  * Updates the given vector "result" from the normalization of the given one.
1893
1924
  * @param vector the vector to normalize
1894
1925
  * @param result the vector to store the result in
1926
+ * @returns result input
1895
1927
  */
1896
- static NormalizeToRef(vector: DeepImmutable<Vector4>, result: Vector4): void;
1928
+ static NormalizeToRef<T extends Vector4>(vector: DeepImmutable<Vector4>, result: T): T;
1897
1929
  /**
1898
1930
  * Returns a vector with the minimum values from the left and right vectors
1899
1931
  * @param left left vector to minimize
1900
1932
  * @param right right vector to minimize
1901
1933
  * @returns a new vector with the minimum of the left and right vector values
1902
1934
  */
1903
- static Minimize(left: DeepImmutable<Vector4>, right: DeepImmutable<Vector4>): Vector4;
1935
+ static Minimize<T extends Vector4>(left: DeepImmutable<T>, right: DeepImmutable<Vector4>): T;
1904
1936
  /**
1905
1937
  * Returns a vector with the maximum values from the left and right vectors
1906
1938
  * @param left left vector to maximize
1907
1939
  * @param right right vector to maximize
1908
1940
  * @returns a new vector with the maximum of the left and right vector values
1909
1941
  */
1910
- static Maximize(left: DeepImmutable<Vector4>, right: DeepImmutable<Vector4>): Vector4;
1942
+ static Maximize<T extends Vector4>(left: DeepImmutable<T>, right: DeepImmutable<Vector4>): T;
1911
1943
  /**
1912
1944
  * Returns the distance (float) between the vectors "value1" and "value2".
1913
1945
  * @param value1 value to calulate the distance between
@@ -1936,7 +1968,7 @@ export declare class Vector4 {
1936
1968
  * @param ref defines third vector
1937
1969
  * @returns ref
1938
1970
  */
1939
- static CenterToRef(value1: DeepImmutable<Vector4>, value2: DeepImmutable<Vector4>, ref: DeepImmutable<Vector4>): Vector4;
1971
+ static CenterToRef<T extends Vector4>(value1: DeepImmutable<Vector4>, value2: DeepImmutable<Vector4>, ref: T): T;
1940
1972
  /**
1941
1973
  * Returns a new Vector4 set with the result of the transformation by the given matrix of the given vector.
1942
1974
  * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
@@ -1953,8 +1985,9 @@ export declare class Vector4 {
1953
1985
  * @param vector defines the Vector3 to transform
1954
1986
  * @param transformation defines the transformation matrix
1955
1987
  * @param result defines the Vector4 where to store the result
1988
+ * @returns result input
1956
1989
  */
1957
- static TransformCoordinatesToRef(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: Vector4): void;
1990
+ static TransformCoordinatesToRef<T extends Vector4>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T;
1958
1991
  /**
1959
1992
  * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
1960
1993
  * This method computes tranformed coordinates only, not transformed direction vectors
@@ -1964,8 +1997,9 @@ export declare class Vector4 {
1964
1997
  * @param z define the z coordinate of the source vector
1965
1998
  * @param transformation defines the transformation matrix
1966
1999
  * @param result defines the Vector4 where to store the result
2000
+ * @returns result input
1967
2001
  */
1968
- static TransformCoordinatesFromFloatsToRef(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: Vector4): void;
2002
+ static TransformCoordinatesFromFloatsToRef<T extends Vector4>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T;
1969
2003
  /**
1970
2004
  * Returns a new Vector4 set with the result of the normal transformation by the given matrix of the given vector.
1971
2005
  * This methods computes transformed normalized direction vectors only.
@@ -1973,15 +2007,16 @@ export declare class Vector4 {
1973
2007
  * @param transformation the transformation matrix to apply
1974
2008
  * @returns the new vector
1975
2009
  */
1976
- static TransformNormal(vector: DeepImmutable<Vector4>, transformation: DeepImmutable<Matrix>): Vector4;
2010
+ static TransformNormal<T extends Vector4>(vector: DeepImmutable<T>, transformation: DeepImmutable<Matrix>): T;
1977
2011
  /**
1978
2012
  * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector.
1979
2013
  * This methods computes transformed normalized direction vectors only.
1980
2014
  * @param vector the vector to transform
1981
2015
  * @param transformation the transformation matrix to apply
1982
2016
  * @param result the vector to store the result in
2017
+ * @returns result input
1983
2018
  */
1984
- static TransformNormalToRef(vector: DeepImmutable<Vector4>, transformation: DeepImmutable<Matrix>, result: Vector4): void;
2019
+ static TransformNormalToRef<T extends Vector4>(vector: DeepImmutable<Vector4>, transformation: DeepImmutable<Matrix>, result: T): T;
1985
2020
  /**
1986
2021
  * 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
2022
  * This methods computes transformed normalized direction vectors only.
@@ -1991,8 +2026,9 @@ export declare class Vector4 {
1991
2026
  * @param w value to transform
1992
2027
  * @param transformation the transformation matrix to apply
1993
2028
  * @param result the vector to store the results in
2029
+ * @returns result input
1994
2030
  */
1995
- static TransformNormalFromFloatsToRef(x: number, y: number, z: number, w: number, transformation: DeepImmutable<Matrix>, result: Vector4): void;
2031
+ static TransformNormalFromFloatsToRef<T extends Vector4>(x: number, y: number, z: number, w: number, transformation: DeepImmutable<Matrix>, result: T): T;
1996
2032
  /**
1997
2033
  * Creates a new Vector4 from a Vector3
1998
2034
  * @param source defines the source data
@@ -2003,6 +2039,7 @@ export declare class Vector4 {
2003
2039
  }
2004
2040
  /**
2005
2041
  * Class used to store quaternion data
2042
+ * Example Playground - Overview - https://playground.babylonjs.com/#L49EJ7#100
2006
2043
  * @see https://en.wikipedia.org/wiki/Quaternion
2007
2044
  * @see https://doc.babylonjs.com/features/position,_rotation,_scaling
2008
2045
  */
@@ -2054,11 +2091,13 @@ export declare class Quaternion {
2054
2091
  getHashCode(): number;
2055
2092
  /**
2056
2093
  * Copy the quaternion to an array
2094
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#13
2057
2095
  * @returns a new array populated with 4 elements from the quaternion coordinates
2058
2096
  */
2059
2097
  asArray(): number[];
2060
2098
  /**
2061
2099
  * Stores from the starting index in the given array the Quaternion successive values
2100
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#59
2062
2101
  * @param array defines the array where to store the x,y,z,w components
2063
2102
  * @param index defines an optional index in the target array to define where to start storing values
2064
2103
  * @returns the current Quaternion object
@@ -2066,12 +2105,14 @@ export declare class Quaternion {
2066
2105
  toArray(array: FloatArray, index?: number): Quaternion;
2067
2106
  /**
2068
2107
  * Check if two quaternions are equals
2108
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#38
2069
2109
  * @param otherQuaternion defines the second operand
2070
2110
  * @returns true if the current quaternion and the given one coordinates are strictly equals
2071
2111
  */
2072
2112
  equals(otherQuaternion: DeepImmutable<Quaternion>): boolean;
2073
2113
  /**
2074
2114
  * Gets a boolean if two quaternions are equals (using an epsilon value)
2115
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#37
2075
2116
  * @param otherQuaternion defines the other quaternion
2076
2117
  * @param epsilon defines the minimal distance to consider equality
2077
2118
  * @returns true if the given quaternion coordinates are close to the current ones by a distance of epsilon.
@@ -2079,204 +2120,219 @@ export declare class Quaternion {
2079
2120
  equalsWithEpsilon(otherQuaternion: DeepImmutable<Quaternion>, epsilon?: number): boolean;
2080
2121
  /**
2081
2122
  * Clone the current quaternion
2123
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#12
2082
2124
  * @returns a new quaternion copied from the current one
2083
2125
  */
2084
- clone(): Quaternion;
2126
+ clone(): this;
2085
2127
  /**
2086
2128
  * Copy a quaternion to the current one
2129
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#86
2087
2130
  * @param other defines the other quaternion
2088
2131
  * @returns the updated current quaternion
2089
2132
  */
2090
- copyFrom(other: DeepImmutable<Quaternion>): Quaternion;
2133
+ copyFrom(other: DeepImmutable<Quaternion>): this;
2091
2134
  /**
2092
2135
  * Updates the current quaternion with the given float coordinates
2136
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#87
2093
2137
  * @param x defines the x coordinate
2094
2138
  * @param y defines the y coordinate
2095
2139
  * @param z defines the z coordinate
2096
2140
  * @param w defines the w coordinate
2097
2141
  * @returns the updated current quaternion
2098
2142
  */
2099
- copyFromFloats(x: number, y: number, z: number, w: number): Quaternion;
2143
+ copyFromFloats(x: number, y: number, z: number, w: number): this;
2100
2144
  /**
2101
2145
  * Updates the current quaternion from the given float coordinates
2146
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#56
2102
2147
  * @param x defines the x coordinate
2103
2148
  * @param y defines the y coordinate
2104
2149
  * @param z defines the z coordinate
2105
2150
  * @param w defines the w coordinate
2106
2151
  * @returns the updated current quaternion
2107
2152
  */
2108
- set(x: number, y: number, z: number, w: number): Quaternion;
2153
+ set(x: number, y: number, z: number, w: number): this;
2109
2154
  /**
2110
2155
  * Adds two quaternions
2156
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#10
2111
2157
  * @param other defines the second operand
2112
2158
  * @returns a new quaternion as the addition result of the given one and the current quaternion
2113
2159
  */
2114
- add(other: DeepImmutable<Quaternion>): Quaternion;
2160
+ add(other: DeepImmutable<Quaternion>): this;
2115
2161
  /**
2116
2162
  * Add a quaternion to the current one
2163
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#11
2117
2164
  * @param other defines the quaternion to add
2118
2165
  * @returns the current quaternion
2119
2166
  */
2120
- addInPlace(other: DeepImmutable<Quaternion>): Quaternion;
2167
+ addInPlace(other: DeepImmutable<Quaternion>): this;
2121
2168
  /**
2122
2169
  * Subtract two quaternions
2170
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#57
2123
2171
  * @param other defines the second operand
2124
2172
  * @returns a new quaternion as the subtraction result of the given one from the current one
2125
2173
  */
2126
- subtract(other: Quaternion): Quaternion;
2174
+ subtract(other: Quaternion): this;
2127
2175
  /**
2128
2176
  * Subtract a quaternion to the current one
2177
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#58
2129
2178
  * @param other defines the quaternion to subtract
2130
2179
  * @returns the current quaternion
2131
2180
  */
2132
- subtractInPlace(other: DeepImmutable<Quaternion>): Quaternion;
2181
+ subtractInPlace(other: DeepImmutable<Quaternion>): this;
2133
2182
  /**
2134
2183
  * Multiplies the current quaternion by a scale factor
2184
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#88
2135
2185
  * @param value defines the scale factor
2136
2186
  * @returns a new quaternion set by multiplying the current quaternion coordinates by the float "scale"
2137
2187
  */
2138
- scale(value: number): Quaternion;
2188
+ scale(value: number): this;
2139
2189
  /**
2140
2190
  * Scale the current quaternion values by a factor and stores the result to a given quaternion
2191
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#89
2141
2192
  * @param scale defines the scale factor
2142
2193
  * @param result defines the Quaternion object where to store the result
2143
- * @returns the unmodified current quaternion
2194
+ * @returns result input
2144
2195
  */
2145
- scaleToRef(scale: number, result: Quaternion): Quaternion;
2196
+ scaleToRef<T extends Quaternion>(scale: number, result: T): T;
2146
2197
  /**
2147
2198
  * Multiplies in place the current quaternion by a scale factor
2199
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#90
2148
2200
  * @param value defines the scale factor
2149
2201
  * @returns the current modified quaternion
2150
2202
  */
2151
- scaleInPlace(value: number): Quaternion;
2203
+ scaleInPlace(value: number): this;
2152
2204
  /**
2153
2205
  * Scale the current quaternion values by a factor and add the result to a given quaternion
2206
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#91
2154
2207
  * @param scale defines the scale factor
2155
2208
  * @param result defines the Quaternion object where to store the result
2156
- * @returns the unmodified current quaternion
2209
+ * @returns result input
2157
2210
  */
2158
- scaleAndAddToRef(scale: number, result: Quaternion): Quaternion;
2211
+ scaleAndAddToRef<T extends Quaternion>(scale: number, result: T): T;
2159
2212
  /**
2160
2213
  * Multiplies two quaternions
2214
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#43
2161
2215
  * @param q1 defines the second operand
2162
2216
  * @returns a new quaternion set as the multiplication result of the current one with the given one "q1"
2163
2217
  */
2164
- multiply(q1: DeepImmutable<Quaternion>): Quaternion;
2218
+ multiply(q1: DeepImmutable<Quaternion>): this;
2165
2219
  /**
2166
2220
  * Sets the given "result" as the the multiplication result of the current one with the given one "q1"
2221
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#45
2167
2222
  * @param q1 defines the second operand
2168
2223
  * @param result defines the target quaternion
2169
2224
  * @returns the current quaternion
2170
2225
  */
2171
- multiplyToRef(q1: DeepImmutable<Quaternion>, result: Quaternion): Quaternion;
2226
+ multiplyToRef<T extends Quaternion>(q1: DeepImmutable<Quaternion>, result: T): T;
2172
2227
  /**
2173
2228
  * Updates the current quaternion with the multiplication of itself with the given one "q1"
2229
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#46
2174
2230
  * @param q1 defines the second operand
2175
2231
  * @returns the currentupdated quaternion
2176
2232
  */
2177
- multiplyInPlace(q1: DeepImmutable<Quaternion>): Quaternion;
2233
+ multiplyInPlace(q1: DeepImmutable<Quaternion>): this;
2178
2234
  /**
2179
2235
  * Conjugates the current quaternion and stores the result in the given quaternion
2236
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#81
2180
2237
  * @param ref defines the target quaternion
2181
- * @returns the current quaternion
2238
+ * @returns result input
2182
2239
  */
2183
- conjugateToRef(ref: Quaternion): Quaternion;
2240
+ conjugateToRef<T extends Quaternion>(ref: T): T;
2184
2241
  /**
2185
2242
  * Conjugates in place the current quaternion
2243
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#82
2186
2244
  * @returns the current updated quaternion
2187
2245
  */
2188
- conjugateInPlace(): Quaternion;
2246
+ conjugateInPlace(): this;
2189
2247
  /**
2190
2248
  * Conjugates (1-q) the current quaternion
2249
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#83
2191
2250
  * @returns a new quaternion
2192
2251
  */
2193
- conjugate(): Quaternion;
2252
+ conjugate(): this;
2194
2253
  /**
2195
2254
  * Returns the inverse of the current quaternion
2255
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#84
2196
2256
  * @returns a new quaternion
2197
2257
  */
2198
- invert(): Quaternion;
2258
+ invert(): this;
2199
2259
  /**
2200
2260
  * Invert in place the current quaternion
2261
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#85
2201
2262
  * @returns this quaternion
2202
2263
  */
2203
- invertInPlace(): Quaternion;
2264
+ invertInPlace(): this;
2204
2265
  /**
2205
2266
  * Gets squared length of current quaternion
2267
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#29
2206
2268
  * @returns the quaternion length (float)
2207
2269
  */
2208
2270
  lengthSquared(): number;
2209
2271
  /**
2210
2272
  * Gets length of current quaternion
2273
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#28
2211
2274
  * @returns the quaternion length (float)
2212
2275
  */
2213
2276
  length(): number;
2214
2277
  /**
2215
2278
  * Normalize in place the current quaternion
2279
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#54
2216
2280
  * @returns the current updated quaternion
2217
2281
  */
2218
- normalize(): Quaternion;
2282
+ normalize(): this;
2219
2283
  /**
2220
2284
  * Normalize a copy of the current quaternion
2285
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#55
2221
2286
  * @returns the normalized quaternion
2222
2287
  */
2223
- normalizeToNew(): Quaternion;
2288
+ normalizeToNew(): this;
2224
2289
  /**
2225
2290
  * Returns a new Vector3 set with the Euler angles translated from the current quaternion
2291
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#32
2226
2292
  * @returns a new Vector3 containing the Euler angles
2227
2293
  * @see https://doc.babylonjs.com/divingDeeper/mesh/transforms/center_origin/rotation_conventions
2228
2294
  */
2229
2295
  toEulerAngles(): Vector3;
2230
2296
  /**
2231
2297
  * Sets the given vector3 "result" with the Euler angles translated from the current quaternion
2298
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#31
2232
2299
  * @param result defines the vector which will be filled with the Euler angles
2233
- * @returns the current unchanged quaternion
2300
+ * @returns result input
2234
2301
  * @see https://doc.babylonjs.com/divingDeeper/mesh/transforms/center_origin/rotation_conventions
2235
2302
  */
2236
- toEulerAnglesToRef(result: Vector3): Quaternion;
2303
+ toEulerAnglesToRef<T extends Vector3>(result: T): T;
2237
2304
  /**
2238
2305
  * Updates the given rotation matrix with the current quaternion values
2306
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#67
2239
2307
  * @param result defines the target matrix
2240
2308
  * @returns the current unchanged quaternion
2241
2309
  */
2242
- toRotationMatrix(result: Matrix): Quaternion;
2310
+ toRotationMatrix<T extends Matrix>(result: T): T;
2243
2311
  /**
2244
2312
  * Updates the current quaternion from the given rotation matrix values
2313
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#41
2245
2314
  * @param matrix defines the source matrix
2246
2315
  * @returns the current updated quaternion
2247
2316
  */
2248
- fromRotationMatrix(matrix: DeepImmutable<Matrix>): Quaternion;
2317
+ fromRotationMatrix(matrix: DeepImmutable<Matrix>): this;
2249
2318
  /**
2250
2319
  * Creates a new quaternion from a rotation matrix
2320
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#101
2251
2321
  * @param matrix defines the source matrix
2252
2322
  * @returns a new quaternion created from the given rotation matrix values
2253
2323
  */
2254
2324
  static FromRotationMatrix(matrix: DeepImmutable<Matrix>): Quaternion;
2255
2325
  /**
2256
2326
  * Updates the given quaternion with the given rotation matrix values
2327
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#102
2257
2328
  * @param matrix defines the source matrix
2258
2329
  * @param result defines the target quaternion
2330
+ * @returns result input
2259
2331
  */
2260
- static FromRotationMatrixToRef(matrix: DeepImmutable<Matrix>, result: Quaternion): void;
2261
- /**
2262
- * Creates the rotation quaternion needed to rotate from one Vector3 onto another Vector3
2263
- * Example PG https://playground.babylonjs.com/#L49EJ7#2
2264
- * @param fromVector the starting vector
2265
- * @param toVector the ending vector
2266
- * @returns the rotation quaternion needed
2267
- */
2268
- static RotationQuaternionFromOnto(fromVector: DeepImmutable<Vector3>, toVector: DeepImmutable<Vector3>): Quaternion;
2269
- /**
2270
- * Creates the rotation quaternion needed to rotate from one Vector3 onto another Vector3 and stores in a result Quaternion
2271
- * Example PG https://playground.babylonjs.com/#L49EJ7#3
2272
- * @param fromVector the starting vector
2273
- * @param toVector the ending vector
2274
- * @param result the rotation quaternion needed
2275
- * @returns the result
2276
- */
2277
- static RotationQuaternionFromOntoToRef(fromVector: DeepImmutable<Vector3>, toVector: DeepImmutable<Vector3>, result: DeepImmutable<Quaternion>): Quaternion;
2332
+ static FromRotationMatrixToRef<T extends Quaternion>(matrix: DeepImmutable<Matrix>, result: T): T;
2278
2333
  /**
2279
2334
  * Returns the dot product (float) between the quaternions "left" and "right"
2335
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#61
2280
2336
  * @param left defines the left operand
2281
2337
  * @param right defines the right operand
2282
2338
  * @returns the dot product
@@ -2284,6 +2340,7 @@ export declare class Quaternion {
2284
2340
  static Dot(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>): number;
2285
2341
  /**
2286
2342
  * Checks if the orientations of two rotation quaternions are close to each other
2343
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#60
2287
2344
  * @param quat0 defines the first quaternion to check
2288
2345
  * @param quat1 defines the second quaternion to check
2289
2346
  * @param epsilon defines closeness, 0 same orientation, 1 PI apart, default 0.1
@@ -2292,14 +2349,14 @@ export declare class Quaternion {
2292
2349
  static AreClose(quat0: DeepImmutable<Quaternion>, quat1: DeepImmutable<Quaternion>, epsilon?: number): boolean;
2293
2350
  /**
2294
2351
  * Smooth interpolation between two quaternions using Slerp
2295
- *
2352
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#93
2296
2353
  * @param source source quaternion
2297
2354
  * @param goal goal quaternion
2298
2355
  * @param deltaTime current interpolation frame
2299
2356
  * @param lerpTime total interpolation time
2300
2357
  * @param result the smoothed quaternion
2301
2358
  */
2302
- static SmoothToRef(source: Quaternion, goal: Quaternion, deltaTime: number, lerpTime: number, result: Quaternion): void;
2359
+ static SmoothToRef<T extends Quaternion>(source: Quaternion, goal: Quaternion, deltaTime: number, lerpTime: number, result: T): T;
2303
2360
  /**
2304
2361
  * Creates an empty quaternion
2305
2362
  * @returns a new quaternion set to (0.0, 0.0, 0.0)
@@ -2307,17 +2364,19 @@ export declare class Quaternion {
2307
2364
  static Zero(): Quaternion;
2308
2365
  /**
2309
2366
  * Inverse a given quaternion
2367
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#103
2310
2368
  * @param q defines the source quaternion
2311
2369
  * @returns a new quaternion as the inverted current quaternion
2312
2370
  */
2313
- static Inverse(q: DeepImmutable<Quaternion>): Quaternion;
2371
+ static Inverse<T extends Quaternion>(q: DeepImmutable<T>): T;
2314
2372
  /**
2315
2373
  * Inverse a given quaternion
2374
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#104
2316
2375
  * @param q defines the source quaternion
2317
2376
  * @param result the quaternion the result will be stored in
2318
2377
  * @returns the result quaternion
2319
2378
  */
2320
- static InverseToRef(q: Quaternion, result: Quaternion): Quaternion;
2379
+ static InverseToRef<T extends Quaternion>(q: Quaternion, result: T): T;
2321
2380
  /**
2322
2381
  * Creates an identity quaternion
2323
2382
  * @returns the identity quaternion
@@ -2331,6 +2390,7 @@ export declare class Quaternion {
2331
2390
  static IsIdentity(quaternion: DeepImmutable<Quaternion>): boolean;
2332
2391
  /**
2333
2392
  * Creates a quaternion from a rotation around an axis
2393
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#72
2334
2394
  * @param axis defines the axis to use
2335
2395
  * @param angle defines the angle to use
2336
2396
  * @returns a new quaternion created from the given axis (Vector3) and angle in radians (float)
@@ -2338,14 +2398,16 @@ export declare class Quaternion {
2338
2398
  static RotationAxis(axis: DeepImmutable<Vector3>, angle: number): Quaternion;
2339
2399
  /**
2340
2400
  * Creates a rotation around an axis and stores it into the given quaternion
2401
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#73
2341
2402
  * @param axis defines the axis to use
2342
2403
  * @param angle defines the angle to use
2343
2404
  * @param result defines the target quaternion
2344
2405
  * @returns the target quaternion
2345
2406
  */
2346
- static RotationAxisToRef(axis: DeepImmutable<Vector3>, angle: number, result: Quaternion): Quaternion;
2407
+ static RotationAxisToRef<T extends Quaternion>(axis: DeepImmutable<Vector3>, angle: number, result: T): T;
2347
2408
  /**
2348
2409
  * Creates a new quaternion from data stored into an array
2410
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#63
2349
2411
  * @param array defines the data source
2350
2412
  * @param offset defines the offset in the source array where the data starts
2351
2413
  * @returns a new quaternion
@@ -2353,13 +2415,16 @@ export declare class Quaternion {
2353
2415
  static FromArray(array: DeepImmutable<ArrayLike<number>>, offset?: number): Quaternion;
2354
2416
  /**
2355
2417
  * Updates the given quaternion "result" from the starting index of the given array.
2418
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#64
2356
2419
  * @param array the array to pull values from
2357
2420
  * @param offset the offset into the array to start at
2358
2421
  * @param result the quaternion to store the result in
2422
+ * @returns result input
2359
2423
  */
2360
- static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number, result: Quaternion): void;
2424
+ static FromArrayToRef<T extends Quaternion>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T;
2361
2425
  /**
2362
2426
  * Create a quaternion from Euler rotation angles
2427
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#33
2363
2428
  * @param x Pitch
2364
2429
  * @param y Yaw
2365
2430
  * @param z Roll
@@ -2368,36 +2433,41 @@ export declare class Quaternion {
2368
2433
  static FromEulerAngles(x: number, y: number, z: number): Quaternion;
2369
2434
  /**
2370
2435
  * Updates a quaternion from Euler rotation angles
2436
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#34
2371
2437
  * @param x Pitch
2372
2438
  * @param y Yaw
2373
2439
  * @param z Roll
2374
2440
  * @param result the quaternion to store the result
2375
2441
  * @returns the updated quaternion
2376
2442
  */
2377
- static FromEulerAnglesToRef(x: number, y: number, z: number, result: Quaternion): Quaternion;
2443
+ static FromEulerAnglesToRef<T extends Quaternion>(x: number, y: number, z: number, result: T): T;
2378
2444
  /**
2379
2445
  * Create a quaternion from Euler rotation vector
2446
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#35
2380
2447
  * @param vec the Euler vector (x Pitch, y Yaw, z Roll)
2381
2448
  * @returns the new Quaternion
2382
2449
  */
2383
2450
  static FromEulerVector(vec: DeepImmutable<Vector3>): Quaternion;
2384
2451
  /**
2385
2452
  * Updates a quaternion from Euler rotation vector
2453
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#36
2386
2454
  * @param vec the Euler vector (x Pitch, y Yaw, z Roll)
2387
2455
  * @param result the quaternion to store the result
2388
2456
  * @returns the updated quaternion
2389
2457
  */
2390
- static FromEulerVectorToRef(vec: DeepImmutable<Vector3>, result: Quaternion): Quaternion;
2458
+ static FromEulerVectorToRef<T extends Quaternion>(vec: DeepImmutable<Vector3>, result: T): T;
2391
2459
  /**
2392
2460
  * Updates a quaternion so that it rotates vector vecFrom to vector vecTo
2461
+ * Example Playground - https://playground.babylonjs.com/#L49EJ7#70
2393
2462
  * @param vecFrom defines the direction vector from which to rotate
2394
2463
  * @param vecTo defines the direction vector to which to rotate
2395
2464
  * @param result the quaternion to store the result
2396
2465
  * @returns the updated quaternion
2397
2466
  */
2398
- static FromUnitVectorsToRef(vecFrom: DeepImmutable<Vector3>, vecTo: DeepImmutable<Vector3>, result: Quaternion): Quaternion;
2467
+ static FromUnitVectorsToRef<T extends Quaternion>(vecFrom: DeepImmutable<Vector3>, vecTo: DeepImmutable<Vector3>, result: T): T;
2399
2468
  /**
2400
2469
  * Creates a new quaternion from the given Euler float angles (y, x, z)
2470
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#77
2401
2471
  * @param yaw defines the rotation around Y axis
2402
2472
  * @param pitch defines the rotation around X axis
2403
2473
  * @param roll defines the rotation around Z axis
@@ -2406,14 +2476,17 @@ export declare class Quaternion {
2406
2476
  static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Quaternion;
2407
2477
  /**
2408
2478
  * Creates a new rotation from the given Euler float angles (y, x, z) and stores it in the target quaternion
2479
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#78
2409
2480
  * @param yaw defines the rotation around Y axis
2410
2481
  * @param pitch defines the rotation around X axis
2411
2482
  * @param roll defines the rotation around Z axis
2412
2483
  * @param result defines the target quaternion
2484
+ * @returns result input
2413
2485
  */
2414
- static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Quaternion): void;
2486
+ static RotationYawPitchRollToRef<T extends Quaternion>(yaw: number, pitch: number, roll: number, result: T): T;
2415
2487
  /**
2416
2488
  * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation
2489
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#68
2417
2490
  * @param alpha defines the rotation around first axis
2418
2491
  * @param beta defines the rotation around second axis
2419
2492
  * @param gamma defines the rotation around third axis
@@ -2422,14 +2495,17 @@ export declare class Quaternion {
2422
2495
  static RotationAlphaBetaGamma(alpha: number, beta: number, gamma: number): Quaternion;
2423
2496
  /**
2424
2497
  * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation and stores it in the target quaternion
2498
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#69
2425
2499
  * @param alpha defines the rotation around first axis
2426
2500
  * @param beta defines the rotation around second axis
2427
2501
  * @param gamma defines the rotation around third axis
2428
2502
  * @param result defines the target quaternion
2503
+ * @returns result input
2429
2504
  */
2430
- static RotationAlphaBetaGammaToRef(alpha: number, beta: number, gamma: number, result: Quaternion): void;
2505
+ static RotationAlphaBetaGammaToRef<T extends Quaternion>(alpha: number, beta: number, gamma: number, result: T): T;
2431
2506
  /**
2432
2507
  * 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)
2508
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#75
2433
2509
  * @param axis1 defines the first axis
2434
2510
  * @param axis2 defines the second axis
2435
2511
  * @param axis3 defines the third axis
@@ -2438,15 +2514,18 @@ export declare class Quaternion {
2438
2514
  static RotationQuaternionFromAxis(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>): Quaternion;
2439
2515
  /**
2440
2516
  * Creates a rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation) and stores it in the target quaternion
2517
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#76
2441
2518
  * @param axis1 defines the first axis
2442
2519
  * @param axis2 defines the second axis
2443
2520
  * @param axis3 defines the third axis
2444
2521
  * @param ref defines the target quaternion
2522
+ * @returns result input
2445
2523
  */
2446
- static RotationQuaternionFromAxisToRef(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref: Quaternion): void;
2524
+ static RotationQuaternionFromAxisToRef<T extends Quaternion>(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref: T): T;
2447
2525
  /**
2448
2526
  * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up".
2449
2527
  * This function works in left handed mode
2528
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#96
2450
2529
  * @param forward defines the forward direction - Must be normalized and orthogonal to up.
2451
2530
  * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
2452
2531
  * @returns A new quaternion oriented toward the specified forward and up.
@@ -2455,14 +2534,17 @@ export declare class Quaternion {
2455
2534
  /**
2456
2535
  * Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like "up", and stores it in the target quaternion.
2457
2536
  * This function works in left handed mode
2537
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#97
2458
2538
  * @param forward defines the forward direction - Must be normalized and orthogonal to up.
2459
2539
  * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
2460
2540
  * @param ref defines the target quaternion.
2541
+ * @returns result input
2461
2542
  */
2462
- static FromLookDirectionLHToRef(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref: Quaternion): void;
2543
+ static FromLookDirectionLHToRef<T extends Quaternion>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref: T): T;
2463
2544
  /**
2464
2545
  * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up".
2465
2546
  * This function works in right handed mode
2547
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#98
2466
2548
  * @param forward defines the forward direction - Must be normalized and orthogonal to up.
2467
2549
  * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
2468
2550
  * @returns A new quaternion oriented toward the specified forward and up.
@@ -2471,13 +2553,16 @@ export declare class Quaternion {
2471
2553
  /**
2472
2554
  * Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like "up", and stores it in the target quaternion.
2473
2555
  * This function works in right handed mode
2556
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#105
2474
2557
  * @param forward defines the forward direction - Must be normalized and orthogonal to up.
2475
2558
  * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
2476
2559
  * @param ref defines the target quaternion.
2560
+ * @returns result input
2477
2561
  */
2478
- static FromLookDirectionRHToRef(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref: Quaternion): void;
2562
+ static FromLookDirectionRHToRef<T extends Quaternion>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref: T): T;
2479
2563
  /**
2480
2564
  * Interpolates between two quaternions
2565
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#79
2481
2566
  * @param left defines first quaternion
2482
2567
  * @param right defines second quaternion
2483
2568
  * @param amount defines the gradient to use
@@ -2486,14 +2571,18 @@ export declare class Quaternion {
2486
2571
  static Slerp(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>, amount: number): Quaternion;
2487
2572
  /**
2488
2573
  * Interpolates between two quaternions and stores it into a target quaternion
2574
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#92
2489
2575
  * @param left defines first quaternion
2490
2576
  * @param right defines second quaternion
2491
2577
  * @param amount defines the gradient to use
2492
2578
  * @param result defines the target quaternion
2579
+ * @returns result input
2493
2580
  */
2494
- static SlerpToRef(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>, amount: number, result: Quaternion): void;
2581
+ static SlerpToRef<T extends Quaternion>(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>, amount: number, result: T): T;
2495
2582
  /**
2496
2583
  * Interpolate between two quaternions using Hermite interpolation
2584
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#47
2585
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#hermite-quaternion-spline
2497
2586
  * @param value1 defines first quaternion
2498
2587
  * @param tangent1 defines the incoming tangent
2499
2588
  * @param value2 defines second quaternion
@@ -2501,9 +2590,10 @@ export declare class Quaternion {
2501
2590
  * @param amount defines the target quaternion
2502
2591
  * @returns the new interpolated quaternion
2503
2592
  */
2504
- static Hermite(value1: DeepImmutable<Quaternion>, tangent1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, tangent2: DeepImmutable<Quaternion>, amount: number): Quaternion;
2593
+ static Hermite<T extends Quaternion>(value1: DeepImmutable<T>, tangent1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, tangent2: DeepImmutable<Quaternion>, amount: number): T;
2505
2594
  /**
2506
2595
  * Returns a new Quaternion which is the 1st derivative of the Hermite spline defined by the quaternions "value1", "value2", "tangent1", "tangent2".
2596
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#48
2507
2597
  * @param value1 defines the first control point
2508
2598
  * @param tangent1 defines the first tangent
2509
2599
  * @param value2 defines the second control point
@@ -2511,17 +2601,19 @@ export declare class Quaternion {
2511
2601
  * @param time define where the derivative must be done
2512
2602
  * @returns 1st derivative
2513
2603
  */
2514
- static Hermite1stDerivative(value1: DeepImmutable<Quaternion>, tangent1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, tangent2: DeepImmutable<Quaternion>, time: number): Quaternion;
2604
+ static Hermite1stDerivative<T extends Quaternion>(value1: DeepImmutable<T>, tangent1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, tangent2: DeepImmutable<Quaternion>, time: number): T;
2515
2605
  /**
2516
2606
  * Update a Quaternion with the 1st derivative of the Hermite spline defined by the quaternions "value1", "value2", "tangent1", "tangent2".
2607
+ * Example Playground https://playground.babylonjs.com/#L49EJ7#49
2517
2608
  * @param value1 defines the first control point
2518
2609
  * @param tangent1 defines the first tangent
2519
2610
  * @param value2 defines the second control point
2520
2611
  * @param tangent2 defines the second tangent
2521
2612
  * @param time define where the derivative must be done
2522
2613
  * @param result define where to store the derivative
2614
+ * @returns result input
2523
2615
  */
2524
- static Hermite1stDerivativeToRef(value1: DeepImmutable<Quaternion>, tangent1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, tangent2: DeepImmutable<Quaternion>, time: number, result: Quaternion): void;
2616
+ static Hermite1stDerivativeToRef<T extends Quaternion>(value1: DeepImmutable<Quaternion>, tangent1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, tangent2: DeepImmutable<Quaternion>, time: number, result: T): T;
2525
2617
  }
2526
2618
  /**
2527
2619
  * Class used to store matrix data (4x4)
@@ -2586,51 +2678,51 @@ export declare class Matrix {
2586
2678
  * Inverts the current matrix in place
2587
2679
  * @returns the current inverted matrix
2588
2680
  */
2589
- invert(): Matrix;
2681
+ invert(): this;
2590
2682
  /**
2591
2683
  * Sets all the matrix elements to zero
2592
2684
  * @returns the current matrix
2593
2685
  */
2594
- reset(): Matrix;
2686
+ reset(): this;
2595
2687
  /**
2596
2688
  * Adds the current matrix with a second one
2597
2689
  * @param other defines the matrix to add
2598
2690
  * @returns a new matrix as the addition of the current matrix and the given one
2599
2691
  */
2600
- add(other: DeepImmutable<Matrix>): Matrix;
2692
+ add(other: DeepImmutable<Matrix>): this;
2601
2693
  /**
2602
2694
  * Sets the given matrix "result" to the addition of the current matrix and the given one
2603
2695
  * @param other defines the matrix to add
2604
2696
  * @param result defines the target matrix
2605
- * @returns the current matrix
2697
+ * @returns result input
2606
2698
  */
2607
- addToRef(other: DeepImmutable<Matrix>, result: Matrix): Matrix;
2699
+ addToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T;
2608
2700
  /**
2609
2701
  * Adds in place the given matrix to the current matrix
2610
2702
  * @param other defines the second operand
2611
2703
  * @returns the current updated matrix
2612
2704
  */
2613
- addToSelf(other: DeepImmutable<Matrix>): Matrix;
2705
+ addToSelf(other: DeepImmutable<Matrix>): this;
2614
2706
  /**
2615
2707
  * Sets the given matrix to the current inverted Matrix
2616
2708
  * @param other defines the target matrix
2617
- * @returns the unmodified current matrix
2709
+ * @returns result input
2618
2710
  */
2619
- invertToRef(other: Matrix): Matrix;
2711
+ invertToRef<T extends Matrix>(other: T): T;
2620
2712
  /**
2621
2713
  * add a value at the specified position in the current Matrix
2622
2714
  * @param index the index of the value within the matrix. between 0 and 15.
2623
2715
  * @param value the value to be added
2624
2716
  * @returns the current updated matrix
2625
2717
  */
2626
- addAtIndex(index: number, value: number): Matrix;
2718
+ addAtIndex(index: number, value: number): this;
2627
2719
  /**
2628
2720
  * mutiply the specified position in the current Matrix by a value
2629
2721
  * @param index the index of the value within the matrix. between 0 and 15.
2630
2722
  * @param value the value to be added
2631
2723
  * @returns the current updated matrix
2632
2724
  */
2633
- multiplyAtIndex(index: number, value: number): Matrix;
2725
+ multiplyAtIndex(index: number, value: number): this;
2634
2726
  /**
2635
2727
  * Inserts the translation vector (using 3 floats) in the current matrix
2636
2728
  * @param x defines the 1st component of the translation
@@ -2638,7 +2730,7 @@ export declare class Matrix {
2638
2730
  * @param z defines the 3rd component of the translation
2639
2731
  * @returns the current updated matrix
2640
2732
  */
2641
- setTranslationFromFloats(x: number, y: number, z: number): Matrix;
2733
+ setTranslationFromFloats(x: number, y: number, z: number): this;
2642
2734
  /**
2643
2735
  * Adds the translation vector (using 3 floats) in the current matrix
2644
2736
  * @param x defines the 1st component of the translation
@@ -2646,13 +2738,13 @@ export declare class Matrix {
2646
2738
  * @param z defines the 3rd component of the translation
2647
2739
  * @returns the current updated matrix
2648
2740
  */
2649
- addTranslationFromFloats(x: number, y: number, z: number): Matrix;
2741
+ addTranslationFromFloats(x: number, y: number, z: number): this;
2650
2742
  /**
2651
2743
  * Inserts the translation vector in the current matrix
2652
2744
  * @param vector3 defines the translation to insert
2653
2745
  * @returns the current updated matrix
2654
2746
  */
2655
- setTranslation(vector3: DeepImmutable<Vector3>): Matrix;
2747
+ setTranslation(vector3: DeepImmutable<Vector3>): this;
2656
2748
  /**
2657
2749
  * Gets the translation value of the current matrix
2658
2750
  * @returns a new Vector3 as the extracted translation from the matrix
@@ -2663,38 +2755,38 @@ export declare class Matrix {
2663
2755
  * @param result defines the Vector3 where to store the translation
2664
2756
  * @returns the current matrix
2665
2757
  */
2666
- getTranslationToRef(result: Vector3): Matrix;
2758
+ getTranslationToRef<T extends Vector3>(result: T): T;
2667
2759
  /**
2668
2760
  * Remove rotation and scaling part from the matrix
2669
2761
  * @returns the updated matrix
2670
2762
  */
2671
- removeRotationAndScaling(): Matrix;
2763
+ removeRotationAndScaling(): this;
2672
2764
  /**
2673
2765
  * Multiply two matrices
2674
2766
  * @param other defines the second operand
2675
2767
  * @returns a new matrix set with the multiplication result of the current Matrix and the given one
2676
2768
  */
2677
- multiply(other: DeepImmutable<Matrix>): Matrix;
2769
+ multiply(other: DeepImmutable<Matrix>): this;
2678
2770
  /**
2679
2771
  * Copy the current matrix from the given one
2680
2772
  * @param other defines the source matrix
2681
2773
  * @returns the current updated matrix
2682
2774
  */
2683
- copyFrom(other: DeepImmutable<Matrix>): Matrix;
2775
+ copyFrom(other: DeepImmutable<Matrix>): this;
2684
2776
  /**
2685
2777
  * Populates the given array from the starting index with the current matrix values
2686
2778
  * @param array defines the target array
2687
2779
  * @param offset defines the offset in the target array where to start storing values
2688
2780
  * @returns the current matrix
2689
2781
  */
2690
- copyToArray(array: Float32Array | Array<number>, offset?: number): Matrix;
2782
+ copyToArray(array: Float32Array | Array<number>, offset?: number): this;
2691
2783
  /**
2692
2784
  * Sets the given matrix "result" with the multiplication result of the current Matrix and the given one
2693
2785
  * @param other defines the second operand
2694
2786
  * @param result defines the matrix where to store the multiplication
2695
- * @returns the current matrix
2787
+ * @returns result input
2696
2788
  */
2697
- multiplyToRef(other: DeepImmutable<Matrix>, result: Matrix): Matrix;
2789
+ multiplyToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T;
2698
2790
  /**
2699
2791
  * Sets the Float32Array "result" from the given index "offset" with the multiplication of the current matrix and the given one
2700
2792
  * @param other defines the second operand
@@ -2702,7 +2794,7 @@ export declare class Matrix {
2702
2794
  * @param offset defines the offset in the target array where to start storing values
2703
2795
  * @returns the current matrix
2704
2796
  */
2705
- multiplyToArray(other: DeepImmutable<Matrix>, result: Float32Array | Array<number>, offset: number): Matrix;
2797
+ multiplyToArray(other: DeepImmutable<Matrix>, result: Float32Array | Array<number>, offset: number): this;
2706
2798
  /**
2707
2799
  * Check equality between this matrix and a second one
2708
2800
  * @param value defines the second matrix to compare
@@ -2713,7 +2805,7 @@ export declare class Matrix {
2713
2805
  * Clone the current matrix
2714
2806
  * @returns a new matrix from the current matrix
2715
2807
  */
2716
- clone(): Matrix;
2808
+ clone(): this;
2717
2809
  /**
2718
2810
  * Returns the name of the current matrix class
2719
2811
  * @returns the string "Matrix"
@@ -2749,27 +2841,27 @@ export declare class Matrix {
2749
2841
  * Gets specific row of the matrix to ref
2750
2842
  * @param index defines the number of the row to get
2751
2843
  * @param rowVector vector to store the index-th row of the current matrix
2752
- * @returns the current matrix
2844
+ * @returns result input
2753
2845
  */
2754
- getRowToRef(index: number, rowVector: Vector4): Matrix;
2846
+ getRowToRef<T extends Vector4>(index: number, rowVector: T): T;
2755
2847
  /**
2756
2848
  * Sets the index-th row of the current matrix to the vector4 values
2757
2849
  * @param index defines the number of the row to set
2758
2850
  * @param row defines the target vector4
2759
2851
  * @returns the updated current matrix
2760
2852
  */
2761
- setRow(index: number, row: Vector4): Matrix;
2853
+ setRow(index: number, row: Vector4): this;
2762
2854
  /**
2763
2855
  * Compute the transpose of the matrix
2764
2856
  * @returns the new transposed matrix
2765
2857
  */
2766
- transpose(): Matrix;
2858
+ transpose(): this;
2767
2859
  /**
2768
2860
  * Compute the transpose of the matrix and store it in a given matrix
2769
2861
  * @param result defines the target matrix
2770
- * @returns the current matrix
2862
+ * @returns result input
2771
2863
  */
2772
- transposeToRef(result: Matrix): Matrix;
2864
+ transposeToRef<T extends Matrix>(result: T): T;
2773
2865
  /**
2774
2866
  * Sets the index-th row of the current matrix with the given 4 x float values
2775
2867
  * @param index defines the row index
@@ -2779,51 +2871,51 @@ export declare class Matrix {
2779
2871
  * @param w defines the w component to set
2780
2872
  * @returns the updated current matrix
2781
2873
  */
2782
- setRowFromFloats(index: number, x: number, y: number, z: number, w: number): Matrix;
2874
+ setRowFromFloats(index: number, x: number, y: number, z: number, w: number): this;
2783
2875
  /**
2784
2876
  * Compute a new matrix set with the current matrix values multiplied by scale (float)
2785
2877
  * @param scale defines the scale factor
2786
2878
  * @returns a new matrix
2787
2879
  */
2788
- scale(scale: number): Matrix;
2880
+ scale(scale: number): this;
2789
2881
  /**
2790
2882
  * Scale the current matrix values by a factor to a given result matrix
2791
2883
  * @param scale defines the scale factor
2792
2884
  * @param result defines the matrix to store the result
2793
- * @returns the current matrix
2885
+ * @returns result input
2794
2886
  */
2795
- scaleToRef(scale: number, result: Matrix): Matrix;
2887
+ scaleToRef<T extends Matrix>(scale: number, result: T): T;
2796
2888
  /**
2797
2889
  * Scale the current matrix values by a factor and add the result to a given matrix
2798
2890
  * @param scale defines the scale factor
2799
2891
  * @param result defines the Matrix to store the result
2800
- * @returns the current matrix
2892
+ * @returns result input
2801
2893
  */
2802
- scaleAndAddToRef(scale: number, result: Matrix): Matrix;
2894
+ scaleAndAddToRef<T extends Matrix>(scale: number, result: T): T;
2803
2895
  /**
2804
2896
  * Writes to the given matrix a normal matrix, computed from this one (using values from identity matrix for fourth row and column).
2805
2897
  * @param ref matrix to store the result
2806
2898
  */
2807
- toNormalMatrix(ref: Matrix): void;
2899
+ toNormalMatrix<T extends Matrix>(ref: T): T;
2808
2900
  /**
2809
2901
  * Gets only rotation part of the current matrix
2810
2902
  * @returns a new matrix sets to the extracted rotation matrix from the current one
2811
2903
  */
2812
- getRotationMatrix(): Matrix;
2904
+ getRotationMatrix(): this;
2813
2905
  /**
2814
2906
  * Extracts the rotation matrix from the current one and sets it as the given "result"
2815
2907
  * @param result defines the target matrix to store data to
2816
- * @returns the current matrix
2908
+ * @returns result input
2817
2909
  */
2818
- getRotationMatrixToRef(result: Matrix): Matrix;
2910
+ getRotationMatrixToRef<T extends Matrix>(result: T): T;
2819
2911
  /**
2820
2912
  * Toggles model matrix from being right handed to left handed in place and vice versa
2821
2913
  */
2822
- toggleModelMatrixHandInPlace(): void;
2914
+ toggleModelMatrixHandInPlace(): this;
2823
2915
  /**
2824
2916
  * Toggles projection matrix from being right handed to left handed in place and vice versa
2825
2917
  */
2826
- toggleProjectionMatrixHandInPlace(): void;
2918
+ toggleProjectionMatrixHandInPlace(): this;
2827
2919
  /**
2828
2920
  * Creates a matrix from an array
2829
2921
  * @param array defines the source array
@@ -2836,16 +2928,18 @@ export declare class Matrix {
2836
2928
  * @param array defines the source array
2837
2929
  * @param offset defines an offset in the source array
2838
2930
  * @param result defines the target matrix
2931
+ * @returns result input
2839
2932
  */
2840
- static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number, result: Matrix): void;
2933
+ static FromArrayToRef<T extends Matrix>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T;
2841
2934
  /**
2842
2935
  * Stores an array into a matrix after having multiplied each component by a given factor
2843
2936
  * @param array defines the source array
2844
2937
  * @param offset defines the offset in the source array
2845
2938
  * @param scale defines the scaling factor
2846
2939
  * @param result defines the target matrix
2940
+ * @returns result input
2847
2941
  */
2848
- static FromFloat32ArrayToRefScaled(array: DeepImmutable<Float32Array | Array<number>>, offset: number, scale: number, result: Matrix): void;
2942
+ static FromFloat32ArrayToRefScaled<T extends Matrix>(array: DeepImmutable<Float32Array | Array<number>>, offset: number, scale: number, result: T): T;
2849
2943
  /**
2850
2944
  * Gets an identity matrix that must not be updated
2851
2945
  */
@@ -2869,6 +2963,7 @@ export declare class Matrix {
2869
2963
  * @param initialM43 defines 3rd value of 4th row
2870
2964
  * @param initialM44 defines 4th value of 4th row
2871
2965
  * @param result defines the target matrix
2966
+ * @returns result input
2872
2967
  */
2873
2968
  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
2969
  /**
@@ -2906,8 +3001,9 @@ export declare class Matrix {
2906
3001
  * @param rotation defines the rotation quaternion
2907
3002
  * @param translation defines the translation vector3
2908
3003
  * @param result defines the target matrix
3004
+ * @returns result input
2909
3005
  */
2910
- static ComposeToRef(scale: DeepImmutable<Vector3>, rotation: DeepImmutable<Quaternion>, translation: DeepImmutable<Vector3>, result: Matrix): void;
3006
+ static ComposeToRef<T extends Matrix>(scale: DeepImmutable<Vector3>, rotation: DeepImmutable<Quaternion>, translation: DeepImmutable<Vector3>, result: T): T;
2911
3007
  /**
2912
3008
  * Creates a new identity matrix
2913
3009
  * @returns a new identity matrix
@@ -2916,8 +3012,9 @@ export declare class Matrix {
2916
3012
  /**
2917
3013
  * Creates a new identity matrix and stores the result in a given matrix
2918
3014
  * @param result defines the target matrix
3015
+ * @returns result input
2919
3016
  */
2920
- static IdentityToRef(result: Matrix): void;
3017
+ static IdentityToRef<T extends Matrix>(result: T): T;
2921
3018
  /**
2922
3019
  * Creates a new zero matrix
2923
3020
  * @returns a new zero matrix
@@ -2934,13 +3031,14 @@ export declare class Matrix {
2934
3031
  * @param source defines the source matrix
2935
3032
  * @returns the new matrix
2936
3033
  */
2937
- static Invert(source: DeepImmutable<Matrix>): Matrix;
3034
+ static Invert<T extends Matrix>(source: DeepImmutable<T>): T;
2938
3035
  /**
2939
3036
  * Creates a new rotation matrix for "angle" radians around the X axis and stores it in a given matrix
2940
3037
  * @param angle defines the angle (in radians) to use
2941
3038
  * @param result defines the target matrix
3039
+ * @returns result input
2942
3040
  */
2943
- static RotationXToRef(angle: number, result: Matrix): void;
3041
+ static RotationXToRef<T extends Matrix>(angle: number, result: T): T;
2944
3042
  /**
2945
3043
  * Creates a new rotation matrix for "angle" radians around the Y axis
2946
3044
  * @param angle defines the angle (in radians) to use
@@ -2951,8 +3049,9 @@ export declare class Matrix {
2951
3049
  * Creates a new rotation matrix for "angle" radians around the Y axis and stores it in a given matrix
2952
3050
  * @param angle defines the angle (in radians) to use
2953
3051
  * @param result defines the target matrix
3052
+ * @returns result input
2954
3053
  */
2955
- static RotationYToRef(angle: number, result: Matrix): void;
3054
+ static RotationYToRef<T extends Matrix>(angle: number, result: T): T;
2956
3055
  /**
2957
3056
  * Creates a new rotation matrix for "angle" radians around the Z axis
2958
3057
  * @param angle defines the angle (in radians) to use
@@ -2963,8 +3062,9 @@ export declare class Matrix {
2963
3062
  * Creates a new rotation matrix for "angle" radians around the Z axis and stores it in a given matrix
2964
3063
  * @param angle defines the angle (in radians) to use
2965
3064
  * @param result defines the target matrix
3065
+ * @returns result input
2966
3066
  */
2967
- static RotationZToRef(angle: number, result: Matrix): void;
3067
+ static RotationZToRef<T extends Matrix>(angle: number, result: T): T;
2968
3068
  /**
2969
3069
  * Creates a new rotation matrix for "angle" radians around the given axis
2970
3070
  * @param axis defines the axis to use
@@ -2977,16 +3077,18 @@ export declare class Matrix {
2977
3077
  * @param axis defines the axis to use
2978
3078
  * @param angle defines the angle (in radians) to use
2979
3079
  * @param result defines the target matrix
3080
+ * @returns result input
2980
3081
  */
2981
- static RotationAxisToRef(axis: DeepImmutable<Vector3>, angle: number, result: Matrix): void;
3082
+ static RotationAxisToRef<T extends Matrix>(axis: DeepImmutable<Vector3>, angle: number, result: T): T;
2982
3083
  /**
2983
3084
  * Takes normalised vectors and returns a rotation matrix to align "from" with "to".
2984
3085
  * Taken from http://www.iquilezles.org/www/articles/noacos/noacos.htm
2985
3086
  * @param from defines the vector to align
2986
3087
  * @param to defines the vector to align to
2987
3088
  * @param result defines the target matrix
3089
+ * @returns result input
2988
3090
  */
2989
- static RotationAlignToRef(from: DeepImmutable<Vector3>, to: DeepImmutable<Vector3>, result: Matrix): void;
3091
+ static RotationAlignToRef<T extends Matrix>(from: DeepImmutable<Vector3>, to: DeepImmutable<Vector3>, result: T): T;
2990
3092
  /**
2991
3093
  * Creates a rotation matrix
2992
3094
  * @param yaw defines the yaw angle in radians (Y axis)
@@ -3001,8 +3103,9 @@ export declare class Matrix {
3001
3103
  * @param pitch defines the pitch angle in radians (X axis)
3002
3104
  * @param roll defines the roll angle in radians (Z axis)
3003
3105
  * @param result defines the target matrix
3106
+ * @returns result input
3004
3107
  */
3005
- static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Matrix): void;
3108
+ static RotationYawPitchRollToRef<T extends Matrix>(yaw: number, pitch: number, roll: number, result: T): T;
3006
3109
  /**
3007
3110
  * Creates a scaling matrix
3008
3111
  * @param x defines the scale factor on X axis
@@ -3017,8 +3120,9 @@ export declare class Matrix {
3017
3120
  * @param y defines the scale factor on Y axis
3018
3121
  * @param z defines the scale factor on Z axis
3019
3122
  * @param result defines the target matrix
3123
+ * @returns result input
3020
3124
  */
3021
- static ScalingToRef(x: number, y: number, z: number, result: Matrix): void;
3125
+ static ScalingToRef<T extends Matrix>(x: number, y: number, z: number, result: T): T;
3022
3126
  /**
3023
3127
  * Creates a translation matrix
3024
3128
  * @param x defines the translation on X axis
@@ -3033,8 +3137,9 @@ export declare class Matrix {
3033
3137
  * @param y defines the translation on Y axis
3034
3138
  * @param z defines the translationon Z axis
3035
3139
  * @param result defines the target matrix
3140
+ * @returns result input
3036
3141
  */
3037
- static TranslationToRef(x: number, y: number, z: number, result: Matrix): void;
3142
+ static TranslationToRef<T extends Matrix>(x: number, y: number, z: number, result: T): T;
3038
3143
  /**
3039
3144
  * Returns a new Matrix whose values are the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
3040
3145
  * @param startValue defines the start value
@@ -3042,15 +3147,16 @@ export declare class Matrix {
3042
3147
  * @param gradient defines the gradient factor
3043
3148
  * @returns the new matrix
3044
3149
  */
3045
- static Lerp(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number): Matrix;
3150
+ static Lerp<T extends Matrix>(startValue: DeepImmutable<T>, endValue: DeepImmutable<Matrix>, gradient: number): T;
3046
3151
  /**
3047
3152
  * Set the given matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".
3048
3153
  * @param startValue defines the start value
3049
3154
  * @param endValue defines the end value
3050
3155
  * @param gradient defines the gradient factor
3051
3156
  * @param result defines the Matrix object where to store data
3157
+ * @returns result input
3052
3158
  */
3053
- static LerpToRef(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result: Matrix): void;
3159
+ static LerpToRef<T extends Matrix>(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result: T): T;
3054
3160
  /**
3055
3161
  * Builds a new matrix whose values are computed by:
3056
3162
  * * decomposing the the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
@@ -3061,7 +3167,7 @@ export declare class Matrix {
3061
3167
  * @param gradient defines the gradient between the two matrices
3062
3168
  * @returns the new matrix
3063
3169
  */
3064
- static DecomposeLerp(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number): Matrix;
3170
+ static DecomposeLerp<T extends Matrix>(startValue: DeepImmutable<T>, endValue: DeepImmutable<Matrix>, gradient: number): T;
3065
3171
  /**
3066
3172
  * Update a matrix to values which are computed by:
3067
3173
  * * decomposing the the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
@@ -3071,8 +3177,9 @@ export declare class Matrix {
3071
3177
  * @param endValue defines the second matrix
3072
3178
  * @param gradient defines the gradient between the two matrices
3073
3179
  * @param result defines the target matrix
3180
+ * @returns result input
3074
3181
  */
3075
- static DecomposeLerpToRef(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result: Matrix): void;
3182
+ static DecomposeLerpToRef<T extends Matrix>(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result: T): T;
3076
3183
  /**
3077
3184
  * 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
3185
  * This function works in left handed mode
@@ -3089,6 +3196,7 @@ export declare class Matrix {
3089
3196
  * @param target defines where the entity should look at
3090
3197
  * @param up defines the up vector for the entity
3091
3198
  * @param result defines the target matrix
3199
+ * @returns result input
3092
3200
  */
3093
3201
  static LookAtLHToRef(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: Matrix): void;
3094
3202
  /**
@@ -3107,8 +3215,9 @@ export declare class Matrix {
3107
3215
  * @param target defines where the entity should look at
3108
3216
  * @param up defines the up vector for the entity
3109
3217
  * @param result defines the target matrix
3218
+ * @returns result input
3110
3219
  */
3111
- static LookAtRHToRef(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: Matrix): void;
3220
+ static LookAtRHToRef<T extends Matrix>(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T;
3112
3221
  /**
3113
3222
  * 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
3223
  * This function works in left handed mode
@@ -3123,8 +3232,9 @@ export declare class Matrix {
3123
3232
  * @param forward defines the forward direction - Must be normalized and orthogonal to up.
3124
3233
  * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
3125
3234
  * @param result defines the target matrix
3235
+ * @returns result input
3126
3236
  */
3127
- static LookDirectionLHToRef(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: Matrix): void;
3237
+ static LookDirectionLHToRef<T extends Matrix>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T;
3128
3238
  /**
3129
3239
  * 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
3240
  * This function works in right handed mode
@@ -3139,8 +3249,9 @@ export declare class Matrix {
3139
3249
  * @param forward defines the forward direction - Must be normalized and orthogonal to up.
3140
3250
  * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.
3141
3251
  * @param result defines the target matrix
3252
+ * @returns result input
3142
3253
  */
3143
- static LookDirectionRHToRef(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: Matrix): void;
3254
+ static LookDirectionRHToRef<T extends Matrix>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T;
3144
3255
  /**
3145
3256
  * Create a left-handed orthographic projection matrix
3146
3257
  * @param width defines the viewport width
@@ -3159,8 +3270,9 @@ export declare class Matrix {
3159
3270
  * @param zfar defines the far clip plane
3160
3271
  * @param result defines the target matrix
3161
3272
  * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
3273
+ * @returns result input
3162
3274
  */
3163
- static OrthoLHToRef(width: number, height: number, znear: number, zfar: number, result: Matrix, halfZRange?: boolean): void;
3275
+ static OrthoLHToRef<T extends Matrix>(width: number, height: number, znear: number, zfar: number, result: T, halfZRange?: boolean): T;
3164
3276
  /**
3165
3277
  * Create a left-handed orthographic projection matrix
3166
3278
  * @param left defines the viewport left coordinate
@@ -3183,8 +3295,9 @@ export declare class Matrix {
3183
3295
  * @param zfar defines the far clip plane
3184
3296
  * @param result defines the target matrix
3185
3297
  * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
3298
+ * @returns result input
3186
3299
  */
3187
- static OrthoOffCenterLHToRef(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: Matrix, halfZRange?: boolean): void;
3300
+ static OrthoOffCenterLHToRef<T extends Matrix>(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: T, halfZRange?: boolean): T;
3188
3301
  /**
3189
3302
  * Creates a right-handed orthographic projection matrix
3190
3303
  * @param left defines the viewport left coordinate
@@ -3207,8 +3320,9 @@ export declare class Matrix {
3207
3320
  * @param zfar defines the far clip plane
3208
3321
  * @param result defines the target matrix
3209
3322
  * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
3323
+ * @returns result input
3210
3324
  */
3211
- static OrthoOffCenterRHToRef(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: Matrix, halfZRange?: boolean): void;
3325
+ static OrthoOffCenterRHToRef<T extends Matrix>(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: T, halfZRange?: boolean): T;
3212
3326
  /**
3213
3327
  * Creates a left-handed perspective projection matrix
3214
3328
  * @param width defines the viewport width
@@ -3243,8 +3357,9 @@ export declare class Matrix {
3243
3357
  * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
3244
3358
  * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
3245
3359
  * @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)
3360
+ * @returns result input
3246
3361
  */
3247
- static PerspectiveFovLHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number, reverseDepthBufferMode?: boolean): void;
3362
+ 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
3363
  /**
3249
3364
  * Stores a left-handed perspective projection into a given matrix with depth reversed
3250
3365
  * @param fov defines the horizontal field of view
@@ -3255,8 +3370,9 @@ export declare class Matrix {
3255
3370
  * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
3256
3371
  * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
3257
3372
  * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
3373
+ * @returns result input
3258
3374
  */
3259
- static PerspectiveFovReverseLHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): void;
3375
+ static PerspectiveFovReverseLHToRef<T extends Matrix>(fov: number, aspect: number, znear: number, zfar: number, result: T, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): T;
3260
3376
  /**
3261
3377
  * Creates a right-handed perspective projection matrix
3262
3378
  * @param fov defines the horizontal field of view
@@ -3280,8 +3396,9 @@ export declare class Matrix {
3280
3396
  * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
3281
3397
  * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
3282
3398
  * @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)
3399
+ * @returns result input
3283
3400
  */
3284
- static PerspectiveFovRHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number, reverseDepthBufferMode?: boolean): void;
3401
+ 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
3402
  /**
3286
3403
  * Stores a right-handed perspective projection into a given matrix
3287
3404
  * @param fov defines the horizontal field of view
@@ -3292,8 +3409,9 @@ export declare class Matrix {
3292
3409
  * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally
3293
3410
  * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
3294
3411
  * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
3412
+ * @returns result input
3295
3413
  */
3296
- static PerspectiveFovReverseRHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): void;
3414
+ static PerspectiveFovReverseRHToRef<T extends Matrix>(fov: number, aspect: number, znear: number, zfar: number, result: T, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): T;
3297
3415
  /**
3298
3416
  * Stores a perspective projection for WebVR info a given matrix
3299
3417
  * @param fov defines the field of view
@@ -3307,13 +3425,14 @@ export declare class Matrix {
3307
3425
  * @param rightHanded defines if the matrix must be in right-handed mode (false by default)
3308
3426
  * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)
3309
3427
  * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)
3428
+ * @returns result input
3310
3429
  */
3311
- static PerspectiveFovWebVRToRef(fov: {
3430
+ static PerspectiveFovWebVRToRef<T extends Matrix>(fov: {
3312
3431
  upDegrees: number;
3313
3432
  downDegrees: number;
3314
3433
  leftDegrees: number;
3315
3434
  rightDegrees: number;
3316
- }, znear: number, zfar: number, result: Matrix, rightHanded?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): void;
3435
+ }, znear: number, zfar: number, result: T, rightHanded?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): T;
3317
3436
  /**
3318
3437
  * Computes a complete transformation matrix
3319
3438
  * @param viewport defines the viewport to use
@@ -3324,7 +3443,7 @@ export declare class Matrix {
3324
3443
  * @param zmax defines the far clip plane
3325
3444
  * @returns the transformation matrix
3326
3445
  */
3327
- static GetFinalMatrix(viewport: DeepImmutable<Viewport>, world: DeepImmutable<Matrix>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>, zmin: number, zmax: number): Matrix;
3446
+ static GetFinalMatrix<T extends Matrix>(viewport: DeepImmutable<Viewport>, world: DeepImmutable<T>, view: DeepImmutable<Matrix>, projection: DeepImmutable<Matrix>, zmin: number, zmax: number): T;
3328
3447
  /**
3329
3448
  * Extracts a 2x2 matrix from a given matrix and store the result in a Float32Array
3330
3449
  * @param matrix defines the matrix to use
@@ -3342,13 +3461,14 @@ export declare class Matrix {
3342
3461
  * @param matrix defines the matrix to transpose
3343
3462
  * @returns the new matrix
3344
3463
  */
3345
- static Transpose(matrix: DeepImmutable<Matrix>): Matrix;
3464
+ static Transpose<T extends Matrix>(matrix: DeepImmutable<T>): T;
3346
3465
  /**
3347
3466
  * Compute the transpose of a matrix and store it in a target matrix
3348
3467
  * @param matrix defines the matrix to transpose
3349
3468
  * @param result defines the target matrix
3469
+ * @returns result input
3350
3470
  */
3351
- static TransposeToRef(matrix: DeepImmutable<Matrix>, result: Matrix): void;
3471
+ static TransposeToRef<T extends Matrix>(matrix: DeepImmutable<Matrix>, result: T): T;
3352
3472
  /**
3353
3473
  * Computes a reflection matrix from a plane
3354
3474
  * @param plane defines the reflection plane
@@ -3359,22 +3479,25 @@ export declare class Matrix {
3359
3479
  * Computes a reflection matrix from a plane
3360
3480
  * @param plane defines the reflection plane
3361
3481
  * @param result defines the target matrix
3482
+ * @returns result input
3362
3483
  */
3363
- static ReflectionToRef(plane: DeepImmutable<IPlaneLike>, result: Matrix): void;
3484
+ static ReflectionToRef<T extends Matrix>(plane: DeepImmutable<IPlaneLike>, result: T): T;
3364
3485
  /**
3365
3486
  * Sets the given matrix as a rotation matrix composed from the 3 left handed axes
3366
3487
  * @param xaxis defines the value of the 1st axis
3367
3488
  * @param yaxis defines the value of the 2nd axis
3368
3489
  * @param zaxis defines the value of the 3rd axis
3369
3490
  * @param result defines the target matrix
3491
+ * @returns result input
3370
3492
  */
3371
- static FromXYZAxesToRef(xaxis: DeepImmutable<Vector3>, yaxis: DeepImmutable<Vector3>, zaxis: DeepImmutable<Vector3>, result: Matrix): void;
3493
+ static FromXYZAxesToRef<T extends Matrix>(xaxis: DeepImmutable<Vector3>, yaxis: DeepImmutable<Vector3>, zaxis: DeepImmutable<Vector3>, result: T): T;
3372
3494
  /**
3373
3495
  * Creates a rotation matrix from a quaternion and stores it in a target matrix
3374
3496
  * @param quat defines the quaternion to use
3375
3497
  * @param result defines the target matrix
3498
+ * @returns result input
3376
3499
  */
3377
- static FromQuaternionToRef(quat: DeepImmutable<Quaternion>, result: Matrix): void;
3500
+ static FromQuaternionToRef<T extends Matrix>(quat: DeepImmutable<Quaternion>, result: T): T;
3378
3501
  }
3379
3502
  /**
3380
3503
  * @internal