@babylonjs/core 5.15.0 → 5.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/Animations/animatable.js +1 -1
  2. package/Animations/animatable.js.map +1 -1
  3. package/Animations/animation.d.ts +8 -1
  4. package/Animations/animation.js +8 -1
  5. package/Animations/animation.js.map +1 -1
  6. package/Animations/animationGroup.js +5 -4
  7. package/Animations/animationGroup.js.map +1 -1
  8. package/Audio/sound.js +2 -2
  9. package/Audio/sound.js.map +1 -1
  10. package/Bones/skeleton.js +1 -1
  11. package/Bones/skeleton.js.map +1 -1
  12. package/Cameras/Inputs/BaseCameraMouseWheelInput.d.ts +1 -1
  13. package/Cameras/Inputs/BaseCameraMouseWheelInput.js +8 -2
  14. package/Cameras/Inputs/BaseCameraMouseWheelInput.js.map +1 -1
  15. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js +2 -2
  16. package/Cameras/Inputs/arcRotateCameraKeyboardMoveInput.js.map +1 -1
  17. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.d.ts +0 -1
  18. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +7 -2
  19. package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
  20. package/Cameras/Inputs/flyCameraKeyboardInput.js +3 -3
  21. package/Cameras/Inputs/flyCameraKeyboardInput.js.map +1 -1
  22. package/Cameras/Inputs/followCameraKeyboardMoveInput.js +2 -2
  23. package/Cameras/Inputs/followCameraKeyboardMoveInput.js.map +1 -1
  24. package/Cameras/Inputs/followCameraMouseWheelInput.d.ts +0 -1
  25. package/Cameras/Inputs/followCameraMouseWheelInput.js +7 -2
  26. package/Cameras/Inputs/followCameraMouseWheelInput.js.map +1 -1
  27. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js +3 -3
  28. package/Cameras/Inputs/freeCameraKeyboardMoveInput.js.map +1 -1
  29. package/Cameras/Inputs/freeCameraTouchInput.js +1 -1
  30. package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
  31. package/Cameras/VR/vrExperienceHelper.js +1 -1
  32. package/Cameras/VR/vrExperienceHelper.js.map +1 -1
  33. package/Cameras/VR/webVRCamera.js +1 -1
  34. package/Cameras/VR/webVRCamera.js.map +1 -1
  35. package/Cameras/arcRotateCamera.js +3 -2
  36. package/Cameras/arcRotateCamera.js.map +1 -1
  37. package/Cameras/camera.js +18 -3
  38. package/Cameras/camera.js.map +1 -1
  39. package/DeviceInput/InputDevices/webDeviceInputSystem.js +1 -1
  40. package/DeviceInput/InputDevices/webDeviceInputSystem.js.map +1 -1
  41. package/Engines/Extensions/engine.cubeTexture.js +3 -3
  42. package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
  43. package/Engines/Extensions/engine.rawTexture.js +3 -3
  44. package/Engines/Extensions/engine.rawTexture.js.map +1 -1
  45. package/Engines/Native/nativeInterfaces.d.ts +1 -0
  46. package/Engines/Native/nativeInterfaces.js.map +1 -1
  47. package/Engines/Processors/shaderCodeCursor.js +2 -1
  48. package/Engines/Processors/shaderCodeCursor.js.map +1 -1
  49. package/Engines/WebGPU/Extensions/engine.rawTexture.js +3 -3
  50. package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
  51. package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
  52. package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
  53. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +6 -6
  54. package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
  55. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +4 -4
  56. package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
  57. package/Engines/engine.d.ts +0 -10
  58. package/Engines/engine.js +0 -14
  59. package/Engines/engine.js.map +1 -1
  60. package/Engines/nativeEngine.d.ts +7 -2
  61. package/Engines/nativeEngine.js +30 -10
  62. package/Engines/nativeEngine.js.map +1 -1
  63. package/Engines/thinEngine.d.ts +22 -2
  64. package/Engines/thinEngine.js +49 -9
  65. package/Engines/thinEngine.js.map +1 -1
  66. package/Engines/webgpuEngine.js +1 -1
  67. package/Engines/webgpuEngine.js.map +1 -1
  68. package/Gizmos/boundingBoxGizmo.d.ts +4 -0
  69. package/Gizmos/boundingBoxGizmo.js +6 -0
  70. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  71. package/Inputs/scene.inputManager.js +5 -4
  72. package/Inputs/scene.inputManager.js.map +1 -1
  73. package/Loading/sceneLoader.js +12 -12
  74. package/Loading/sceneLoader.js.map +1 -1
  75. package/Materials/Node/Blocks/Fragment/TBNBlock.d.ts +12 -0
  76. package/Materials/Node/Blocks/Fragment/TBNBlock.js +50 -0
  77. package/Materials/Node/Blocks/Fragment/TBNBlock.js.map +1 -1
  78. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +2 -1
  79. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  80. package/Materials/Node/Blocks/gradientBlock.js +1 -1
  81. package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
  82. package/Materials/Node/nodeMaterial.d.ts +10 -1
  83. package/Materials/Node/nodeMaterial.js +43 -26
  84. package/Materials/Node/nodeMaterial.js.map +1 -1
  85. package/Materials/PBR/pbrBaseMaterial.js +4 -4
  86. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  87. package/Materials/Textures/baseTexture.d.ts +1 -1
  88. package/Materials/Textures/baseTexture.js +2 -2
  89. package/Materials/Textures/baseTexture.js.map +1 -1
  90. package/Materials/Textures/prePassRenderTarget.js +1 -1
  91. package/Materials/Textures/prePassRenderTarget.js.map +1 -1
  92. package/Materials/Textures/renderTargetTexture.js +11 -3
  93. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  94. package/Materials/Textures/videoTexture.js +4 -1
  95. package/Materials/Textures/videoTexture.js.map +1 -1
  96. package/Materials/imageProcessingConfiguration.js.map +1 -1
  97. package/Materials/materialDefines.js +3 -1
  98. package/Materials/materialDefines.js.map +1 -1
  99. package/Materials/materialHelper.d.ts +1 -1
  100. package/Materials/materialHelper.js +6 -6
  101. package/Materials/materialHelper.js.map +1 -1
  102. package/Materials/shaderMaterial.d.ts +10 -1
  103. package/Materials/shaderMaterial.js +10 -1
  104. package/Materials/shaderMaterial.js.map +1 -1
  105. package/Maths/math.color.d.ts +9 -1
  106. package/Maths/math.color.js +13 -1
  107. package/Maths/math.color.js.map +1 -1
  108. package/Meshes/Builders/icoSphereBuilder.js +2 -2
  109. package/Meshes/Builders/icoSphereBuilder.js.map +1 -1
  110. package/Meshes/abstractMesh.js +1 -1
  111. package/Meshes/abstractMesh.js.map +1 -1
  112. package/Meshes/geometry.js +3 -4
  113. package/Meshes/geometry.js.map +1 -1
  114. package/Meshes/mesh.d.ts +1 -1
  115. package/Meshes/mesh.js +8 -7
  116. package/Meshes/mesh.js.map +1 -1
  117. package/Meshes/thinInstanceMesh.js +5 -0
  118. package/Meshes/thinInstanceMesh.js.map +1 -1
  119. package/Meshes/transformNode.d.ts +2 -2
  120. package/Meshes/transformNode.js +1 -1
  121. package/Meshes/transformNode.js.map +1 -1
  122. package/Misc/smartArray.js +0 -1
  123. package/Misc/smartArray.js.map +1 -1
  124. package/Particles/computeShaderParticleSystem.js +2 -2
  125. package/Particles/computeShaderParticleSystem.js.map +1 -1
  126. package/Particles/particleHelper.d.ts +12 -1
  127. package/Particles/particleHelper.js +16 -5
  128. package/Particles/particleHelper.js.map +1 -1
  129. package/Particles/particleSystem.js +2 -2
  130. package/Particles/particleSystem.js.map +1 -1
  131. package/Particles/particleSystemSet.js +1 -1
  132. package/Particles/particleSystemSet.js.map +1 -1
  133. package/Particles/solidParticleSystem.d.ts +3 -0
  134. package/Particles/solidParticleSystem.js +3 -0
  135. package/Particles/solidParticleSystem.js.map +1 -1
  136. package/Particles/webgl2ParticleSystem.js +2 -2
  137. package/Particles/webgl2ParticleSystem.js.map +1 -1
  138. package/Physics/Plugins/cannonJSPlugin.js +1 -1
  139. package/Physics/Plugins/cannonJSPlugin.js.map +1 -1
  140. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +3 -3
  141. package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
  142. package/Rendering/geometryBufferRenderer.js +3 -2
  143. package/Rendering/geometryBufferRenderer.js.map +1 -1
  144. package/Rendering/utilityLayerRenderer.js +1 -1
  145. package/Rendering/utilityLayerRenderer.js.map +1 -1
  146. package/Shaders/ShadersInclude/helperFunctions.js +1 -1
  147. package/Shaders/ShadersInclude/helperFunctions.js.map +1 -1
  148. package/Shaders/geometry.fragment.js +1 -1
  149. package/Shaders/geometry.fragment.js.map +1 -1
  150. package/Sprites/spriteManager.d.ts +10 -1
  151. package/Sprites/spriteManager.js +10 -1
  152. package/Sprites/spriteManager.js.map +1 -1
  153. package/XR/features/WebXRLayers.js +1 -1
  154. package/XR/features/WebXRLayers.js.map +1 -1
  155. package/assetContainer.d.ts +1 -1
  156. package/assetContainer.js +23 -23
  157. package/assetContainer.js.map +1 -1
  158. package/node.js +1 -1
  159. package/node.js.map +1 -1
  160. package/package.json +1 -1
  161. package/scene.d.ts +8 -6
  162. package/scene.js +23 -14
  163. package/scene.js.map +1 -1
@@ -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;IACI;;;;;OAKG;IACH;IACI;;OAEG;IACI,CAAa;IACpB;;OAEG;IACI,CAAa;IACpB;;OAEG;IACI,CAAa;QARb,kBAAA,EAAA,KAAa;QAIb,k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AC,CAAC,EAAtB,CAAsB,CAAC,CAAC;IAC5F,gBAAC;CAAA,AAHD,IAGC;SAHY,SAAS;AAKtB,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\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 * Convert 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 * 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 * @hidden\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;;GAEG;AACH;IACI;;;;;OAKG;IACH;IACI;;OAEG;IACI,CAAa;IACpB;;OAEG;IACI,CAAa;IACpB;;OAEG;IACI,CAAa;QARb,kBAAA,EAAA,KAAa;QAIb,kBAAA,EAAA,KAAa;QAIb,kBAAA,EAAA,KAAa;QARb,MAAC,GAAD,CAAC,CAAY;QAIb,MAAC,GAAD,CAAC,CAAY;QAIb,MAAC,GAAD,CAAC,CAAY;IACrB,CAAC;IAEJ;;;OAGG;IACI,yBAAQ,GAAf;QACI,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,6BAAY,GAAnB;QACI,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;;OAGG;IACI,4BAAW,GAAlB;QACI,IAAI,IA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AE,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\r\n * @param saturation defines the saturation\r\n * @param value defines the value\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 * @hidden\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"]}
@@ -247,8 +247,8 @@ export function CreateIcoSphereVertexData(options) {
247
247
  var v_id = ico_indices[3 * face + v012];
248
248
  // vertex have 3D position (x,y,z)
249
249
  face_vertex_pos[v012].copyFromFloats(icoVertices[3 * vertices_unalias_id[v_id]], icoVertices[3 * vertices_unalias_id[v_id] + 1], icoVertices[3 * vertices_unalias_id[v_id] + 2]);
250
- // Normalize to get normal, then scale to radius
251
- face_vertex_pos[v012].normalize().scaleInPlace(radius);
250
+ // Normalize to get normal
251
+ face_vertex_pos[v012].normalize();
252
252
  // uv Coordinates from vertex ID
253
253
  face_vertex_uv[v012].copyFromFloats(ico_vertexuv[2 * v_id] * ustep + uoffset + island[face] * island_u_offset, ico_vertexuv[2 * v_id + 1] * vstep + voffset + island[face] * island_v_offset);
254
254
  }
@@ -1 +1 @@
1
- {"version":3,"file":"icoSphereBuilder.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Meshes/Builders/icoSphereBuilder.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,oBAAoB,E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../Maths/math.vector\";\r\nimport { Vector3, Vector2 } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData of the IcoSphere\r\n * @param options an object used to set the following optional parameters for the IcoSphere, required but can be empty\r\n * * radius the radius of the IcoSphere, optional default 1\r\n * * radiusX allows stretching in the x direction, optional, default radius\r\n * * radiusY allows stretching in the y direction, optional, default radius\r\n * * radiusZ allows stretching in the z direction, optional, default radius\r\n * * flat when true creates a flat shaded mesh, optional, default true\r\n * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)\r\n * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)\r\n * @param options.radius\r\n * @param options.radiusX\r\n * @param options.radiusY\r\n * @param options.radiusZ\r\n * @param options.flat\r\n * @param options.subdivisions\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @returns the VertexData of the IcoSphere\r\n */\r\nexport function CreateIcoSphereVertexData(options: {\r\n radius?: number;\r\n radiusX?: number;\r\n radiusY?: number;\r\n radiusZ?: number;\r\n flat?: boolean;\r\n subdivisions?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n}): VertexData {\r\n const sideOrientation = options.sideOrientation || VertexData.DEFAULTSIDE;\r\n const radius = options.radius || 1;\r\n const flat = options.flat === undefined ? true : options.flat;\r\n const subdivisions = options.subdivisions || 4;\r\n const radiusX = options.radiusX || radius;\r\n const radiusY = options.radiusY || radius;\r\n const radiusZ = options.radiusZ || radius;\r\n\r\n const t = (1 + Math.sqrt(5)) / 2;\r\n\r\n // 12 vertex x,y,z\r\n const icoVertices = [\r\n -1,\r\n t,\r\n -0,\r\n 1,\r\n t,\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0, // v0-3\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0,\r\n -1,\r\n t,\r\n 0,\r\n 1,\r\n t, // v4-7\r\n t,\r\n 0,\r\n 1,\r\n t,\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0,\r\n -1, // v8-11\r\n ];\r\n\r\n // index of 3 vertex makes a face of icopshere\r\n const ico_indices = [\r\n 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 12, 22, 23, 1, 5, 20, 5, 11, 4, 23, 22, 13, 22, 18, 6, 7, 1, 8, 14, 21, 4, 14, 4, 2, 16, 13, 6, 15, 6, 19, 3, 8, 9, 4, 21, 5, 13, 17,\r\n 23, 6, 13, 22, 19, 6, 18, 9, 8, 1,\r\n ];\r\n // vertex for uv have aliased position, not for UV\r\n const vertices_unalias_id = [\r\n 0,\r\n 1,\r\n 2,\r\n 3,\r\n 4,\r\n 5,\r\n 6,\r\n 7,\r\n 8,\r\n 9,\r\n 10,\r\n 11,\r\n // vertex alias\r\n 0, // 12: 0 + 12\r\n 2, // 13: 2 + 11\r\n 3, // 14: 3 + 11\r\n 3, // 15: 3 + 12\r\n 3, // 16: 3 + 13\r\n 4, // 17: 4 + 13\r\n 7, // 18: 7 + 11\r\n 8, // 19: 8 + 11\r\n 9, // 20: 9 + 11\r\n 9, // 21: 9 + 12\r\n 10, // 22: A + 12\r\n 11, // 23: B + 12\r\n ];\r\n\r\n // uv as integer step (not pixels !)\r\n const ico_vertexuv = [\r\n 5,\r\n 1,\r\n 3,\r\n 1,\r\n 6,\r\n 4,\r\n 0,\r\n 0, // v0-3\r\n 5,\r\n 3,\r\n 4,\r\n 2,\r\n 2,\r\n 2,\r\n 4,\r\n 0, // v4-7\r\n 2,\r\n 0,\r\n 1,\r\n 1,\r\n 6,\r\n 0,\r\n 6,\r\n 2, // v8-11\r\n // vertex alias (for same vertex on different faces)\r\n 0,\r\n 4, // 12: 0 + 12\r\n 3,\r\n 3, // 13: 2 + 11\r\n 4,\r\n 4, // 14: 3 + 11\r\n 3,\r\n 1, // 15: 3 + 12\r\n 4,\r\n 2, // 16: 3 + 13\r\n 4,\r\n 4, // 17: 4 + 13\r\n 0,\r\n 2, // 18: 7 + 11\r\n 1,\r\n 1, // 19: 8 + 11\r\n 2,\r\n 2, // 20: 9 + 11\r\n 3,\r\n 3, // 21: 9 + 12\r\n 1,\r\n 3, // 22: A + 12\r\n 2,\r\n 4, // 23: B + 12\r\n ];\r\n\r\n // Vertices[0, 1, ...9, A, B] : position on UV plane\r\n // '+' indicate duplicate position to be fixed (3,9:0,2,3,4,7,8,A,B)\r\n // First island of uv mapping\r\n // v = 4h 3+ 2\r\n // v = 3h 9+ 4\r\n // v = 2h 9+ 5 B\r\n // v = 1h 9 1 0\r\n // v = 0h 3 8 7 A\r\n // u = 0 1 2 3 4 5 6 *a\r\n\r\n // Second island of uv mapping\r\n // v = 4h 0+ B+ 4+\r\n // v = 3h A+ 2+\r\n // v = 2h 7+ 6 3+\r\n // v = 1h 8+ 3+\r\n // v = 0h\r\n // u = 0 1 2 3 4 5 6 *a\r\n\r\n // Face layout on texture UV mapping\r\n // ============\r\n // \\ 4 /\\ 16 / ======\r\n // \\ / \\ / /\\ 11 /\r\n // \\/ 7 \\/ / \\ /\r\n // ======= / 10 \\/\r\n // /\\ 17 /\\ =======\r\n // / \\ / \\ \\ 15 /\\\r\n // / 8 \\/ 12 \\ \\ / \\\r\n // ============ \\/ 6 \\\r\n // \\ 18 /\\ ============\r\n // \\ / \\ \\ 5 /\\ 0 /\r\n // \\/ 13 \\ \\ / \\ /\r\n // ======= \\/ 1 \\/\r\n // =============\r\n // /\\ 19 /\\ 2 /\\\r\n // / \\ / \\ / \\\r\n // / 14 \\/ 9 \\/ 3 \\\r\n // ===================\r\n\r\n // uv step is u:1 or 0.5, v:cos(30)=sqrt(3)/2, ratio approx is 84/97\r\n const ustep = 138 / 1024;\r\n const vstep = 239 / 1024;\r\n const uoffset = 60 / 1024;\r\n const voffset = 26 / 1024;\r\n // Second island should have margin, not to touch the first island\r\n // avoid any borderline artefact in pixel rounding\r\n const island_u_offset = -40 / 1024;\r\n const island_v_offset = +20 / 1024;\r\n // face is either island 0 or 1 :\r\n // second island is for faces : [4, 7, 8, 12, 13, 16, 17, 18]\r\n const island = [\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 1, // 0 - 4\r\n 0,\r\n 0,\r\n 1,\r\n 1,\r\n 0, // 5 - 9\r\n 0,\r\n 0,\r\n 1,\r\n 1,\r\n 0, // 10 - 14\r\n 0,\r\n 1,\r\n 1,\r\n 1,\r\n 0, // 15 - 19\r\n ];\r\n\r\n const indices = new Array<number>();\r\n const positions = new Array<number>();\r\n const normals = new Array<number>();\r\n const uvs = new Array<number>();\r\n\r\n let current_indice = 0;\r\n // prepare array of 3 vector (empty) (to be worked in place, shared for each face)\r\n const face_vertex_pos = new Array(3);\r\n const face_vertex_uv = new Array(3);\r\n let v012;\r\n for (v012 = 0; v012 < 3; v012++) {\r\n face_vertex_pos[v012] = Vector3.Zero();\r\n face_vertex_uv[v012] = Vector2.Zero();\r\n }\r\n // create all with normals\r\n for (let face = 0; face < 20; face++) {\r\n // 3 vertex per face\r\n for (v012 = 0; v012 < 3; v012++) {\r\n // look up vertex 0,1,2 to its index in 0 to 11 (or 23 including alias)\r\n const v_id = ico_indices[3 * face + v012];\r\n // vertex have 3D position (x,y,z)\r\n face_vertex_pos[v012].copyFromFloats(\r\n icoVertices[3 * vertices_unalias_id[v_id]],\r\n icoVertices[3 * vertices_unalias_id[v_id] + 1],\r\n icoVertices[3 * vertices_unalias_id[v_id] + 2]\r\n );\r\n // Normalize to get normal, then scale to radius\r\n face_vertex_pos[v012].normalize().scaleInPlace(radius);\r\n\r\n // uv Coordinates from vertex ID\r\n face_vertex_uv[v012].copyFromFloats(\r\n ico_vertexuv[2 * v_id] * ustep + uoffset + island[face] * island_u_offset,\r\n ico_vertexuv[2 * v_id + 1] * vstep + voffset + island[face] * island_v_offset\r\n );\r\n }\r\n\r\n // Subdivide the face (interpolate pos, norm, uv)\r\n // - pos is linear interpolation, then projected to sphere (converge polyhedron to sphere)\r\n // - norm is linear interpolation of vertex corner normal\r\n // (to be checked if better to re-calc from face vertex, or if approximation is OK ??? )\r\n // - uv is linear interpolation\r\n //\r\n // Topology is as below for sub-divide by 2\r\n // vertex shown as v0,v1,v2\r\n // interp index is i1 to progress in range [v0,v1[\r\n // interp index is i2 to progress in range [v0,v2[\r\n // face index as (i1,i2) for /\\ : (i1,i2),(i1+1,i2),(i1,i2+1)\r\n // and (i1,i2)' for \\/ : (i1+1,i2),(i1+1,i2+1),(i1,i2+1)\r\n //\r\n //\r\n // i2 v2\r\n // ^ ^\r\n // / / \\\r\n // / / \\\r\n // / / \\\r\n // / / (0,1) \\\r\n // / #---------\\\r\n // / / \\ (0,0)'/ \\\r\n // / / \\ / \\\r\n // / / \\ / \\\r\n // / / (0,0) \\ / (1,0) \\\r\n // / #---------#---------\\\r\n // v0 v1\r\n //\r\n // --------------------> i1\r\n //\r\n // interp of (i1,i2):\r\n // along i2 : x0=lerp(v0,v2, i2/S) <---> x1=lerp(v1,v2, i2/S)\r\n // along i1 : lerp(x0,x1, i1/(S-i2))\r\n //\r\n // centroid of triangle is needed to get help normal computation\r\n // (c1,c2) are used for centroid location\r\n\r\n const interp_vertex = (i1: number, i2: number, c1: number, c2: number) => {\r\n // vertex is interpolated from\r\n // - face_vertex_pos[0..2]\r\n // - face_vertex_uv[0..2]\r\n const pos_x0 = Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], i2 / subdivisions);\r\n const pos_x1 = Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], i2 / subdivisions);\r\n const pos_interp = subdivisions === i2 ? face_vertex_pos[2] : Vector3.Lerp(pos_x0, pos_x1, i1 / (subdivisions - i2));\r\n pos_interp.normalize();\r\n\r\n let vertex_normal;\r\n if (flat) {\r\n // in flat mode, recalculate normal as face centroid normal\r\n const centroid_x0 = Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], c2 / subdivisions);\r\n const centroid_x1 = Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], c2 / subdivisions);\r\n vertex_normal = Vector3.Lerp(centroid_x0, centroid_x1, c1 / (subdivisions - c2));\r\n } else {\r\n // in smooth mode, recalculate normal from each single vertex position\r\n vertex_normal = new Vector3(pos_interp.x, pos_interp.y, pos_interp.z);\r\n }\r\n // Vertex normal need correction due to X,Y,Z radius scaling\r\n vertex_normal.x /= radiusX;\r\n vertex_normal.y /= radiusY;\r\n vertex_normal.z /= radiusZ;\r\n vertex_normal.normalize();\r\n\r\n const uv_x0 = Vector2.Lerp(face_vertex_uv[0], face_vertex_uv[2], i2 / subdivisions);\r\n const uv_x1 = Vector2.Lerp(face_vertex_uv[1], face_vertex_uv[2], i2 / subdivisions);\r\n const uv_interp = subdivisions === i2 ? face_vertex_uv[2] : Vector2.Lerp(uv_x0, uv_x1, i1 / (subdivisions - i2));\r\n positions.push(pos_interp.x * radiusX, pos_interp.y * radiusY, pos_interp.z * radiusZ);\r\n normals.push(vertex_normal.x, vertex_normal.y, vertex_normal.z);\r\n uvs.push(uv_interp.x, CompatibilityOptions.UseOpenGLOrientationForUV ? 1.0 - uv_interp.y : uv_interp.y);\r\n // push each vertex has member of a face\r\n // Same vertex can belong to multiple face, it is pushed multiple time (duplicate vertex are present)\r\n indices.push(current_indice);\r\n current_indice++;\r\n };\r\n\r\n for (let i2 = 0; i2 < subdivisions; i2++) {\r\n for (let i1 = 0; i1 + i2 < subdivisions; i1++) {\r\n // face : (i1,i2) for /\\ :\r\n // interp for : (i1,i2),(i1+1,i2),(i1,i2+1)\r\n interp_vertex(i1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n interp_vertex(i1 + 1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n interp_vertex(i1, i2 + 1, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n if (i1 + i2 + 1 < subdivisions) {\r\n // face : (i1,i2)' for \\/ :\r\n // interp for (i1+1,i2),(i1+1,i2+1),(i1,i2+1)\r\n interp_vertex(i1 + 1, i2, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n interp_vertex(i1 + 1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n interp_vertex(i1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided\r\n * * The parameter `radius` sets the radius size (float) of the icosphere (default 1)\r\n * * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value of `radius`)\r\n * * The parameter `subdivisions` sets the number of subdivisions (positive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size\r\n * * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param options.radius\r\n * @param options.radiusX\r\n * @param options.radiusY\r\n * @param options.radiusZ\r\n * @param options.flat\r\n * @param options.subdivisions\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.updatable\r\n * @param scene defines the hosting scene\r\n * @returns the icosahedron mesh\r\n * @see https://doc.babylonjs.com/how_to/polyhedra_shapes#icosphere\r\n */\r\nexport function CreateIcoSphere(\r\n name: string,\r\n options: {\r\n radius?: number;\r\n radiusX?: number;\r\n radiusY?: number;\r\n radiusZ?: number;\r\n flat?: boolean;\r\n subdivisions?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n updatable?: boolean;\r\n } = {},\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const sphere = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n sphere._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateIcoSphereVertexData(options);\r\n\r\n vertexData.applyToMesh(sphere, options.updatable);\r\n\r\n return sphere;\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the function directly from the module\r\n */\r\nexport const IcoSphereBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateIcoSphere,\r\n};\r\n\r\nVertexData.CreateIcoSphere = CreateIcoSphereVertexData;\r\n\r\n(Mesh as any).CreateIcoSphere = (\r\n name: string,\r\n options: { radius?: number; flat?: boolean; subdivisions?: number; sideOrientation?: number; updatable?: boolean },\r\n scene: Scene\r\n): Mesh => {\r\n return CreateIcoSphere(name, options, scene);\r\n};\r\n"]}
1
+ {"version":3,"file":"icoSphereBuilder.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Meshes/Builders/icoSphereBuilder.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GAAG,UAC5B,IAAY,EACZ,OAAkH,EAClH,KAAY;IAEZ,OAAO,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC,CAAC","sourcesContent":["import type { Scene } from \"../../scene\";\r\nimport type { Vector4 } from \"../../Maths/math.vector\";\r\nimport { Vector3, Vector2 } from \"../../Maths/math.vector\";\r\nimport { Mesh } from \"../mesh\";\r\nimport { VertexData } from \"../mesh.vertexData\";\r\nimport type { Nullable } from \"../../types\";\r\nimport { CompatibilityOptions } from \"../../Compat/compatibilityOptions\";\r\n\r\n/**\r\n * Creates the VertexData of the IcoSphere\r\n * @param options an object used to set the following optional parameters for the IcoSphere, required but can be empty\r\n * * radius the radius of the IcoSphere, optional default 1\r\n * * radiusX allows stretching in the x direction, optional, default radius\r\n * * radiusY allows stretching in the y direction, optional, default radius\r\n * * radiusZ allows stretching in the z direction, optional, default radius\r\n * * flat when true creates a flat shaded mesh, optional, default true\r\n * * subdivisions increasing the subdivisions increases the number of faces, optional, default 4\r\n * * sideOrientation optional and takes the values : Mesh.FRONTSIDE (default), Mesh.BACKSIDE or Mesh.DOUBLESIDE\r\n * * frontUvs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the front side, optional, default vector4 (0, 0, 1, 1)\r\n * * backUVs only usable when you create a double-sided mesh, used to choose what parts of the texture image to crop and apply on the back side, optional, default vector4 (0, 0, 1, 1)\r\n * @param options.radius\r\n * @param options.radiusX\r\n * @param options.radiusY\r\n * @param options.radiusZ\r\n * @param options.flat\r\n * @param options.subdivisions\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @returns the VertexData of the IcoSphere\r\n */\r\nexport function CreateIcoSphereVertexData(options: {\r\n radius?: number;\r\n radiusX?: number;\r\n radiusY?: number;\r\n radiusZ?: number;\r\n flat?: boolean;\r\n subdivisions?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n}): VertexData {\r\n const sideOrientation = options.sideOrientation || VertexData.DEFAULTSIDE;\r\n const radius = options.radius || 1;\r\n const flat = options.flat === undefined ? true : options.flat;\r\n const subdivisions = options.subdivisions || 4;\r\n const radiusX = options.radiusX || radius;\r\n const radiusY = options.radiusY || radius;\r\n const radiusZ = options.radiusZ || radius;\r\n\r\n const t = (1 + Math.sqrt(5)) / 2;\r\n\r\n // 12 vertex x,y,z\r\n const icoVertices = [\r\n -1,\r\n t,\r\n -0,\r\n 1,\r\n t,\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0, // v0-3\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0,\r\n -1,\r\n t,\r\n 0,\r\n 1,\r\n t, // v4-7\r\n t,\r\n 0,\r\n 1,\r\n t,\r\n 0,\r\n -1,\r\n -t,\r\n 0,\r\n 1,\r\n -t,\r\n 0,\r\n -1, // v8-11\r\n ];\r\n\r\n // index of 3 vertex makes a face of icopshere\r\n const ico_indices = [\r\n 0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 12, 22, 23, 1, 5, 20, 5, 11, 4, 23, 22, 13, 22, 18, 6, 7, 1, 8, 14, 21, 4, 14, 4, 2, 16, 13, 6, 15, 6, 19, 3, 8, 9, 4, 21, 5, 13, 17,\r\n 23, 6, 13, 22, 19, 6, 18, 9, 8, 1,\r\n ];\r\n // vertex for uv have aliased position, not for UV\r\n const vertices_unalias_id = [\r\n 0,\r\n 1,\r\n 2,\r\n 3,\r\n 4,\r\n 5,\r\n 6,\r\n 7,\r\n 8,\r\n 9,\r\n 10,\r\n 11,\r\n // vertex alias\r\n 0, // 12: 0 + 12\r\n 2, // 13: 2 + 11\r\n 3, // 14: 3 + 11\r\n 3, // 15: 3 + 12\r\n 3, // 16: 3 + 13\r\n 4, // 17: 4 + 13\r\n 7, // 18: 7 + 11\r\n 8, // 19: 8 + 11\r\n 9, // 20: 9 + 11\r\n 9, // 21: 9 + 12\r\n 10, // 22: A + 12\r\n 11, // 23: B + 12\r\n ];\r\n\r\n // uv as integer step (not pixels !)\r\n const ico_vertexuv = [\r\n 5,\r\n 1,\r\n 3,\r\n 1,\r\n 6,\r\n 4,\r\n 0,\r\n 0, // v0-3\r\n 5,\r\n 3,\r\n 4,\r\n 2,\r\n 2,\r\n 2,\r\n 4,\r\n 0, // v4-7\r\n 2,\r\n 0,\r\n 1,\r\n 1,\r\n 6,\r\n 0,\r\n 6,\r\n 2, // v8-11\r\n // vertex alias (for same vertex on different faces)\r\n 0,\r\n 4, // 12: 0 + 12\r\n 3,\r\n 3, // 13: 2 + 11\r\n 4,\r\n 4, // 14: 3 + 11\r\n 3,\r\n 1, // 15: 3 + 12\r\n 4,\r\n 2, // 16: 3 + 13\r\n 4,\r\n 4, // 17: 4 + 13\r\n 0,\r\n 2, // 18: 7 + 11\r\n 1,\r\n 1, // 19: 8 + 11\r\n 2,\r\n 2, // 20: 9 + 11\r\n 3,\r\n 3, // 21: 9 + 12\r\n 1,\r\n 3, // 22: A + 12\r\n 2,\r\n 4, // 23: B + 12\r\n ];\r\n\r\n // Vertices[0, 1, ...9, A, B] : position on UV plane\r\n // '+' indicate duplicate position to be fixed (3,9:0,2,3,4,7,8,A,B)\r\n // First island of uv mapping\r\n // v = 4h 3+ 2\r\n // v = 3h 9+ 4\r\n // v = 2h 9+ 5 B\r\n // v = 1h 9 1 0\r\n // v = 0h 3 8 7 A\r\n // u = 0 1 2 3 4 5 6 *a\r\n\r\n // Second island of uv mapping\r\n // v = 4h 0+ B+ 4+\r\n // v = 3h A+ 2+\r\n // v = 2h 7+ 6 3+\r\n // v = 1h 8+ 3+\r\n // v = 0h\r\n // u = 0 1 2 3 4 5 6 *a\r\n\r\n // Face layout on texture UV mapping\r\n // ============\r\n // \\ 4 /\\ 16 / ======\r\n // \\ / \\ / /\\ 11 /\r\n // \\/ 7 \\/ / \\ /\r\n // ======= / 10 \\/\r\n // /\\ 17 /\\ =======\r\n // / \\ / \\ \\ 15 /\\\r\n // / 8 \\/ 12 \\ \\ / \\\r\n // ============ \\/ 6 \\\r\n // \\ 18 /\\ ============\r\n // \\ / \\ \\ 5 /\\ 0 /\r\n // \\/ 13 \\ \\ / \\ /\r\n // ======= \\/ 1 \\/\r\n // =============\r\n // /\\ 19 /\\ 2 /\\\r\n // / \\ / \\ / \\\r\n // / 14 \\/ 9 \\/ 3 \\\r\n // ===================\r\n\r\n // uv step is u:1 or 0.5, v:cos(30)=sqrt(3)/2, ratio approx is 84/97\r\n const ustep = 138 / 1024;\r\n const vstep = 239 / 1024;\r\n const uoffset = 60 / 1024;\r\n const voffset = 26 / 1024;\r\n // Second island should have margin, not to touch the first island\r\n // avoid any borderline artefact in pixel rounding\r\n const island_u_offset = -40 / 1024;\r\n const island_v_offset = +20 / 1024;\r\n // face is either island 0 or 1 :\r\n // second island is for faces : [4, 7, 8, 12, 13, 16, 17, 18]\r\n const island = [\r\n 0,\r\n 0,\r\n 0,\r\n 0,\r\n 1, // 0 - 4\r\n 0,\r\n 0,\r\n 1,\r\n 1,\r\n 0, // 5 - 9\r\n 0,\r\n 0,\r\n 1,\r\n 1,\r\n 0, // 10 - 14\r\n 0,\r\n 1,\r\n 1,\r\n 1,\r\n 0, // 15 - 19\r\n ];\r\n\r\n const indices = new Array<number>();\r\n const positions = new Array<number>();\r\n const normals = new Array<number>();\r\n const uvs = new Array<number>();\r\n\r\n let current_indice = 0;\r\n // prepare array of 3 vector (empty) (to be worked in place, shared for each face)\r\n const face_vertex_pos = new Array(3);\r\n const face_vertex_uv = new Array(3);\r\n let v012;\r\n for (v012 = 0; v012 < 3; v012++) {\r\n face_vertex_pos[v012] = Vector3.Zero();\r\n face_vertex_uv[v012] = Vector2.Zero();\r\n }\r\n // create all with normals\r\n for (let face = 0; face < 20; face++) {\r\n // 3 vertex per face\r\n for (v012 = 0; v012 < 3; v012++) {\r\n // look up vertex 0,1,2 to its index in 0 to 11 (or 23 including alias)\r\n const v_id = ico_indices[3 * face + v012];\r\n // vertex have 3D position (x,y,z)\r\n face_vertex_pos[v012].copyFromFloats(\r\n icoVertices[3 * vertices_unalias_id[v_id]],\r\n icoVertices[3 * vertices_unalias_id[v_id] + 1],\r\n icoVertices[3 * vertices_unalias_id[v_id] + 2]\r\n );\r\n // Normalize to get normal\r\n face_vertex_pos[v012].normalize();\r\n\r\n // uv Coordinates from vertex ID\r\n face_vertex_uv[v012].copyFromFloats(\r\n ico_vertexuv[2 * v_id] * ustep + uoffset + island[face] * island_u_offset,\r\n ico_vertexuv[2 * v_id + 1] * vstep + voffset + island[face] * island_v_offset\r\n );\r\n }\r\n\r\n // Subdivide the face (interpolate pos, norm, uv)\r\n // - pos is linear interpolation, then projected to sphere (converge polyhedron to sphere)\r\n // - norm is linear interpolation of vertex corner normal\r\n // (to be checked if better to re-calc from face vertex, or if approximation is OK ??? )\r\n // - uv is linear interpolation\r\n //\r\n // Topology is as below for sub-divide by 2\r\n // vertex shown as v0,v1,v2\r\n // interp index is i1 to progress in range [v0,v1[\r\n // interp index is i2 to progress in range [v0,v2[\r\n // face index as (i1,i2) for /\\ : (i1,i2),(i1+1,i2),(i1,i2+1)\r\n // and (i1,i2)' for \\/ : (i1+1,i2),(i1+1,i2+1),(i1,i2+1)\r\n //\r\n //\r\n // i2 v2\r\n // ^ ^\r\n // / / \\\r\n // / / \\\r\n // / / \\\r\n // / / (0,1) \\\r\n // / #---------\\\r\n // / / \\ (0,0)'/ \\\r\n // / / \\ / \\\r\n // / / \\ / \\\r\n // / / (0,0) \\ / (1,0) \\\r\n // / #---------#---------\\\r\n // v0 v1\r\n //\r\n // --------------------> i1\r\n //\r\n // interp of (i1,i2):\r\n // along i2 : x0=lerp(v0,v2, i2/S) <---> x1=lerp(v1,v2, i2/S)\r\n // along i1 : lerp(x0,x1, i1/(S-i2))\r\n //\r\n // centroid of triangle is needed to get help normal computation\r\n // (c1,c2) are used for centroid location\r\n\r\n const interp_vertex = (i1: number, i2: number, c1: number, c2: number) => {\r\n // vertex is interpolated from\r\n // - face_vertex_pos[0..2]\r\n // - face_vertex_uv[0..2]\r\n const pos_x0 = Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], i2 / subdivisions);\r\n const pos_x1 = Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], i2 / subdivisions);\r\n const pos_interp = subdivisions === i2 ? face_vertex_pos[2] : Vector3.Lerp(pos_x0, pos_x1, i1 / (subdivisions - i2));\r\n pos_interp.normalize();\r\n\r\n let vertex_normal;\r\n if (flat) {\r\n // in flat mode, recalculate normal as face centroid normal\r\n const centroid_x0 = Vector3.Lerp(face_vertex_pos[0], face_vertex_pos[2], c2 / subdivisions);\r\n const centroid_x1 = Vector3.Lerp(face_vertex_pos[1], face_vertex_pos[2], c2 / subdivisions);\r\n vertex_normal = Vector3.Lerp(centroid_x0, centroid_x1, c1 / (subdivisions - c2));\r\n } else {\r\n // in smooth mode, recalculate normal from each single vertex position\r\n vertex_normal = new Vector3(pos_interp.x, pos_interp.y, pos_interp.z);\r\n }\r\n // Vertex normal need correction due to X,Y,Z radius scaling\r\n vertex_normal.x /= radiusX;\r\n vertex_normal.y /= radiusY;\r\n vertex_normal.z /= radiusZ;\r\n vertex_normal.normalize();\r\n\r\n const uv_x0 = Vector2.Lerp(face_vertex_uv[0], face_vertex_uv[2], i2 / subdivisions);\r\n const uv_x1 = Vector2.Lerp(face_vertex_uv[1], face_vertex_uv[2], i2 / subdivisions);\r\n const uv_interp = subdivisions === i2 ? face_vertex_uv[2] : Vector2.Lerp(uv_x0, uv_x1, i1 / (subdivisions - i2));\r\n positions.push(pos_interp.x * radiusX, pos_interp.y * radiusY, pos_interp.z * radiusZ);\r\n normals.push(vertex_normal.x, vertex_normal.y, vertex_normal.z);\r\n uvs.push(uv_interp.x, CompatibilityOptions.UseOpenGLOrientationForUV ? 1.0 - uv_interp.y : uv_interp.y);\r\n // push each vertex has member of a face\r\n // Same vertex can belong to multiple face, it is pushed multiple time (duplicate vertex are present)\r\n indices.push(current_indice);\r\n current_indice++;\r\n };\r\n\r\n for (let i2 = 0; i2 < subdivisions; i2++) {\r\n for (let i1 = 0; i1 + i2 < subdivisions; i1++) {\r\n // face : (i1,i2) for /\\ :\r\n // interp for : (i1,i2),(i1+1,i2),(i1,i2+1)\r\n interp_vertex(i1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n interp_vertex(i1 + 1, i2, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n interp_vertex(i1, i2 + 1, i1 + 1.0 / 3, i2 + 1.0 / 3);\r\n if (i1 + i2 + 1 < subdivisions) {\r\n // face : (i1,i2)' for \\/ :\r\n // interp for (i1+1,i2),(i1+1,i2+1),(i1,i2+1)\r\n interp_vertex(i1 + 1, i2, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n interp_vertex(i1 + 1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n interp_vertex(i1, i2 + 1, i1 + 2.0 / 3, i2 + 2.0 / 3);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Sides\r\n VertexData._ComputeSides(sideOrientation, positions, indices, normals, uvs, options.frontUVs, options.backUVs);\r\n\r\n // Result\r\n const vertexData = new VertexData();\r\n vertexData.indices = indices;\r\n vertexData.positions = positions;\r\n vertexData.normals = normals;\r\n vertexData.uvs = uvs;\r\n return vertexData;\r\n}\r\n\r\n/**\r\n * Creates a sphere based upon an icosahedron with 20 triangular faces which can be subdivided\r\n * * The parameter `radius` sets the radius size (float) of the icosphere (default 1)\r\n * * You can set some different icosphere dimensions, for instance to build an ellipsoid, by using the parameters `radiusX`, `radiusY` and `radiusZ` (all by default have the same value of `radius`)\r\n * * The parameter `subdivisions` sets the number of subdivisions (positive integer, default 4). The more subdivisions, the more faces on the icosphere whatever its size\r\n * * The parameter `flat` (boolean, default true) gives each side its own normals. Set it to false to get a smooth continuous light reflection on the surface\r\n * * You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE\r\n * * If you create a double-sided mesh, you can choose what parts of the texture image to crop and stick respectively on the front and the back sides with the parameters `frontUVs` and `backUVs` (Vector4). Detail here : https://doc.babylonjs.com/babylon101/discover_basic_elements#side-orientation\r\n * * The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created\r\n * @param name defines the name of the mesh\r\n * @param options defines the options used to create the mesh\r\n * @param options.radius\r\n * @param options.radiusX\r\n * @param options.radiusY\r\n * @param options.radiusZ\r\n * @param options.flat\r\n * @param options.subdivisions\r\n * @param options.sideOrientation\r\n * @param options.frontUVs\r\n * @param options.backUVs\r\n * @param options.updatable\r\n * @param scene defines the hosting scene\r\n * @returns the icosahedron mesh\r\n * @see https://doc.babylonjs.com/how_to/polyhedra_shapes#icosphere\r\n */\r\nexport function CreateIcoSphere(\r\n name: string,\r\n options: {\r\n radius?: number;\r\n radiusX?: number;\r\n radiusY?: number;\r\n radiusZ?: number;\r\n flat?: boolean;\r\n subdivisions?: number;\r\n sideOrientation?: number;\r\n frontUVs?: Vector4;\r\n backUVs?: Vector4;\r\n updatable?: boolean;\r\n } = {},\r\n scene: Nullable<Scene> = null\r\n): Mesh {\r\n const sphere = new Mesh(name, scene);\r\n\r\n options.sideOrientation = Mesh._GetDefaultSideOrientation(options.sideOrientation);\r\n sphere._originalBuilderSideOrientation = options.sideOrientation;\r\n\r\n const vertexData = CreateIcoSphereVertexData(options);\r\n\r\n vertexData.applyToMesh(sphere, options.updatable);\r\n\r\n return sphere;\r\n}\r\n/**\r\n * Class containing static functions to help procedurally build meshes\r\n * @deprecated use the function directly from the module\r\n */\r\nexport const IcoSphereBuilder = {\r\n // eslint-disable-next-line @typescript-eslint/naming-convention\r\n CreateIcoSphere,\r\n};\r\n\r\nVertexData.CreateIcoSphere = CreateIcoSphereVertexData;\r\n\r\n(Mesh as any).CreateIcoSphere = (\r\n name: string,\r\n options: { radius?: number; flat?: boolean; subdivisions?: number; sideOrientation?: number; updatable?: boolean },\r\n scene: Scene\r\n): Mesh => {\r\n return CreateIcoSphere(name, options, scene);\r\n};\r\n"]}
@@ -1857,7 +1857,7 @@ var AbstractMesh = /** @class */ (function (_super) {
1857
1857
  var pos = other._intersectionsInProgress.indexOf(this);
1858
1858
  other._intersectionsInProgress.splice(pos, 1);
1859
1859
  }
1860
- this._intersectionsInProgress = [];
1860
+ this._intersectionsInProgress.length = 0;
1861
1861
  // Lights
1862
1862
  var lights = this.getScene().lights;
1863
1863
  lights.forEach(function (light) {