@babylonjs/core 5.48.0 → 5.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Bones/skeleton.js +1 -1
- package/Bones/skeleton.js.map +1 -1
- package/Debug/physicsViewer.js +4 -0
- package/Debug/physicsViewer.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +0 -1
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/engine.d.ts +3 -1
- package/Engines/engine.js +14 -5
- package/Engines/engine.js.map +1 -1
- package/Engines/engineStore.d.ts +6 -0
- package/Engines/engineStore.js +6 -0
- package/Engines/engineStore.js.map +1 -1
- package/Engines/nativeEngine.d.ts +3 -2
- package/Engines/nativeEngine.js +9 -5
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/thinEngine.d.ts +4 -3
- package/Engines/thinEngine.js +11 -13
- package/Engines/thinEngine.js.map +1 -1
- package/Helpers/environmentHelper.d.ts +1 -0
- package/Helpers/environmentHelper.js +6 -5
- package/Helpers/environmentHelper.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +1 -0
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +1 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +8 -8
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Textures/thinTexture.d.ts +4 -2
- package/Materials/Textures/thinTexture.js +5 -2
- package/Materials/Textures/thinTexture.js.map +1 -1
- package/Materials/material.js +5 -0
- package/Materials/material.js.map +1 -1
- package/Materials/materialHelper.js +1 -1
- package/Materials/materialHelper.js.map +1 -1
- package/Materials/materialPluginBase.js +3 -0
- package/Materials/materialPluginBase.js.map +1 -1
- package/Materials/pushMaterial.d.ts +2 -1
- package/Materials/pushMaterial.js +4 -0
- package/Materials/pushMaterial.js.map +1 -1
- package/Maths/math.color.d.ts +20 -12
- package/Maths/math.color.js +85 -31
- package/Maths/math.color.js.map +1 -1
- package/Misc/decorators.js +2 -2
- package/Misc/decorators.js.map +1 -1
- package/Misc/fileTools.js +3 -0
- package/Misc/fileTools.js.map +1 -1
- package/Misc/khronosTextureContainer2.d.ts +3 -3
- package/Misc/khronosTextureContainer2.js +4 -3
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/observable.d.ts +18 -1
- package/Misc/observable.js +28 -2
- package/Misc/observable.js.map +1 -1
- package/Physics/v2/IPhysicsEnginePlugin.d.ts +3 -0
- package/Physics/v2/IPhysicsEnginePlugin.js.map +1 -1
- package/Physics/v2/physicsAggregate.js +1 -1
- package/Physics/v2/physicsAggregate.js.map +1 -1
- package/Physics/v2/physicsBody.d.ts +12 -0
- package/Physics/v2/physicsBody.js +19 -0
- package/Physics/v2/physicsBody.js.map +1 -1
- package/Physics/v2/physicsShape.d.ts +24 -4
- package/Physics/v2/physicsShape.js +24 -13
- package/Physics/v2/physicsShape.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +1 -1
- package/scene.js +47 -46
- package/scene.js.map +1 -1
package/Maths/math.color.js
CHANGED
|
@@ -2,6 +2,24 @@ import { Scalar } from "./math.scalar.js";
|
|
|
2
2
|
import { ToLinearSpace, ToGammaSpace } from "./math.constants.js";
|
|
3
3
|
import { ArrayTools } from "../Misc/arrayTools.js";
|
|
4
4
|
import { RegisterClass } from "../Misc/typeStore.js";
|
|
5
|
+
function colorChannelToLinearSpace(color) {
|
|
6
|
+
return Math.pow(color, ToLinearSpace);
|
|
7
|
+
}
|
|
8
|
+
function colorChannelToLinearSpaceExact(color) {
|
|
9
|
+
if (color <= 0.04045) {
|
|
10
|
+
return 0.0773993808 * color;
|
|
11
|
+
}
|
|
12
|
+
return Math.pow(0.947867299 * (color + 0.055), 2.4);
|
|
13
|
+
}
|
|
14
|
+
function colorChannelToGammaSpace(color) {
|
|
15
|
+
return Math.pow(color, ToGammaSpace);
|
|
16
|
+
}
|
|
17
|
+
function colorChannelToGammaSpaceExact(color) {
|
|
18
|
+
if (color <= 0.0031308) {
|
|
19
|
+
return 12.92 * color;
|
|
20
|
+
}
|
|
21
|
+
return 1.055 * Math.pow(color, 0.41666) - 0.055;
|
|
22
|
+
}
|
|
5
23
|
/**
|
|
6
24
|
* Class used to hold a RGB color
|
|
7
25
|
*/
|
|
@@ -283,15 +301,6 @@ export class Color3 {
|
|
|
283
301
|
const intB = Math.round(this.b * 255);
|
|
284
302
|
return "#" + Scalar.ToHex(intR) + Scalar.ToHex(intG) + Scalar.ToHex(intB);
|
|
285
303
|
}
|
|
286
|
-
/**
|
|
287
|
-
* Computes a new Color3 converted from the current one to linear space
|
|
288
|
-
* @returns a new Color3 object
|
|
289
|
-
*/
|
|
290
|
-
toLinearSpace() {
|
|
291
|
-
const convertedColor = new Color3();
|
|
292
|
-
this.toLinearSpaceToRef(convertedColor);
|
|
293
|
-
return convertedColor;
|
|
294
|
-
}
|
|
295
304
|
/**
|
|
296
305
|
* Converts current color in rgb space to HSV values
|
|
297
306
|
* @returns a new color3 representing the HSV values
|
|
@@ -337,35 +346,62 @@ export class Color3 {
|
|
|
337
346
|
result.g = s;
|
|
338
347
|
result.b = v;
|
|
339
348
|
}
|
|
349
|
+
/**
|
|
350
|
+
* Computes a new Color3 converted from the current one to linear space
|
|
351
|
+
* @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
|
|
352
|
+
* @returns a new Color3 object
|
|
353
|
+
*/
|
|
354
|
+
toLinearSpace(exact = false) {
|
|
355
|
+
const convertedColor = new Color3();
|
|
356
|
+
this.toLinearSpaceToRef(convertedColor, exact);
|
|
357
|
+
return convertedColor;
|
|
358
|
+
}
|
|
340
359
|
/**
|
|
341
360
|
* Converts the Color3 values to linear space and stores the result in "convertedColor"
|
|
342
361
|
* @param convertedColor defines the Color3 object where to store the linear space version
|
|
362
|
+
* @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
|
|
343
363
|
* @returns the unmodified Color3
|
|
344
364
|
*/
|
|
345
|
-
toLinearSpaceToRef(convertedColor) {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
365
|
+
toLinearSpaceToRef(convertedColor, exact = false) {
|
|
366
|
+
if (exact) {
|
|
367
|
+
convertedColor.r = colorChannelToLinearSpaceExact(this.r);
|
|
368
|
+
convertedColor.g = colorChannelToLinearSpaceExact(this.g);
|
|
369
|
+
convertedColor.b = colorChannelToLinearSpaceExact(this.b);
|
|
370
|
+
}
|
|
371
|
+
else {
|
|
372
|
+
convertedColor.r = colorChannelToLinearSpace(this.r);
|
|
373
|
+
convertedColor.g = colorChannelToLinearSpace(this.g);
|
|
374
|
+
convertedColor.b = colorChannelToLinearSpace(this.b);
|
|
375
|
+
}
|
|
349
376
|
return this;
|
|
350
377
|
}
|
|
351
378
|
/**
|
|
352
379
|
* Computes a new Color3 converted from the current one to gamma space
|
|
380
|
+
* @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
|
|
353
381
|
* @returns a new Color3 object
|
|
354
382
|
*/
|
|
355
|
-
toGammaSpace() {
|
|
383
|
+
toGammaSpace(exact = false) {
|
|
356
384
|
const convertedColor = new Color3();
|
|
357
|
-
this.toGammaSpaceToRef(convertedColor);
|
|
385
|
+
this.toGammaSpaceToRef(convertedColor, exact);
|
|
358
386
|
return convertedColor;
|
|
359
387
|
}
|
|
360
388
|
/**
|
|
361
389
|
* Converts the Color3 values to gamma space and stores the result in "convertedColor"
|
|
362
390
|
* @param convertedColor defines the Color3 object where to store the gamma space version
|
|
391
|
+
* @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
|
|
363
392
|
* @returns the unmodified Color3
|
|
364
393
|
*/
|
|
365
|
-
toGammaSpaceToRef(convertedColor) {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
394
|
+
toGammaSpaceToRef(convertedColor, exact = false) {
|
|
395
|
+
if (exact) {
|
|
396
|
+
convertedColor.r = colorChannelToGammaSpaceExact(this.r);
|
|
397
|
+
convertedColor.g = colorChannelToGammaSpaceExact(this.g);
|
|
398
|
+
convertedColor.b = colorChannelToGammaSpaceExact(this.b);
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
convertedColor.r = colorChannelToGammaSpace(this.r);
|
|
402
|
+
convertedColor.g = colorChannelToGammaSpace(this.g);
|
|
403
|
+
convertedColor.b = colorChannelToGammaSpace(this.b);
|
|
404
|
+
}
|
|
369
405
|
return this;
|
|
370
406
|
}
|
|
371
407
|
/**
|
|
@@ -906,43 +942,61 @@ export class Color4 {
|
|
|
906
942
|
}
|
|
907
943
|
/**
|
|
908
944
|
* Computes a new Color4 converted from the current one to linear space
|
|
945
|
+
* @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
|
|
909
946
|
* @returns a new Color4 object
|
|
910
947
|
*/
|
|
911
|
-
toLinearSpace() {
|
|
948
|
+
toLinearSpace(exact = false) {
|
|
912
949
|
const convertedColor = new Color4();
|
|
913
|
-
this.toLinearSpaceToRef(convertedColor);
|
|
950
|
+
this.toLinearSpaceToRef(convertedColor, exact);
|
|
914
951
|
return convertedColor;
|
|
915
952
|
}
|
|
916
953
|
/**
|
|
917
954
|
* Converts the Color4 values to linear space and stores the result in "convertedColor"
|
|
918
955
|
* @param convertedColor defines the Color4 object where to store the linear space version
|
|
956
|
+
* @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
|
|
919
957
|
* @returns the unmodified Color4
|
|
920
958
|
*/
|
|
921
|
-
toLinearSpaceToRef(convertedColor) {
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
959
|
+
toLinearSpaceToRef(convertedColor, exact = false) {
|
|
960
|
+
if (exact) {
|
|
961
|
+
convertedColor.r = colorChannelToLinearSpaceExact(this.r);
|
|
962
|
+
convertedColor.g = colorChannelToLinearSpaceExact(this.g);
|
|
963
|
+
convertedColor.b = colorChannelToLinearSpaceExact(this.b);
|
|
964
|
+
}
|
|
965
|
+
else {
|
|
966
|
+
convertedColor.r = colorChannelToLinearSpace(this.r);
|
|
967
|
+
convertedColor.g = colorChannelToLinearSpace(this.g);
|
|
968
|
+
convertedColor.b = colorChannelToLinearSpace(this.b);
|
|
969
|
+
}
|
|
925
970
|
convertedColor.a = this.a;
|
|
926
971
|
return this;
|
|
927
972
|
}
|
|
928
973
|
/**
|
|
929
974
|
* Computes a new Color4 converted from the current one to gamma space
|
|
975
|
+
* @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
|
|
930
976
|
* @returns a new Color4 object
|
|
931
977
|
*/
|
|
932
|
-
toGammaSpace() {
|
|
978
|
+
toGammaSpace(exact = false) {
|
|
933
979
|
const convertedColor = new Color4();
|
|
934
|
-
this.toGammaSpaceToRef(convertedColor);
|
|
980
|
+
this.toGammaSpaceToRef(convertedColor, exact);
|
|
935
981
|
return convertedColor;
|
|
936
982
|
}
|
|
937
983
|
/**
|
|
938
984
|
* Converts the Color4 values to gamma space and stores the result in "convertedColor"
|
|
939
985
|
* @param convertedColor defines the Color4 object where to store the gamma space version
|
|
986
|
+
* @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)
|
|
940
987
|
* @returns the unmodified Color4
|
|
941
988
|
*/
|
|
942
|
-
toGammaSpaceToRef(convertedColor) {
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
989
|
+
toGammaSpaceToRef(convertedColor, exact = false) {
|
|
990
|
+
if (exact) {
|
|
991
|
+
convertedColor.r = colorChannelToGammaSpaceExact(this.r);
|
|
992
|
+
convertedColor.g = colorChannelToGammaSpaceExact(this.g);
|
|
993
|
+
convertedColor.b = colorChannelToGammaSpaceExact(this.b);
|
|
994
|
+
}
|
|
995
|
+
else {
|
|
996
|
+
convertedColor.r = colorChannelToGammaSpace(this.r);
|
|
997
|
+
convertedColor.g = colorChannelToGammaSpace(this.g);
|
|
998
|
+
convertedColor.b = colorChannelToGammaSpace(this.b);
|
|
999
|
+
}
|
|
946
1000
|
convertedColor.a = this.a;
|
|
947
1001
|
return this;
|
|
948
1002
|
}
|
package/Maths/math.color.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"math.color.js","sourceRoot":"","sources":["../../../../lts/core/generated/Maths/math.color.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD;;GAEG;AACH,MAAM,OAAO,MAAM;IACf;;;;;OAKG;IACH;IACI;;OAEG;IACI,IAAY,CAAC;IACpB;;OAEG;IACI,IAAY,CAAC;IACpB;;OAEG;IACI,IAAY,CAAC;QARb,MAAC,GAAD,CAAC,CAAY;QAIb,MAAC,GAAD,CAAC,CAAY;QAIb,MAAC,GAAD,CAAC,CAAY;IACrB,CAAC;IAEJ;;;OAGG;IACI,QAAQ;QACX,OAAO,MAAM,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;IACnE,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;;OAGG;IACI,WAAW;QACd,IAAI,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3C,IAAI,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3C,OAAO,IAAI,CAAC;IAChB,CAAC;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aAAa,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC","sourcesContent":["import type { DeepImmutable, FloatArray } from \"../types\";\r\nimport { Scalar } from \"./math.scalar\";\r\nimport { ToLinearSpace, ToGammaSpace } from \"./math.constants\";\r\nimport { ArrayTools } from \"../Misc/arrayTools\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\n/**\r\n * Class used to hold a RGB color\r\n */\r\nexport class Color3 {\r\n /**\r\n * Creates a new Color3 object from red, green, blue values, all between 0 and 1\r\n * @param r defines the red component (between 0 and 1, default is 0)\r\n * @param g defines the green component (between 0 and 1, default is 0)\r\n * @param b defines the blue component (between 0 and 1, default is 0)\r\n */\r\n constructor(\r\n /**\r\n * Defines the red component (between 0 and 1, default is 0)\r\n */\r\n public r: number = 0,\r\n /**\r\n * Defines the green component (between 0 and 1, default is 0)\r\n */\r\n public g: number = 0,\r\n /**\r\n * Defines the blue component (between 0 and 1, default is 0)\r\n */\r\n public b: number = 0\r\n ) {}\r\n\r\n /**\r\n * Creates a string with the Color3 current values\r\n * @returns the string representation of the Color3 object\r\n */\r\n public toString(): string {\r\n return \"{R: \" + this.r + \" G:\" + this.g + \" B:\" + this.b + \"}\";\r\n }\r\n\r\n /**\r\n * Returns the string \"Color3\"\r\n * @returns \"Color3\"\r\n */\r\n public getClassName(): string {\r\n return \"Color3\";\r\n }\r\n\r\n /**\r\n * Compute the Color3 hash code\r\n * @returns an unique number that can be used to hash Color3 objects\r\n */\r\n public getHashCode(): number {\r\n let hash = (this.r * 255) | 0;\r\n hash = (hash * 397) ^ ((this.g * 255) | 0);\r\n hash = (hash * 397) ^ ((this.b * 255) | 0);\r\n return hash;\r\n }\r\n\r\n // Operators\r\n\r\n /**\r\n * Stores in the given array from the given starting index the red, green, blue values as successive elements\r\n * @param array defines the array where to store the r,g,b components\r\n * @param index defines an optional index in the target array to define where to start storing values\r\n * @returns the current Color3 object\r\n */\r\n public toArray(array: FloatArray, index: number = 0): Color3 {\r\n array[index] = this.r;\r\n array[index + 1] = this.g;\r\n array[index + 2] = this.b;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Update the current color with values stored in an array from the starting index of the given array\r\n * @param array defines the source array\r\n * @param offset defines an offset in the source array\r\n * @returns the current Color3 object\r\n */\r\n public fromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Color3 {\r\n Color3.FromArrayToRef(array, offset, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Color4 object from the current Color3 and the given alpha\r\n * @param alpha defines the alpha component on the new Color4 object (default is 1)\r\n * @returns a new Color4 object\r\n */\r\n public toColor4(alpha: number = 1): Color4 {\r\n return new Color4(this.r, this.g, this.b, alpha);\r\n }\r\n\r\n /**\r\n * Returns a new array populated with 3 numeric elements : red, green and blue values\r\n * @returns the new array\r\n */\r\n public asArray(): number[] {\r\n return [this.r, this.g, this.b];\r\n }\r\n\r\n /**\r\n * Returns the luminance value\r\n * @returns a float value\r\n */\r\n public toLuminance(): number {\r\n return this.r * 0.3 + this.g * 0.59 + this.b * 0.11;\r\n }\r\n\r\n /**\r\n * Multiply each Color3 rgb values by the given Color3 rgb values in a new Color3 object\r\n * @param otherColor defines the second operand\r\n * @returns the new Color3 object\r\n */\r\n public multiply(otherColor: DeepImmutable<Color3>): Color3 {\r\n return new Color3(this.r * otherColor.r, this.g * otherColor.g, this.b * otherColor.b);\r\n }\r\n\r\n /**\r\n * Multiply the rgb values of the Color3 and the given Color3 and stores the result in the object \"result\"\r\n * @param otherColor defines the second operand\r\n * @param result defines the Color3 object where to store the result\r\n * @returns the current Color3\r\n */\r\n public multiplyToRef(otherColor: DeepImmutable<Color3>, result: Color3): Color3 {\r\n result.r = this.r * otherColor.r;\r\n result.g = this.g * otherColor.g;\r\n result.b = this.b * otherColor.b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Determines equality between Color3 objects\r\n * @param otherColor defines the second operand\r\n * @returns true if the rgb values are equal to the given ones\r\n */\r\n public equals(otherColor: DeepImmutable<Color3>): boolean {\r\n return otherColor && this.r === otherColor.r && this.g === otherColor.g && this.b === otherColor.b;\r\n }\r\n\r\n /**\r\n * Determines equality between the current Color3 object and a set of r,b,g values\r\n * @param r defines the red component to check\r\n * @param g defines the green component to check\r\n * @param b defines the blue component to check\r\n * @returns true if the rgb values are equal to the given ones\r\n */\r\n public equalsFloats(r: number, g: number, b: number): boolean {\r\n return this.r === r && this.g === g && this.b === b;\r\n }\r\n\r\n /**\r\n * Creates a new Color3 with the current Color3 values multiplied by scale\r\n * @param scale defines the scaling factor to apply\r\n * @returns a new Color3 object\r\n */\r\n public scale(scale: number): Color3 {\r\n return new Color3(this.r * scale, this.g * scale, this.b * scale);\r\n }\r\n\r\n /**\r\n * Multiplies the Color3 values by the float \"scale\"\r\n * @param scale defines the scaling factor to apply\r\n * @returns the current updated Color3\r\n */\r\n public scaleInPlace(scale: number): Color3 {\r\n this.r *= scale;\r\n this.g *= scale;\r\n this.b *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies the rgb values by scale and stores the result into \"result\"\r\n * @param scale defines the scaling factor\r\n * @param result defines the Color3 object where to store the result\r\n * @returns the unmodified current Color3\r\n */\r\n public scaleToRef(scale: number, result: Color3): Color3 {\r\n result.r = this.r * scale;\r\n result.g = this.g * scale;\r\n result.b = this.b * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Scale the current Color3 values by a factor and add the result to a given Color3\r\n * @param scale defines the scale factor\r\n * @param result defines color to store the result into\r\n * @returns the unmodified current Color3\r\n */\r\n public scaleAndAddToRef(scale: number, result: Color3): Color3 {\r\n result.r += this.r * scale;\r\n result.g += this.g * scale;\r\n result.b += this.b * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Clamps the rgb values by the min and max values and stores the result into \"result\"\r\n * @param min defines minimum clamping value (default is 0)\r\n * @param max defines maximum clamping value (default is 1)\r\n * @param result defines color to store the result into\r\n * @returns the original Color3\r\n */\r\n public clampToRef(min: number = 0, max: number = 1, result: Color3): Color3 {\r\n result.r = Scalar.Clamp(this.r, min, max);\r\n result.g = Scalar.Clamp(this.g, min, max);\r\n result.b = Scalar.Clamp(this.b, min, max);\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates a new Color3 set with the added values of the current Color3 and of the given one\r\n * @param otherColor defines the second operand\r\n * @returns the new Color3\r\n */\r\n public add(otherColor: DeepImmutable<Color3>): Color3 {\r\n return new Color3(this.r + otherColor.r, this.g + otherColor.g, this.b + otherColor.b);\r\n }\r\n\r\n /**\r\n * Stores the result of the addition of the current Color3 and given one rgb values into \"result\"\r\n * @param otherColor defines the second operand\r\n * @param result defines Color3 object to store the result into\r\n * @returns the unmodified current Color3\r\n */\r\n public addToRef(otherColor: DeepImmutable<Color3>, result: Color3): Color3 {\r\n result.r = this.r + otherColor.r;\r\n result.g = this.g + otherColor.g;\r\n result.b = this.b + otherColor.b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Color3 set with the subtracted values of the given one from the current Color3\r\n * @param otherColor defines the second operand\r\n * @returns the new Color3\r\n */\r\n public subtract(otherColor: DeepImmutable<Color3>): Color3 {\r\n return new Color3(this.r - otherColor.r, this.g - otherColor.g, this.b - otherColor.b);\r\n }\r\n\r\n /**\r\n * Stores the result of the subtraction of given one from the current Color3 rgb values into \"result\"\r\n * @param otherColor defines the second operand\r\n * @param result defines Color3 object to store the result into\r\n * @returns the unmodified current Color3\r\n */\r\n public subtractToRef(otherColor: DeepImmutable<Color3>, result: Color3): Color3 {\r\n result.r = this.r - otherColor.r;\r\n result.g = this.g - otherColor.g;\r\n result.b = this.b - otherColor.b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Copy the current object\r\n * @returns a new Color3 copied the current one\r\n */\r\n public clone(): Color3 {\r\n return new Color3(this.r, this.g, this.b);\r\n }\r\n\r\n /**\r\n * Copies the rgb values from the source in the current Color3\r\n * @param source defines the source Color3 object\r\n * @returns the updated Color3 object\r\n */\r\n public copyFrom(source: DeepImmutable<Color3>): Color3 {\r\n this.r = source.r;\r\n this.g = source.g;\r\n this.b = source.b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the Color3 rgb values from the given floats\r\n * @param r defines the red component to read from\r\n * @param g defines the green component to read from\r\n * @param b defines the blue component to read from\r\n * @returns the current Color3 object\r\n */\r\n public copyFromFloats(r: number, g: number, b: number): Color3 {\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the Color3 rgb values from the given floats\r\n * @param r defines the red component to read from\r\n * @param g defines the green component to read from\r\n * @param b defines the blue component to read from\r\n * @returns the current Color3 object\r\n */\r\n public set(r: number, g: number, b: number): Color3 {\r\n return this.copyFromFloats(r, g, b);\r\n }\r\n\r\n /**\r\n * Compute the Color3 hexadecimal code as a string\r\n * @returns a string containing the hexadecimal representation of the Color3 object\r\n */\r\n public toHexString(): string {\r\n const intR = Math.round(this.r * 255);\r\n const intG = Math.round(this.g * 255);\r\n const intB = Math.round(this.b * 255);\r\n return \"#\" + Scalar.ToHex(intR) + Scalar.ToHex(intG) + Scalar.ToHex(intB);\r\n }\r\n\r\n /**\r\n * Computes a new Color3 converted from the current one to linear space\r\n * @returns a new Color3 object\r\n */\r\n public toLinearSpace(): Color3 {\r\n const convertedColor = new Color3();\r\n this.toLinearSpaceToRef(convertedColor);\r\n return convertedColor;\r\n }\r\n\r\n /**\r\n * Converts current color in rgb space to HSV values\r\n * @returns a new color3 representing the HSV values\r\n */\r\n public toHSV(): Color3 {\r\n const result = new Color3();\r\n\r\n this.toHSVToRef(result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Converts current color in rgb space to HSV values\r\n * @param result defines the Color3 where to store the HSV values\r\n */\r\n public toHSVToRef(result: Color3) {\r\n const r = this.r;\r\n const g = this.g;\r\n const b = this.b;\r\n\r\n const max = Math.max(r, g, b);\r\n const min = Math.min(r, g, b);\r\n let h = 0;\r\n let s = 0;\r\n const v = max;\r\n\r\n const dm = max - min;\r\n\r\n if (max !== 0) {\r\n s = dm / max;\r\n }\r\n\r\n if (max != min) {\r\n if (max == r) {\r\n h = (g - b) / dm;\r\n if (g < b) {\r\n h += 6;\r\n }\r\n } else if (max == g) {\r\n h = (b - r) / dm + 2;\r\n } else if (max == b) {\r\n h = (r - g) / dm + 4;\r\n }\r\n h *= 60;\r\n }\r\n\r\n result.r = h;\r\n result.g = s;\r\n result.b = v;\r\n }\r\n\r\n /**\r\n * Converts the Color3 values to linear space and stores the result in \"convertedColor\"\r\n * @param convertedColor defines the Color3 object where to store the linear space version\r\n * @returns the unmodified Color3\r\n */\r\n public toLinearSpaceToRef(convertedColor: Color3): Color3 {\r\n convertedColor.r = Math.pow(this.r, ToLinearSpace);\r\n convertedColor.g = Math.pow(this.g, ToLinearSpace);\r\n convertedColor.b = Math.pow(this.b, ToLinearSpace);\r\n return this;\r\n }\r\n\r\n /**\r\n * Computes a new Color3 converted from the current one to gamma space\r\n * @returns a new Color3 object\r\n */\r\n public toGammaSpace(): Color3 {\r\n const convertedColor = new Color3();\r\n this.toGammaSpaceToRef(convertedColor);\r\n return convertedColor;\r\n }\r\n\r\n /**\r\n * Converts the Color3 values to gamma space and stores the result in \"convertedColor\"\r\n * @param convertedColor defines the Color3 object where to store the gamma space version\r\n * @returns the unmodified Color3\r\n */\r\n public toGammaSpaceToRef(convertedColor: Color3): Color3 {\r\n convertedColor.r = Math.pow(this.r, ToGammaSpace);\r\n convertedColor.g = Math.pow(this.g, ToGammaSpace);\r\n convertedColor.b = Math.pow(this.b, ToGammaSpace);\r\n return this;\r\n }\r\n\r\n // Statics\r\n\r\n private static _BlackReadOnly = Color3.Black() as DeepImmutable<Color3>;\r\n\r\n /**\r\n * Converts Hue, saturation and value to a Color3 (RGB)\r\n * @param hue defines the hue\r\n * @param saturation defines the saturation\r\n * @param value defines the value\r\n * @param result defines the Color3 where to store the RGB values\r\n */\r\n public static HSVtoRGBToRef(hue: number, saturation: number, value: number, result: Color3) {\r\n const chroma = value * saturation;\r\n const h = hue / 60;\r\n const x = chroma * (1 - Math.abs((h % 2) - 1));\r\n let r = 0;\r\n let g = 0;\r\n let b = 0;\r\n\r\n if (h >= 0 && h <= 1) {\r\n r = chroma;\r\n g = x;\r\n } else if (h >= 1 && h <= 2) {\r\n r = x;\r\n g = chroma;\r\n } else if (h >= 2 && h <= 3) {\r\n g = chroma;\r\n b = x;\r\n } else if (h >= 3 && h <= 4) {\r\n g = x;\r\n b = chroma;\r\n } else if (h >= 4 && h <= 5) {\r\n r = x;\r\n b = chroma;\r\n } else if (h >= 5 && h <= 6) {\r\n r = chroma;\r\n b = x;\r\n }\r\n\r\n const m = value - chroma;\r\n result.set(r + m, g + m, b + m);\r\n }\r\n\r\n /**\r\n * Converts Hue, saturation and value to a new Color3 (RGB)\r\n * @param hue defines the hue (value between 0 and 360)\r\n * @param saturation defines the saturation (value between 0 and 1)\r\n * @param value defines the value (value between 0 and 1)\r\n * @returns a new Color3 object\r\n */\r\n public static FromHSV(hue: number, saturation: number, value: number): Color3 {\r\n const result = new Color3(0, 0, 0);\r\n Color3.HSVtoRGBToRef(hue, saturation, value, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new Color3 from the string containing valid hexadecimal values\r\n * @param hex defines a string containing valid hexadecimal values\r\n * @returns a new Color3 object\r\n */\r\n public static FromHexString(hex: string): Color3 {\r\n if (hex.substring(0, 1) !== \"#\" || hex.length !== 7) {\r\n return new Color3(0, 0, 0);\r\n }\r\n\r\n const r = parseInt(hex.substring(1, 3), 16);\r\n const g = parseInt(hex.substring(3, 5), 16);\r\n const b = parseInt(hex.substring(5, 7), 16);\r\n\r\n return Color3.FromInts(r, g, b);\r\n }\r\n\r\n /**\r\n * Creates a new Color3 from the starting index of the given array\r\n * @param array defines the source array\r\n * @param offset defines an offset in the source array\r\n * @returns a new Color3 object\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Color3 {\r\n return new Color3(array[offset], array[offset + 1], array[offset + 2]);\r\n }\r\n\r\n /**\r\n * Creates a new Color3 from the starting index element of the given array\r\n * @param array defines the source array to read from\r\n * @param offset defines the offset in the source array\r\n * @param result defines the target Color3 object\r\n */\r\n public static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number = 0, result: Color3) {\r\n result.r = array[offset];\r\n result.g = array[offset + 1];\r\n result.b = array[offset + 2];\r\n }\r\n\r\n /**\r\n * Creates a new Color3 from integer values (< 256)\r\n * @param r defines the red component to read from (value between 0 and 255)\r\n * @param g defines the green component to read from (value between 0 and 255)\r\n * @param b defines the blue component to read from (value between 0 and 255)\r\n * @returns a new Color3 object\r\n */\r\n public static FromInts(r: number, g: number, b: number): Color3 {\r\n return new Color3(r / 255.0, g / 255.0, b / 255.0);\r\n }\r\n\r\n /**\r\n * Creates a new Color3 with values linearly interpolated of \"amount\" between the start Color3 and the end Color3\r\n * @param start defines the start Color3 value\r\n * @param end defines the end Color3 value\r\n * @param amount defines the gradient value between start and end\r\n * @returns a new Color3 object\r\n */\r\n public static Lerp(start: DeepImmutable<Color3>, end: DeepImmutable<Color3>, amount: number): Color3 {\r\n const result = new Color3(0.0, 0.0, 0.0);\r\n Color3.LerpToRef(start, end, amount, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new Color3 with values linearly interpolated of \"amount\" between the start Color3 and the end Color3\r\n * @param left defines the start value\r\n * @param right defines the end value\r\n * @param amount defines the gradient factor\r\n * @param result defines the Color3 object where to store the result\r\n */\r\n public static LerpToRef(left: DeepImmutable<Color3>, right: DeepImmutable<Color3>, amount: number, result: Color3): void {\r\n result.r = left.r + (right.r - left.r) * amount;\r\n result.g = left.g + (right.g - left.g) * amount;\r\n result.b = left.b + (right.b - left.b) * amount;\r\n }\r\n\r\n /**\r\n * Returns a new Color3 located for \"amount\" (float) on the Hermite interpolation spline defined by the vectors \"value1\", \"tangent1\", \"value2\", \"tangent2\"\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent Color3\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent Color3\r\n * @param amount defines the amount on the interpolation spline (between 0 and 1)\r\n * @returns the new Color3\r\n */\r\n public static Hermite(value1: DeepImmutable<Color3>, tangent1: DeepImmutable<Color3>, value2: DeepImmutable<Color3>, tangent2: DeepImmutable<Color3>, amount: number): Color3 {\r\n const squared = amount * amount;\r\n const cubed = amount * squared;\r\n const part1 = 2.0 * cubed - 3.0 * squared + 1.0;\r\n const part2 = -2.0 * cubed + 3.0 * squared;\r\n const part3 = cubed - 2.0 * squared + amount;\r\n const part4 = cubed - squared;\r\n\r\n const r = value1.r * part1 + value2.r * part2 + tangent1.r * part3 + tangent2.r * part4;\r\n const g = value1.g * part1 + value2.g * part2 + tangent1.g * part3 + tangent2.g * part4;\r\n const b = value1.b * part1 + value2.b * part2 + tangent1.b * part3 + tangent2.b * part4;\r\n return new Color3(r, g, b);\r\n }\r\n\r\n /**\r\n * Returns a new Color3 which is the 1st derivative of the Hermite spline defined by the colors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent\r\n * @param time define where the derivative must be done\r\n * @returns 1st derivative\r\n */\r\n public static Hermite1stDerivative(\r\n value1: DeepImmutable<Color3>,\r\n tangent1: DeepImmutable<Color3>,\r\n value2: DeepImmutable<Color3>,\r\n tangent2: DeepImmutable<Color3>,\r\n time: number\r\n ): Color3 {\r\n const result = Color3.Black();\r\n\r\n this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Color3 which is the 1st derivative of the Hermite spline defined by the colors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent\r\n * @param time define where the derivative must be done\r\n * @param result define where to store the derivative\r\n */\r\n public static Hermite1stDerivativeToRef(\r\n value1: DeepImmutable<Color3>,\r\n tangent1: DeepImmutable<Color3>,\r\n value2: DeepImmutable<Color3>,\r\n tangent2: DeepImmutable<Color3>,\r\n time: number,\r\n result: Color3\r\n ) {\r\n const t2 = time * time;\r\n\r\n result.r = (t2 - time) * 6 * value1.r + (3 * t2 - 4 * time + 1) * tangent1.r + (-t2 + time) * 6 * value2.r + (3 * t2 - 2 * time) * tangent2.r;\r\n result.g = (t2 - time) * 6 * value1.g + (3 * t2 - 4 * time + 1) * tangent1.g + (-t2 + time) * 6 * value2.g + (3 * t2 - 2 * time) * tangent2.g;\r\n result.b = (t2 - time) * 6 * value1.b + (3 * t2 - 4 * time + 1) * tangent1.b + (-t2 + time) * 6 * value2.b + (3 * t2 - 2 * time) * tangent2.b;\r\n }\r\n\r\n /**\r\n * Returns a Color3 value containing a red color\r\n * @returns a new Color3 object\r\n */\r\n public static Red(): Color3 {\r\n return new Color3(1, 0, 0);\r\n }\r\n /**\r\n * Returns a Color3 value containing a green color\r\n * @returns a new Color3 object\r\n */\r\n public static Green(): Color3 {\r\n return new Color3(0, 1, 0);\r\n }\r\n /**\r\n * Returns a Color3 value containing a blue color\r\n * @returns a new Color3 object\r\n */\r\n public static Blue(): Color3 {\r\n return new Color3(0, 0, 1);\r\n }\r\n /**\r\n * Returns a Color3 value containing a black color\r\n * @returns a new Color3 object\r\n */\r\n public static Black(): Color3 {\r\n return new Color3(0, 0, 0);\r\n }\r\n\r\n /**\r\n * Gets a Color3 value containing a black color that must not be updated\r\n */\r\n public static get BlackReadOnly(): DeepImmutable<Color3> {\r\n return Color3._BlackReadOnly;\r\n }\r\n\r\n /**\r\n * Returns a Color3 value containing a white color\r\n * @returns a new Color3 object\r\n */\r\n public static White(): Color3 {\r\n return new Color3(1, 1, 1);\r\n }\r\n /**\r\n * Returns a Color3 value containing a purple color\r\n * @returns a new Color3 object\r\n */\r\n public static Purple(): Color3 {\r\n return new Color3(0.5, 0, 0.5);\r\n }\r\n /**\r\n * Returns a Color3 value containing a magenta color\r\n * @returns a new Color3 object\r\n */\r\n public static Magenta(): Color3 {\r\n return new Color3(1, 0, 1);\r\n }\r\n /**\r\n * Returns a Color3 value containing a yellow color\r\n * @returns a new Color3 object\r\n */\r\n public static Yellow(): Color3 {\r\n return new Color3(1, 1, 0);\r\n }\r\n /**\r\n * Returns a Color3 value containing a gray color\r\n * @returns a new Color3 object\r\n */\r\n public static Gray(): Color3 {\r\n return new Color3(0.5, 0.5, 0.5);\r\n }\r\n /**\r\n * Returns a Color3 value containing a teal color\r\n * @returns a new Color3 object\r\n */\r\n public static Teal(): Color3 {\r\n return new Color3(0, 1.0, 1.0);\r\n }\r\n /**\r\n * Returns a Color3 value containing a random color\r\n * @returns a new Color3 object\r\n */\r\n public static Random(): Color3 {\r\n return new Color3(Math.random(), Math.random(), Math.random());\r\n }\r\n}\r\n\r\n/**\r\n * Class used to hold a RBGA color\r\n */\r\nexport class Color4 {\r\n /**\r\n * Creates a new Color4 object from red, green, blue values, all between 0 and 1\r\n * @param r defines the red component (between 0 and 1, default is 0)\r\n * @param g defines the green component (between 0 and 1, default is 0)\r\n * @param b defines the blue component (between 0 and 1, default is 0)\r\n * @param a defines the alpha component (between 0 and 1, default is 1)\r\n */\r\n constructor(\r\n /**\r\n * Defines the red component (between 0 and 1, default is 0)\r\n */\r\n public r: number = 0,\r\n /**\r\n * Defines the green component (between 0 and 1, default is 0)\r\n */\r\n public g: number = 0,\r\n /**\r\n * Defines the blue component (between 0 and 1, default is 0)\r\n */\r\n public b: number = 0,\r\n /**\r\n * Defines the alpha component (between 0 and 1, default is 1)\r\n */\r\n public a: number = 1\r\n ) {}\r\n\r\n // Operators\r\n\r\n /**\r\n * Adds in place the given Color4 values to the current Color4 object\r\n * @param right defines the second operand\r\n * @returns the current updated Color4 object\r\n */\r\n public addInPlace(right: DeepImmutable<Color4>): Color4 {\r\n this.r += right.r;\r\n this.g += right.g;\r\n this.b += right.b;\r\n this.a += right.a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates a new array populated with 4 numeric elements : red, green, blue, alpha values\r\n * @returns the new array\r\n */\r\n public asArray(): number[] {\r\n return [this.r, this.g, this.b, this.a];\r\n }\r\n\r\n /**\r\n * Stores from the starting index in the given array the Color4 successive values\r\n * @param array defines the array where to store the r,g,b components\r\n * @param index defines an optional index in the target array to define where to start storing values\r\n * @returns the current Color4 object\r\n */\r\n public toArray(array: FloatArray, index: number = 0): Color4 {\r\n array[index] = this.r;\r\n array[index + 1] = this.g;\r\n array[index + 2] = this.b;\r\n array[index + 3] = this.a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Update the current color with values stored in an array from the starting index of the given array\r\n * @param array defines the source array\r\n * @param offset defines an offset in the source array\r\n * @returns the current Color4 object\r\n */\r\n public fromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Color4 {\r\n Color4.FromArrayToRef(array, offset, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Determines equality between Color4 objects\r\n * @param otherColor defines the second operand\r\n * @returns true if the rgba values are equal to the given ones\r\n */\r\n public equals(otherColor: DeepImmutable<Color4>): boolean {\r\n return otherColor && this.r === otherColor.r && this.g === otherColor.g && this.b === otherColor.b && this.a === otherColor.a;\r\n }\r\n\r\n /**\r\n * Creates a new Color4 set with the added values of the current Color4 and of the given one\r\n * @param right defines the second operand\r\n * @returns a new Color4 object\r\n */\r\n public add(right: DeepImmutable<Color4>): Color4 {\r\n return new Color4(this.r + right.r, this.g + right.g, this.b + right.b, this.a + right.a);\r\n }\r\n\r\n /**\r\n * Creates a new Color4 set with the subtracted values of the given one from the current Color4\r\n * @param right defines the second operand\r\n * @returns a new Color4 object\r\n */\r\n public subtract(right: DeepImmutable<Color4>): Color4 {\r\n return new Color4(this.r - right.r, this.g - right.g, this.b - right.b, this.a - right.a);\r\n }\r\n\r\n /**\r\n * Subtracts the given ones from the current Color4 values and stores the results in \"result\"\r\n * @param right defines the second operand\r\n * @param result defines the Color4 object where to store the result\r\n * @returns the current Color4 object\r\n */\r\n public subtractToRef(right: DeepImmutable<Color4>, result: Color4): Color4 {\r\n result.r = this.r - right.r;\r\n result.g = this.g - right.g;\r\n result.b = this.b - right.b;\r\n result.a = this.a - right.a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates a new Color4 with the current Color4 values multiplied by scale\r\n * @param scale defines the scaling factor to apply\r\n * @returns a new Color4 object\r\n */\r\n public scale(scale: number): Color4 {\r\n return new Color4(this.r * scale, this.g * scale, this.b * scale, this.a * scale);\r\n }\r\n\r\n /**\r\n * Multiplies the Color4 values by the float \"scale\"\r\n * @param scale defines the scaling factor to apply\r\n * @returns the current updated Color4\r\n */\r\n public scaleInPlace(scale: number): Color4 {\r\n this.r *= scale;\r\n this.g *= scale;\r\n this.b *= scale;\r\n this.a *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies the current Color4 values by scale and stores the result in \"result\"\r\n * @param scale defines the scaling factor to apply\r\n * @param result defines the Color4 object where to store the result\r\n * @returns the current unmodified Color4\r\n */\r\n public scaleToRef(scale: number, result: Color4): Color4 {\r\n result.r = this.r * scale;\r\n result.g = this.g * scale;\r\n result.b = this.b * scale;\r\n result.a = this.a * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Scale the current Color4 values by a factor and add the result to a given Color4\r\n * @param scale defines the scale factor\r\n * @param result defines the Color4 object where to store the result\r\n * @returns the unmodified current Color4\r\n */\r\n public scaleAndAddToRef(scale: number, result: Color4): Color4 {\r\n result.r += this.r * scale;\r\n result.g += this.g * scale;\r\n result.b += this.b * scale;\r\n result.a += this.a * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Clamps the rgb values by the min and max values and stores the result into \"result\"\r\n * @param min defines minimum clamping value (default is 0)\r\n * @param max defines maximum clamping value (default is 1)\r\n * @param result defines color to store the result into.\r\n * @returns the current Color4\r\n */\r\n public clampToRef(min: number = 0, max: number = 1, result: Color4): Color4 {\r\n result.r = Scalar.Clamp(this.r, min, max);\r\n result.g = Scalar.Clamp(this.g, min, max);\r\n result.b = Scalar.Clamp(this.b, min, max);\r\n result.a = Scalar.Clamp(this.a, min, max);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiply an Color4 value by another and return a new Color4 object\r\n * @param color defines the Color4 value to multiply by\r\n * @returns a new Color4 object\r\n */\r\n public multiply(color: Color4): Color4 {\r\n return new Color4(this.r * color.r, this.g * color.g, this.b * color.b, this.a * color.a);\r\n }\r\n\r\n /**\r\n * Multiply a Color4 value by another and push the result in a reference value\r\n * @param color defines the Color4 value to multiply by\r\n * @param result defines the Color4 to fill the result in\r\n * @returns the result Color4\r\n */\r\n public multiplyToRef(color: Color4, result: Color4): Color4 {\r\n result.r = this.r * color.r;\r\n result.g = this.g * color.g;\r\n result.b = this.b * color.b;\r\n result.a = this.a * color.a;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a string with the Color4 current values\r\n * @returns the string representation of the Color4 object\r\n */\r\n public toString(): string {\r\n return \"{R: \" + this.r + \" G:\" + this.g + \" B:\" + this.b + \" A:\" + this.a + \"}\";\r\n }\r\n\r\n /**\r\n * Returns the string \"Color4\"\r\n * @returns \"Color4\"\r\n */\r\n public getClassName(): string {\r\n return \"Color4\";\r\n }\r\n\r\n /**\r\n * Compute the Color4 hash code\r\n * @returns an unique number that can be used to hash Color4 objects\r\n */\r\n public getHashCode(): number {\r\n let hash = (this.r * 255) | 0;\r\n hash = (hash * 397) ^ ((this.g * 255) | 0);\r\n hash = (hash * 397) ^ ((this.b * 255) | 0);\r\n hash = (hash * 397) ^ ((this.a * 255) | 0);\r\n return hash;\r\n }\r\n\r\n /**\r\n * Creates a new Color4 copied from the current one\r\n * @returns a new Color4 object\r\n */\r\n public clone(): Color4 {\r\n return new Color4(this.r, this.g, this.b, this.a);\r\n }\r\n\r\n /**\r\n * Copies the given Color4 values into the current one\r\n * @param source defines the source Color4 object\r\n * @returns the current updated Color4 object\r\n */\r\n public copyFrom(source: Color4): Color4 {\r\n this.r = source.r;\r\n this.g = source.g;\r\n this.b = source.b;\r\n this.a = source.a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Copies the given float values into the current one\r\n * @param r defines the red component to read from\r\n * @param g defines the green component to read from\r\n * @param b defines the blue component to read from\r\n * @param a defines the alpha component to read from\r\n * @returns the current updated Color4 object\r\n */\r\n public copyFromFloats(r: number, g: number, b: number, a: number): Color4 {\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Copies the given float values into the current one\r\n * @param r defines the red component to read from\r\n * @param g defines the green component to read from\r\n * @param b defines the blue component to read from\r\n * @param a defines the alpha component to read from\r\n * @returns the current updated Color4 object\r\n */\r\n public set(r: number, g: number, b: number, a: number): Color4 {\r\n return this.copyFromFloats(r, g, b, a);\r\n }\r\n\r\n /**\r\n * Compute the Color4 hexadecimal code as a string\r\n * @param returnAsColor3 defines if the string should only contains RGB values (off by default)\r\n * @returns a string containing the hexadecimal representation of the Color4 object\r\n */\r\n public toHexString(returnAsColor3 = false): string {\r\n const intR = Math.round(this.r * 255);\r\n const intG = Math.round(this.g * 255);\r\n const intB = Math.round(this.b * 255);\r\n\r\n if (returnAsColor3) {\r\n return \"#\" + Scalar.ToHex(intR) + Scalar.ToHex(intG) + Scalar.ToHex(intB);\r\n }\r\n\r\n const intA = Math.round(this.a * 255);\r\n return \"#\" + Scalar.ToHex(intR) + Scalar.ToHex(intG) + Scalar.ToHex(intB) + Scalar.ToHex(intA);\r\n }\r\n\r\n /**\r\n * Computes a new Color4 converted from the current one to linear space\r\n * @returns a new Color4 object\r\n */\r\n public toLinearSpace(): Color4 {\r\n const convertedColor = new Color4();\r\n this.toLinearSpaceToRef(convertedColor);\r\n return convertedColor;\r\n }\r\n\r\n /**\r\n * Converts the Color4 values to linear space and stores the result in \"convertedColor\"\r\n * @param convertedColor defines the Color4 object where to store the linear space version\r\n * @returns the unmodified Color4\r\n */\r\n public toLinearSpaceToRef(convertedColor: Color4): Color4 {\r\n convertedColor.r = Math.pow(this.r, ToLinearSpace);\r\n convertedColor.g = Math.pow(this.g, ToLinearSpace);\r\n convertedColor.b = Math.pow(this.b, ToLinearSpace);\r\n convertedColor.a = this.a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Computes a new Color4 converted from the current one to gamma space\r\n * @returns a new Color4 object\r\n */\r\n public toGammaSpace(): Color4 {\r\n const convertedColor = new Color4();\r\n this.toGammaSpaceToRef(convertedColor);\r\n return convertedColor;\r\n }\r\n\r\n /**\r\n * Converts the Color4 values to gamma space and stores the result in \"convertedColor\"\r\n * @param convertedColor defines the Color4 object where to store the gamma space version\r\n * @returns the unmodified Color4\r\n */\r\n public toGammaSpaceToRef(convertedColor: Color4): Color4 {\r\n convertedColor.r = Math.pow(this.r, ToGammaSpace);\r\n convertedColor.g = Math.pow(this.g, ToGammaSpace);\r\n convertedColor.b = Math.pow(this.b, ToGammaSpace);\r\n convertedColor.a = this.a;\r\n return this;\r\n }\r\n\r\n // Statics\r\n\r\n /**\r\n * Creates a new Color4 from the string containing valid hexadecimal values.\r\n *\r\n * A valid hex string is either in the format #RRGGBB or #RRGGBBAA.\r\n *\r\n * When a hex string without alpha is passed, the resulting Color4 has\r\n * its alpha value set to 1.0.\r\n *\r\n * An invalid string results in a Color with all its channels set to 0.0,\r\n * i.e. \"transparent black\".\r\n *\r\n * @param hex defines a string containing valid hexadecimal values\r\n * @returns a new Color4 object\r\n */\r\n public static FromHexString(hex: string): Color4 {\r\n if (hex.substring(0, 1) !== \"#\" || (hex.length !== 9 && hex.length !== 7)) {\r\n return new Color4(0.0, 0.0, 0.0, 0.0);\r\n }\r\n\r\n const r = parseInt(hex.substring(1, 3), 16);\r\n const g = parseInt(hex.substring(3, 5), 16);\r\n const b = parseInt(hex.substring(5, 7), 16);\r\n const a = hex.length === 9 ? parseInt(hex.substring(7, 9), 16) : 255;\r\n\r\n return Color4.FromInts(r, g, b, a);\r\n }\r\n\r\n /**\r\n * Creates a new Color4 object set with the linearly interpolated values of \"amount\" between the left Color4 object and the right Color4 object\r\n * @param left defines the start value\r\n * @param right defines the end value\r\n * @param amount defines the gradient factor\r\n * @returns a new Color4 object\r\n */\r\n public static Lerp(left: DeepImmutable<Color4>, right: DeepImmutable<Color4>, amount: number): Color4 {\r\n const result = new Color4(0.0, 0.0, 0.0, 0.0);\r\n Color4.LerpToRef(left, right, amount, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Set the given \"result\" with the linearly interpolated values of \"amount\" between the left Color4 object and the right Color4 object\r\n * @param left defines the start value\r\n * @param right defines the end value\r\n * @param amount defines the gradient factor\r\n * @param result defines the Color4 object where to store data\r\n */\r\n public static LerpToRef(left: DeepImmutable<Color4>, right: DeepImmutable<Color4>, amount: number, result: Color4): void {\r\n result.r = left.r + (right.r - left.r) * amount;\r\n result.g = left.g + (right.g - left.g) * amount;\r\n result.b = left.b + (right.b - left.b) * amount;\r\n result.a = left.a + (right.a - left.a) * amount;\r\n }\r\n\r\n /**\r\n * Interpolate between two Color4 using Hermite interpolation\r\n * @param value1 defines first Color4\r\n * @param tangent1 defines the incoming tangent\r\n * @param value2 defines second Color4\r\n * @param tangent2 defines the outgoing tangent\r\n * @param amount defines the target Color4\r\n * @returns the new interpolated Color4\r\n */\r\n public static Hermite(value1: DeepImmutable<Color4>, tangent1: DeepImmutable<Color4>, value2: DeepImmutable<Color4>, tangent2: DeepImmutable<Color4>, amount: number): Color4 {\r\n const squared = amount * amount;\r\n const cubed = amount * squared;\r\n const part1 = 2.0 * cubed - 3.0 * squared + 1.0;\r\n const part2 = -2.0 * cubed + 3.0 * squared;\r\n const part3 = cubed - 2.0 * squared + amount;\r\n const part4 = cubed - squared;\r\n\r\n const r = value1.r * part1 + value2.r * part2 + tangent1.r * part3 + tangent2.r * part4;\r\n const g = value1.g * part1 + value2.g * part2 + tangent1.g * part3 + tangent2.g * part4;\r\n const b = value1.b * part1 + value2.b * part2 + tangent1.b * part3 + tangent2.b * part4;\r\n const a = value1.a * part1 + value2.a * part2 + tangent1.a * part3 + tangent2.a * part4;\r\n return new Color4(r, g, b, a);\r\n }\r\n\r\n /**\r\n * Returns a new Color4 which is the 1st derivative of the Hermite spline defined by the colors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent\r\n * @param time define where the derivative must be done\r\n * @returns 1st derivative\r\n */\r\n public static Hermite1stDerivative(\r\n value1: DeepImmutable<Color4>,\r\n tangent1: DeepImmutable<Color4>,\r\n value2: DeepImmutable<Color4>,\r\n tangent2: DeepImmutable<Color4>,\r\n time: number\r\n ): Color4 {\r\n const result = new Color4();\r\n\r\n this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Update a Color4 with the 1st derivative of the Hermite spline defined by the colors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent\r\n * @param time define where the derivative must be done\r\n * @param result define where to store the derivative\r\n */\r\n public static Hermite1stDerivativeToRef(\r\n value1: DeepImmutable<Color4>,\r\n tangent1: DeepImmutable<Color4>,\r\n value2: DeepImmutable<Color4>,\r\n tangent2: DeepImmutable<Color4>,\r\n time: number,\r\n result: Color4\r\n ) {\r\n const t2 = time * time;\r\n\r\n result.r = (t2 - time) * 6 * value1.r + (3 * t2 - 4 * time + 1) * tangent1.r + (-t2 + time) * 6 * value2.r + (3 * t2 - 2 * time) * tangent2.r;\r\n result.g = (t2 - time) * 6 * value1.g + (3 * t2 - 4 * time + 1) * tangent1.g + (-t2 + time) * 6 * value2.g + (3 * t2 - 2 * time) * tangent2.g;\r\n result.b = (t2 - time) * 6 * value1.b + (3 * t2 - 4 * time + 1) * tangent1.b + (-t2 + time) * 6 * value2.b + (3 * t2 - 2 * time) * tangent2.b;\r\n result.a = (t2 - time) * 6 * value1.a + (3 * t2 - 4 * time + 1) * tangent1.a + (-t2 + time) * 6 * value2.a + (3 * t2 - 2 * time) * tangent2.a;\r\n }\r\n\r\n /**\r\n * Creates a new Color4 from a Color3 and an alpha value\r\n * @param color3 defines the source Color3 to read from\r\n * @param alpha defines the alpha component (1.0 by default)\r\n * @returns a new Color4 object\r\n */\r\n public static FromColor3(color3: DeepImmutable<Color3>, alpha: number = 1.0): Color4 {\r\n return new Color4(color3.r, color3.g, color3.b, alpha);\r\n }\r\n\r\n /**\r\n * Creates a new Color4 from the starting index element of the given array\r\n * @param array defines the source array to read from\r\n * @param offset defines the offset in the source array\r\n * @returns a new Color4 object\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Color4 {\r\n return new Color4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);\r\n }\r\n\r\n /**\r\n * Creates a new Color4 from the starting index element of the given array\r\n * @param array defines the source array to read from\r\n * @param offset defines the offset in the source array\r\n * @param result defines the target Color4 object\r\n */\r\n public static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number = 0, result: Color4) {\r\n result.r = array[offset];\r\n result.g = array[offset + 1];\r\n result.b = array[offset + 2];\r\n result.a = array[offset + 3];\r\n }\r\n\r\n /**\r\n * Creates a new Color3 from integer values (< 256)\r\n * @param r defines the red component to read from (value between 0 and 255)\r\n * @param g defines the green component to read from (value between 0 and 255)\r\n * @param b defines the blue component to read from (value between 0 and 255)\r\n * @param a defines the alpha component to read from (value between 0 and 255)\r\n * @returns a new Color3 object\r\n */\r\n public static FromInts(r: number, g: number, b: number, a: number): Color4 {\r\n return new Color4(r / 255.0, g / 255.0, b / 255.0, a / 255.0);\r\n }\r\n\r\n /**\r\n * Check the content of a given array and convert it to an array containing RGBA data\r\n * If the original array was already containing count * 4 values then it is returned directly\r\n * @param colors defines the array to check\r\n * @param count defines the number of RGBA data to expect\r\n * @returns an array containing count * 4 values (RGBA)\r\n */\r\n public static CheckColors4(colors: number[], count: number): number[] {\r\n // Check if color3 was used\r\n if (colors.length === count * 3) {\r\n const colors4 = [];\r\n for (let index = 0; index < colors.length; index += 3) {\r\n const newIndex = (index / 3) * 4;\r\n colors4[newIndex] = colors[index];\r\n colors4[newIndex + 1] = colors[index + 1];\r\n colors4[newIndex + 2] = colors[index + 2];\r\n colors4[newIndex + 3] = 1.0;\r\n }\r\n\r\n return colors4;\r\n }\r\n\r\n return colors;\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class TmpColors {\r\n public static Color3: Color3[] = ArrayTools.BuildArray(3, Color3.Black);\r\n public static Color4: Color4[] = ArrayTools.BuildArray(3, () => new Color4(0, 0, 0, 0));\r\n}\r\n\r\nRegisterClass(\"BABYLON.Color3\", Color3);\r\nRegisterClass(\"BABYLON.Color4\", Color4);\r\n"]}
|
|
1
|
+
{"version":3,"file":"math.color.js","sourceRoot":"","sources":["../../../../lts/core/generated/Maths/math.color.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,SAAS,yBAAyB,CAAC,KAAa;IAC5C,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,8BAA8B,CAAC,KAAa;IACjD,IAAI,KAAK,IAAI,OAAO,EAAE;QAClB,OAAO,YAAY,GAAG,KAAK,CAAC;KAC/B;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAa;IAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;AACz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,GAAG,EAAE,CAAC;YACnB,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE;gBACnD,MAAM,QAAQ,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;gBACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;gBAC1C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;gBAC1C,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;aAC/B;YAED,OAAO,OAAO,CAAC;SAClB;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,SAAS;;AACJ,gBAAM,GAAa,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,gBAAM,GAAa,UAAU,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAG5F,aAAa,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AACxC,aAAa,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC","sourcesContent":["import type { DeepImmutable, FloatArray } from \"../types\";\r\nimport { Scalar } from \"./math.scalar\";\r\nimport { ToLinearSpace, ToGammaSpace } from \"./math.constants\";\r\nimport { ArrayTools } from \"../Misc/arrayTools\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\n\r\nfunction colorChannelToLinearSpace(color: number): number {\r\n return Math.pow(color, ToLinearSpace);\r\n}\r\n\r\nfunction colorChannelToLinearSpaceExact(color: number): number {\r\n if (color <= 0.04045) {\r\n return 0.0773993808 * color;\r\n }\r\n return Math.pow(0.947867299 * (color + 0.055), 2.4);\r\n}\r\n\r\nfunction colorChannelToGammaSpace(color: number): number {\r\n return Math.pow(color, ToGammaSpace);\r\n}\r\n\r\nfunction colorChannelToGammaSpaceExact(color: number): number {\r\n if (color <= 0.0031308) {\r\n return 12.92 * color;\r\n }\r\n return 1.055 * Math.pow(color, 0.41666) - 0.055;\r\n}\r\n\r\n/**\r\n * Class used to hold a RGB color\r\n */\r\nexport class Color3 {\r\n /**\r\n * Creates a new Color3 object from red, green, blue values, all between 0 and 1\r\n * @param r defines the red component (between 0 and 1, default is 0)\r\n * @param g defines the green component (between 0 and 1, default is 0)\r\n * @param b defines the blue component (between 0 and 1, default is 0)\r\n */\r\n constructor(\r\n /**\r\n * Defines the red component (between 0 and 1, default is 0)\r\n */\r\n public r: number = 0,\r\n /**\r\n * Defines the green component (between 0 and 1, default is 0)\r\n */\r\n public g: number = 0,\r\n /**\r\n * Defines the blue component (between 0 and 1, default is 0)\r\n */\r\n public b: number = 0\r\n ) {}\r\n\r\n /**\r\n * Creates a string with the Color3 current values\r\n * @returns the string representation of the Color3 object\r\n */\r\n public toString(): string {\r\n return \"{R: \" + this.r + \" G:\" + this.g + \" B:\" + this.b + \"}\";\r\n }\r\n\r\n /**\r\n * Returns the string \"Color3\"\r\n * @returns \"Color3\"\r\n */\r\n public getClassName(): string {\r\n return \"Color3\";\r\n }\r\n\r\n /**\r\n * Compute the Color3 hash code\r\n * @returns an unique number that can be used to hash Color3 objects\r\n */\r\n public getHashCode(): number {\r\n let hash = (this.r * 255) | 0;\r\n hash = (hash * 397) ^ ((this.g * 255) | 0);\r\n hash = (hash * 397) ^ ((this.b * 255) | 0);\r\n return hash;\r\n }\r\n\r\n // Operators\r\n\r\n /**\r\n * Stores in the given array from the given starting index the red, green, blue values as successive elements\r\n * @param array defines the array where to store the r,g,b components\r\n * @param index defines an optional index in the target array to define where to start storing values\r\n * @returns the current Color3 object\r\n */\r\n public toArray(array: FloatArray, index: number = 0): Color3 {\r\n array[index] = this.r;\r\n array[index + 1] = this.g;\r\n array[index + 2] = this.b;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Update the current color with values stored in an array from the starting index of the given array\r\n * @param array defines the source array\r\n * @param offset defines an offset in the source array\r\n * @returns the current Color3 object\r\n */\r\n public fromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Color3 {\r\n Color3.FromArrayToRef(array, offset, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Color4 object from the current Color3 and the given alpha\r\n * @param alpha defines the alpha component on the new Color4 object (default is 1)\r\n * @returns a new Color4 object\r\n */\r\n public toColor4(alpha: number = 1): Color4 {\r\n return new Color4(this.r, this.g, this.b, alpha);\r\n }\r\n\r\n /**\r\n * Returns a new array populated with 3 numeric elements : red, green and blue values\r\n * @returns the new array\r\n */\r\n public asArray(): number[] {\r\n return [this.r, this.g, this.b];\r\n }\r\n\r\n /**\r\n * Returns the luminance value\r\n * @returns a float value\r\n */\r\n public toLuminance(): number {\r\n return this.r * 0.3 + this.g * 0.59 + this.b * 0.11;\r\n }\r\n\r\n /**\r\n * Multiply each Color3 rgb values by the given Color3 rgb values in a new Color3 object\r\n * @param otherColor defines the second operand\r\n * @returns the new Color3 object\r\n */\r\n public multiply(otherColor: DeepImmutable<Color3>): Color3 {\r\n return new Color3(this.r * otherColor.r, this.g * otherColor.g, this.b * otherColor.b);\r\n }\r\n\r\n /**\r\n * Multiply the rgb values of the Color3 and the given Color3 and stores the result in the object \"result\"\r\n * @param otherColor defines the second operand\r\n * @param result defines the Color3 object where to store the result\r\n * @returns the current Color3\r\n */\r\n public multiplyToRef(otherColor: DeepImmutable<Color3>, result: Color3): Color3 {\r\n result.r = this.r * otherColor.r;\r\n result.g = this.g * otherColor.g;\r\n result.b = this.b * otherColor.b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Determines equality between Color3 objects\r\n * @param otherColor defines the second operand\r\n * @returns true if the rgb values are equal to the given ones\r\n */\r\n public equals(otherColor: DeepImmutable<Color3>): boolean {\r\n return otherColor && this.r === otherColor.r && this.g === otherColor.g && this.b === otherColor.b;\r\n }\r\n\r\n /**\r\n * Determines equality between the current Color3 object and a set of r,b,g values\r\n * @param r defines the red component to check\r\n * @param g defines the green component to check\r\n * @param b defines the blue component to check\r\n * @returns true if the rgb values are equal to the given ones\r\n */\r\n public equalsFloats(r: number, g: number, b: number): boolean {\r\n return this.r === r && this.g === g && this.b === b;\r\n }\r\n\r\n /**\r\n * Creates a new Color3 with the current Color3 values multiplied by scale\r\n * @param scale defines the scaling factor to apply\r\n * @returns a new Color3 object\r\n */\r\n public scale(scale: number): Color3 {\r\n return new Color3(this.r * scale, this.g * scale, this.b * scale);\r\n }\r\n\r\n /**\r\n * Multiplies the Color3 values by the float \"scale\"\r\n * @param scale defines the scaling factor to apply\r\n * @returns the current updated Color3\r\n */\r\n public scaleInPlace(scale: number): Color3 {\r\n this.r *= scale;\r\n this.g *= scale;\r\n this.b *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies the rgb values by scale and stores the result into \"result\"\r\n * @param scale defines the scaling factor\r\n * @param result defines the Color3 object where to store the result\r\n * @returns the unmodified current Color3\r\n */\r\n public scaleToRef(scale: number, result: Color3): Color3 {\r\n result.r = this.r * scale;\r\n result.g = this.g * scale;\r\n result.b = this.b * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Scale the current Color3 values by a factor and add the result to a given Color3\r\n * @param scale defines the scale factor\r\n * @param result defines color to store the result into\r\n * @returns the unmodified current Color3\r\n */\r\n public scaleAndAddToRef(scale: number, result: Color3): Color3 {\r\n result.r += this.r * scale;\r\n result.g += this.g * scale;\r\n result.b += this.b * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Clamps the rgb values by the min and max values and stores the result into \"result\"\r\n * @param min defines minimum clamping value (default is 0)\r\n * @param max defines maximum clamping value (default is 1)\r\n * @param result defines color to store the result into\r\n * @returns the original Color3\r\n */\r\n public clampToRef(min: number = 0, max: number = 1, result: Color3): Color3 {\r\n result.r = Scalar.Clamp(this.r, min, max);\r\n result.g = Scalar.Clamp(this.g, min, max);\r\n result.b = Scalar.Clamp(this.b, min, max);\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates a new Color3 set with the added values of the current Color3 and of the given one\r\n * @param otherColor defines the second operand\r\n * @returns the new Color3\r\n */\r\n public add(otherColor: DeepImmutable<Color3>): Color3 {\r\n return new Color3(this.r + otherColor.r, this.g + otherColor.g, this.b + otherColor.b);\r\n }\r\n\r\n /**\r\n * Stores the result of the addition of the current Color3 and given one rgb values into \"result\"\r\n * @param otherColor defines the second operand\r\n * @param result defines Color3 object to store the result into\r\n * @returns the unmodified current Color3\r\n */\r\n public addToRef(otherColor: DeepImmutable<Color3>, result: Color3): Color3 {\r\n result.r = this.r + otherColor.r;\r\n result.g = this.g + otherColor.g;\r\n result.b = this.b + otherColor.b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Color3 set with the subtracted values of the given one from the current Color3\r\n * @param otherColor defines the second operand\r\n * @returns the new Color3\r\n */\r\n public subtract(otherColor: DeepImmutable<Color3>): Color3 {\r\n return new Color3(this.r - otherColor.r, this.g - otherColor.g, this.b - otherColor.b);\r\n }\r\n\r\n /**\r\n * Stores the result of the subtraction of given one from the current Color3 rgb values into \"result\"\r\n * @param otherColor defines the second operand\r\n * @param result defines Color3 object to store the result into\r\n * @returns the unmodified current Color3\r\n */\r\n public subtractToRef(otherColor: DeepImmutable<Color3>, result: Color3): Color3 {\r\n result.r = this.r - otherColor.r;\r\n result.g = this.g - otherColor.g;\r\n result.b = this.b - otherColor.b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Copy the current object\r\n * @returns a new Color3 copied the current one\r\n */\r\n public clone(): Color3 {\r\n return new Color3(this.r, this.g, this.b);\r\n }\r\n\r\n /**\r\n * Copies the rgb values from the source in the current Color3\r\n * @param source defines the source Color3 object\r\n * @returns the updated Color3 object\r\n */\r\n public copyFrom(source: DeepImmutable<Color3>): Color3 {\r\n this.r = source.r;\r\n this.g = source.g;\r\n this.b = source.b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the Color3 rgb values from the given floats\r\n * @param r defines the red component to read from\r\n * @param g defines the green component to read from\r\n * @param b defines the blue component to read from\r\n * @returns the current Color3 object\r\n */\r\n public copyFromFloats(r: number, g: number, b: number): Color3 {\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the Color3 rgb values from the given floats\r\n * @param r defines the red component to read from\r\n * @param g defines the green component to read from\r\n * @param b defines the blue component to read from\r\n * @returns the current Color3 object\r\n */\r\n public set(r: number, g: number, b: number): Color3 {\r\n return this.copyFromFloats(r, g, b);\r\n }\r\n\r\n /**\r\n * Compute the Color3 hexadecimal code as a string\r\n * @returns a string containing the hexadecimal representation of the Color3 object\r\n */\r\n public toHexString(): string {\r\n const intR = Math.round(this.r * 255);\r\n const intG = Math.round(this.g * 255);\r\n const intB = Math.round(this.b * 255);\r\n return \"#\" + Scalar.ToHex(intR) + Scalar.ToHex(intG) + Scalar.ToHex(intB);\r\n }\r\n\r\n /**\r\n * Converts current color in rgb space to HSV values\r\n * @returns a new color3 representing the HSV values\r\n */\r\n public toHSV(): Color3 {\r\n const result = new Color3();\r\n\r\n this.toHSVToRef(result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Converts current color in rgb space to HSV values\r\n * @param result defines the Color3 where to store the HSV values\r\n */\r\n public toHSVToRef(result: Color3) {\r\n const r = this.r;\r\n const g = this.g;\r\n const b = this.b;\r\n\r\n const max = Math.max(r, g, b);\r\n const min = Math.min(r, g, b);\r\n let h = 0;\r\n let s = 0;\r\n const v = max;\r\n\r\n const dm = max - min;\r\n\r\n if (max !== 0) {\r\n s = dm / max;\r\n }\r\n\r\n if (max != min) {\r\n if (max == r) {\r\n h = (g - b) / dm;\r\n if (g < b) {\r\n h += 6;\r\n }\r\n } else if (max == g) {\r\n h = (b - r) / dm + 2;\r\n } else if (max == b) {\r\n h = (r - g) / dm + 4;\r\n }\r\n h *= 60;\r\n }\r\n\r\n result.r = h;\r\n result.g = s;\r\n result.b = v;\r\n }\r\n\r\n /**\r\n * Computes a new Color3 converted from the current one to linear space\r\n * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)\r\n * @returns a new Color3 object\r\n */\r\n public toLinearSpace(exact = false): Color3 {\r\n const convertedColor = new Color3();\r\n this.toLinearSpaceToRef(convertedColor, exact);\r\n return convertedColor;\r\n }\r\n\r\n /**\r\n * Converts the Color3 values to linear space and stores the result in \"convertedColor\"\r\n * @param convertedColor defines the Color3 object where to store the linear space version\r\n * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)\r\n * @returns the unmodified Color3\r\n */\r\n public toLinearSpaceToRef(convertedColor: Color3, exact = false): Color3 {\r\n if (exact) {\r\n convertedColor.r = colorChannelToLinearSpaceExact(this.r);\r\n convertedColor.g = colorChannelToLinearSpaceExact(this.g);\r\n convertedColor.b = colorChannelToLinearSpaceExact(this.b);\r\n } else {\r\n convertedColor.r = colorChannelToLinearSpace(this.r);\r\n convertedColor.g = colorChannelToLinearSpace(this.g);\r\n convertedColor.b = colorChannelToLinearSpace(this.b);\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Computes a new Color3 converted from the current one to gamma space\r\n * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)\r\n * @returns a new Color3 object\r\n */\r\n public toGammaSpace(exact = false): Color3 {\r\n const convertedColor = new Color3();\r\n this.toGammaSpaceToRef(convertedColor, exact);\r\n return convertedColor;\r\n }\r\n\r\n /**\r\n * Converts the Color3 values to gamma space and stores the result in \"convertedColor\"\r\n * @param convertedColor defines the Color3 object where to store the gamma space version\r\n * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)\r\n * @returns the unmodified Color3\r\n */\r\n public toGammaSpaceToRef(convertedColor: Color3, exact = false): Color3 {\r\n if (exact) {\r\n convertedColor.r = colorChannelToGammaSpaceExact(this.r);\r\n convertedColor.g = colorChannelToGammaSpaceExact(this.g);\r\n convertedColor.b = colorChannelToGammaSpaceExact(this.b);\r\n } else {\r\n convertedColor.r = colorChannelToGammaSpace(this.r);\r\n convertedColor.g = colorChannelToGammaSpace(this.g);\r\n convertedColor.b = colorChannelToGammaSpace(this.b);\r\n }\r\n return this;\r\n }\r\n\r\n // Statics\r\n\r\n private static _BlackReadOnly = Color3.Black() as DeepImmutable<Color3>;\r\n\r\n /**\r\n * Converts Hue, saturation and value to a Color3 (RGB)\r\n * @param hue defines the hue\r\n * @param saturation defines the saturation\r\n * @param value defines the value\r\n * @param result defines the Color3 where to store the RGB values\r\n */\r\n public static HSVtoRGBToRef(hue: number, saturation: number, value: number, result: Color3) {\r\n const chroma = value * saturation;\r\n const h = hue / 60;\r\n const x = chroma * (1 - Math.abs((h % 2) - 1));\r\n let r = 0;\r\n let g = 0;\r\n let b = 0;\r\n\r\n if (h >= 0 && h <= 1) {\r\n r = chroma;\r\n g = x;\r\n } else if (h >= 1 && h <= 2) {\r\n r = x;\r\n g = chroma;\r\n } else if (h >= 2 && h <= 3) {\r\n g = chroma;\r\n b = x;\r\n } else if (h >= 3 && h <= 4) {\r\n g = x;\r\n b = chroma;\r\n } else if (h >= 4 && h <= 5) {\r\n r = x;\r\n b = chroma;\r\n } else if (h >= 5 && h <= 6) {\r\n r = chroma;\r\n b = x;\r\n }\r\n\r\n const m = value - chroma;\r\n result.set(r + m, g + m, b + m);\r\n }\r\n\r\n /**\r\n * Converts Hue, saturation and value to a new Color3 (RGB)\r\n * @param hue defines the hue (value between 0 and 360)\r\n * @param saturation defines the saturation (value between 0 and 1)\r\n * @param value defines the value (value between 0 and 1)\r\n * @returns a new Color3 object\r\n */\r\n public static FromHSV(hue: number, saturation: number, value: number): Color3 {\r\n const result = new Color3(0, 0, 0);\r\n Color3.HSVtoRGBToRef(hue, saturation, value, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new Color3 from the string containing valid hexadecimal values\r\n * @param hex defines a string containing valid hexadecimal values\r\n * @returns a new Color3 object\r\n */\r\n public static FromHexString(hex: string): Color3 {\r\n if (hex.substring(0, 1) !== \"#\" || hex.length !== 7) {\r\n return new Color3(0, 0, 0);\r\n }\r\n\r\n const r = parseInt(hex.substring(1, 3), 16);\r\n const g = parseInt(hex.substring(3, 5), 16);\r\n const b = parseInt(hex.substring(5, 7), 16);\r\n\r\n return Color3.FromInts(r, g, b);\r\n }\r\n\r\n /**\r\n * Creates a new Color3 from the starting index of the given array\r\n * @param array defines the source array\r\n * @param offset defines an offset in the source array\r\n * @returns a new Color3 object\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Color3 {\r\n return new Color3(array[offset], array[offset + 1], array[offset + 2]);\r\n }\r\n\r\n /**\r\n * Creates a new Color3 from the starting index element of the given array\r\n * @param array defines the source array to read from\r\n * @param offset defines the offset in the source array\r\n * @param result defines the target Color3 object\r\n */\r\n public static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number = 0, result: Color3) {\r\n result.r = array[offset];\r\n result.g = array[offset + 1];\r\n result.b = array[offset + 2];\r\n }\r\n\r\n /**\r\n * Creates a new Color3 from integer values (< 256)\r\n * @param r defines the red component to read from (value between 0 and 255)\r\n * @param g defines the green component to read from (value between 0 and 255)\r\n * @param b defines the blue component to read from (value between 0 and 255)\r\n * @returns a new Color3 object\r\n */\r\n public static FromInts(r: number, g: number, b: number): Color3 {\r\n return new Color3(r / 255.0, g / 255.0, b / 255.0);\r\n }\r\n\r\n /**\r\n * Creates a new Color3 with values linearly interpolated of \"amount\" between the start Color3 and the end Color3\r\n * @param start defines the start Color3 value\r\n * @param end defines the end Color3 value\r\n * @param amount defines the gradient value between start and end\r\n * @returns a new Color3 object\r\n */\r\n public static Lerp(start: DeepImmutable<Color3>, end: DeepImmutable<Color3>, amount: number): Color3 {\r\n const result = new Color3(0.0, 0.0, 0.0);\r\n Color3.LerpToRef(start, end, amount, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new Color3 with values linearly interpolated of \"amount\" between the start Color3 and the end Color3\r\n * @param left defines the start value\r\n * @param right defines the end value\r\n * @param amount defines the gradient factor\r\n * @param result defines the Color3 object where to store the result\r\n */\r\n public static LerpToRef(left: DeepImmutable<Color3>, right: DeepImmutable<Color3>, amount: number, result: Color3): void {\r\n result.r = left.r + (right.r - left.r) * amount;\r\n result.g = left.g + (right.g - left.g) * amount;\r\n result.b = left.b + (right.b - left.b) * amount;\r\n }\r\n\r\n /**\r\n * Returns a new Color3 located for \"amount\" (float) on the Hermite interpolation spline defined by the vectors \"value1\", \"tangent1\", \"value2\", \"tangent2\"\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent Color3\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent Color3\r\n * @param amount defines the amount on the interpolation spline (between 0 and 1)\r\n * @returns the new Color3\r\n */\r\n public static Hermite(value1: DeepImmutable<Color3>, tangent1: DeepImmutable<Color3>, value2: DeepImmutable<Color3>, tangent2: DeepImmutable<Color3>, amount: number): Color3 {\r\n const squared = amount * amount;\r\n const cubed = amount * squared;\r\n const part1 = 2.0 * cubed - 3.0 * squared + 1.0;\r\n const part2 = -2.0 * cubed + 3.0 * squared;\r\n const part3 = cubed - 2.0 * squared + amount;\r\n const part4 = cubed - squared;\r\n\r\n const r = value1.r * part1 + value2.r * part2 + tangent1.r * part3 + tangent2.r * part4;\r\n const g = value1.g * part1 + value2.g * part2 + tangent1.g * part3 + tangent2.g * part4;\r\n const b = value1.b * part1 + value2.b * part2 + tangent1.b * part3 + tangent2.b * part4;\r\n return new Color3(r, g, b);\r\n }\r\n\r\n /**\r\n * Returns a new Color3 which is the 1st derivative of the Hermite spline defined by the colors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent\r\n * @param time define where the derivative must be done\r\n * @returns 1st derivative\r\n */\r\n public static Hermite1stDerivative(\r\n value1: DeepImmutable<Color3>,\r\n tangent1: DeepImmutable<Color3>,\r\n value2: DeepImmutable<Color3>,\r\n tangent2: DeepImmutable<Color3>,\r\n time: number\r\n ): Color3 {\r\n const result = Color3.Black();\r\n\r\n this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Color3 which is the 1st derivative of the Hermite spline defined by the colors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent\r\n * @param time define where the derivative must be done\r\n * @param result define where to store the derivative\r\n */\r\n public static Hermite1stDerivativeToRef(\r\n value1: DeepImmutable<Color3>,\r\n tangent1: DeepImmutable<Color3>,\r\n value2: DeepImmutable<Color3>,\r\n tangent2: DeepImmutable<Color3>,\r\n time: number,\r\n result: Color3\r\n ) {\r\n const t2 = time * time;\r\n\r\n result.r = (t2 - time) * 6 * value1.r + (3 * t2 - 4 * time + 1) * tangent1.r + (-t2 + time) * 6 * value2.r + (3 * t2 - 2 * time) * tangent2.r;\r\n result.g = (t2 - time) * 6 * value1.g + (3 * t2 - 4 * time + 1) * tangent1.g + (-t2 + time) * 6 * value2.g + (3 * t2 - 2 * time) * tangent2.g;\r\n result.b = (t2 - time) * 6 * value1.b + (3 * t2 - 4 * time + 1) * tangent1.b + (-t2 + time) * 6 * value2.b + (3 * t2 - 2 * time) * tangent2.b;\r\n }\r\n\r\n /**\r\n * Returns a Color3 value containing a red color\r\n * @returns a new Color3 object\r\n */\r\n public static Red(): Color3 {\r\n return new Color3(1, 0, 0);\r\n }\r\n /**\r\n * Returns a Color3 value containing a green color\r\n * @returns a new Color3 object\r\n */\r\n public static Green(): Color3 {\r\n return new Color3(0, 1, 0);\r\n }\r\n /**\r\n * Returns a Color3 value containing a blue color\r\n * @returns a new Color3 object\r\n */\r\n public static Blue(): Color3 {\r\n return new Color3(0, 0, 1);\r\n }\r\n /**\r\n * Returns a Color3 value containing a black color\r\n * @returns a new Color3 object\r\n */\r\n public static Black(): Color3 {\r\n return new Color3(0, 0, 0);\r\n }\r\n\r\n /**\r\n * Gets a Color3 value containing a black color that must not be updated\r\n */\r\n public static get BlackReadOnly(): DeepImmutable<Color3> {\r\n return Color3._BlackReadOnly;\r\n }\r\n\r\n /**\r\n * Returns a Color3 value containing a white color\r\n * @returns a new Color3 object\r\n */\r\n public static White(): Color3 {\r\n return new Color3(1, 1, 1);\r\n }\r\n /**\r\n * Returns a Color3 value containing a purple color\r\n * @returns a new Color3 object\r\n */\r\n public static Purple(): Color3 {\r\n return new Color3(0.5, 0, 0.5);\r\n }\r\n /**\r\n * Returns a Color3 value containing a magenta color\r\n * @returns a new Color3 object\r\n */\r\n public static Magenta(): Color3 {\r\n return new Color3(1, 0, 1);\r\n }\r\n /**\r\n * Returns a Color3 value containing a yellow color\r\n * @returns a new Color3 object\r\n */\r\n public static Yellow(): Color3 {\r\n return new Color3(1, 1, 0);\r\n }\r\n /**\r\n * Returns a Color3 value containing a gray color\r\n * @returns a new Color3 object\r\n */\r\n public static Gray(): Color3 {\r\n return new Color3(0.5, 0.5, 0.5);\r\n }\r\n /**\r\n * Returns a Color3 value containing a teal color\r\n * @returns a new Color3 object\r\n */\r\n public static Teal(): Color3 {\r\n return new Color3(0, 1.0, 1.0);\r\n }\r\n /**\r\n * Returns a Color3 value containing a random color\r\n * @returns a new Color3 object\r\n */\r\n public static Random(): Color3 {\r\n return new Color3(Math.random(), Math.random(), Math.random());\r\n }\r\n}\r\n\r\n/**\r\n * Class used to hold a RBGA color\r\n */\r\nexport class Color4 {\r\n /**\r\n * Creates a new Color4 object from red, green, blue values, all between 0 and 1\r\n * @param r defines the red component (between 0 and 1, default is 0)\r\n * @param g defines the green component (between 0 and 1, default is 0)\r\n * @param b defines the blue component (between 0 and 1, default is 0)\r\n * @param a defines the alpha component (between 0 and 1, default is 1)\r\n */\r\n constructor(\r\n /**\r\n * Defines the red component (between 0 and 1, default is 0)\r\n */\r\n public r: number = 0,\r\n /**\r\n * Defines the green component (between 0 and 1, default is 0)\r\n */\r\n public g: number = 0,\r\n /**\r\n * Defines the blue component (between 0 and 1, default is 0)\r\n */\r\n public b: number = 0,\r\n /**\r\n * Defines the alpha component (between 0 and 1, default is 1)\r\n */\r\n public a: number = 1\r\n ) {}\r\n\r\n // Operators\r\n\r\n /**\r\n * Adds in place the given Color4 values to the current Color4 object\r\n * @param right defines the second operand\r\n * @returns the current updated Color4 object\r\n */\r\n public addInPlace(right: DeepImmutable<Color4>): Color4 {\r\n this.r += right.r;\r\n this.g += right.g;\r\n this.b += right.b;\r\n this.a += right.a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates a new array populated with 4 numeric elements : red, green, blue, alpha values\r\n * @returns the new array\r\n */\r\n public asArray(): number[] {\r\n return [this.r, this.g, this.b, this.a];\r\n }\r\n\r\n /**\r\n * Stores from the starting index in the given array the Color4 successive values\r\n * @param array defines the array where to store the r,g,b components\r\n * @param index defines an optional index in the target array to define where to start storing values\r\n * @returns the current Color4 object\r\n */\r\n public toArray(array: FloatArray, index: number = 0): Color4 {\r\n array[index] = this.r;\r\n array[index + 1] = this.g;\r\n array[index + 2] = this.b;\r\n array[index + 3] = this.a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Update the current color with values stored in an array from the starting index of the given array\r\n * @param array defines the source array\r\n * @param offset defines an offset in the source array\r\n * @returns the current Color4 object\r\n */\r\n public fromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Color4 {\r\n Color4.FromArrayToRef(array, offset, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Determines equality between Color4 objects\r\n * @param otherColor defines the second operand\r\n * @returns true if the rgba values are equal to the given ones\r\n */\r\n public equals(otherColor: DeepImmutable<Color4>): boolean {\r\n return otherColor && this.r === otherColor.r && this.g === otherColor.g && this.b === otherColor.b && this.a === otherColor.a;\r\n }\r\n\r\n /**\r\n * Creates a new Color4 set with the added values of the current Color4 and of the given one\r\n * @param right defines the second operand\r\n * @returns a new Color4 object\r\n */\r\n public add(right: DeepImmutable<Color4>): Color4 {\r\n return new Color4(this.r + right.r, this.g + right.g, this.b + right.b, this.a + right.a);\r\n }\r\n\r\n /**\r\n * Creates a new Color4 set with the subtracted values of the given one from the current Color4\r\n * @param right defines the second operand\r\n * @returns a new Color4 object\r\n */\r\n public subtract(right: DeepImmutable<Color4>): Color4 {\r\n return new Color4(this.r - right.r, this.g - right.g, this.b - right.b, this.a - right.a);\r\n }\r\n\r\n /**\r\n * Subtracts the given ones from the current Color4 values and stores the results in \"result\"\r\n * @param right defines the second operand\r\n * @param result defines the Color4 object where to store the result\r\n * @returns the current Color4 object\r\n */\r\n public subtractToRef(right: DeepImmutable<Color4>, result: Color4): Color4 {\r\n result.r = this.r - right.r;\r\n result.g = this.g - right.g;\r\n result.b = this.b - right.b;\r\n result.a = this.a - right.a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates a new Color4 with the current Color4 values multiplied by scale\r\n * @param scale defines the scaling factor to apply\r\n * @returns a new Color4 object\r\n */\r\n public scale(scale: number): Color4 {\r\n return new Color4(this.r * scale, this.g * scale, this.b * scale, this.a * scale);\r\n }\r\n\r\n /**\r\n * Multiplies the Color4 values by the float \"scale\"\r\n * @param scale defines the scaling factor to apply\r\n * @returns the current updated Color4\r\n */\r\n public scaleInPlace(scale: number): Color4 {\r\n this.r *= scale;\r\n this.g *= scale;\r\n this.b *= scale;\r\n this.a *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies the current Color4 values by scale and stores the result in \"result\"\r\n * @param scale defines the scaling factor to apply\r\n * @param result defines the Color4 object where to store the result\r\n * @returns the current unmodified Color4\r\n */\r\n public scaleToRef(scale: number, result: Color4): Color4 {\r\n result.r = this.r * scale;\r\n result.g = this.g * scale;\r\n result.b = this.b * scale;\r\n result.a = this.a * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Scale the current Color4 values by a factor and add the result to a given Color4\r\n * @param scale defines the scale factor\r\n * @param result defines the Color4 object where to store the result\r\n * @returns the unmodified current Color4\r\n */\r\n public scaleAndAddToRef(scale: number, result: Color4): Color4 {\r\n result.r += this.r * scale;\r\n result.g += this.g * scale;\r\n result.b += this.b * scale;\r\n result.a += this.a * scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Clamps the rgb values by the min and max values and stores the result into \"result\"\r\n * @param min defines minimum clamping value (default is 0)\r\n * @param max defines maximum clamping value (default is 1)\r\n * @param result defines color to store the result into.\r\n * @returns the current Color4\r\n */\r\n public clampToRef(min: number = 0, max: number = 1, result: Color4): Color4 {\r\n result.r = Scalar.Clamp(this.r, min, max);\r\n result.g = Scalar.Clamp(this.g, min, max);\r\n result.b = Scalar.Clamp(this.b, min, max);\r\n result.a = Scalar.Clamp(this.a, min, max);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiply an Color4 value by another and return a new Color4 object\r\n * @param color defines the Color4 value to multiply by\r\n * @returns a new Color4 object\r\n */\r\n public multiply(color: Color4): Color4 {\r\n return new Color4(this.r * color.r, this.g * color.g, this.b * color.b, this.a * color.a);\r\n }\r\n\r\n /**\r\n * Multiply a Color4 value by another and push the result in a reference value\r\n * @param color defines the Color4 value to multiply by\r\n * @param result defines the Color4 to fill the result in\r\n * @returns the result Color4\r\n */\r\n public multiplyToRef(color: Color4, result: Color4): Color4 {\r\n result.r = this.r * color.r;\r\n result.g = this.g * color.g;\r\n result.b = this.b * color.b;\r\n result.a = this.a * color.a;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a string with the Color4 current values\r\n * @returns the string representation of the Color4 object\r\n */\r\n public toString(): string {\r\n return \"{R: \" + this.r + \" G:\" + this.g + \" B:\" + this.b + \" A:\" + this.a + \"}\";\r\n }\r\n\r\n /**\r\n * Returns the string \"Color4\"\r\n * @returns \"Color4\"\r\n */\r\n public getClassName(): string {\r\n return \"Color4\";\r\n }\r\n\r\n /**\r\n * Compute the Color4 hash code\r\n * @returns an unique number that can be used to hash Color4 objects\r\n */\r\n public getHashCode(): number {\r\n let hash = (this.r * 255) | 0;\r\n hash = (hash * 397) ^ ((this.g * 255) | 0);\r\n hash = (hash * 397) ^ ((this.b * 255) | 0);\r\n hash = (hash * 397) ^ ((this.a * 255) | 0);\r\n return hash;\r\n }\r\n\r\n /**\r\n * Creates a new Color4 copied from the current one\r\n * @returns a new Color4 object\r\n */\r\n public clone(): Color4 {\r\n return new Color4(this.r, this.g, this.b, this.a);\r\n }\r\n\r\n /**\r\n * Copies the given Color4 values into the current one\r\n * @param source defines the source Color4 object\r\n * @returns the current updated Color4 object\r\n */\r\n public copyFrom(source: Color4): Color4 {\r\n this.r = source.r;\r\n this.g = source.g;\r\n this.b = source.b;\r\n this.a = source.a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Copies the given float values into the current one\r\n * @param r defines the red component to read from\r\n * @param g defines the green component to read from\r\n * @param b defines the blue component to read from\r\n * @param a defines the alpha component to read from\r\n * @returns the current updated Color4 object\r\n */\r\n public copyFromFloats(r: number, g: number, b: number, a: number): Color4 {\r\n this.r = r;\r\n this.g = g;\r\n this.b = b;\r\n this.a = a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Copies the given float values into the current one\r\n * @param r defines the red component to read from\r\n * @param g defines the green component to read from\r\n * @param b defines the blue component to read from\r\n * @param a defines the alpha component to read from\r\n * @returns the current updated Color4 object\r\n */\r\n public set(r: number, g: number, b: number, a: number): Color4 {\r\n return this.copyFromFloats(r, g, b, a);\r\n }\r\n\r\n /**\r\n * Compute the Color4 hexadecimal code as a string\r\n * @param returnAsColor3 defines if the string should only contains RGB values (off by default)\r\n * @returns a string containing the hexadecimal representation of the Color4 object\r\n */\r\n public toHexString(returnAsColor3 = false): string {\r\n const intR = Math.round(this.r * 255);\r\n const intG = Math.round(this.g * 255);\r\n const intB = Math.round(this.b * 255);\r\n\r\n if (returnAsColor3) {\r\n return \"#\" + Scalar.ToHex(intR) + Scalar.ToHex(intG) + Scalar.ToHex(intB);\r\n }\r\n\r\n const intA = Math.round(this.a * 255);\r\n return \"#\" + Scalar.ToHex(intR) + Scalar.ToHex(intG) + Scalar.ToHex(intB) + Scalar.ToHex(intA);\r\n }\r\n\r\n /**\r\n * Computes a new Color4 converted from the current one to linear space\r\n * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)\r\n * @returns a new Color4 object\r\n */\r\n public toLinearSpace(exact = false): Color4 {\r\n const convertedColor = new Color4();\r\n this.toLinearSpaceToRef(convertedColor, exact);\r\n return convertedColor;\r\n }\r\n\r\n /**\r\n * Converts the Color4 values to linear space and stores the result in \"convertedColor\"\r\n * @param convertedColor defines the Color4 object where to store the linear space version\r\n * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)\r\n * @returns the unmodified Color4\r\n */\r\n public toLinearSpaceToRef(convertedColor: Color4, exact = false): Color4 {\r\n if (exact) {\r\n convertedColor.r = colorChannelToLinearSpaceExact(this.r);\r\n convertedColor.g = colorChannelToLinearSpaceExact(this.g);\r\n convertedColor.b = colorChannelToLinearSpaceExact(this.b);\r\n } else {\r\n convertedColor.r = colorChannelToLinearSpace(this.r);\r\n convertedColor.g = colorChannelToLinearSpace(this.g);\r\n convertedColor.b = colorChannelToLinearSpace(this.b);\r\n }\r\n convertedColor.a = this.a;\r\n return this;\r\n }\r\n\r\n /**\r\n * Computes a new Color4 converted from the current one to gamma space\r\n * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)\r\n * @returns a new Color4 object\r\n */\r\n public toGammaSpace(exact = false): Color4 {\r\n const convertedColor = new Color4();\r\n this.toGammaSpaceToRef(convertedColor, exact);\r\n return convertedColor;\r\n }\r\n\r\n /**\r\n * Converts the Color4 values to gamma space and stores the result in \"convertedColor\"\r\n * @param convertedColor defines the Color4 object where to store the gamma space version\r\n * @param exact defines if the conversion will be done in an exact way which is slower but more accurate (default is false)\r\n * @returns the unmodified Color4\r\n */\r\n public toGammaSpaceToRef(convertedColor: Color4, exact = false): Color4 {\r\n if (exact) {\r\n convertedColor.r = colorChannelToGammaSpaceExact(this.r);\r\n convertedColor.g = colorChannelToGammaSpaceExact(this.g);\r\n convertedColor.b = colorChannelToGammaSpaceExact(this.b);\r\n } else {\r\n convertedColor.r = colorChannelToGammaSpace(this.r);\r\n convertedColor.g = colorChannelToGammaSpace(this.g);\r\n convertedColor.b = colorChannelToGammaSpace(this.b);\r\n }\r\n convertedColor.a = this.a;\r\n return this;\r\n }\r\n\r\n // Statics\r\n\r\n /**\r\n * Creates a new Color4 from the string containing valid hexadecimal values.\r\n *\r\n * A valid hex string is either in the format #RRGGBB or #RRGGBBAA.\r\n *\r\n * When a hex string without alpha is passed, the resulting Color4 has\r\n * its alpha value set to 1.0.\r\n *\r\n * An invalid string results in a Color with all its channels set to 0.0,\r\n * i.e. \"transparent black\".\r\n *\r\n * @param hex defines a string containing valid hexadecimal values\r\n * @returns a new Color4 object\r\n */\r\n public static FromHexString(hex: string): Color4 {\r\n if (hex.substring(0, 1) !== \"#\" || (hex.length !== 9 && hex.length !== 7)) {\r\n return new Color4(0.0, 0.0, 0.0, 0.0);\r\n }\r\n\r\n const r = parseInt(hex.substring(1, 3), 16);\r\n const g = parseInt(hex.substring(3, 5), 16);\r\n const b = parseInt(hex.substring(5, 7), 16);\r\n const a = hex.length === 9 ? parseInt(hex.substring(7, 9), 16) : 255;\r\n\r\n return Color4.FromInts(r, g, b, a);\r\n }\r\n\r\n /**\r\n * Creates a new Color4 object set with the linearly interpolated values of \"amount\" between the left Color4 object and the right Color4 object\r\n * @param left defines the start value\r\n * @param right defines the end value\r\n * @param amount defines the gradient factor\r\n * @returns a new Color4 object\r\n */\r\n public static Lerp(left: DeepImmutable<Color4>, right: DeepImmutable<Color4>, amount: number): Color4 {\r\n const result = new Color4(0.0, 0.0, 0.0, 0.0);\r\n Color4.LerpToRef(left, right, amount, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Set the given \"result\" with the linearly interpolated values of \"amount\" between the left Color4 object and the right Color4 object\r\n * @param left defines the start value\r\n * @param right defines the end value\r\n * @param amount defines the gradient factor\r\n * @param result defines the Color4 object where to store data\r\n */\r\n public static LerpToRef(left: DeepImmutable<Color4>, right: DeepImmutable<Color4>, amount: number, result: Color4): void {\r\n result.r = left.r + (right.r - left.r) * amount;\r\n result.g = left.g + (right.g - left.g) * amount;\r\n result.b = left.b + (right.b - left.b) * amount;\r\n result.a = left.a + (right.a - left.a) * amount;\r\n }\r\n\r\n /**\r\n * Interpolate between two Color4 using Hermite interpolation\r\n * @param value1 defines first Color4\r\n * @param tangent1 defines the incoming tangent\r\n * @param value2 defines second Color4\r\n * @param tangent2 defines the outgoing tangent\r\n * @param amount defines the target Color4\r\n * @returns the new interpolated Color4\r\n */\r\n public static Hermite(value1: DeepImmutable<Color4>, tangent1: DeepImmutable<Color4>, value2: DeepImmutable<Color4>, tangent2: DeepImmutable<Color4>, amount: number): Color4 {\r\n const squared = amount * amount;\r\n const cubed = amount * squared;\r\n const part1 = 2.0 * cubed - 3.0 * squared + 1.0;\r\n const part2 = -2.0 * cubed + 3.0 * squared;\r\n const part3 = cubed - 2.0 * squared + amount;\r\n const part4 = cubed - squared;\r\n\r\n const r = value1.r * part1 + value2.r * part2 + tangent1.r * part3 + tangent2.r * part4;\r\n const g = value1.g * part1 + value2.g * part2 + tangent1.g * part3 + tangent2.g * part4;\r\n const b = value1.b * part1 + value2.b * part2 + tangent1.b * part3 + tangent2.b * part4;\r\n const a = value1.a * part1 + value2.a * part2 + tangent1.a * part3 + tangent2.a * part4;\r\n return new Color4(r, g, b, a);\r\n }\r\n\r\n /**\r\n * Returns a new Color4 which is the 1st derivative of the Hermite spline defined by the colors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent\r\n * @param time define where the derivative must be done\r\n * @returns 1st derivative\r\n */\r\n public static Hermite1stDerivative(\r\n value1: DeepImmutable<Color4>,\r\n tangent1: DeepImmutable<Color4>,\r\n value2: DeepImmutable<Color4>,\r\n tangent2: DeepImmutable<Color4>,\r\n time: number\r\n ): Color4 {\r\n const result = new Color4();\r\n\r\n this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Update a Color4 with the 1st derivative of the Hermite spline defined by the colors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent\r\n * @param time define where the derivative must be done\r\n * @param result define where to store the derivative\r\n */\r\n public static Hermite1stDerivativeToRef(\r\n value1: DeepImmutable<Color4>,\r\n tangent1: DeepImmutable<Color4>,\r\n value2: DeepImmutable<Color4>,\r\n tangent2: DeepImmutable<Color4>,\r\n time: number,\r\n result: Color4\r\n ) {\r\n const t2 = time * time;\r\n\r\n result.r = (t2 - time) * 6 * value1.r + (3 * t2 - 4 * time + 1) * tangent1.r + (-t2 + time) * 6 * value2.r + (3 * t2 - 2 * time) * tangent2.r;\r\n result.g = (t2 - time) * 6 * value1.g + (3 * t2 - 4 * time + 1) * tangent1.g + (-t2 + time) * 6 * value2.g + (3 * t2 - 2 * time) * tangent2.g;\r\n result.b = (t2 - time) * 6 * value1.b + (3 * t2 - 4 * time + 1) * tangent1.b + (-t2 + time) * 6 * value2.b + (3 * t2 - 2 * time) * tangent2.b;\r\n result.a = (t2 - time) * 6 * value1.a + (3 * t2 - 4 * time + 1) * tangent1.a + (-t2 + time) * 6 * value2.a + (3 * t2 - 2 * time) * tangent2.a;\r\n }\r\n\r\n /**\r\n * Creates a new Color4 from a Color3 and an alpha value\r\n * @param color3 defines the source Color3 to read from\r\n * @param alpha defines the alpha component (1.0 by default)\r\n * @returns a new Color4 object\r\n */\r\n public static FromColor3(color3: DeepImmutable<Color3>, alpha: number = 1.0): Color4 {\r\n return new Color4(color3.r, color3.g, color3.b, alpha);\r\n }\r\n\r\n /**\r\n * Creates a new Color4 from the starting index element of the given array\r\n * @param array defines the source array to read from\r\n * @param offset defines the offset in the source array\r\n * @returns a new Color4 object\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Color4 {\r\n return new Color4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);\r\n }\r\n\r\n /**\r\n * Creates a new Color4 from the starting index element of the given array\r\n * @param array defines the source array to read from\r\n * @param offset defines the offset in the source array\r\n * @param result defines the target Color4 object\r\n */\r\n public static FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number = 0, result: Color4) {\r\n result.r = array[offset];\r\n result.g = array[offset + 1];\r\n result.b = array[offset + 2];\r\n result.a = array[offset + 3];\r\n }\r\n\r\n /**\r\n * Creates a new Color3 from integer values (< 256)\r\n * @param r defines the red component to read from (value between 0 and 255)\r\n * @param g defines the green component to read from (value between 0 and 255)\r\n * @param b defines the blue component to read from (value between 0 and 255)\r\n * @param a defines the alpha component to read from (value between 0 and 255)\r\n * @returns a new Color3 object\r\n */\r\n public static FromInts(r: number, g: number, b: number, a: number): Color4 {\r\n return new Color4(r / 255.0, g / 255.0, b / 255.0, a / 255.0);\r\n }\r\n\r\n /**\r\n * Check the content of a given array and convert it to an array containing RGBA data\r\n * If the original array was already containing count * 4 values then it is returned directly\r\n * @param colors defines the array to check\r\n * @param count defines the number of RGBA data to expect\r\n * @returns an array containing count * 4 values (RGBA)\r\n */\r\n public static CheckColors4(colors: number[], count: number): number[] {\r\n // Check if color3 was used\r\n if (colors.length === count * 3) {\r\n const colors4 = [];\r\n for (let index = 0; index < colors.length; index += 3) {\r\n const newIndex = (index / 3) * 4;\r\n colors4[newIndex] = colors[index];\r\n colors4[newIndex + 1] = colors[index + 1];\r\n colors4[newIndex + 2] = colors[index + 2];\r\n colors4[newIndex + 3] = 1.0;\r\n }\r\n\r\n return colors4;\r\n }\r\n\r\n return colors;\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class TmpColors {\r\n public static Color3: Color3[] = ArrayTools.BuildArray(3, Color3.Black);\r\n public static Color4: Color4[] = ArrayTools.BuildArray(3, () => new Color4(0, 0, 0, 0));\r\n}\r\n\r\nRegisterClass(\"BABYLON.Color3\", Color3);\r\nRegisterClass(\"BABYLON.Color4\", Color4);\r\n"]}
|
package/Misc/decorators.js
CHANGED
|
@@ -9,8 +9,8 @@ const __mergedStore = {};
|
|
|
9
9
|
const _copySource = function (creationFunction, source, instanciate) {
|
|
10
10
|
const destination = creationFunction();
|
|
11
11
|
// Tags
|
|
12
|
-
if (Tags) {
|
|
13
|
-
Tags.AddTagsTo(destination, source
|
|
12
|
+
if (Tags && Tags.HasTags(source)) {
|
|
13
|
+
Tags.AddTagsTo(destination, Tags.GetTags(source, true));
|
|
14
14
|
}
|
|
15
15
|
const classStore = getMergedStore(destination);
|
|
16
16
|
// Properties
|