@babylonjs/core 6.45.0 → 6.46.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 (235) hide show
  1. package/Animations/animation.js +1 -1
  2. package/Animations/animation.js.map +1 -1
  3. package/BakedVertexAnimation/bakedVertexAnimationManager.js +2 -1
  4. package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
  5. package/Bones/skeleton.js +2 -2
  6. package/Bones/skeleton.js.map +1 -1
  7. package/Cameras/camera.d.ts +3 -3
  8. package/Cameras/camera.js +2 -1
  9. package/Cameras/camera.js.map +1 -1
  10. package/Cameras/cameraInputsManager.js +1 -1
  11. package/Cameras/cameraInputsManager.js.map +1 -1
  12. package/Cameras/targetCamera.js +4 -0
  13. package/Cameras/targetCamera.js.map +1 -1
  14. package/Compute/computeShader.d.ts +4 -2
  15. package/Compute/computeShader.js +7 -3
  16. package/Compute/computeShader.js.map +1 -1
  17. package/Debug/directionalLightFrustumViewer.js +6 -6
  18. package/Debug/directionalLightFrustumViewer.js.map +1 -1
  19. package/Engines/Extensions/engine.computeShader.d.ts +2 -1
  20. package/Engines/Extensions/engine.computeShader.js +1 -0
  21. package/Engines/Extensions/engine.computeShader.js.map +1 -1
  22. package/Engines/Extensions/engine.rawTexture.js +3 -3
  23. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  24. package/Engines/Native/nativePipelineContext.js +1 -1
  25. package/Engines/Native/nativePipelineContext.js.map +1 -1
  26. package/Engines/WebGL/webGLPipelineContext.js +1 -1
  27. package/Engines/WebGL/webGLPipelineContext.js.map +1 -1
  28. package/Engines/WebGPU/webgpuComputeContext.js +7 -3
  29. package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
  30. package/Engines/engine.d.ts +1 -1
  31. package/Engines/thinEngine.js +2 -2
  32. package/Engines/thinEngine.js.map +1 -1
  33. package/Engines/webgpuEngine.js +2 -15
  34. package/Engines/webgpuEngine.js.map +1 -1
  35. package/Layers/glowLayer.js +2 -1
  36. package/Layers/glowLayer.js.map +1 -1
  37. package/Layers/highlightLayer.js +2 -1
  38. package/Layers/highlightLayer.js.map +1 -1
  39. package/Lights/light.js +2 -1
  40. package/Lights/light.js.map +1 -1
  41. package/Loading/Plugins/babylonFileLoader.js +9 -0
  42. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  43. package/Loading/sceneLoader.d.ts +6 -1
  44. package/Loading/sceneLoader.js +6 -5
  45. package/Loading/sceneLoader.js.map +1 -1
  46. package/Materials/Background/backgroundMaterial.js +2 -1
  47. package/Materials/Background/backgroundMaterial.js.map +1 -1
  48. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +1 -1
  49. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  50. package/Materials/Node/nodeMaterial.d.ts +2 -1
  51. package/Materials/Node/nodeMaterial.js +5 -1
  52. package/Materials/Node/nodeMaterial.js.map +1 -1
  53. package/Materials/PBR/pbrBaseMaterial.d.ts +1 -1
  54. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  55. package/Materials/PBR/pbrMaterial.js +2 -1
  56. package/Materials/PBR/pbrMaterial.js.map +1 -1
  57. package/Materials/PBR/pbrMetallicRoughnessMaterial.js +2 -1
  58. package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
  59. package/Materials/PBR/pbrSpecularGlossinessMaterial.js +2 -1
  60. package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
  61. package/Materials/Textures/baseTexture.js +2 -1
  62. package/Materials/Textures/baseTexture.js.map +1 -1
  63. package/Materials/Textures/cubeTexture.js +2 -1
  64. package/Materials/Textures/cubeTexture.js.map +1 -1
  65. package/Materials/Textures/rawCubeTexture.js +1 -1
  66. package/Materials/Textures/rawCubeTexture.js.map +1 -1
  67. package/Materials/Textures/texture.js +2 -1
  68. package/Materials/Textures/texture.js.map +1 -1
  69. package/Materials/colorCurves.d.ts +1 -1
  70. package/Materials/colorCurves.functions.d.ts +5 -0
  71. package/Materials/colorCurves.functions.js +8 -0
  72. package/Materials/colorCurves.functions.js.map +1 -0
  73. package/Materials/colorCurves.js +8 -8
  74. package/Materials/colorCurves.js.map +1 -1
  75. package/Materials/fresnelParameters.js +1 -1
  76. package/Materials/fresnelParameters.js.map +1 -1
  77. package/Materials/imageProcessingConfiguration.d.ts +3 -48
  78. package/Materials/imageProcessingConfiguration.defines.d.ts +46 -0
  79. package/Materials/imageProcessingConfiguration.defines.js +27 -0
  80. package/Materials/imageProcessingConfiguration.defines.js.map +1 -0
  81. package/Materials/imageProcessingConfiguration.functions.d.ts +13 -0
  82. package/Materials/imageProcessingConfiguration.functions.js +41 -0
  83. package/Materials/imageProcessingConfiguration.functions.js.map +1 -0
  84. package/Materials/imageProcessingConfiguration.js +18 -69
  85. package/Materials/imageProcessingConfiguration.js.map +1 -1
  86. package/Materials/material.js +2 -1
  87. package/Materials/material.js.map +1 -1
  88. package/Materials/materialHelper.d.ts +33 -33
  89. package/Materials/materialHelper.js +244 -286
  90. package/Materials/materialHelper.js.map +1 -1
  91. package/Materials/materialPluginBase.js +2 -1
  92. package/Materials/materialPluginBase.js.map +1 -1
  93. package/Materials/materialStencilState.js +2 -1
  94. package/Materials/materialStencilState.js.map +1 -1
  95. package/Materials/shaderMaterial.js +1 -1
  96. package/Materials/shaderMaterial.js.map +1 -1
  97. package/Materials/standardMaterial.d.ts +1 -1
  98. package/Materials/standardMaterial.js +2 -1
  99. package/Materials/standardMaterial.js.map +1 -1
  100. package/Materials/uniformBuffer.js +2 -2
  101. package/Materials/uniformBuffer.js.map +1 -1
  102. package/Maths/math.color.d.ts +392 -66
  103. package/Maths/math.color.js +541 -65
  104. package/Maths/math.color.js.map +1 -1
  105. package/Maths/math.like.d.ts +17 -28
  106. package/Maths/math.like.js.map +1 -1
  107. package/Maths/math.plane.d.ts +2 -1
  108. package/Maths/math.plane.js.map +1 -1
  109. package/Maths/math.polar.d.ts +1 -1
  110. package/Maths/math.polar.js.map +1 -1
  111. package/Maths/math.scalar.d.ts +6 -6
  112. package/Maths/math.scalar.functions.d.ts +51 -0
  113. package/Maths/math.scalar.functions.js +80 -0
  114. package/Maths/math.scalar.functions.js.map +1 -0
  115. package/Maths/math.scalar.js +48 -73
  116. package/Maths/math.scalar.js.map +1 -1
  117. package/Maths/math.vector.d.ts +571 -72
  118. package/Maths/math.vector.js +917 -119
  119. package/Maths/math.vector.js.map +1 -1
  120. package/Maths/math.viewport.d.ts +2 -1
  121. package/Maths/math.viewport.js.map +1 -1
  122. package/Maths/tensor.d.ts +411 -0
  123. package/Maths/tensor.js +3 -0
  124. package/Maths/tensor.js.map +1 -0
  125. package/Meshes/Node/Blocks/Set/setColorsBlock.js +20 -4
  126. package/Meshes/Node/Blocks/Set/setColorsBlock.js.map +1 -1
  127. package/Meshes/Node/nodeGeometry.js +2 -1
  128. package/Meshes/Node/nodeGeometry.js.map +1 -1
  129. package/Meshes/mesh.js +2 -2
  130. package/Meshes/mesh.js.map +1 -1
  131. package/Meshes/mesh.vertexData.d.ts +4 -0
  132. package/Meshes/mesh.vertexData.js +10 -0
  133. package/Meshes/mesh.vertexData.js.map +1 -1
  134. package/Meshes/transformNode.js +2 -1
  135. package/Meshes/transformNode.js.map +1 -1
  136. package/Misc/arrayTools.d.ts +2 -19
  137. package/Misc/arrayTools.js.map +1 -1
  138. package/Misc/decorators.d.ts +0 -80
  139. package/Misc/decorators.functions.d.ts +7 -0
  140. package/Misc/decorators.functions.js +52 -0
  141. package/Misc/decorators.functions.js.map +1 -0
  142. package/Misc/decorators.js +2 -318
  143. package/Misc/decorators.js.map +1 -1
  144. package/Misc/decorators.serialization.d.ts +81 -0
  145. package/Misc/decorators.serialization.js +269 -0
  146. package/Misc/decorators.serialization.js.map +1 -0
  147. package/Misc/index.d.ts +1 -0
  148. package/Misc/index.js +1 -0
  149. package/Misc/index.js.map +1 -1
  150. package/Misc/sceneRecorder.js +1 -1
  151. package/Misc/sceneRecorder.js.map +1 -1
  152. package/Misc/sceneSerializer.js +8 -1
  153. package/Misc/sceneSerializer.js.map +1 -1
  154. package/Misc/tools.functions.d.ts +14 -0
  155. package/Misc/tools.functions.js +23 -0
  156. package/Misc/tools.functions.js.map +1 -0
  157. package/Misc/tools.js +5 -6
  158. package/Misc/tools.js.map +1 -1
  159. package/Morph/morphTarget.js +2 -1
  160. package/Morph/morphTarget.js.map +1 -1
  161. package/Particles/EmitterTypes/boxParticleEmitter.js +8 -8
  162. package/Particles/EmitterTypes/boxParticleEmitter.js.map +1 -1
  163. package/Particles/baseParticleSystem.d.ts +8 -11
  164. package/Particles/baseParticleSystem.js +9 -40
  165. package/Particles/baseParticleSystem.js.map +1 -1
  166. package/Particles/gpuParticleSystem.d.ts +71 -1
  167. package/Particles/gpuParticleSystem.js +102 -1
  168. package/Particles/gpuParticleSystem.js.map +1 -1
  169. package/Particles/particle.d.ts +3 -3
  170. package/Particles/particle.js +3 -3
  171. package/Particles/particle.js.map +1 -1
  172. package/Particles/particleSystem.d.ts +81 -455
  173. package/Particles/particleSystem.functions.d.ts +61 -0
  174. package/Particles/particleSystem.functions.js +79 -0
  175. package/Particles/particleSystem.functions.js.map +1 -0
  176. package/Particles/particleSystem.js +390 -1984
  177. package/Particles/particleSystem.js.map +1 -1
  178. package/Particles/thinParticleSystem.d.ts +485 -0
  179. package/Particles/thinParticleSystem.js +1768 -0
  180. package/Particles/thinParticleSystem.js.map +1 -0
  181. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js +2 -1
  182. package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
  183. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -1
  184. package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
  185. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js +2 -1
  186. package/PostProcesses/RenderPipeline/Pipelines/ssrRenderingPipeline.js.map +1 -1
  187. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +2 -1
  188. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  189. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js +2 -1
  190. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js.map +1 -1
  191. package/PostProcesses/blackAndWhitePostProcess.js +2 -1
  192. package/PostProcesses/blackAndWhitePostProcess.js.map +1 -1
  193. package/PostProcesses/blurPostProcess.js +2 -1
  194. package/PostProcesses/blurPostProcess.js.map +1 -1
  195. package/PostProcesses/chromaticAberrationPostProcess.js +2 -1
  196. package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
  197. package/PostProcesses/colorCorrectionPostProcess.js +2 -1
  198. package/PostProcesses/colorCorrectionPostProcess.js.map +1 -1
  199. package/PostProcesses/convolutionPostProcess.js +2 -1
  200. package/PostProcesses/convolutionPostProcess.js.map +1 -1
  201. package/PostProcesses/displayPassPostProcess.js +1 -1
  202. package/PostProcesses/displayPassPostProcess.js.map +1 -1
  203. package/PostProcesses/filterPostProcess.js +2 -1
  204. package/PostProcesses/filterPostProcess.js.map +1 -1
  205. package/PostProcesses/fxaaPostProcess.js +1 -1
  206. package/PostProcesses/fxaaPostProcess.js.map +1 -1
  207. package/PostProcesses/grainPostProcess.js +2 -1
  208. package/PostProcesses/grainPostProcess.js.map +1 -1
  209. package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
  210. package/PostProcesses/motionBlurPostProcess.js +2 -1
  211. package/PostProcesses/motionBlurPostProcess.js.map +1 -1
  212. package/PostProcesses/passPostProcess.js +1 -1
  213. package/PostProcesses/passPostProcess.js.map +1 -1
  214. package/PostProcesses/postProcess.js +2 -1
  215. package/PostProcesses/postProcess.js.map +1 -1
  216. package/PostProcesses/refractionPostProcess.js +2 -1
  217. package/PostProcesses/refractionPostProcess.js.map +1 -1
  218. package/PostProcesses/screenSpaceCurvaturePostProcess.js +2 -1
  219. package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
  220. package/PostProcesses/screenSpaceReflectionPostProcess.js +2 -1
  221. package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
  222. package/PostProcesses/sharpenPostProcess.js +2 -1
  223. package/PostProcesses/sharpenPostProcess.js.map +1 -1
  224. package/Probes/reflectionProbe.js +2 -1
  225. package/Probes/reflectionProbe.js.map +1 -1
  226. package/Sprites/spriteManager.d.ts +4 -0
  227. package/Sprites/spriteManager.js.map +1 -1
  228. package/XR/features/WebXRControllerTeleportation.d.ts +9 -0
  229. package/XR/features/WebXRControllerTeleportation.js +75 -31
  230. package/XR/features/WebXRControllerTeleportation.js.map +1 -1
  231. package/node.js +2 -1
  232. package/node.js.map +1 -1
  233. package/package.json +1 -1
  234. package/types.d.ts +105 -0
  235. package/types.js.map +1 -1
@@ -1,8 +1,10 @@
1
- import type { DeepImmutable, FloatArray } from "../types";
1
+ import type { DeepImmutable, FloatArray, Tuple } from "../types";
2
+ import type { Tensor } from "./tensor";
3
+ import type { IColor3Like, IColor4Like } from "./math.like";
2
4
  /**
3
5
  * Class used to hold a RGB color
4
6
  */
5
- export declare class Color3 {
7
+ export declare class Color3 implements Tensor<Tuple<number, 3>>, IColor3Like {
6
8
  /**
7
9
  * Defines the red component (between 0 and 1, default is 0)
8
10
  */
@@ -15,6 +17,14 @@ export declare class Color3 {
15
17
  * Defines the blue component (between 0 and 1, default is 0)
16
18
  */
17
19
  b: number;
20
+ /**
21
+ * @see Tensor.dimension
22
+ */
23
+ readonly dimension: [3];
24
+ /**
25
+ * @see Tensor.rank
26
+ */
27
+ readonly rank: 1;
18
28
  /**
19
29
  * Creates a new Color3 object from red, green, blue values, all between 0 and 1
20
30
  * @param r defines the red component (between 0 and 1, default is 0)
@@ -55,14 +65,14 @@ export declare class Color3 {
55
65
  * @param index defines an optional index in the target array to define where to start storing values
56
66
  * @returns the current Color3 object
57
67
  */
58
- toArray(array: FloatArray, index?: number): Color3;
68
+ toArray(array: FloatArray, index?: number): this;
59
69
  /**
60
70
  * Update the current color with values stored in an array from the starting index of the given array
61
71
  * @param array defines the source array
62
72
  * @param offset defines an offset in the source array
63
73
  * @returns the current Color3 object
64
74
  */
65
- fromArray(array: DeepImmutable<ArrayLike<number>>, offset?: number): Color3;
75
+ fromArray(array: DeepImmutable<ArrayLike<number>>, offset?: number): this;
66
76
  /**
67
77
  * Returns a new Color4 object from the current Color3 and the given alpha
68
78
  * @param alpha defines the alpha component on the new Color4 object (default is 1)
@@ -73,7 +83,7 @@ export declare class Color3 {
73
83
  * Returns a new array populated with 3 numeric elements : red, green and blue values
74
84
  * @returns the new array
75
85
  */
76
- asArray(): number[];
86
+ asArray(): Tuple<number, 3>;
77
87
  /**
78
88
  * Returns the luminance value
79
89
  * @returns a float value
@@ -84,20 +94,105 @@ export declare class Color3 {
84
94
  * @param otherColor defines the second operand
85
95
  * @returns the new Color3 object
86
96
  */
87
- multiply(otherColor: DeepImmutable<Color3>): Color3;
97
+ multiply(otherColor: DeepImmutable<this>): this;
88
98
  /**
89
99
  * Multiply the rgb values of the Color3 and the given Color3 and stores the result in the object "result"
90
100
  * @param otherColor defines the second operand
91
101
  * @param result defines the Color3 object where to store the result
92
- * @returns the current Color3
102
+ * @returns the result Color3
103
+ */
104
+ multiplyToRef<T extends this>(otherColor: DeepImmutable<this>, result: T): T;
105
+ /**
106
+ * Multiplies the current Color3 coordinates by the given ones
107
+ * @param otherColor defines the second operand
108
+ * @returns the current updated Color3
109
+ */
110
+ multiplyInPlace(otherColor: DeepImmutable<Color3>): this;
111
+ /**
112
+ * Returns a new Color3 set with the result of the multiplication of the current Color3 coordinates by the given floats
113
+ * @param r defines the r coordinate of the operand
114
+ * @param g defines the g coordinate of the operand
115
+ * @param b defines the b coordinate of the operand
116
+ * @returns the new Color3
117
+ */
118
+ multiplyByFloats(r: number, g: number, b: number): this;
119
+ /**
120
+ * @internal
121
+ * Do not use
122
+ */
123
+ divide(_other: DeepImmutable<this>): this;
124
+ /**
125
+ * @internal
126
+ * Do not use
127
+ */
128
+ divideToRef<T extends this>(_other: DeepImmutable<this>, _result: T): T;
129
+ /**
130
+ * @internal
131
+ * Do not use
132
+ */
133
+ divideInPlace(_other: DeepImmutable<this>): this;
134
+ /**
135
+ * Updates the current Color3 with the minimal coordinate values between its and the given color ones
136
+ * @param other defines the second operand
137
+ * @returns the current updated Color3
138
+ */
139
+ minimizeInPlace(other: DeepImmutable<this>): this;
140
+ /**
141
+ * Updates the current Color3 with the maximal coordinate values between its and the given color ones.
142
+ * @param other defines the second operand
143
+ * @returns the current updated Color3
144
+ */
145
+ maximizeInPlace(other: DeepImmutable<this>): this;
146
+ /**
147
+ * Updates the current Color3 with the minimal coordinate values between its and the given coordinates
148
+ * @param r defines the r coordinate of the operand
149
+ * @param g defines the g coordinate of the operand
150
+ * @param b defines the b coordinate of the operand
151
+ * @returns the current updated Color3
152
+ */
153
+ minimizeInPlaceFromFloats(r: number, g: number, b: number): this;
154
+ /**
155
+ * Updates the current Color3 with the maximal coordinate values between its and the given coordinates.
156
+ * @param r defines the r coordinate of the operand
157
+ * @param g defines the g coordinate of the operand
158
+ * @param b defines the b coordinate of the operand
159
+ * @returns the current updated Color3
160
+ */
161
+ maximizeInPlaceFromFloats(r: number, g: number, b: number): this;
162
+ /**
163
+ * @internal
164
+ * Do not use
165
+ */
166
+ floorToRef<T extends this>(_result: T): T;
167
+ /**
168
+ * @internal
169
+ * Do not use
170
+ */
171
+ floor(): this;
172
+ /**
173
+ * @internal
174
+ * Do not use
175
+ */
176
+ fractToRef<T extends this>(_result: T): T;
177
+ /**
178
+ * @internal
179
+ * Do not use
93
180
  */
94
- multiplyToRef(otherColor: DeepImmutable<Color3>, result: Color3): Color3;
181
+ fract(): this;
95
182
  /**
96
183
  * Determines equality between Color3 objects
97
184
  * @param otherColor defines the second operand
98
185
  * @returns true if the rgb values are equal to the given ones
99
186
  */
100
- equals(otherColor: DeepImmutable<Color3>): boolean;
187
+ equals(otherColor: DeepImmutable<this>): boolean;
188
+ /**
189
+ * Alias for equalsToFloats
190
+ * @param r red color component
191
+ * @param g green color component
192
+ * @param b blue color component
193
+ * @returns boolean
194
+ */
195
+ equalsFloats(r: number, g: number, b: number): boolean;
101
196
  /**
102
197
  * Determines equality between the current Color3 object and a set of r,b,g values
103
198
  * @param r defines the red component to check
@@ -105,78 +200,137 @@ export declare class Color3 {
105
200
  * @param b defines the blue component to check
106
201
  * @returns true if the rgb values are equal to the given ones
107
202
  */
108
- equalsFloats(r: number, g: number, b: number): boolean;
203
+ equalsToFloats(r: number, g: number, b: number): boolean;
204
+ /**
205
+ * Returns true if the current Color3 and the given color coordinates are distant less than epsilon
206
+ * @param otherColor defines the second operand
207
+ * @param epsilon defines the minimal distance to define values as equals
208
+ * @returns true if both colors are distant less than epsilon
209
+ */
210
+ equalsWithEpsilon(otherColor: DeepImmutable<this>, epsilon?: number): boolean;
211
+ /**
212
+ * @internal
213
+ * Do not use
214
+ */
215
+ negate(): this;
216
+ /**
217
+ * @internal
218
+ * Do not use
219
+ */
220
+ negateInPlace(): this;
221
+ /**
222
+ * @internal
223
+ * Do not use
224
+ */
225
+ negateToRef<T extends this>(_result: T): T;
109
226
  /**
110
227
  * Creates a new Color3 with the current Color3 values multiplied by scale
111
228
  * @param scale defines the scaling factor to apply
112
229
  * @returns a new Color3 object
113
230
  */
114
- scale(scale: number): Color3;
231
+ scale(scale: number): this;
115
232
  /**
116
233
  * Multiplies the Color3 values by the float "scale"
117
234
  * @param scale defines the scaling factor to apply
118
235
  * @returns the current updated Color3
119
236
  */
120
- scaleInPlace(scale: number): Color3;
237
+ scaleInPlace(scale: number): this;
121
238
  /**
122
239
  * Multiplies the rgb values by scale and stores the result into "result"
123
240
  * @param scale defines the scaling factor
124
241
  * @param result defines the Color3 object where to store the result
125
- * @returns the unmodified current Color3
242
+ * @returns the result Color3
126
243
  */
127
- scaleToRef(scale: number, result: Color3): Color3;
244
+ scaleToRef<T extends this>(scale: number, result: T): T;
128
245
  /**
129
246
  * Scale the current Color3 values by a factor and add the result to a given Color3
130
247
  * @param scale defines the scale factor
131
248
  * @param result defines color to store the result into
132
- * @returns the unmodified current Color3
249
+ * @returns the result Color3
133
250
  */
134
- scaleAndAddToRef(scale: number, result: Color3): Color3;
251
+ scaleAndAddToRef<T extends this>(scale: number, result: T): T;
135
252
  /**
136
253
  * Clamps the rgb values by the min and max values and stores the result into "result"
137
254
  * @param min defines minimum clamping value (default is 0)
138
255
  * @param max defines maximum clamping value (default is 1)
139
256
  * @param result defines color to store the result into
140
- * @returns the original Color3
257
+ * @returns the result Color3
141
258
  */
142
- clampToRef(min: number | undefined, max: number | undefined, result: Color3): Color3;
259
+ clampToRef<T extends this>(min: number | undefined, max: number | undefined, result: T): T;
143
260
  /**
144
261
  * Creates a new Color3 set with the added values of the current Color3 and of the given one
145
262
  * @param otherColor defines the second operand
146
263
  * @returns the new Color3
147
264
  */
148
- add(otherColor: DeepImmutable<Color3>): Color3;
265
+ add(otherColor: DeepImmutable<this>): this;
266
+ /**
267
+ * Adds the given color to the current Color3
268
+ * @param otherColor defines the second operand
269
+ * @returns the current updated Color3
270
+ */
271
+ addInPlace(otherColor: DeepImmutable<this>): this;
272
+ /**
273
+ * Adds the given coordinates to the current Color3
274
+ * @param r defines the r coordinate of the operand
275
+ * @param g defines the g coordinate of the operand
276
+ * @param b defines the b coordinate of the operand
277
+ * @returns the current updated Color3
278
+ */
279
+ addInPlaceFromFloats(r: number, g: number, b: number): this;
149
280
  /**
150
281
  * Stores the result of the addition of the current Color3 and given one rgb values into "result"
151
282
  * @param otherColor defines the second operand
152
283
  * @param result defines Color3 object to store the result into
153
284
  * @returns the unmodified current Color3
154
285
  */
155
- addToRef(otherColor: DeepImmutable<Color3>, result: Color3): Color3;
286
+ addToRef<T extends this>(otherColor: DeepImmutable<this>, result: T): T;
156
287
  /**
157
288
  * Returns a new Color3 set with the subtracted values of the given one from the current Color3
158
289
  * @param otherColor defines the second operand
159
290
  * @returns the new Color3
160
291
  */
161
- subtract(otherColor: DeepImmutable<Color3>): Color3;
292
+ subtract(otherColor: DeepImmutable<this>): this;
162
293
  /**
163
294
  * Stores the result of the subtraction of given one from the current Color3 rgb values into "result"
164
295
  * @param otherColor defines the second operand
165
296
  * @param result defines Color3 object to store the result into
166
297
  * @returns the unmodified current Color3
167
298
  */
168
- subtractToRef(otherColor: DeepImmutable<Color3>, result: Color3): Color3;
299
+ subtractToRef<T extends this>(otherColor: DeepImmutable<this>, result: T): T;
300
+ /**
301
+ * Subtract the given color from the current Color3
302
+ * @param otherColor defines the second operand
303
+ * @returns the current updated Color3
304
+ */
305
+ subtractInPlace(otherColor: DeepImmutable<this>): this;
306
+ /**
307
+ * Returns a new Color3 set with the subtraction of the given floats from the current Color3 coordinates
308
+ * @param r defines the r coordinate of the operand
309
+ * @param g defines the g coordinate of the operand
310
+ * @param b defines the b coordinate of the operand
311
+ * @returns the resulting Color3
312
+ */
313
+ subtractFromFloats(r: number, g: number, b: number): this;
314
+ /**
315
+ * Subtracts the given floats from the current Color3 coordinates and set the given color "result" with this result
316
+ * @param r defines the r coordinate of the operand
317
+ * @param g defines the g coordinate of the operand
318
+ * @param b defines the b coordinate of the operand
319
+ * @param result defines the Color3 object where to store the result
320
+ * @returns the result
321
+ */
322
+ subtractFromFloatsToRef<T extends Color3>(r: number, g: number, b: number, result: T): T;
169
323
  /**
170
324
  * Copy the current object
171
325
  * @returns a new Color3 copied the current one
172
326
  */
173
- clone(): Color3;
327
+ clone(): this;
174
328
  /**
175
329
  * Copies the rgb values from the source in the current Color3
176
330
  * @param source defines the source Color3 object
177
331
  * @returns the updated Color3 object
178
332
  */
179
- copyFrom(source: DeepImmutable<Color3>): Color3;
333
+ copyFrom(source: DeepImmutable<this>): this;
180
334
  /**
181
335
  * Updates the Color3 rgb values from the given floats
182
336
  * @param r defines the red component to read from
@@ -184,7 +338,7 @@ export declare class Color3 {
184
338
  * @param b defines the blue component to read from
185
339
  * @returns the current Color3 object
186
340
  */
187
- copyFromFloats(r: number, g: number, b: number): Color3;
341
+ copyFromFloats(r: number, g: number, b: number): this;
188
342
  /**
189
343
  * Updates the Color3 rgb values from the given floats
190
344
  * @param r defines the red component to read from
@@ -192,7 +346,13 @@ export declare class Color3 {
192
346
  * @param b defines the blue component to read from
193
347
  * @returns the current Color3 object
194
348
  */
195
- set(r: number, g: number, b: number): Color3;
349
+ set(r: number, g: number, b: number): this;
350
+ /**
351
+ * Copies the given float to the current Color3 coordinates
352
+ * @param v defines the r, g and b coordinates of the operand
353
+ * @returns the current updated Color3
354
+ */
355
+ setAll(v: number): this;
196
356
  /**
197
357
  * Compute the Color3 hexadecimal code as a string
198
358
  * @returns a string containing the hexadecimal representation of the Color3 object
@@ -202,38 +362,38 @@ export declare class Color3 {
202
362
  * Converts current color in rgb space to HSV values
203
363
  * @returns a new color3 representing the HSV values
204
364
  */
205
- toHSV(): Color3;
365
+ toHSV(): this;
206
366
  /**
207
367
  * Converts current color in rgb space to HSV values
208
368
  * @param result defines the Color3 where to store the HSV values
209
369
  */
210
- toHSVToRef(result: Color3): void;
370
+ toHSVToRef(result: this): void;
211
371
  /**
212
372
  * Computes a new Color3 converted from the current one to linear space
213
373
  * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
214
374
  * @returns a new Color3 object
215
375
  */
216
- toLinearSpace(exact?: boolean): Color3;
376
+ toLinearSpace(exact?: boolean): this;
217
377
  /**
218
378
  * Converts the Color3 values to linear space and stores the result in "convertedColor"
219
379
  * @param convertedColor defines the Color3 object where to store the linear space version
220
380
  * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
221
381
  * @returns the unmodified Color3
222
382
  */
223
- toLinearSpaceToRef(convertedColor: Color3, exact?: boolean): Color3;
383
+ toLinearSpaceToRef(convertedColor: this, exact?: boolean): this;
224
384
  /**
225
385
  * Computes a new Color3 converted from the current one to gamma space
226
386
  * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
227
387
  * @returns a new Color3 object
228
388
  */
229
- toGammaSpace(exact?: boolean): Color3;
389
+ toGammaSpace(exact?: boolean): this;
230
390
  /**
231
391
  * Converts the Color3 values to gamma space and stores the result in "convertedColor"
232
392
  * @param convertedColor defines the Color3 object where to store the gamma space version
233
393
  * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
234
394
  * @returns the unmodified Color3
235
395
  */
236
- toGammaSpaceToRef(convertedColor: Color3, exact?: boolean): Color3;
396
+ toGammaSpaceToRef(convertedColor: this, exact?: boolean): this;
237
397
  private static _BlackReadOnly;
238
398
  /**
239
399
  * Converts Hue, saturation and value to a Color3 (RGB)
@@ -272,7 +432,7 @@ export declare class Color3 {
272
432
  */
273
433
  static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number | undefined, result: Color3): void;
274
434
  /**
275
- * Creates a new Color3 from integer values (< 256)
435
+ * Creates a new Color3 from integer values (\< 256)
276
436
  * @param r defines the red component to read from (value between 0 and 255)
277
437
  * @param g defines the green component to read from (value between 0 and 255)
278
438
  * @param b defines the blue component to read from (value between 0 and 255)
@@ -388,7 +548,7 @@ export declare class Color3 {
388
548
  /**
389
549
  * Class used to hold a RBGA color
390
550
  */
391
- export declare class Color4 {
551
+ export declare class Color4 implements Tensor<Tuple<number, 4>>, IColor4Like {
392
552
  /**
393
553
  * Defines the red component (between 0 and 1, default is 0)
394
554
  */
@@ -405,6 +565,14 @@ export declare class Color4 {
405
565
  * Defines the alpha component (between 0 and 1, default is 1)
406
566
  */
407
567
  a: number;
568
+ /**
569
+ * @see Tensor.dimension
570
+ */
571
+ readonly dimension: [4];
572
+ /**
573
+ * @see Tensor.rank
574
+ */
575
+ readonly rank: 1;
408
576
  /**
409
577
  * Creates a new Color4 object from red, green, blue values, all between 0 and 1
410
578
  * @param r defines the red component (between 0 and 1, default is 0)
@@ -429,103 +597,255 @@ export declare class Color4 {
429
597
  * Defines the alpha component (between 0 and 1, default is 1)
430
598
  */
431
599
  a?: number);
432
- /**
433
- * Adds in place the given Color4 values to the current Color4 object
434
- * @param right defines the second operand
435
- * @returns the current updated Color4 object
436
- */
437
- addInPlace(right: DeepImmutable<Color4>): Color4;
438
600
  /**
439
601
  * Creates a new array populated with 4 numeric elements : red, green, blue, alpha values
440
602
  * @returns the new array
441
603
  */
442
- asArray(): number[];
604
+ asArray(): Tuple<number, 4>;
443
605
  /**
444
606
  * Stores from the starting index in the given array the Color4 successive values
445
607
  * @param array defines the array where to store the r,g,b components
446
608
  * @param index defines an optional index in the target array to define where to start storing values
447
609
  * @returns the current Color4 object
448
610
  */
449
- toArray(array: FloatArray, index?: number): Color4;
611
+ toArray(array: FloatArray, index?: number): this;
450
612
  /**
451
613
  * Update the current color with values stored in an array from the starting index of the given array
452
614
  * @param array defines the source array
453
615
  * @param offset defines an offset in the source array
454
616
  * @returns the current Color4 object
455
617
  */
456
- fromArray(array: DeepImmutable<ArrayLike<number>>, offset?: number): Color4;
618
+ fromArray(array: DeepImmutable<ArrayLike<number>>, offset?: number): this;
457
619
  /**
458
620
  * Determines equality between Color4 objects
459
621
  * @param otherColor defines the second operand
460
622
  * @returns true if the rgba values are equal to the given ones
461
623
  */
462
- equals(otherColor: DeepImmutable<Color4>): boolean;
624
+ equals(otherColor: DeepImmutable<this>): boolean;
463
625
  /**
464
626
  * Creates a new Color4 set with the added values of the current Color4 and of the given one
465
- * @param right defines the second operand
627
+ * @param otherColor defines the second operand
466
628
  * @returns a new Color4 object
467
629
  */
468
- add(right: DeepImmutable<Color4>): Color4;
630
+ add(otherColor: DeepImmutable<this>): this;
631
+ /**
632
+ * Updates the given color "result" with the result of the addition of the current Color4 and the given one.
633
+ * @param otherColor the color to add
634
+ * @param result the color to store the result
635
+ * @returns result input
636
+ */
637
+ addToRef<T extends Color4>(otherColor: DeepImmutable<this>, result: T): T;
638
+ /**
639
+ * Adds in place the given Color4 values to the current Color4 object
640
+ * @param otherColor defines the second operand
641
+ * @returns the current updated Color4 object
642
+ */
643
+ addInPlace(otherColor: DeepImmutable<this>): this;
644
+ /**
645
+ * Adds the given coordinates to the current Color4
646
+ * @param r defines the r coordinate of the operand
647
+ * @param g defines the g coordinate of the operand
648
+ * @param b defines the b coordinate of the operand
649
+ * @param a defines the a coordinate of the operand
650
+ * @returns the current updated Color4
651
+ */
652
+ addInPlaceFromFloats(r: number, g: number, b: number, a: number): this;
469
653
  /**
470
654
  * Creates a new Color4 set with the subtracted values of the given one from the current Color4
471
- * @param right defines the second operand
655
+ * @param otherColor defines the second operand
472
656
  * @returns a new Color4 object
473
657
  */
474
- subtract(right: DeepImmutable<Color4>): Color4;
658
+ subtract(otherColor: DeepImmutable<this>): this;
475
659
  /**
476
660
  * Subtracts the given ones from the current Color4 values and stores the results in "result"
477
- * @param right defines the second operand
661
+ * @param otherColor defines the second operand
478
662
  * @param result defines the Color4 object where to store the result
479
- * @returns the current Color4 object
663
+ * @returns the result Color4 object
664
+ */
665
+ subtractToRef<T extends this>(otherColor: DeepImmutable<this>, result: T): T;
666
+ /**
667
+ * Subtract in place the given color from the current Color4.
668
+ * @param otherColor the color to subtract
669
+ * @returns the updated Color4.
670
+ */
671
+ subtractInPlace(otherColor: DeepImmutable<Color4>): this;
672
+ /**
673
+ * Returns a new Color4 set with the result of the subtraction of the given floats from the current Color4 coordinates.
674
+ * @param r value to subtract
675
+ * @param g value to subtract
676
+ * @param b value to subtract
677
+ * @param a value to subtract
678
+ * @returns new color containing the result
679
+ */
680
+ subtractFromFloats(r: number, g: number, b: number, a: number): this;
681
+ /**
682
+ * Sets the given color "result" set with the result of the subtraction of the given floats from the current Color4 coordinates.
683
+ * @param r value to subtract
684
+ * @param g value to subtract
685
+ * @param b value to subtract
686
+ * @param a value to subtract
687
+ * @param result the color to store the result in
688
+ * @returns result input
480
689
  */
481
- subtractToRef(right: DeepImmutable<Color4>, result: Color4): Color4;
690
+ subtractFromFloatsToRef<T extends Color4>(r: number, g: number, b: number, a: number, result: T): T;
482
691
  /**
483
692
  * Creates a new Color4 with the current Color4 values multiplied by scale
484
693
  * @param scale defines the scaling factor to apply
485
694
  * @returns a new Color4 object
486
695
  */
487
- scale(scale: number): Color4;
696
+ scale(scale: number): this;
488
697
  /**
489
698
  * Multiplies the Color4 values by the float "scale"
490
699
  * @param scale defines the scaling factor to apply
491
700
  * @returns the current updated Color4
492
701
  */
493
- scaleInPlace(scale: number): Color4;
702
+ scaleInPlace(scale: number): this;
494
703
  /**
495
704
  * Multiplies the current Color4 values by scale and stores the result in "result"
496
705
  * @param scale defines the scaling factor to apply
497
706
  * @param result defines the Color4 object where to store the result
498
- * @returns the current unmodified Color4
707
+ * @returns the result Color4
499
708
  */
500
- scaleToRef(scale: number, result: Color4): Color4;
709
+ scaleToRef<T extends this>(scale: number, result: T): T;
501
710
  /**
502
711
  * Scale the current Color4 values by a factor and add the result to a given Color4
503
712
  * @param scale defines the scale factor
504
713
  * @param result defines the Color4 object where to store the result
505
- * @returns the unmodified current Color4
714
+ * @returns the result Color4
506
715
  */
507
- scaleAndAddToRef(scale: number, result: Color4): Color4;
716
+ scaleAndAddToRef<T extends this>(scale: number, result: T): T;
508
717
  /**
509
718
  * Clamps the rgb values by the min and max values and stores the result into "result"
510
719
  * @param min defines minimum clamping value (default is 0)
511
720
  * @param max defines maximum clamping value (default is 1)
512
721
  * @param result defines color to store the result into.
513
- * @returns the current Color4
722
+ * @returns the result Color4
514
723
  */
515
- clampToRef(min: number | undefined, max: number | undefined, result: Color4): Color4;
724
+ clampToRef<T extends this>(min: number | undefined, max: number | undefined, result: T): T;
516
725
  /**
517
726
  * Multiply an Color4 value by another and return a new Color4 object
518
727
  * @param color defines the Color4 value to multiply by
519
728
  * @returns a new Color4 object
520
729
  */
521
- multiply(color: Color4): Color4;
730
+ multiply(color: DeepImmutable<this>): this;
522
731
  /**
523
732
  * Multiply a Color4 value by another and push the result in a reference value
524
733
  * @param color defines the Color4 value to multiply by
525
734
  * @param result defines the Color4 to fill the result in
526
735
  * @returns the result Color4
527
736
  */
528
- multiplyToRef(color: Color4, result: Color4): Color4;
737
+ multiplyToRef<T extends this>(color: DeepImmutable<this>, result: T): T;
738
+ /**
739
+ * Multiplies in place the current Color4 by the given one.
740
+ * @param otherColor color to multiple with
741
+ * @returns the updated Color4.
742
+ */
743
+ multiplyInPlace(otherColor: DeepImmutable<Color4>): this;
744
+ /**
745
+ * Returns a new Color4 set with the multiplication result of the given floats and the current Color4 coordinates.
746
+ * @param r value multiply with
747
+ * @param g value multiply with
748
+ * @param b value multiply with
749
+ * @param a value multiply with
750
+ * @returns resulting new color
751
+ */
752
+ multiplyByFloats(r: number, g: number, b: number, a: number): this;
753
+ /**
754
+ * @internal
755
+ * Do not use
756
+ */
757
+ divide(_other: DeepImmutable<this>): this;
758
+ /**
759
+ * @internal
760
+ * Do not use
761
+ */
762
+ divideToRef<T extends this>(_other: DeepImmutable<this>, _result: T): T;
763
+ /**
764
+ * @internal
765
+ * Do not use
766
+ */
767
+ divideInPlace(_other: DeepImmutable<this>): this;
768
+ /**
769
+ * Updates the Color4 coordinates with the minimum values between its own and the given color ones
770
+ * @param other defines the second operand
771
+ * @returns the current updated Color4
772
+ */
773
+ minimizeInPlace(other: DeepImmutable<Color4>): this;
774
+ /**
775
+ * Updates the Color4 coordinates with the maximum values between its own and the given color ones
776
+ * @param other defines the second operand
777
+ * @returns the current updated Color4
778
+ */
779
+ maximizeInPlace(other: DeepImmutable<Color4>): this;
780
+ /**
781
+ * Updates the current Color4 with the minimal coordinate values between its and the given coordinates
782
+ * @param r defines the r coordinate of the operand
783
+ * @param g defines the g coordinate of the operand
784
+ * @param b defines the b coordinate of the operand
785
+ * @param a defines the a coordinate of the operand
786
+ * @returns the current updated Color4
787
+ */
788
+ minimizeInPlaceFromFloats(r: number, g: number, b: number, a: number): this;
789
+ /**
790
+ * Updates the current Color4 with the maximal coordinate values between its and the given coordinates.
791
+ * @param r defines the r coordinate of the operand
792
+ * @param g defines the g coordinate of the operand
793
+ * @param b defines the b coordinate of the operand
794
+ * @param a defines the a coordinate of the operand
795
+ * @returns the current updated Color4
796
+ */
797
+ maximizeInPlaceFromFloats(r: number, g: number, b: number, a: number): this;
798
+ /**
799
+ * @internal
800
+ * Do not use
801
+ */
802
+ floorToRef<T extends this>(_result: T): T;
803
+ /**
804
+ * @internal
805
+ * Do not use
806
+ */
807
+ floor(): this;
808
+ /**
809
+ * @internal
810
+ * Do not use
811
+ */
812
+ fractToRef<T extends this>(_result: T): T;
813
+ /**
814
+ * @internal
815
+ * Do not use
816
+ */
817
+ fract(): this;
818
+ /**
819
+ * @internal
820
+ * Do not use
821
+ */
822
+ negate(): this;
823
+ /**
824
+ * @internal
825
+ * Do not use
826
+ */
827
+ negateInPlace(): this;
828
+ /**
829
+ * @internal
830
+ * Do not use
831
+ */
832
+ negateToRef<T extends this>(_result: T): T;
833
+ /**
834
+ * Boolean : True if the current Color4 coordinates are each beneath the distance "epsilon" from the given color ones.
835
+ * @param otherColor color to compare against
836
+ * @param epsilon (Default: very small number)
837
+ * @returns true if they are equal
838
+ */
839
+ equalsWithEpsilon(otherColor: DeepImmutable<Color4>, epsilon?: number): boolean;
840
+ /**
841
+ * Boolean : True if the given floats are strictly equal to the current Color4 coordinates.
842
+ * @param x x value to compare against
843
+ * @param y y value to compare against
844
+ * @param z z value to compare against
845
+ * @param w w value to compare against
846
+ * @returns true if equal
847
+ */
848
+ equalsToFloats(x: number, y: number, z: number, w: number): boolean;
529
849
  /**
530
850
  * Creates a string with the Color4 current values
531
851
  * @returns the string representation of the Color4 object
@@ -545,13 +865,13 @@ export declare class Color4 {
545
865
  * Creates a new Color4 copied from the current one
546
866
  * @returns a new Color4 object
547
867
  */
548
- clone(): Color4;
868
+ clone(): this;
549
869
  /**
550
870
  * Copies the given Color4 values into the current one
551
871
  * @param source defines the source Color4 object
552
872
  * @returns the current updated Color4 object
553
873
  */
554
- copyFrom(source: Color4): Color4;
874
+ copyFrom(source: DeepImmutable<Color4>): this;
555
875
  /**
556
876
  * Copies the given float values into the current one
557
877
  * @param r defines the red component to read from
@@ -560,7 +880,7 @@ export declare class Color4 {
560
880
  * @param a defines the alpha component to read from
561
881
  * @returns the current updated Color4 object
562
882
  */
563
- copyFromFloats(r: number, g: number, b: number, a: number): Color4;
883
+ copyFromFloats(r: number, g: number, b: number, a: number): this;
564
884
  /**
565
885
  * Copies the given float values into the current one
566
886
  * @param r defines the red component to read from
@@ -569,7 +889,13 @@ export declare class Color4 {
569
889
  * @param a defines the alpha component to read from
570
890
  * @returns the current updated Color4 object
571
891
  */
572
- set(r: number, g: number, b: number, a: number): Color4;
892
+ set(r: number, g: number, b: number, a: number): this;
893
+ /**
894
+ * Copies the given float to the current Vector4 coordinates
895
+ * @param v defines the r, g, b, and a coordinates of the operand
896
+ * @returns the current updated Vector4
897
+ */
898
+ setAll(v: number): this;
573
899
  /**
574
900
  * Compute the Color4 hexadecimal code as a string
575
901
  * @param returnAsColor3 defines if the string should only contains RGB values (off by default)
@@ -685,7 +1011,7 @@ export declare class Color4 {
685
1011
  */
686
1012
  static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number | undefined, result: Color4): void;
687
1013
  /**
688
- * Creates a new Color3 from integer values (< 256)
1014
+ * Creates a new Color3 from integer values (less than 256)
689
1015
  * @param r defines the red component to read from (value between 0 and 255)
690
1016
  * @param g defines the green component to read from (value between 0 and 255)
691
1017
  * @param b defines the blue component to read from (value between 0 and 255)