@onerjs/core 8.28.6 → 8.28.8

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 (110) hide show
  1. package/Engines/abstractEngine.js +2 -2
  2. package/Engines/abstractEngine.js.map +1 -1
  3. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +1 -1
  4. package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
  5. package/FrameGraph/Node/Blocks/PostProcesses/taaPostProcessBlock.d.ts +55 -0
  6. package/FrameGraph/Node/Blocks/PostProcesses/taaPostProcessBlock.js +147 -0
  7. package/FrameGraph/Node/Blocks/PostProcesses/taaPostProcessBlock.js.map +1 -0
  8. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +1 -1
  9. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
  10. package/FrameGraph/Node/Blocks/index.d.ts +1 -1
  11. package/FrameGraph/Node/Blocks/index.js +1 -1
  12. package/FrameGraph/Node/Blocks/index.js.map +1 -1
  13. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +1 -6
  14. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  15. package/FrameGraph/Tasks/PostProcesses/taaTask.d.ts +29 -0
  16. package/FrameGraph/Tasks/PostProcesses/taaTask.js +102 -0
  17. package/FrameGraph/Tasks/PostProcesses/taaTask.js.map +1 -0
  18. package/FrameGraph/frameGraphTextureManager.d.ts +9 -0
  19. package/FrameGraph/frameGraphTextureManager.js +15 -0
  20. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  21. package/FrameGraph/index.d.ts +1 -1
  22. package/FrameGraph/index.js +1 -1
  23. package/FrameGraph/index.js.map +1 -1
  24. package/Lights/Clustered/clusteredLightContainer.js +4 -3
  25. package/Lights/Clustered/clusteredLightContainer.js.map +1 -1
  26. package/Lights/pointLight.js +6 -4
  27. package/Lights/pointLight.js.map +1 -1
  28. package/Lights/rectAreaLight.js +6 -4
  29. package/Lights/rectAreaLight.js.map +1 -1
  30. package/Lights/spotLight.js +3 -2
  31. package/Lights/spotLight.js.map +1 -1
  32. package/Materials/Background/backgroundMaterial.js +1 -1
  33. package/Materials/Background/backgroundMaterial.js.map +1 -1
  34. package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +11 -0
  35. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +74 -27
  36. package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
  37. package/Materials/PBR/index.d.ts +1 -1
  38. package/Materials/PBR/index.js +1 -1
  39. package/Materials/PBR/index.js.map +1 -1
  40. package/Materials/PBR/{openPbrMaterial.d.ts → openpbrMaterial.d.ts} +17 -0
  41. package/Materials/PBR/{openPbrMaterial.js → openpbrMaterial.js} +33 -5
  42. package/Materials/PBR/openpbrMaterial.js.map +1 -0
  43. package/Materials/PBR/pbrBaseMaterial.js +1 -1
  44. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  45. package/Materials/material.d.ts +7 -3
  46. package/Materials/material.js +11 -7
  47. package/Materials/material.js.map +1 -1
  48. package/Materials/standardMaterial.js +1 -1
  49. package/Materials/standardMaterial.js.map +1 -1
  50. package/Maths/math.vector.d.ts +1 -1
  51. package/Maths/math.vector.js +1 -1
  52. package/Maths/math.vector.js.map +1 -1
  53. package/Meshes/mesh.js +9 -0
  54. package/Meshes/mesh.js.map +1 -1
  55. package/Morph/morphTargetManager.d.ts +2 -0
  56. package/Morph/morphTargetManager.js +19 -1
  57. package/Morph/morphTargetManager.js.map +1 -1
  58. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.js +1 -1
  59. package/PostProcesses/RenderPipeline/Pipelines/taaMaterialManager.js.map +1 -1
  60. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.d.ts +0 -1
  61. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js +4 -22
  62. package/PostProcesses/RenderPipeline/Pipelines/taaRenderingPipeline.js.map +1 -1
  63. package/PostProcesses/thinTAAPostProcess.d.ts +10 -5
  64. package/PostProcesses/thinTAAPostProcess.js +37 -7
  65. package/PostProcesses/thinTAAPostProcess.js.map +1 -1
  66. package/Rendering/IBLShadows/iblShadowsPluginMaterial.d.ts +1 -1
  67. package/Rendering/IBLShadows/iblShadowsPluginMaterial.js +1 -1
  68. package/Rendering/IBLShadows/iblShadowsPluginMaterial.js.map +1 -1
  69. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +1 -1
  70. package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
  71. package/Rendering/boundingBoxRenderer.js +6 -1
  72. package/Rendering/boundingBoxRenderer.js.map +1 -1
  73. package/Rendering/edgesRenderer.js +4 -0
  74. package/Rendering/edgesRenderer.js.map +1 -1
  75. package/Rendering/geometryBufferRenderer.js.map +1 -1
  76. package/Shaders/ShadersInclude/gaussianSplatting.js +10 -2
  77. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  78. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js +4 -4
  79. package/Shaders/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  80. package/Shaders/gaussianSplattingDepth.fragment.d.ts +5 -0
  81. package/Shaders/gaussianSplattingDepth.fragment.js +11 -0
  82. package/Shaders/gaussianSplattingDepth.fragment.js.map +1 -0
  83. package/Shaders/gaussianSplattingDepth.vertex.d.ts +8 -0
  84. package/Shaders/gaussianSplattingDepth.vertex.js +17 -0
  85. package/Shaders/gaussianSplattingDepth.vertex.js.map +1 -0
  86. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +7 -1
  87. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  88. package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js +1 -1
  89. package/ShadersWGSL/ShadersInclude/openpbrBaseLayerData.js.map +1 -1
  90. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js +4 -4
  91. package/ShadersWGSL/ShadersInclude/openpbrEnvironmentLighting.js.map +1 -1
  92. package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js +1 -1
  93. package/ShadersWGSL/ShadersInclude/openpbrFragmentSamplersDeclaration.js.map +1 -1
  94. package/ShadersWGSL/gaussianSplattingDepth.fragment.d.ts +6 -0
  95. package/ShadersWGSL/gaussianSplattingDepth.fragment.js +17 -0
  96. package/ShadersWGSL/gaussianSplattingDepth.fragment.js.map +1 -0
  97. package/ShadersWGSL/gaussianSplattingDepth.vertex.d.ts +8 -0
  98. package/ShadersWGSL/gaussianSplattingDepth.vertex.js +19 -0
  99. package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -0
  100. package/package.json +1 -1
  101. package/scene.d.ts +3 -1
  102. package/scene.js +6 -5
  103. package/scene.js.map +1 -1
  104. package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.d.ts +0 -48
  105. package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js +0 -119
  106. package/FrameGraph/Node/Blocks/Rendering/taaObjectRendererBlock.js.map +0 -1
  107. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.d.ts +0 -24
  108. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +0 -109
  109. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +0 -1
  110. package/Materials/PBR/openPbrMaterial.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"math.vector.js","sourceRoot":"","sources":["../../../../dev/core/src/Maths/math.vector.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,O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iBAAiB,EAAE,OAAO,CAAC,CAAC;AAC1C,aAAa,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AAExC,MAAM,yBAAyB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport { Epsilon } from \"./math.constants\";\r\nimport type { Viewport } from \"./math.viewport\";\r\nimport type { DeepImmutable, Nullable, FloatArray, float, Tuple } from \"../types\";\r\nimport { BuildTuple } from \"../Misc/arrayTools\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { Plane } from \"./math.plane\";\r\nimport { PerformanceConfigurator } from \"../Engines/performanceConfigurator\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport type { Dimension, Tensor, TensorLike, TensorStatic } from \"./tensor\";\r\nimport type { IVector2Like, IVector3Like, IVector4Like, IQuaternionLike, IMatrixLike, IPlaneLike, IVector3LikeInternal } from \"./math.like\";\r\nimport { Clamp, Lerp, NormalizeRadians, RandomRange, WithinEpsilon } from \"./math.scalar.functions\";\r\nimport { CopyMatrixToArray, InvertMatrixToArray, MatrixManagement, MultiplyMatricesToArray } from \"./ThinMaths/thinMath.matrix.functions\";\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nconst ExtractAsInt = (value: number) => {\r\n return parseInt(value.toString().replace(/\\W/g, \"\"));\r\n};\r\n\r\n/**\r\n * Represents a vector of any dimension\r\n */\r\nexport interface Vector<N extends number[], I> extends Tensor<N, I> {\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n readonly dimension: Readonly<Dimension<N>>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n readonly rank: 1;\r\n\r\n /**\r\n * Gets the length of the vector\r\n * @returns the vector length (float)\r\n */\r\n length(): number;\r\n\r\n /**\r\n * Gets the vector squared length\r\n * @returns the vector squared length (float)\r\n */\r\n lengthSquared(): number;\r\n\r\n /**\r\n * Normalize the vector\r\n * @returns the current updated Vector\r\n */\r\n normalize(): this;\r\n\r\n /**\r\n * Normalize the current Vector with the given input length.\r\n * Please note that this is an in place operation.\r\n * @param len the length of the vector\r\n * @returns the current updated Vector\r\n */\r\n normalizeFromLength(len: number): this;\r\n\r\n /**\r\n * Normalize the current Vector to a new vector\r\n * @returns the new Vector\r\n */\r\n normalizeToNew(): Vector<N, I>;\r\n\r\n /**\r\n * Normalize the current Vector to the reference\r\n * @param reference define the Vector to update\r\n * @returns the updated Vector\r\n */\r\n normalizeToRef<T extends I>(reference: T): T;\r\n}\r\n\r\n/**\r\n * Static side of Vector\r\n */\r\nexport interface VectorStatic<T extends Vector<any[], _I>, _I = TensorLike<T>> extends TensorStatic<T, _I> {\r\n /**\r\n * Checks if a given vector is inside a specific range\r\n * @param value defines the vector to test\r\n * @param min defines the minimum range\r\n * @param max defines the maximum range\r\n */\r\n CheckExtends(value: _I, min: _I, max: _I): void;\r\n\r\n /**\r\n * Returns a new Vector equal to the normalized given vector\r\n * @param vector defines the vector to normalize\r\n * @returns a new Vector\r\n */\r\n Normalize(vector: DeepImmutable<T>): T;\r\n\r\n /**\r\n * Normalize a given vector into a second one\r\n * @param vector defines the vector to normalize\r\n * @param result defines the vector where to store the result\r\n * @returns result input\r\n */\r\n NormalizeToRef(vector: DeepImmutable<T>, result: T): T;\r\n}\r\n\r\n/**\r\n * Class representing a vector containing 2 coordinates\r\n * Example Playground - Overview - https://playground.babylonjs.com/#QYBWV4#9\r\n */\r\nexport class Vector2 implements Vector<Tuple<number, 2>, IVector2Like>, IVector2Like {\r\n /**\r\n * If the first vector is flagged with integers (as everything is 0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.\r\n * If subsequent vectors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,\r\n * and henceforth it will use floating-point representation for all Vector2 instances that it creates.\r\n * But the original Vector2 instances are unchanged and has a \"deprecated map\".\r\n * If we keep using the Vector2 instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.\r\n */\r\n static _V8PerformanceHack = new Vector2(0.5, 0.5) as DeepImmutable<Vector2>;\r\n private static _ZeroReadOnly = Vector2.Zero() as DeepImmutable<Vector2>;\r\n\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n declare public readonly dimension: Readonly<[2]>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n declare public readonly rank: 1;\r\n\r\n /**\r\n * Creates a new Vector2 from the given x and y coordinates\r\n * @param x defines the first coordinate\r\n * @param y defines the second coordinate\r\n */\r\n constructor(\r\n /** [0] defines the first coordinate */\r\n public x: number = 0,\r\n /** [0] defines the second coordinate */\r\n public y: number = 0\r\n ) {}\r\n\r\n /**\r\n * Gets a string with the Vector2 coordinates\r\n * @returns a string with the Vector2 coordinates\r\n */\r\n public toString(): string {\r\n return `{X: ${this.x} Y: ${this.y}}`;\r\n }\r\n\r\n /**\r\n * Gets class name\r\n * @returns the string \"Vector2\"\r\n */\r\n public getClassName(): string {\r\n return \"Vector2\";\r\n }\r\n\r\n /**\r\n * Gets current vector hash code\r\n * @returns the Vector2 hash code as a number\r\n */\r\n public getHashCode(): number {\r\n const x = ExtractAsInt(this.x);\r\n const y = ExtractAsInt(this.y);\r\n let hash = x;\r\n hash = (hash * 397) ^ y;\r\n return hash;\r\n }\r\n\r\n // Operators\r\n\r\n /**\r\n * Sets the Vector2 coordinates in the given array or Float32Array from the given index.\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#15\r\n * @param array defines the source array\r\n * @param index defines the offset in source array\r\n * @returns the current Vector2\r\n */\r\n public toArray(array: FloatArray, index: number = 0): this {\r\n array[index] = this.x;\r\n array[index + 1] = this.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Update the current vector from an array\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#39\r\n * @param array defines the destination array\r\n * @param offset defines the offset in the destination array\r\n * @returns the current Vector2\r\n */\r\n public fromArray(array: FloatArray, offset: number = 0): this {\r\n Vector2.FromArrayToRef(array, offset, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Copy the current vector to an array\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#40\r\n * @returns a new array with 2 elements: the Vector2 coordinates.\r\n */\r\n public asArray(): [number, number] {\r\n return [this.x, this.y];\r\n }\r\n\r\n /**\r\n * Sets the Vector2 coordinates with the given Vector2 coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#24\r\n * @param source defines the source Vector2\r\n * @returns the current updated Vector2\r\n */\r\n public copyFrom(source: DeepImmutable<IVector2Like>): this {\r\n this.x = source.x;\r\n this.y = source.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the Vector2 coordinates with the given floats\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#25\r\n * @param x defines the first coordinate\r\n * @param y defines the second coordinate\r\n * @returns the current updated Vector2\r\n */\r\n public copyFromFloats(x: number, y: number): this {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the Vector2 coordinates with the given floats\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#62\r\n * @param x defines the first coordinate\r\n * @param y defines the second coordinate\r\n * @returns the current updated Vector2\r\n */\r\n public set(x: number, y: number): this {\r\n return this.copyFromFloats(x, y);\r\n }\r\n\r\n /**\r\n * Copies the given float to the current Vector2 coordinates\r\n * @param v defines the x and y coordinates of the operand\r\n * @returns the current updated Vector2\r\n */\r\n public setAll(v: number): this {\r\n return this.copyFromFloats(v, v);\r\n }\r\n\r\n /**\r\n * Add another vector with the current one\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#11\r\n * @param otherVector defines the other vector\r\n * @returns a new Vector2 set with the addition of the current Vector2 and the given one coordinates\r\n */\r\n public add(otherVector: DeepImmutable<IVector2Like>): Vector2 {\r\n return new Vector2(this.x + otherVector.x, this.y + otherVector.y);\r\n }\r\n\r\n /**\r\n * Sets the \"result\" coordinates with the addition of the current Vector2 and the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#12\r\n * @param otherVector defines the other vector\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public addToRef<T extends IVector2Like>(otherVector: DeepImmutable<IVector2Like>, result: T): T {\r\n result.x = this.x + otherVector.x;\r\n result.y = this.y + otherVector.y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Set the Vector2 coordinates by adding the given Vector2 coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#13\r\n * @param otherVector defines the other vector\r\n * @returns the current updated Vector2\r\n */\r\n public addInPlace(otherVector: DeepImmutable<IVector2Like>): this {\r\n this.x += otherVector.x;\r\n this.y += otherVector.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the given coordinates to the current Vector2\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @returns the current updated Vector2\r\n */\r\n public addInPlaceFromFloats(x: number, y: number): this {\r\n this.x += x;\r\n this.y += y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 by adding the current Vector2 coordinates to the given Vector3 x, y coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#14\r\n * @param otherVector defines the other vector\r\n * @returns a new Vector2\r\n */\r\n public addVector3(otherVector: IVector3Like): Vector2 {\r\n return new Vector2(this.x + otherVector.x, this.y + otherVector.y);\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set with the subtracted coordinates of the given one from the current Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#61\r\n * @param otherVector defines the other vector\r\n * @returns a new Vector2\r\n */\r\n public subtract(otherVector: DeepImmutable<IVector2Like>): Vector2 {\r\n return new Vector2(this.x - otherVector.x, this.y - otherVector.y);\r\n }\r\n\r\n /**\r\n * Sets the \"result\" coordinates with the subtraction of the given one from the current Vector2 coordinates.\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#63\r\n * @param otherVector defines the other vector\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public subtractToRef<T extends IVector2Like>(otherVector: DeepImmutable<IVector2Like>, result: T): T {\r\n result.x = this.x - otherVector.x;\r\n result.y = this.y - otherVector.y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the current Vector2 coordinates by subtracting from it the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#88\r\n * @param otherVector defines the other vector\r\n * @returns the current updated Vector2\r\n */\r\n public subtractInPlace(otherVector: DeepImmutable<IVector2Like>): this {\r\n this.x -= otherVector.x;\r\n this.y -= otherVector.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies in place the current Vector2 coordinates by the given ones\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#43\r\n * @param otherVector defines the other vector\r\n * @returns the current updated Vector2\r\n */\r\n public multiplyInPlace(otherVector: DeepImmutable<IVector2Like>): this {\r\n this.x *= otherVector.x;\r\n this.y *= otherVector.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 set with the multiplication of the current Vector2 and the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#42\r\n * @param otherVector defines the other vector\r\n * @returns a new Vector2\r\n */\r\n public multiply(otherVector: DeepImmutable<IVector2Like>): Vector2 {\r\n return new Vector2(this.x * otherVector.x, this.y * otherVector.y);\r\n }\r\n\r\n /**\r\n * Sets \"result\" coordinates with the multiplication of the current Vector2 and the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#44\r\n * @param otherVector defines the other vector\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public multiplyToRef<T extends IVector2Like>(otherVector: DeepImmutable<IVector2Like>, result: T): T {\r\n result.x = this.x * otherVector.x;\r\n result.y = this.y * otherVector.y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set with the Vector2 coordinates multiplied by the given floats\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#89\r\n * @param x defines the first coordinate\r\n * @param y defines the second coordinate\r\n * @returns a new Vector2\r\n */\r\n public multiplyByFloats(x: number, y: number): Vector2 {\r\n return new Vector2(this.x * x, this.y * y);\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 set with the Vector2 coordinates divided by the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#27\r\n * @param otherVector defines the other vector\r\n * @returns a new Vector2\r\n */\r\n public divide(otherVector: DeepImmutable<IVector2Like>): Vector2 {\r\n return new Vector2(this.x / otherVector.x, this.y / otherVector.y);\r\n }\r\n\r\n /**\r\n * Sets the \"result\" coordinates with the Vector2 divided by the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#30\r\n * @param otherVector defines the other vector\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public divideToRef<T extends IVector2Like>(otherVector: DeepImmutable<IVector2Like>, result: T): T {\r\n result.x = this.x / otherVector.x;\r\n result.y = this.y / otherVector.y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Divides the current Vector2 coordinates by the given ones\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#28\r\n * @param otherVector defines the other vector\r\n * @returns the current updated Vector2\r\n */\r\n public divideInPlace(otherVector: DeepImmutable<IVector2Like>): this {\r\n this.x = this.x / otherVector.x;\r\n this.y = this.y / otherVector.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector2 with the minimal coordinate values between its and the given vector ones\r\n * @param other defines the second operand\r\n * @returns the current updated Vector2\r\n */\r\n public minimizeInPlace(other: DeepImmutable<IVector2Like>): this {\r\n return this.minimizeInPlaceFromFloats(other.x, other.y);\r\n }\r\n\r\n /**\r\n * Updates the current Vector2 with the maximal coordinate values between its and the given vector ones.\r\n * @param other defines the second operand\r\n * @returns the current updated Vector2\r\n */\r\n public maximizeInPlace(other: DeepImmutable<IVector2Like>): this {\r\n return this.maximizeInPlaceFromFloats(other.x, other.y);\r\n }\r\n\r\n /**\r\n * Updates the current Vector2 with the minimal coordinate values between its and the given coordinates\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @returns the current updated Vector2\r\n */\r\n public minimizeInPlaceFromFloats(x: number, y: number): this {\r\n this.x = Math.min(x, this.x);\r\n this.y = Math.min(y, this.y);\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector2 with the maximal coordinate values between its and the given coordinates.\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @returns the current updated Vector2\r\n */\r\n public maximizeInPlaceFromFloats(x: number, y: number): this {\r\n this.x = Math.max(x, this.x);\r\n this.y = Math.max(y, this.y);\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 set with the subtraction of the given floats from the current Vector2 coordinates\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @returns the resulting Vector2\r\n */\r\n public subtractFromFloats(x: number, y: number): Vector2 {\r\n return new Vector2(this.x - x, this.y - y);\r\n }\r\n\r\n /**\r\n * Subtracts the given floats from the current Vector2 coordinates and set the given vector \"result\" with this result\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param result defines the Vector2 object where to store the result\r\n * @returns the result\r\n */\r\n public subtractFromFloatsToRef<T extends IVector2Like>(x: number, y: number, result: T): T {\r\n result.x = this.x - x;\r\n result.y = this.y - y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 with current Vector2 negated coordinates\r\n * @returns a new Vector2\r\n */\r\n public negate(): Vector2 {\r\n return new Vector2(-this.x, -this.y);\r\n }\r\n\r\n /**\r\n * Negate this vector in place\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#23\r\n * @returns this\r\n */\r\n public negateInPlace(): this {\r\n this.x *= -1;\r\n this.y *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Negate the current Vector2 and stores the result in the given vector \"result\" coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#41\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public negateToRef<T extends IVector2Like>(result: T): T {\r\n result.x = -this.x;\r\n result.y = -this.y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Multiply the Vector2 coordinates by\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#59\r\n * @param scale defines the scaling factor\r\n * @returns the current updated Vector2\r\n */\r\n public scaleInPlace(scale: number): this {\r\n this.x *= scale;\r\n this.y *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 scaled by \"scale\" from the current Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#52\r\n * @param scale defines the scaling factor\r\n * @returns a new Vector2\r\n */\r\n public scale(scale: number): Vector2 {\r\n return new Vector2(this.x * scale, this.y * scale);\r\n }\r\n\r\n /**\r\n * Scale the current Vector2 values by a factor to a given Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#57\r\n * @param scale defines the scale factor\r\n * @param result defines the Vector2 object where to store the result\r\n * @returns result input\r\n */\r\n public scaleToRef<T extends IVector2Like>(scale: number, result: T): T {\r\n result.x = this.x * scale;\r\n result.y = this.y * scale;\r\n return result;\r\n }\r\n\r\n /**\r\n * Scale the current Vector2 values by a factor and add the result to a given Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#58\r\n * @param scale defines the scale factor\r\n * @param result defines the Vector2 object where to store the result\r\n * @returns result input\r\n */\r\n public scaleAndAddToRef<T extends IVector2Like>(scale: number, result: T): T {\r\n result.x += this.x * scale;\r\n result.y += this.y * scale;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a boolean if two vectors are equals\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#31\r\n * @param otherVector defines the other vector\r\n * @returns true if the given vector coordinates strictly equal the current Vector2 ones\r\n */\r\n public equals(otherVector: DeepImmutable<IVector2Like>): boolean {\r\n return otherVector && this.x === otherVector.x && this.y === otherVector.y;\r\n }\r\n\r\n /**\r\n * Gets a boolean if two vectors are equals (using an epsilon value)\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#32\r\n * @param otherVector defines the other vector\r\n * @param epsilon defines the minimal distance to consider equality\r\n * @returns true if the given vector coordinates are close to the current ones by a distance of epsilon.\r\n */\r\n public equalsWithEpsilon(otherVector: DeepImmutable<IVector2Like>, epsilon: number = Epsilon): boolean {\r\n return otherVector && WithinEpsilon(this.x, otherVector.x, epsilon) && WithinEpsilon(this.y, otherVector.y, epsilon);\r\n }\r\n\r\n /**\r\n * Returns true if the current Vector2 coordinates equals the given floats\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @returns true if both vectors are equal\r\n */\r\n public equalsToFloats(x: number, y: number): boolean {\r\n return this.x === x && this.y === y;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 from current Vector2 floored values\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#35\r\n * eg (1.2, 2.31) returns (1, 2)\r\n * @returns a new Vector2\r\n */\r\n public floor(): Vector2 {\r\n return new Vector2(Math.floor(this.x), Math.floor(this.y));\r\n }\r\n\r\n /**\r\n * Gets the current Vector2's floored values and stores them in result\r\n * @param result the Vector2 to store the result in\r\n * @returns the result Vector2\r\n */\r\n public floorToRef<T extends IVector2Like>(result: T): T {\r\n result.x = Math.floor(this.x);\r\n result.y = Math.floor(this.y);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 from current Vector2 fractional values\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#34\r\n * eg (1.2, 2.31) returns (0.2, 0.31)\r\n * @returns a new Vector2\r\n */\r\n public fract(): Vector2 {\r\n return new Vector2(this.x - Math.floor(this.x), this.y - Math.floor(this.y));\r\n }\r\n\r\n /**\r\n * Gets the current Vector2's fractional values and stores them in result\r\n * @param result the Vector2 to store the result in\r\n * @returns the result Vector2\r\n */\r\n public fractToRef<T extends IVector2Like>(result: T): T {\r\n result.x = this.x - Math.floor(this.x);\r\n result.y = this.y - Math.floor(this.y);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 rotated by the given angle\r\n * @param angle defines the rotation angle\r\n * @returns a new Vector2\r\n */\r\n public rotate(angle: number): Vector2 {\r\n return this.rotateToRef(angle, new Vector2());\r\n }\r\n\r\n /**\r\n * Rotate the current vector into a given result vector\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#49\r\n * @param angle defines the rotation angle\r\n * @param result defines the result vector where to store the rotated vector\r\n * @returns result input\r\n */\r\n public rotateToRef<T extends IVector2Like>(angle: number, result: T): T {\r\n const cos = Math.cos(angle);\r\n const sin = Math.sin(angle);\r\n result.x = cos * this.x - sin * this.y;\r\n result.y = sin * this.x + cos * this.y;\r\n return result;\r\n }\r\n\r\n // Properties\r\n\r\n /**\r\n * Gets the length of the vector\r\n * @returns the vector length (float)\r\n */\r\n public length(): number {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n }\r\n\r\n /**\r\n * Gets the vector squared length\r\n * @returns the vector squared length (float)\r\n */\r\n public lengthSquared(): number {\r\n return this.x * this.x + this.y * this.y;\r\n }\r\n\r\n // Methods\r\n\r\n /**\r\n * Normalize the vector\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#48\r\n * @returns the current updated Vector2\r\n */\r\n public normalize(): this {\r\n return this.normalizeFromLength(this.length());\r\n }\r\n\r\n /**\r\n * Normalize the current Vector2 with the given input length.\r\n * Please note that this is an in place operation.\r\n * @param len the length of the vector\r\n * @returns the current updated Vector2\r\n */\r\n public normalizeFromLength(len: number): this {\r\n if (len === 0 || len === 1.0) {\r\n return this;\r\n }\r\n\r\n return this.scaleInPlace(1.0 / len);\r\n }\r\n\r\n /**\r\n * Normalize the current Vector2 to a new vector\r\n * @returns the new Vector2\r\n */\r\n public normalizeToNew(): Vector2 {\r\n const normalized = new Vector2();\r\n this.normalizeToRef(normalized);\r\n return normalized;\r\n }\r\n\r\n /**\r\n * Normalize the current Vector2 to the reference\r\n * @param result define the Vector to update\r\n * @returns the updated Vector2\r\n */\r\n public normalizeToRef<T extends IVector2Like>(result: T): T {\r\n const len = this.length();\r\n if (len === 0) {\r\n result.x = this.x;\r\n result.y = this.y;\r\n }\r\n return this.scaleToRef(1.0 / len, result);\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 copied from the Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#20\r\n * @returns a new Vector2\r\n */\r\n public clone(): Vector2 {\r\n return new Vector2(this.x, this.y);\r\n }\r\n\r\n /**\r\n * Gets the dot product of the current vector and the vector \"otherVector\"\r\n * @param otherVector defines second vector\r\n * @returns the dot product (float)\r\n */\r\n public dot(otherVector: DeepImmutable<IVector2Like>): number {\r\n return this.x * otherVector.x + this.y * otherVector.y;\r\n }\r\n\r\n // Statics\r\n\r\n /**\r\n * Gets a new Vector2(0, 0)\r\n * @returns a new Vector2\r\n */\r\n public static Zero(): Vector2 {\r\n return new Vector2(0, 0);\r\n }\r\n\r\n /**\r\n * Gets a new Vector2(1, 1)\r\n * @returns a new Vector2\r\n */\r\n public static One(): Vector2 {\r\n return new Vector2(1, 1);\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @returns a Vector2 with random values between min and max\r\n */\r\n public static Random(min: number = 0, max: number = 1): Vector2 {\r\n return new Vector2(RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Sets a Vector2 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @param ref the ref to store the values in\r\n * @returns the ref with random values between min and max\r\n */\r\n public static RandomToRef<T extends Vector2>(min: number = 0, max: number = 1, ref: T): T {\r\n return ref.copyFromFloats(RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Gets a zero Vector2 that must not be updated\r\n */\r\n public static get ZeroReadOnly(): DeepImmutable<Vector2> {\r\n return Vector2._ZeroReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set from the given index element of the given array\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#79\r\n * @param array defines the data source\r\n * @param offset defines the offset in the data source\r\n * @returns a new Vector2\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Vector2 {\r\n return new Vector2(array[offset], array[offset + 1]);\r\n }\r\n\r\n /**\r\n * Sets \"result\" from the given index element of the given array\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#80\r\n * @param array defines the data source\r\n * @param offset defines the offset in the data source\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public static FromArrayToRef<T extends Vector2>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T {\r\n result.x = array[offset];\r\n result.y = array[offset + 1];\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the given floats.\r\n * @param x defines the x coordinate of the source\r\n * @param y defines the y coordinate of the source\r\n * @param result defines the Vector2 where to store the result\r\n * @returns the result vector\r\n */\r\n public static FromFloatsToRef<T extends Vector2>(x: number, y: number, result: T): T {\r\n result.copyFromFloats(x, y);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 located for \"amount\" (float) on the CatmullRom spline defined by the given four Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#65\r\n * @param value1 defines 1st point of control\r\n * @param value2 defines 2nd point of control\r\n * @param value3 defines 3rd point of control\r\n * @param value4 defines 4th point of control\r\n * @param amount defines the interpolation factor\r\n * @returns a new Vector2\r\n */\r\n public static CatmullRom(\r\n value1: DeepImmutable<IVector2Like>,\r\n value2: DeepImmutable<IVector2Like>,\r\n value3: DeepImmutable<IVector2Like>,\r\n value4: DeepImmutable<IVector2Like>,\r\n amount: number\r\n ): Vector2 {\r\n const squared = amount * amount;\r\n const cubed = amount * squared;\r\n\r\n const x =\r\n 0.5 *\r\n (2.0 * value2.x +\r\n (-value1.x + value3.x) * amount +\r\n (2.0 * value1.x - 5.0 * value2.x + 4.0 * value3.x - value4.x) * squared +\r\n (-value1.x + 3.0 * value2.x - 3.0 * value3.x + value4.x) * cubed);\r\n\r\n const y =\r\n 0.5 *\r\n (2.0 * value2.y +\r\n (-value1.y + value3.y) * amount +\r\n (2.0 * value1.y - 5.0 * value2.y + 4.0 * value3.y - value4.y) * squared +\r\n (-value1.y + 3.0 * value2.y - 3.0 * value3.y + value4.y) * cubed);\r\n\r\n return new Vector2(x, y);\r\n }\r\n\r\n /**\r\n * Sets reference with same the coordinates than \"value\" ones if the vector \"value\" is in the square defined by \"min\" and \"max\".\r\n * If a coordinate of \"value\" is lower than \"min\" coordinates, the returned Vector2 is given this \"min\" coordinate.\r\n * If a coordinate of \"value\" is greater than \"max\" coordinates, the returned Vector2 is given this \"max\" coordinate\r\n * @param value defines the value to clamp\r\n * @param min defines the lower limit\r\n * @param max defines the upper limit\r\n * @param ref the reference\r\n * @returns the reference\r\n */\r\n public static ClampToRef<T extends Vector2>(value: DeepImmutable<IVector2Like>, min: DeepImmutable<IVector2Like>, max: DeepImmutable<IVector2Like>, ref: T): T {\r\n ref.x = Clamp(value.x, min.x, max.x);\r\n ref.y = Clamp(value.y, min.y, max.y);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 set with same the coordinates than \"value\" ones if the vector \"value\" is in the square defined by \"min\" and \"max\".\r\n * If a coordinate of \"value\" is lower than \"min\" coordinates, the returned Vector2 is given this \"min\" coordinate.\r\n * If a coordinate of \"value\" is greater than \"max\" coordinates, the returned Vector2 is given this \"max\" coordinate\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#76\r\n * @param value defines the value to clamp\r\n * @param min defines the lower limit\r\n * @param max defines the upper limit\r\n * @returns a new Vector2\r\n */\r\n public static Clamp(value: DeepImmutable<IVector2Like>, min: DeepImmutable<IVector2Like>, max: DeepImmutable<IVector2Like>): Vector2 {\r\n const x = Clamp(value.x, min.x, max.x);\r\n const y = Clamp(value.y, min.y, max.y);\r\n return new Vector2(x, y);\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 located for \"amount\" (float) on the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#81\r\n * @param value1 defines the 1st control point\r\n * @param tangent1 defines the outgoing tangent\r\n * @param value2 defines the 2nd control point\r\n * @param tangent2 defines the incoming tangent\r\n * @param amount defines the interpolation factor\r\n * @returns a new Vector2\r\n */\r\n public static Hermite(\r\n value1: DeepImmutable<IVector2Like>,\r\n tangent1: DeepImmutable<IVector2Like>,\r\n value2: DeepImmutable<IVector2Like>,\r\n tangent2: DeepImmutable<IVector2Like>,\r\n amount: number\r\n ): Vector2 {\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 x = value1.x * part1 + value2.x * part2 + tangent1.x * part3 + tangent2.x * part4;\r\n const y = value1.y * part1 + value2.y * part2 + tangent1.y * part3 + tangent2.y * part4;\r\n\r\n return new Vector2(x, y);\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#82\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<IVector2Like>,\r\n tangent1: DeepImmutable<IVector2Like>,\r\n value2: DeepImmutable<IVector2Like>,\r\n tangent2: DeepImmutable<IVector2Like>,\r\n time: number\r\n ): Vector2 {\r\n return this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, new Vector2());\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#83\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 the derivative will be stored\r\n * @returns result input\r\n */\r\n public static Hermite1stDerivativeToRef<T extends Vector2>(\r\n value1: DeepImmutable<IVector2Like>,\r\n tangent1: DeepImmutable<IVector2Like>,\r\n value2: DeepImmutable<IVector2Like>,\r\n tangent2: DeepImmutable<IVector2Like>,\r\n time: number,\r\n result: T\r\n ): T {\r\n const t2 = time * time;\r\n\r\n result.x = (t2 - time) * 6 * value1.x + (3 * t2 - 4 * time + 1) * tangent1.x + (-t2 + time) * 6 * value2.x + (3 * t2 - 2 * time) * tangent2.x;\r\n result.y = (t2 - time) * 6 * value1.y + (3 * t2 - 4 * time + 1) * tangent1.y + (-t2 + time) * 6 * value2.y + (3 * t2 - 2 * time) * tangent2.y;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 located for \"amount\" (float) on the linear interpolation between the vector \"start\" adn the vector \"end\".\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#84\r\n * @param start defines the start vector\r\n * @param end defines the end vector\r\n * @param amount defines the interpolation factor\r\n * @returns a new Vector2\r\n */\r\n public static Lerp(start: DeepImmutable<IVector2Like>, end: DeepImmutable<IVector2Like>, amount: number): Vector2 {\r\n return Vector2.LerpToRef(start, end, amount, new Vector2());\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the linear interpolation from the vector \"start\" for \"amount\" to the vector \"end\"\r\n * @param start defines the start value\r\n * @param end defines the end value\r\n * @param amount max defines amount between both (between 0 and 1)\r\n * @param result defines the Vector2 where to store the result\r\n * @returns result input\r\n */\r\n public static LerpToRef(start: DeepImmutable<IVector2Like>, end: DeepImmutable<IVector2Like>, amount: number, result: Vector2): Vector2 {\r\n result.x = start.x + (end.x - start.x) * amount;\r\n result.y = start.y + (end.y - start.y) * amount;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets the dot product of the vector \"left\" and the vector \"right\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#90\r\n * @param left defines first vector\r\n * @param right defines second vector\r\n * @returns the dot product (float)\r\n */\r\n public static Dot(left: DeepImmutable<IVector2Like>, right: DeepImmutable<IVector2Like>): number {\r\n return left.x * right.x + left.y * right.y;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 equal to the normalized given vector\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#46\r\n * @param vector defines the vector to normalize\r\n * @returns a new Vector2\r\n */\r\n public static Normalize(vector: DeepImmutable<Vector2>): Vector2 {\r\n return Vector2.NormalizeToRef(vector, new Vector2());\r\n }\r\n\r\n /**\r\n * Normalize a given vector into a second one\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#50\r\n * @param vector defines the vector to normalize\r\n * @param result defines the vector where to store the result\r\n * @returns result input\r\n */\r\n public static NormalizeToRef<T extends Vector2>(vector: DeepImmutable<Vector2>, result: T): T {\r\n vector.normalizeToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set with the minimal coordinate values from the \"left\" and \"right\" vectors\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#86\r\n * @param left defines 1st vector\r\n * @param right defines 2nd vector\r\n * @returns a new Vector2\r\n */\r\n public static Minimize(left: DeepImmutable<IVector2Like>, right: DeepImmutable<IVector2Like>): Vector2 {\r\n const x = left.x < right.x ? left.x : right.x;\r\n const y = left.y < right.y ? left.y : right.y;\r\n return new Vector2(x, y);\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set with the maximal coordinate values from the \"left\" and \"right\" vectors\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#86\r\n * @param left defines 1st vector\r\n * @param right defines 2nd vector\r\n * @returns a new Vector2\r\n */\r\n public static Maximize(left: DeepImmutable<IVector2Like>, right: DeepImmutable<IVector2Like>): Vector2 {\r\n const x = left.x > right.x ? left.x : right.x;\r\n const y = left.y > right.y ? left.y : right.y;\r\n return new Vector2(x, y);\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set with the transformed coordinates of the given vector by the given transformation matrix\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#17\r\n * @param vector defines the vector to transform\r\n * @param transformation defines the matrix to apply\r\n * @returns a new Vector2\r\n */\r\n public static Transform(vector: DeepImmutable<IVector2Like>, transformation: DeepImmutable<Matrix>): Vector2 {\r\n return Vector2.TransformToRef(vector, transformation, new Vector2());\r\n }\r\n\r\n /**\r\n * Transforms the given vector coordinates by the given transformation matrix and stores the result in the vector \"result\" coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#19\r\n * @param vector defines the vector to transform\r\n * @param transformation defines the matrix to apply\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public static TransformToRef<T extends Vector2>(vector: DeepImmutable<IVector2Like>, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n const x = vector.x * m[0] + vector.y * m[4] + m[12];\r\n const y = vector.x * m[1] + vector.y * m[5] + m[13];\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Determines if a given vector is included in a triangle\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#87\r\n * @param p defines the vector to test\r\n * @param p0 defines 1st triangle point\r\n * @param p1 defines 2nd triangle point\r\n * @param p2 defines 3rd triangle point\r\n * @returns true if the point \"p\" is in the triangle defined by the vectors \"p0\", \"p1\", \"p2\"\r\n */\r\n public static PointInTriangle(p: DeepImmutable<IVector2Like>, p0: DeepImmutable<IVector2Like>, p1: DeepImmutable<IVector2Like>, p2: DeepImmutable<IVector2Like>): boolean {\r\n const a = (1 / 2) * (-p1.y * p2.x + p0.y * (-p1.x + p2.x) + p0.x * (p1.y - p2.y) + p1.x * p2.y);\r\n const sign = a < 0 ? -1 : 1;\r\n const s = (p0.y * p2.x - p0.x * p2.y + (p2.y - p0.y) * p.x + (p0.x - p2.x) * p.y) * sign;\r\n const t = (p0.x * p1.y - p0.y * p1.x + (p0.y - p1.y) * p.x + (p1.x - p0.x) * p.y) * sign;\r\n\r\n return s > 0 && t > 0 && s + t < 2 * a * sign;\r\n }\r\n\r\n /**\r\n * Gets the distance between the vectors \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#71\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @returns the distance between vectors\r\n */\r\n public static Distance(value1: DeepImmutable<IVector2Like>, value2: DeepImmutable<IVector2Like>): number {\r\n return Math.sqrt(Vector2.DistanceSquared(value1, value2));\r\n }\r\n\r\n /**\r\n * Returns the squared distance between the vectors \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#72\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @returns the squared distance between vectors\r\n */\r\n public static DistanceSquared(value1: DeepImmutable<IVector2Like>, value2: DeepImmutable<IVector2Like>): number {\r\n const x = value1.x - value2.x;\r\n const y = value1.y - value2.y;\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 located at the center of the vectors \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#86\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#66\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @returns a new Vector2\r\n */\r\n public static Center(value1: DeepImmutable<IVector2Like>, value2: DeepImmutable<IVector2Like>): Vector2 {\r\n return Vector2.CenterToRef(value1, value2, new Vector2());\r\n }\r\n\r\n /**\r\n * Gets the center of the vectors \"value1\" and \"value2\" and stores the result in the vector \"ref\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#66\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @param ref defines third vector\r\n * @returns ref\r\n */\r\n public static CenterToRef<T extends Vector2>(value1: DeepImmutable<IVector2Like>, value2: DeepImmutable<IVector2Like>, ref: T): T {\r\n return ref.copyFromFloats((value1.x + value2.x) / 2, (value1.y + value2.y) / 2);\r\n }\r\n\r\n /**\r\n * Gets the shortest distance (float) between the point \"p\" and the segment defined by the two points \"segA\" and \"segB\".\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#77\r\n * @param p defines the middle point\r\n * @param segA defines one point of the segment\r\n * @param segB defines the other point of the segment\r\n * @returns the shortest distance\r\n */\r\n public static DistanceOfPointFromSegment(p: DeepImmutable<Vector2>, segA: DeepImmutable<Vector2>, segB: DeepImmutable<Vector2>): number {\r\n const l2 = Vector2.DistanceSquared(segA, segB);\r\n if (l2 === 0.0) {\r\n return Vector2.Distance(p, segA);\r\n }\r\n const v = segB.subtract(segA);\r\n const t = Math.max(0, Math.min(1, Vector2.Dot(p.subtract(segA), v) / l2));\r\n const proj = segA.add(v.multiplyByFloats(t, t));\r\n return Vector2.Distance(p, proj);\r\n }\r\n}\r\n\r\nVector2 satisfies TensorStatic<Vector2, IVector2Like>;\r\nObject.defineProperties(Vector2.prototype, {\r\n dimension: { value: [2] },\r\n rank: { value: 1 },\r\n});\r\n\r\ntype VectorInterceptor = (newValue: { x?: number; y?: number; z?: number }) => boolean;\r\n\r\n/**\r\n * Class used to store (x,y,z) vector representation\r\n * A Vector3 is the main object used in 3D geometry\r\n * It can represent either the coordinates of a point the space, either a direction\r\n * Reminder: js uses a left handed forward facing system\r\n * Example Playground - Overview - https://playground.babylonjs.com/#R1F8YU\r\n */\r\nexport class Vector3 implements Vector<Tuple<number, 3>, IVector3LikeInternal>, IVector3Like {\r\n /**\r\n * If the first vector is flagged with integers (as everything is 0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.\r\n * If subsequent vectors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,\r\n * and henceforth it will use floating-point representation for all Vector3 instances that it creates.\r\n * But the original Vector3 instances are unchanged and has a \"deprecated map\".\r\n * If we keep using the Vector3 instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.\r\n */\r\n static _V8PerformanceHack = new Vector3(0.5, 0.5, 0.5) as DeepImmutable<Vector3>;\r\n private static _UpReadOnly = Vector3.Up() as DeepImmutable<Vector3>;\r\n private static _DownReadOnly = Vector3.Down() as DeepImmutable<Vector3>;\r\n private static _LeftHandedForwardReadOnly = Vector3.Forward(false) as DeepImmutable<Vector3>;\r\n private static _RightHandedForwardReadOnly = Vector3.Forward(true) as DeepImmutable<Vector3>;\r\n private static _LeftHandedBackwardReadOnly = Vector3.Backward(false) as DeepImmutable<Vector3>;\r\n private static _RightHandedBackwardReadOnly = Vector3.Backward(true) as DeepImmutable<Vector3>;\r\n private static _RightReadOnly = Vector3.Right() as DeepImmutable<Vector3>;\r\n private static _LeftReadOnly = Vector3.Left() as DeepImmutable<Vector3>;\r\n private static _ZeroReadOnly = Vector3.Zero() as DeepImmutable<Vector3>;\r\n private static _OneReadOnly = Vector3.One() as DeepImmutable<Vector3>;\r\n\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n declare public readonly dimension: Readonly<[3]>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n declare public readonly rank: 1;\r\n\r\n /** @internal */\r\n public _x: number;\r\n\r\n /** @internal */\r\n public _y: number;\r\n\r\n /** @internal */\r\n public _z: number;\r\n\r\n /** @internal */\r\n public _isDirty = true;\r\n\r\n /** @internal */\r\n private _interceptor?: Nullable<VectorInterceptor> = null;\r\n\r\n /** Gets or sets the x coordinate */\r\n public get x() {\r\n return this._x;\r\n }\r\n\r\n public set x(value: number) {\r\n if (this._interceptor && this._interceptor({ x: value })) {\r\n return;\r\n }\r\n this._x = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the y coordinate */\r\n public get y() {\r\n return this._y;\r\n }\r\n\r\n public set y(value: number) {\r\n if (this._interceptor && this._interceptor({ y: value })) {\r\n return;\r\n }\r\n this._y = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the z coordinate */\r\n public get z() {\r\n return this._z;\r\n }\r\n\r\n public set z(value: number) {\r\n if (this._interceptor && this._interceptor({ z: value })) {\r\n return;\r\n }\r\n this._z = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Creates a new Vector3 object from the given x, y, z (floats) coordinates.\r\n * @param x defines the first coordinates (on X axis)\r\n * @param y defines the second coordinates (on Y axis)\r\n * @param z defines the third coordinates (on Z axis)\r\n * @param interceptor defines intercept the value change function\r\n */\r\n constructor(x: number = 0, y: number = 0, z: number = 0, interceptor?: VectorInterceptor) {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n if (interceptor) {\r\n this._interceptor = interceptor;\r\n }\r\n }\r\n\r\n /**\r\n * Creates a string representation of the Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#67\r\n * @returns a string with the Vector3 coordinates.\r\n */\r\n public toString(): string {\r\n return `{X: ${this._x} Y: ${this._y} Z: ${this._z}}`;\r\n }\r\n\r\n /**\r\n * Gets the class name\r\n * @returns the string \"Vector3\"\r\n */\r\n public getClassName(): string {\r\n return \"Vector3\";\r\n }\r\n\r\n /**\r\n * Creates the Vector3 hash code\r\n * @returns a number which tends to be unique between Vector3 instances\r\n */\r\n public getHashCode(): number {\r\n const x = ExtractAsInt(this._x);\r\n const y = ExtractAsInt(this._y);\r\n const z = ExtractAsInt(this._z);\r\n\r\n let hash = x;\r\n hash = (hash * 397) ^ y;\r\n hash = (hash * 397) ^ z;\r\n return hash;\r\n }\r\n\r\n // Operators\r\n\r\n /**\r\n * Creates an array containing three elements : the coordinates of the Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#10\r\n * @returns a new array of numbers\r\n */\r\n public asArray(): Tuple<number, 3> {\r\n return [this._x, this._y, this._z];\r\n }\r\n\r\n /**\r\n * Populates the given array or Float32Array from the given index with the successive coordinates of the Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#65\r\n * @param array defines the destination array\r\n * @param index defines the offset in the destination array\r\n * @returns the current Vector3\r\n */\r\n public toArray(array: FloatArray, index: number = 0): this {\r\n array[index] = this._x;\r\n array[index + 1] = this._y;\r\n array[index + 2] = this._z;\r\n return this;\r\n }\r\n\r\n /**\r\n * Update the current vector from an array\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#24\r\n * @param array defines the destination array\r\n * @param offset defines the offset in the destination array\r\n * @returns the current Vector3\r\n */\r\n public fromArray(array: DeepImmutable<FloatArray>, offset: number = 0): this {\r\n Vector3.FromArrayToRef(array, offset, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Intercept the x,y,z value change\r\n * @param interceptor\r\n */\r\n public setInterceptor(interceptor: (newValue: { x?: number; y?: number; z?: number }) => boolean) {\r\n this._interceptor = interceptor;\r\n }\r\n\r\n /**\r\n * Get the current interceptor\r\n * @returns the current vector interceptor\r\n */\r\n public getInterceptor(): Nullable<VectorInterceptor> | undefined {\r\n return this._interceptor;\r\n }\r\n\r\n /**\r\n * Converts the current Vector3 into a quaternion (considering that the Vector3 contains Euler angles representation of a rotation)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#66\r\n * @returns a new Quaternion object, computed from the Vector3 coordinates\r\n */\r\n public toQuaternion(): Quaternion {\r\n return Quaternion.RotationYawPitchRoll(this._y, this._x, this._z);\r\n }\r\n\r\n /**\r\n * Adds the given vector to the current Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#4\r\n * @param otherVector defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public addInPlace(otherVector: DeepImmutable<Vector3>): this {\r\n this._x += otherVector._x;\r\n this._y += otherVector._y;\r\n this._z += otherVector._z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the given coordinates to the current Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#5\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public addInPlaceFromFloats(x: number, y: number, z: number): this {\r\n this._x += x;\r\n this._y += y;\r\n this._z += z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets a new Vector3, result of the addition the current Vector3 and the given vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#3\r\n * @param otherVector defines the second operand\r\n * @returns the resulting Vector3\r\n */\r\n public add(otherVector: DeepImmutable<IVector3LikeInternal>): Vector3 {\r\n return new Vector3(this._x + otherVector._x, this._y + otherVector._y, this._z + otherVector._z);\r\n }\r\n\r\n /**\r\n * Adds the current Vector3 to the given one and stores the result in the vector \"result\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#6\r\n * @param otherVector defines the second operand\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public addToRef<T extends IVector3LikeInternal>(otherVector: DeepImmutable<IVector3LikeInternal>, result: T): T {\r\n result._x = this._x + otherVector._x;\r\n result._y = this._y + otherVector._y;\r\n result._z = this._z + otherVector._z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Subtract the given vector from the current Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#61\r\n * @param otherVector defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public subtractInPlace(otherVector: DeepImmutable<IVector3LikeInternal>): this {\r\n this._x -= otherVector._x;\r\n this._y -= otherVector._y;\r\n this._z -= otherVector._z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3, result of the subtraction of the given vector from the current Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#60\r\n * @param otherVector defines the second operand\r\n * @returns the resulting Vector3\r\n */\r\n public subtract(otherVector: DeepImmutable<IVector3LikeInternal>): Vector3 {\r\n return new Vector3(this._x - otherVector._x, this._y - otherVector._y, this._z - otherVector._z);\r\n }\r\n\r\n /**\r\n * Subtracts the given vector from the current Vector3 and stores the result in the vector \"result\".\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#63\r\n * @param otherVector defines the second operand\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public subtractToRef<T extends IVector3LikeInternal>(otherVector: DeepImmutable<IVector3LikeInternal>, result: T): T {\r\n return this.subtractFromFloatsToRef(otherVector._x, otherVector._y, otherVector._z, result);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the subtraction of the given floats from the current Vector3 coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#62\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the resulting Vector3\r\n */\r\n public subtractFromFloats(x: number, y: number, z: number): Vector3 {\r\n return new Vector3(this._x - x, this._y - y, this._z - z);\r\n }\r\n\r\n /**\r\n * Subtracts the given floats from the current Vector3 coordinates and set the given vector \"result\" with this result\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#64\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public subtractFromFloatsToRef<T extends IVector3LikeInternal>(x: number, y: number, z: number, result: T): T {\r\n result._x = this._x - x;\r\n result._y = this._y - y;\r\n result._z = this._z - z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector3 set with the current Vector3 negated coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#35\r\n * @returns a new Vector3\r\n */\r\n public negate(): Vector3 {\r\n return new Vector3(-this._x, -this._y, -this._z);\r\n }\r\n\r\n /**\r\n * Negate this vector in place\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#36\r\n * @returns this\r\n */\r\n public negateInPlace(): this {\r\n this._x *= -1;\r\n this._y *= -1;\r\n this._z *= -1;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Negate the current Vector3 and stores the result in the given vector \"result\" coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#37\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public negateToRef<T extends IVector3LikeInternal>(result: T): T {\r\n result._x = this._x * -1;\r\n result._y = this._y * -1;\r\n result._z = this._z * -1;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Multiplies the Vector3 coordinates by the float \"scale\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#56\r\n * @param scale defines the multiplier factor\r\n * @returns the current updated Vector3\r\n */\r\n public scaleInPlace(scale: number): this {\r\n this._x *= scale;\r\n this._y *= scale;\r\n this._z *= scale;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float \"scale\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#53\r\n * @param scale defines the multiplier factor\r\n * @returns a new Vector3\r\n */\r\n public scale(scale: number): Vector3 {\r\n return new Vector3(this._x * scale, this._y * scale, this._z * scale);\r\n }\r\n\r\n /**\r\n * Multiplies the current Vector3 coordinates by the float \"scale\" and stores the result in the given vector \"result\" coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#57\r\n * @param scale defines the multiplier factor\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public scaleToRef<T extends IVector3LikeInternal>(scale: number, result: T): T {\r\n result._x = this._x * scale;\r\n result._y = this._y * scale;\r\n result._z = this._z * scale;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a vector normal (perpendicular) to the current Vector3 and stores the result in the given vector\r\n * Out of the infinite possibilities the normal chosen is the one formed by rotating the current vector\r\n * 90 degrees about an axis which lies perpendicular to the current vector\r\n * and its projection on the xz plane. In the case of a current vector in the xz plane\r\n * the normal is calculated to be along the y axis.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#230\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#231\r\n * @param result defines the Vector3 object where to store the resultant normal\r\n * @returns the result\r\n */\r\n public getNormalToRef(result: Vector3): Vector3 {\r\n /**\r\n * Calculates the spherical coordinates of the current vector\r\n * so saves on memory rather than importing whole Spherical Class\r\n */\r\n const radius: number = this.length();\r\n let theta: number = Math.acos(this._y / radius);\r\n const phi = Math.atan2(this._z, this._x);\r\n //makes angle 90 degs to current vector\r\n if (theta > Math.PI / 2) {\r\n theta -= Math.PI / 2;\r\n } else {\r\n theta += Math.PI / 2;\r\n }\r\n //Calculates resutant normal vector from spherical coordinate of perpendicular vector\r\n const x = radius * Math.sin(theta) * Math.cos(phi);\r\n const y = radius * Math.cos(theta);\r\n const z = radius * Math.sin(theta) * Math.sin(phi);\r\n result.set(x, y, z);\r\n return result;\r\n }\r\n\r\n /**\r\n * Rotates the vector using the given unit quaternion and stores the new vector in result\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#9\r\n * @param q the unit quaternion representing the rotation\r\n * @param result the output vector\r\n * @returns the result\r\n */\r\n public applyRotationQuaternionToRef<T extends Vector3>(q: Quaternion, result: T): T {\r\n // Derived from https://raw.org/proof/vector-rotation-using-quaternions/\r\n\r\n const vx = this._x,\r\n vy = this._y,\r\n vz = this._z;\r\n const qx = q._x,\r\n qy = q._y,\r\n qz = q._z,\r\n qw = q._w;\r\n\r\n // t = 2q x v\r\n const tx = 2 * (qy * vz - qz * vy);\r\n const ty = 2 * (qz * vx - qx * vz);\r\n const tz = 2 * (qx * vy - qy * vx);\r\n\r\n // v + w t + q x t\r\n result._x = vx + qw * tx + qy * tz - qz * ty;\r\n result._y = vy + qw * ty + qz * tx - qx * tz;\r\n result._z = vz + qw * tz + qx * ty - qy * tx;\r\n\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Rotates the vector in place using the given unit quaternion\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#8\r\n * @param q the unit quaternion representing the rotation\r\n * @returns the current updated Vector3\r\n */\r\n public applyRotationQuaternionInPlace(q: Quaternion): this {\r\n return this.applyRotationQuaternionToRef(q, this);\r\n }\r\n\r\n /**\r\n * Rotates the vector using the given unit quaternion and returns the new vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#7\r\n * @param q the unit quaternion representing the rotation\r\n * @returns a new Vector3\r\n */\r\n public applyRotationQuaternion(q: Quaternion): Vector3 {\r\n return this.applyRotationQuaternionToRef(q, new Vector3());\r\n }\r\n\r\n /**\r\n * Scale the current Vector3 values by a factor and add the result to a given Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#55\r\n * @param scale defines the scale factor\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns result input\r\n */\r\n public scaleAndAddToRef<T extends IVector3LikeInternal>(scale: number, result: T): T {\r\n result._x += this._x * scale;\r\n result._y += this._y * scale;\r\n result._z += this._z * scale;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#48\r\n * @param plane defines the plane to project to\r\n * @param origin defines the origin of the projection ray\r\n * @returns the projected vector3\r\n */\r\n public projectOnPlane(plane: Plane, origin: Vector3): Vector3 {\r\n return this.projectOnPlaneToRef(plane, origin, new Vector3());\r\n }\r\n\r\n /**\r\n * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#49\r\n * @param plane defines the plane to project to\r\n * @param origin defines the origin of the projection ray\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public projectOnPlaneToRef<T extends Vector3>(plane: Plane, origin: Vector3, result: T): T {\r\n const n = plane.normal;\r\n const d = plane.d;\r\n\r\n const V = MathTmp.Vector3[0];\r\n\r\n // ray direction\r\n this.subtractToRef(origin, V);\r\n\r\n V.normalize();\r\n\r\n const denom = Vector3.Dot(V, n);\r\n\r\n //When the ray is close to parallel to the plane return infinity vector\r\n if (Math.abs(denom) < 0.0000000001) {\r\n result.setAll(Infinity);\r\n } else {\r\n const t = -(Vector3.Dot(origin, n) + d) / denom;\r\n\r\n // P = P0 + t*V\r\n const scaledV = V.scaleInPlace(t);\r\n origin.addToRef(scaledV, result);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns true if the current Vector3 and the given vector coordinates are strictly equal\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#19\r\n * @param otherVector defines the second operand\r\n * @returns true if both vectors are equals\r\n */\r\n public equals(otherVector: DeepImmutable<Vector3>): boolean {\r\n return otherVector && this._x === otherVector._x && this._y === otherVector._y && this._z === otherVector._z;\r\n }\r\n\r\n /**\r\n * Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#21\r\n * @param otherVector defines the second operand\r\n * @param epsilon defines the minimal distance to define values as equals\r\n * @returns true if both vectors are distant less than epsilon\r\n */\r\n public equalsWithEpsilon(otherVector: DeepImmutable<Vector3>, epsilon: number = Epsilon): boolean {\r\n return otherVector && WithinEpsilon(this._x, otherVector._x, epsilon) && WithinEpsilon(this._y, otherVector._y, epsilon) && WithinEpsilon(this._z, otherVector._z, epsilon);\r\n }\r\n\r\n /**\r\n * Returns true if the current Vector3 coordinates equals the given floats\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#20\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns true if both vectors are equal\r\n */\r\n public equalsToFloats(x: number, y: number, z: number): boolean {\r\n return this._x === x && this._y === y && this._z === z;\r\n }\r\n\r\n /**\r\n * Multiplies the current Vector3 coordinates by the given ones\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#32\r\n * @param otherVector defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public multiplyInPlace(otherVector: DeepImmutable<IVector3LikeInternal>): this {\r\n this._x *= otherVector._x;\r\n this._y *= otherVector._y;\r\n this._z *= otherVector._z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#31\r\n * @param otherVector defines the second operand\r\n * @returns the new Vector3\r\n */\r\n public multiply(otherVector: DeepImmutable<IVector3LikeInternal>): Vector3 {\r\n return this.multiplyByFloats(otherVector._x, otherVector._y, otherVector._z);\r\n }\r\n\r\n /**\r\n * Multiplies the current Vector3 by the given one and stores the result in the given vector \"result\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#33\r\n * @param otherVector defines the second operand\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public multiplyToRef<T extends IVector3LikeInternal>(otherVector: DeepImmutable<IVector3LikeInternal>, result: T): T {\r\n result._x = this._x * otherVector._x;\r\n result._y = this._y * otherVector._y;\r\n result._z = this._z * otherVector._z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the result of the multiplication of the current Vector3 coordinates by the given floats\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#34\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the new Vector3\r\n */\r\n public multiplyByFloats(x: number, y: number, z: number): Vector3 {\r\n return new Vector3(this._x * x, this._y * y, this._z * z);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#16\r\n * @param otherVector defines the second operand\r\n * @returns the new Vector3\r\n */\r\n public divide(otherVector: DeepImmutable<IVector3LikeInternal>): Vector3 {\r\n return new Vector3(this._x / otherVector._x, this._y / otherVector._y, this._z / otherVector._z);\r\n }\r\n\r\n /**\r\n * Divides the current Vector3 coordinates by the given ones and stores the result in the given vector \"result\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#18\r\n * @param otherVector defines the second operand\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public divideToRef<T extends IVector3LikeInternal>(otherVector: DeepImmutable<IVector3LikeInternal>, result: T): T {\r\n result._x = this._x / otherVector._x;\r\n result._y = this._y / otherVector._y;\r\n result._z = this._z / otherVector._z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Divides the current Vector3 coordinates by the given ones.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#17\r\n * @param otherVector defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public divideInPlace(otherVector: DeepImmutable<IVector3LikeInternal>): this {\r\n this._x = this._x / otherVector._x;\r\n this._y = this._y / otherVector._y;\r\n this._z = this._z / otherVector._z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector3 with the minimal coordinate values between its and the given vector ones\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#29\r\n * @param other defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public minimizeInPlace(other: DeepImmutable<IVector3LikeInternal>): this {\r\n return this.minimizeInPlaceFromFloats(other._x, other._y, other._z);\r\n }\r\n\r\n /**\r\n * Updates the current Vector3 with the maximal coordinate values between its and the given vector ones.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#27\r\n * @param other defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public maximizeInPlace(other: DeepImmutable<IVector3LikeInternal>): this {\r\n return this.maximizeInPlaceFromFloats(other._x, other._y, other._z);\r\n }\r\n\r\n /**\r\n * Updates the current Vector3 with the minimal coordinate values between its and the given coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#30\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public minimizeInPlaceFromFloats(x: number, y: number, z: number): this {\r\n if (x < this._x) {\r\n this.x = x;\r\n }\r\n if (y < this._y) {\r\n this.y = y;\r\n }\r\n if (z < this._z) {\r\n this.z = z;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector3 with the maximal coordinate values between its and the given coordinates.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#28\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public maximizeInPlaceFromFloats(x: number, y: number, z: number): this {\r\n if (x > this._x) {\r\n this.x = x;\r\n }\r\n if (y > this._y) {\r\n this.y = y;\r\n }\r\n if (z > this._z) {\r\n this.z = z;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Due to float precision, scale of a mesh could be uniform but float values are off by a small fraction\r\n * Check if is non uniform within a certain amount of decimal places to account for this\r\n * @param epsilon the amount the values can differ\r\n * @returns if the vector is non uniform to a certain number of decimal places\r\n */\r\n public isNonUniformWithinEpsilon(epsilon: number) {\r\n const absX = Math.abs(this._x);\r\n const absY = Math.abs(this._y);\r\n if (!WithinEpsilon(absX, absY, epsilon)) {\r\n return true;\r\n }\r\n\r\n const absZ = Math.abs(this._z);\r\n if (!WithinEpsilon(absX, absZ, epsilon)) {\r\n return true;\r\n }\r\n\r\n if (!WithinEpsilon(absY, absZ, epsilon)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the vector is non uniform meaning x, y or z are not all the same\r\n */\r\n public get isNonUniform(): boolean {\r\n const absX = Math.abs(this._x);\r\n const absY = Math.abs(this._y);\r\n if (absX !== absY) {\r\n return true;\r\n }\r\n\r\n const absZ = Math.abs(this._z);\r\n if (absX !== absZ) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets the current Vector3's floored values and stores them in result\r\n * @param result the vector to store the result in\r\n * @returns the result vector\r\n */\r\n public floorToRef<T extends IVector3LikeInternal>(result: T): T {\r\n result._x = Math.floor(this._x);\r\n result._y = Math.floor(this._y);\r\n result._z = Math.floor(this._z);\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector3 from current Vector3 floored values\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#22\r\n * @returns a new Vector3\r\n */\r\n public floor(): Vector3 {\r\n return new Vector3(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));\r\n }\r\n\r\n /**\r\n * Gets the current Vector3's fractional values and stores them in result\r\n * @param result the vector to store the result in\r\n * @returns the result vector\r\n */\r\n public fractToRef<T extends IVector3LikeInternal>(result: T): T {\r\n result._x = this._x - Math.floor(this._x);\r\n result._y = this._y - Math.floor(this._y);\r\n result._z = this._z - Math.floor(this._z);\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector3 from current Vector3 fractional values\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#23\r\n * @returns a new Vector3\r\n */\r\n public fract(): Vector3 {\r\n return new Vector3(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z));\r\n }\r\n\r\n // Properties\r\n /**\r\n * Gets the length of the Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#25\r\n * @returns the length of the Vector3\r\n */\r\n public length(): number {\r\n return Math.sqrt(this.lengthSquared());\r\n }\r\n\r\n /**\r\n * Gets the squared length of the Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#26\r\n * @returns squared length of the Vector3\r\n */\r\n public lengthSquared(): number {\r\n return this._x * this._x + this._y * this._y + this._z * this._z;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the vector contains a zero in one of its components\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#1\r\n */\r\n public get hasAZeroComponent(): boolean {\r\n return this._x * this._y * this._z === 0;\r\n }\r\n\r\n /**\r\n * Normalize the current Vector3.\r\n * Please note that this is an in place operation.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#122\r\n * @returns the current updated Vector3\r\n */\r\n public normalize(): this {\r\n return this.normalizeFromLength(this.length());\r\n }\r\n\r\n /**\r\n * Reorders the x y z properties of the vector in place\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#44\r\n * @param order new ordering of the properties (eg. for vector 1,2,3 with \"ZYX\" will produce 3,2,1)\r\n * @returns the current updated vector\r\n */\r\n public reorderInPlace(order: string) {\r\n order = order.toLowerCase();\r\n if (order === \"xyz\") {\r\n return this;\r\n }\r\n const tem = MathTmp.Vector3[0].copyFrom(this);\r\n this.x = (<any>tem)[order[0]];\r\n this.y = (<any>tem)[order[1]];\r\n this.z = (<any>tem)[order[2]];\r\n return this;\r\n }\r\n\r\n /**\r\n * Rotates the vector around 0,0,0 by a quaternion\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#47\r\n * @param quaternion the rotation quaternion\r\n * @param result vector to store the result\r\n * @returns the resulting vector\r\n */\r\n public rotateByQuaternionToRef<T extends Vector3>(quaternion: Quaternion, result: T): T {\r\n quaternion.toRotationMatrix(MathTmp.Matrix[0]);\r\n Vector3.TransformCoordinatesToRef(this, MathTmp.Matrix[0], result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Rotates a vector around a given point\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#46\r\n * @param quaternion the rotation quaternion\r\n * @param point the point to rotate around\r\n * @param result vector to store the result\r\n * @returns the resulting vector\r\n */\r\n public rotateByQuaternionAroundPointToRef<T extends Vector3>(quaternion: Quaternion, point: Vector3, result: T): T {\r\n this.subtractToRef(point, MathTmp.Vector3[0]);\r\n MathTmp.Vector3[0].rotateByQuaternionToRef(quaternion, MathTmp.Vector3[0]);\r\n point.addToRef(MathTmp.Vector3[0], result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 as the cross product of the current vector and the \"other\" one\r\n * The cross product is then orthogonal to both current and \"other\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#14\r\n * @param other defines the right operand\r\n * @returns the cross product\r\n */\r\n public cross(other: Vector3): Vector3 {\r\n return Vector3.CrossToRef(this, other, new Vector3());\r\n }\r\n\r\n /**\r\n * Normalize the current Vector3 with the given input length.\r\n * Please note that this is an in place operation.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#123\r\n * @param len the length of the vector\r\n * @returns the current updated Vector3\r\n */\r\n public normalizeFromLength(len: number): this {\r\n if (len === 0 || len === 1.0) {\r\n return this;\r\n }\r\n\r\n return this.scaleInPlace(1.0 / len);\r\n }\r\n\r\n /**\r\n * Normalize the current Vector3 to a new vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#124\r\n * @returns the new Vector3\r\n */\r\n public normalizeToNew(): Vector3 {\r\n return this.normalizeToRef(new Vector3());\r\n }\r\n\r\n /**\r\n * Normalize the current Vector3 to the reference\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#125\r\n * @param result define the Vector3 to update\r\n * @returns the updated Vector3\r\n */\r\n public normalizeToRef<T extends IVector3LikeInternal>(result: T): T {\r\n const len = this.length();\r\n if (len === 0 || len === 1.0) {\r\n result._x = this._x;\r\n result._y = this._y;\r\n result._z = this._z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n return this.scaleToRef(1.0 / len, result);\r\n }\r\n\r\n /**\r\n * Creates a new Vector3 copied from the current Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#11\r\n * @returns the new Vector3\r\n */\r\n public clone(): Vector3 {\r\n return new Vector3(this._x, this._y, this._z);\r\n }\r\n\r\n /**\r\n * Copies the given vector coordinates to the current Vector3 ones\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#12\r\n * @param source defines the source Vector3\r\n * @returns the current updated Vector3\r\n */\r\n public copyFrom(source: DeepImmutable<Vector3>): this {\r\n return this.copyFromFloats(source._x, source._y, source._z);\r\n }\r\n\r\n /**\r\n * Copies the given floats to the current Vector3 coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#13\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public copyFromFloats(x: number, y: number, z: number): this {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Copies the given floats to the current Vector3 coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#58\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public set(x: number, y: number, z: number): this {\r\n return this.copyFromFloats(x, y, z);\r\n }\r\n\r\n /**\r\n * Copies the given float to the current Vector3 coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#59\r\n * @param v defines the x, y and z coordinates of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public setAll(v: number): this {\r\n this._x = this._y = this._z = v;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n // Statics\r\n\r\n /**\r\n * Get the clip factor between two vectors\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#126\r\n * @param vector0 defines the first operand\r\n * @param vector1 defines the second operand\r\n * @param axis defines the axis to use\r\n * @param size defines the size along the axis\r\n * @returns the clip factor\r\n */\r\n public static GetClipFactor(vector0: DeepImmutable<Vector3>, vector1: DeepImmutable<Vector3>, axis: DeepImmutable<Vector3>, size: number): number {\r\n const d0 = Vector3.Dot(vector0, axis);\r\n const d1 = Vector3.Dot(vector1, axis);\r\n\r\n return (d0 - size) / (d0 - d1);\r\n }\r\n\r\n /**\r\n * Get angle between two vectors\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#86\r\n * @param vector0 the starting point\r\n * @param vector1 the ending point\r\n * @param normal direction of the normal\r\n * @returns the angle between vector0 and vector1\r\n */\r\n public static GetAngleBetweenVectors(vector0: DeepImmutable<Vector3>, vector1: DeepImmutable<Vector3>, normal: DeepImmutable<Vector3>): number {\r\n const v0: Vector3 = vector0.normalizeToRef(MathTmp.Vector3[1]);\r\n const v1: Vector3 = vector1.normalizeToRef(MathTmp.Vector3[2]);\r\n let dot: number = Vector3.Dot(v0, v1);\r\n // Vectors are normalized so dot will be in [-1, 1] (aside precision issues enough to break the result which explains the below clamp)\r\n dot = Clamp(dot, -1, 1);\r\n\r\n const angle = Math.acos(dot);\r\n const n = MathTmp.Vector3[3];\r\n Vector3.CrossToRef(v0, v1, n);\r\n if (Vector3.Dot(n, normal) > 0) {\r\n return isNaN(angle) ? 0 : angle;\r\n }\r\n return isNaN(angle) ? -Math.PI : -Math.acos(dot);\r\n }\r\n\r\n /**\r\n * Get angle between two vectors projected on a plane\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#87\r\n * Expectation compute time: 0.01 ms (median) and 0.02 ms (percentile 95%)\r\n * @param vector0 angle between vector0 and vector1\r\n * @param vector1 angle between vector0 and vector1\r\n * @param normal Normal of the projection plane\r\n * @returns the angle in radians (float) between vector0 and vector1 projected on the plane with the specified normal\r\n */\r\n public static GetAngleBetweenVectorsOnPlane(vector0: DeepImmutable<Vector3>, vector1: DeepImmutable<Vector3>, normal: DeepImmutable<Vector3>): number {\r\n MathTmp.Vector3[0].copyFrom(vector0);\r\n const v0 = MathTmp.Vector3[0];\r\n MathTmp.Vector3[1].copyFrom(vector1);\r\n const v1 = MathTmp.Vector3[1];\r\n MathTmp.Vector3[2].copyFrom(normal);\r\n const vNormal = MathTmp.Vector3[2];\r\n const right = MathTmp.Vector3[3];\r\n const forward = MathTmp.Vector3[4];\r\n\r\n v0.normalize();\r\n v1.normalize();\r\n vNormal.normalize();\r\n\r\n Vector3.CrossToRef(vNormal, v0, right);\r\n Vector3.CrossToRef(right, vNormal, forward);\r\n\r\n const angle = Math.atan2(Vector3.Dot(v1, right), Vector3.Dot(v1, forward));\r\n\r\n return NormalizeRadians(angle);\r\n }\r\n\r\n /**\r\n * Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point and stores it in the ref Vector3\r\n * Example PG https://playground.babylonjs.com/#R1F8YU#189\r\n * @param start the starting point\r\n * @param target the target point\r\n * @param ref the vector3 to store the result\r\n * @returns ref in the form (pitch, yaw, 0)\r\n */\r\n public static PitchYawRollToMoveBetweenPointsToRef<T extends Vector3>(start: Vector3, target: Vector3, ref: T): T {\r\n const diff = TmpVectors.Vector3[0];\r\n target.subtractToRef(start, diff);\r\n ref._y = Math.atan2(diff.x, diff.z) || 0;\r\n ref._x = Math.atan2(Math.sqrt(diff.x ** 2 + diff.z ** 2), diff.y) || 0;\r\n ref._z = 0;\r\n ref._isDirty = true;\r\n return ref;\r\n }\r\n\r\n /**\r\n * Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point\r\n * Example PG https://playground.babylonjs.com/#R1F8YU#188\r\n * @param start the starting point\r\n * @param target the target point\r\n * @returns the rotation in the form (pitch, yaw, 0)\r\n */\r\n public static PitchYawRollToMoveBetweenPoints(start: Vector3, target: Vector3): Vector3 {\r\n const ref = Vector3.Zero();\r\n return Vector3.PitchYawRollToMoveBetweenPointsToRef(start, target, ref);\r\n }\r\n\r\n /**\r\n * Slerp between two vectors. See also `SmoothToRef`\r\n * Slerp is a spherical linear interpolation\r\n * giving a slow in and out effect\r\n * Example Playground 1 https://playground.babylonjs.com/#R1F8YU#108\r\n * Example Playground 2 https://playground.babylonjs.com/#R1F8YU#109\r\n * @param vector0 Start vector\r\n * @param vector1 End vector\r\n * @param slerp amount (will be clamped between 0 and 1)\r\n * @param result The slerped vector\r\n * @returns The slerped vector\r\n */\r\n public static SlerpToRef<T extends Vector3 = Vector3>(vector0: Vector3, vector1: Vector3, slerp: number, result: T): T {\r\n slerp = Clamp(slerp, 0, 1);\r\n const vector0Dir = MathTmp.Vector3[0];\r\n const vector1Dir = MathTmp.Vector3[1];\r\n\r\n vector0Dir.copyFrom(vector0);\r\n const vector0Length = vector0Dir.length();\r\n vector0Dir.normalizeFromLength(vector0Length);\r\n\r\n vector1Dir.copyFrom(vector1);\r\n const vector1Length = vector1Dir.length();\r\n vector1Dir.normalizeFromLength(vector1Length);\r\n\r\n const dot = Vector3.Dot(vector0Dir, vector1Dir);\r\n\r\n let scale0;\r\n let scale1;\r\n\r\n if (dot < 1 - Epsilon) {\r\n const omega = Math.acos(dot);\r\n const invSin = 1 / Math.sin(omega);\r\n scale0 = Math.sin((1 - slerp) * omega) * invSin;\r\n scale1 = Math.sin(slerp * omega) * invSin;\r\n } else {\r\n // Use linear interpolation\r\n scale0 = 1 - slerp;\r\n scale1 = slerp;\r\n }\r\n\r\n vector0Dir.scaleInPlace(scale0);\r\n vector1Dir.scaleInPlace(scale1);\r\n result.copyFrom(vector0Dir).addInPlace(vector1Dir);\r\n result.scaleInPlace(Lerp(vector0Length, vector1Length, slerp));\r\n return result;\r\n }\r\n\r\n /**\r\n * Smooth interpolation between two vectors using Slerp\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#110\r\n * @param source source vector\r\n * @param goal goal vector\r\n * @param deltaTime current interpolation frame\r\n * @param lerpTime total interpolation time\r\n * @param result the smoothed vector\r\n * @returns the smoothed vector\r\n */\r\n public static SmoothToRef<T extends Vector3 = Vector3>(source: Vector3, goal: Vector3, deltaTime: number, lerpTime: number, result: T): T {\r\n Vector3.SlerpToRef(source, goal, lerpTime === 0 ? 1 : deltaTime / lerpTime, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set from the index \"offset\" of the given array\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#83\r\n * @param array defines the source array\r\n * @param offset defines the offset in the source array\r\n * @returns the new Vector3\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Vector3 {\r\n return new Vector3(array[offset], array[offset + 1], array[offset + 2]);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set from the index \"offset\" of the given Float32Array\r\n * @param array defines the source array\r\n * @param offset defines the offset in the source array\r\n * @returns the new Vector3\r\n * @deprecated Please use FromArray instead.\r\n */\r\n public static FromFloatArray(array: DeepImmutable<Float32Array>, offset?: number): Vector3 {\r\n return Vector3.FromArray(array, offset);\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the element values from the index \"offset\" of the given array\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#84\r\n * @param array defines the source array\r\n * @param offset defines the offset in the source array\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static FromArrayToRef<T extends Vector3>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T {\r\n result._x = array[offset];\r\n result._y = array[offset + 1];\r\n result._z = array[offset + 2];\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the element values from the index \"offset\" of the given Float32Array\r\n * @param array defines the source array\r\n * @param offset defines the offset in the source array\r\n * @param result defines the Vector3 where to store the result\r\n * @deprecated Please use FromArrayToRef instead.\r\n * @returns result input\r\n */\r\n public static FromFloatArrayToRef<T extends Vector3>(array: DeepImmutable<Float32Array>, offset: number, result: T): T {\r\n return Vector3.FromArrayToRef<T>(array, offset, result);\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the given floats.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#85\r\n * @param x defines the x coordinate of the source\r\n * @param y defines the y coordinate of the source\r\n * @param z defines the z coordinate of the source\r\n * @param result defines the Vector3 where to store the result\r\n * @returns the result vector\r\n */\r\n public static FromFloatsToRef<T extends Vector3 = Vector3>(x: number, y: number, z: number, result: T): T {\r\n result.copyFromFloats(x, y, z);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (0.0, 0.0, 0.0)\r\n * @returns a new empty Vector3\r\n */\r\n public static Zero(): Vector3 {\r\n return new Vector3(0.0, 0.0, 0.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (1.0, 1.0, 1.0)\r\n * @returns a new Vector3\r\n */\r\n public static One(): Vector3 {\r\n return new Vector3(1.0, 1.0, 1.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (0.0, 1.0, 0.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @returns a new up Vector3\r\n */\r\n public static Up(): Vector3 {\r\n return new Vector3(0.0, 1.0, 0.0);\r\n }\r\n\r\n /**\r\n * Gets an up Vector3 that must not be updated\r\n */\r\n public static get UpReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._UpReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a down Vector3 that must not be updated\r\n */\r\n public static get DownReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._DownReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a right Vector3 that must not be updated\r\n */\r\n public static get RightReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._RightReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a left Vector3 that must not be updated\r\n */\r\n public static get LeftReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._LeftReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a forward Vector3 that must not be updated\r\n */\r\n public static get LeftHandedForwardReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._LeftHandedForwardReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a forward Vector3 that must not be updated\r\n */\r\n public static get RightHandedForwardReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._RightHandedForwardReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a backward Vector3 that must not be updated\r\n */\r\n public static get LeftHandedBackwardReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._LeftHandedBackwardReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a backward Vector3 that must not be updated\r\n */\r\n public static get RightHandedBackwardReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._RightHandedBackwardReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a zero Vector3 that must not be updated\r\n */\r\n public static get ZeroReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._ZeroReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a one Vector3 that must not be updated\r\n */\r\n public static get OneReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._OneReadOnly;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (0.0, -1.0, 0.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @returns a new down Vector3\r\n */\r\n public static Down(): Vector3 {\r\n return new Vector3(0.0, -1.0, 0.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (0.0, 0.0, 1.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @param rightHandedSystem is the scene right-handed (negative z)\r\n * @returns a new forward Vector3\r\n */\r\n public static Forward(rightHandedSystem: boolean = false): Vector3 {\r\n return new Vector3(0.0, 0.0, rightHandedSystem ? -1.0 : 1.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (0.0, 0.0, -1.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @param rightHandedSystem is the scene right-handed (negative-z)\r\n * @returns a new Backward Vector3\r\n */\r\n public static Backward(rightHandedSystem: boolean = false): Vector3 {\r\n return new Vector3(0.0, 0.0, rightHandedSystem ? 1.0 : -1.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (1.0, 0.0, 0.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @returns a new right Vector3\r\n */\r\n public static Right(): Vector3 {\r\n return new Vector3(1.0, 0.0, 0.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (-1.0, 0.0, 0.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @returns a new left Vector3\r\n */\r\n public static Left(): Vector3 {\r\n return new Vector3(-1.0, 0.0, 0.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @returns a Vector3 with random values between min and max\r\n */\r\n public static Random(min: number = 0, max: number = 1): Vector3 {\r\n return new Vector3(RandomRange(min, max), RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Sets a Vector3 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @param ref the ref to store the values in\r\n * @returns the ref with random values between min and max\r\n */\r\n public static RandomToRef<T extends Vector3>(min: number = 0, max: number = 1, ref: T): T {\r\n return ref.copyFromFloats(RandomRange(min, max), RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the result of the transformation by the given matrix of the given vector.\r\n * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#111\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @returns the transformed Vector3\r\n */\r\n public static TransformCoordinates(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>): Vector3 {\r\n const result = Vector3.Zero();\r\n Vector3.TransformCoordinatesToRef(vector, transformation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given vector\r\n * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#113\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformCoordinatesToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T {\r\n Vector3.TransformCoordinatesFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)\r\n * This method computes transformed coordinates only, not transformed direction vectors\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#115\r\n * @param x define the x coordinate of the source vector\r\n * @param y define the y coordinate of the source vector\r\n * @param z define the z coordinate of the source vector\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformCoordinatesFromFloatsToRef<T extends Vector3>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n const rx = x * m[0] + y * m[4] + z * m[8] + m[12];\r\n const ry = x * m[1] + y * m[5] + z * m[9] + m[13];\r\n const rz = x * m[2] + y * m[6] + z * m[10] + m[14];\r\n const rw = 1 / (x * m[3] + y * m[7] + z * m[11] + m[15]);\r\n\r\n result._x = rx * rw;\r\n result._y = ry * rw;\r\n result._z = rz * rw;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector\r\n * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#112\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @returns the new Vector3\r\n */\r\n public static TransformNormal(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>): Vector3 {\r\n const result = Vector3.Zero();\r\n Vector3.TransformNormalToRef(vector, transformation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the normal transformation by the given matrix of the given vector\r\n * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#114\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformNormalToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T {\r\n this.TransformNormalFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the normal transformation by the given matrix of the given floats (x, y, z)\r\n * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#116\r\n * @param x define the x coordinate of the source vector\r\n * @param y define the y coordinate of the source vector\r\n * @param z define the z coordinate of the source vector\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformNormalFromFloatsToRef<T extends Vector3>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n result._x = x * m[0] + y * m[4] + z * m[8];\r\n result._y = x * m[1] + y * m[5] + z * m[9];\r\n result._z = x * m[2] + y * m[6] + z * m[10];\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 located for \"amount\" on the CatmullRom interpolation spline defined by the vectors \"value1\", \"value2\", \"value3\", \"value4\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#69\r\n * @param value1 defines the first control point\r\n * @param value2 defines the second control point\r\n * @param value3 defines the third control point\r\n * @param value4 defines the fourth control point\r\n * @param amount defines the amount on the spline to use\r\n * @returns the new Vector3\r\n */\r\n public static CatmullRom(\r\n value1: DeepImmutable<Vector3>,\r\n value2: DeepImmutable<Vector3>,\r\n value3: DeepImmutable<Vector3>,\r\n value4: DeepImmutable<Vector3>,\r\n amount: number\r\n ): Vector3 {\r\n const squared = amount * amount;\r\n const cubed = amount * squared;\r\n\r\n const x =\r\n 0.5 *\r\n (2.0 * value2._x +\r\n (-value1._x + value3._x) * amount +\r\n (2.0 * value1._x - 5.0 * value2._x + 4.0 * value3._x - value4._x) * squared +\r\n (-value1._x + 3.0 * value2._x - 3.0 * value3._x + value4._x) * cubed);\r\n\r\n const y =\r\n 0.5 *\r\n (2.0 * value2._y +\r\n (-value1._y + value3._y) * amount +\r\n (2.0 * value1._y - 5.0 * value2._y + 4.0 * value3._y - value4._y) * squared +\r\n (-value1._y + 3.0 * value2._y - 3.0 * value3._y + value4._y) * cubed);\r\n\r\n const z =\r\n 0.5 *\r\n (2.0 * value2._z +\r\n (-value1._z + value3._z) * amount +\r\n (2.0 * value1._z - 5.0 * value2._z + 4.0 * value3._z - value4._z) * squared +\r\n (-value1._z + 3.0 * value2._z - 3.0 * value3._z + value4._z) * cubed);\r\n\r\n return new Vector3(x, y, z);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the coordinates of \"value\", if the vector \"value\" is in the cube defined by the vectors \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#76\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @returns the new Vector3\r\n */\r\n public static Clamp(value: DeepImmutable<Vector3>, min: DeepImmutable<Vector3>, max: DeepImmutable<Vector3>): Vector3 {\r\n const result = new Vector3();\r\n Vector3.ClampToRef(value, min, max, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the coordinates of \"value\", if the vector \"value\" is in the cube defined by the vectors \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#77\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static ClampToRef<T extends Vector3>(value: DeepImmutable<Vector3>, min: DeepImmutable<Vector3>, max: DeepImmutable<Vector3>, result: T): T {\r\n let x = value._x;\r\n x = x > max._x ? max._x : x;\r\n x = x < min._x ? min._x : x;\r\n\r\n let y = value._y;\r\n y = y > max._y ? max._y : y;\r\n y = y < min._y ? min._y : y;\r\n\r\n let z = value._z;\r\n z = z > max._z ? max._z : z;\r\n z = z < min._z ? min._z : z;\r\n\r\n result.copyFromFloats(x, y, z);\r\n return result;\r\n }\r\n\r\n /**\r\n * Checks if a given vector is inside a specific range\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#75\r\n * @param v defines the vector to test\r\n * @param min defines the minimum range\r\n * @param max defines the maximum range\r\n */\r\n public static CheckExtends(v: Vector3, min: Vector3, max: Vector3): void {\r\n min.minimizeInPlace(v);\r\n max.maximizeInPlace(v);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 located for \"amount\" (float) on the Hermite interpolation spline defined by the vectors \"value1\", \"tangent1\", \"value2\", \"tangent2\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#89\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent vector\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent vector\r\n * @param amount defines the amount on the interpolation spline (between 0 and 1)\r\n * @returns the new Vector3\r\n */\r\n public static Hermite(\r\n value1: DeepImmutable<Vector3>,\r\n tangent1: DeepImmutable<Vector3>,\r\n value2: DeepImmutable<Vector3>,\r\n tangent2: DeepImmutable<Vector3>,\r\n amount: number\r\n ): Vector3 {\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 x = value1._x * part1 + value2._x * part2 + tangent1._x * part3 + tangent2._x * part4;\r\n const y = value1._y * part1 + value2._y * part2 + tangent1._y * part3 + tangent2._y * part4;\r\n const z = value1._z * part1 + value2._z * part2 + tangent1._z * part3 + tangent2._z * part4;\r\n return new Vector3(x, y, z);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 which is the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#90\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<Vector3>,\r\n tangent1: DeepImmutable<Vector3>,\r\n value2: DeepImmutable<Vector3>,\r\n tangent2: DeepImmutable<Vector3>,\r\n time: number\r\n ): Vector3 {\r\n const result = new Vector3();\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 Vector3 with the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#91\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 * @returns result input\r\n */\r\n public static Hermite1stDerivativeToRef<T extends Vector3>(\r\n value1: DeepImmutable<Vector3>,\r\n tangent1: DeepImmutable<Vector3>,\r\n value2: DeepImmutable<Vector3>,\r\n tangent2: DeepImmutable<Vector3>,\r\n time: number,\r\n result: T\r\n ): T {\r\n const t2 = time * time;\r\n\r\n result._x = (t2 - time) * 6 * value1._x + (3 * t2 - 4 * time + 1) * tangent1._x + (-t2 + time) * 6 * value2._x + (3 * t2 - 2 * time) * tangent2._x;\r\n result._y = (t2 - time) * 6 * value1._y + (3 * t2 - 4 * time + 1) * tangent1._y + (-t2 + time) * 6 * value2._y + (3 * t2 - 2 * time) * tangent2._y;\r\n result._z = (t2 - time) * 6 * value1._z + (3 * t2 - 4 * time + 1) * tangent1._z + (-t2 + time) * 6 * value2._z + (3 * t2 - 2 * time) * tangent2._z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 located for \"amount\" (float) on the linear interpolation between the vectors \"start\" and \"end\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#95\r\n * @param start defines the start value\r\n * @param end defines the end value\r\n * @param amount max defines amount between both (between 0 and 1)\r\n * @returns the new Vector3\r\n */\r\n public static Lerp(start: DeepImmutable<Vector3>, end: DeepImmutable<Vector3>, amount: number): Vector3 {\r\n const result = new Vector3(0, 0, 0);\r\n Vector3.LerpToRef(start, end, amount, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the linear interpolation from the vector \"start\" for \"amount\" to the vector \"end\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#93\r\n * @param start defines the start value\r\n * @param end defines the end value\r\n * @param amount max defines amount between both (between 0 and 1)\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static LerpToRef<T extends Vector3>(start: DeepImmutable<Vector3>, end: DeepImmutable<Vector3>, amount: number, result: T): T {\r\n result._x = start._x + (end._x - start._x) * amount;\r\n result._y = start._y + (end._y - start._y) * amount;\r\n result._z = start._z + (end._z - start._z) * amount;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the vectors \"left\" and \"right\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#82\r\n * @param left defines the left operand\r\n * @param right defines the right operand\r\n * @returns the dot product\r\n */\r\n public static Dot(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): number {\r\n return left._x * right._x + left._y * right._y + left._z * right._z;\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the current vectors and \"otherVector\"\r\n * @param otherVector defines the right operand\r\n * @returns the dot product\r\n */\r\n public dot(otherVector: DeepImmutable<Vector3>): number {\r\n return this._x * otherVector._x + this._y * otherVector._y + this._z * otherVector._z;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 as the cross product of the vectors \"left\" and \"right\"\r\n * The cross product is then orthogonal to both \"left\" and \"right\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#15\r\n * @param left defines the left operand\r\n * @param right defines the right operand\r\n * @returns the cross product\r\n */\r\n public static Cross(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): Vector3 {\r\n const result = new Vector3();\r\n Vector3.CrossToRef(left, right, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the cross product of \"left\" and \"right\"\r\n * The cross product is then orthogonal to both \"left\" and \"right\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#78\r\n * @param left defines the left operand\r\n * @param right defines the right operand\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static CrossToRef<T extends Vector3>(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>, result: T): T {\r\n const x = left._y * right._z - left._z * right._y;\r\n const y = left._z * right._x - left._x * right._z;\r\n const z = left._x * right._y - left._y * right._x;\r\n result.copyFromFloats(x, y, z);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 as the normalization of the given vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#98\r\n * @param vector defines the Vector3 to normalize\r\n * @returns the new Vector3\r\n */\r\n public static Normalize(vector: DeepImmutable<Vector3>): Vector3 {\r\n const result = Vector3.Zero();\r\n Vector3.NormalizeToRef(vector, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the normalization of the given first vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#98\r\n * @param vector defines the Vector3 to normalize\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static NormalizeToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, result: T): T {\r\n vector.normalizeToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Project a Vector3 onto screen space\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#101\r\n * @param vector defines the Vector3 to project\r\n * @param world defines the world matrix to use\r\n * @param transform defines the transform (view x projection) matrix to use\r\n * @param viewport defines the screen viewport to use\r\n * @returns the new Vector3\r\n */\r\n public static Project(vector: DeepImmutable<Vector3>, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>, viewport: DeepImmutable<Viewport>): Vector3 {\r\n const result = new Vector3();\r\n Vector3.ProjectToRef(vector, world, transform, viewport, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Project a Vector3 onto screen space to reference\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#102\r\n * @param vector defines the Vector3 to project\r\n * @param world defines the world matrix to use\r\n * @param transform defines the transform (view x projection) matrix to use\r\n * @param viewport defines the screen viewport to use\r\n * @param result the vector in which the screen space will be stored\r\n * @returns result input\r\n */\r\n public static ProjectToRef<T extends Vector3>(\r\n vector: DeepImmutable<Vector3>,\r\n world: DeepImmutable<Matrix>,\r\n transform: DeepImmutable<Matrix>,\r\n viewport: DeepImmutable<Viewport>,\r\n result: T\r\n ): T {\r\n const cw = viewport.width;\r\n const ch = viewport.height;\r\n const cx = viewport.x;\r\n const cy = viewport.y;\r\n\r\n const viewportMatrix = MathTmp.Matrix[1];\r\n\r\n const isNDCHalfZRange = EngineStore.LastCreatedEngine?.isNDCHalfZRange;\r\n const zScale = isNDCHalfZRange ? 1 : 0.5;\r\n const zOffset = isNDCHalfZRange ? 0 : 0.5;\r\n\r\n Matrix.FromValuesToRef(cw / 2.0, 0, 0, 0, 0, -ch / 2.0, 0, 0, 0, 0, zScale, 0, cx + cw / 2.0, ch / 2.0 + cy, zOffset, 1, viewportMatrix);\r\n\r\n const matrix = MathTmp.Matrix[0];\r\n world.multiplyToRef(transform, matrix);\r\n matrix.multiplyToRef(viewportMatrix, matrix);\r\n\r\n Vector3.TransformCoordinatesToRef(vector, matrix, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Reflects a vector off the plane defined by a normalized normal\r\n * @param inDirection defines the vector direction\r\n * @param normal defines the normal - Must be normalized\r\n * @returns the resulting vector\r\n */\r\n public static Reflect(inDirection: DeepImmutable<Vector3>, normal: DeepImmutable<Vector3>): Vector3 {\r\n return this.ReflectToRef(inDirection, normal, new Vector3());\r\n }\r\n\r\n /**\r\n * Reflects a vector off the plane defined by a normalized normal to reference\r\n * @param inDirection defines the vector direction\r\n * @param normal defines the normal - Must be normalized\r\n * @param ref defines the Vector3 where to store the result\r\n * @returns the resulting vector\r\n */\r\n public static ReflectToRef<T extends Vector3>(inDirection: DeepImmutable<Vector3>, normal: DeepImmutable<Vector3>, ref: T): T {\r\n const tmp = TmpVectors.Vector3[0];\r\n tmp.copyFrom(normal).scaleInPlace(2 * Vector3.Dot(inDirection, normal));\r\n\r\n return ref.copyFrom(inDirection).subtractInPlace(tmp);\r\n }\r\n\r\n /**\r\n * Unproject from screen space to object space\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#121\r\n * @param source defines the screen space Vector3 to use\r\n * @param viewportWidth defines the current width of the viewport\r\n * @param viewportHeight defines the current height of the viewport\r\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\r\n * @param transform defines the transform (view x projection) matrix to use\r\n * @returns the new Vector3\r\n */\r\n public static UnprojectFromTransform(\r\n source: DeepImmutable<Vector3>,\r\n viewportWidth: number,\r\n viewportHeight: number,\r\n world: DeepImmutable<Matrix>,\r\n transform: DeepImmutable<Matrix>\r\n ): Vector3 {\r\n return this.Unproject(source, viewportWidth, viewportHeight, world, transform, Matrix.IdentityReadOnly);\r\n }\r\n\r\n /**\r\n * Unproject from screen space to object space\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#117\r\n * @param source defines the screen space Vector3 to use\r\n * @param viewportWidth defines the current width of the viewport\r\n * @param viewportHeight defines the current height of the viewport\r\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\r\n * @param view defines the view matrix to use\r\n * @param projection defines the projection matrix to use\r\n * @returns the new Vector3\r\n */\r\n public static Unproject(\r\n source: DeepImmutable<Vector3>,\r\n viewportWidth: number,\r\n viewportHeight: number,\r\n world: DeepImmutable<Matrix>,\r\n view: DeepImmutable<Matrix>,\r\n projection: DeepImmutable<Matrix>\r\n ): Vector3 {\r\n const result = new Vector3();\r\n\r\n Vector3.UnprojectToRef(source, viewportWidth, viewportHeight, world, view, projection, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Unproject from screen space to object space\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#119\r\n * @param source defines the screen space Vector3 to use\r\n * @param viewportWidth defines the current width of the viewport\r\n * @param viewportHeight defines the current height of the viewport\r\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\r\n * @param view defines the view matrix to use\r\n * @param projection defines the projection matrix to use\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static UnprojectToRef<T extends Vector3>(\r\n source: DeepImmutable<Vector3>,\r\n viewportWidth: number,\r\n viewportHeight: number,\r\n world: DeepImmutable<Matrix>,\r\n view: DeepImmutable<Matrix>,\r\n projection: DeepImmutable<Matrix>,\r\n result: T\r\n ): T {\r\n Vector3.UnprojectFloatsToRef(source._x, source._y, source._z, viewportWidth, viewportHeight, world, view, projection, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Unproject from screen space to object space\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#120\r\n * @param sourceX defines the screen space x coordinate to use\r\n * @param sourceY defines the screen space y coordinate to use\r\n * @param sourceZ defines the screen space z coordinate to use\r\n * @param viewportWidth defines the current width of the viewport\r\n * @param viewportHeight defines the current height of the viewport\r\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\r\n * @param view defines the view matrix to use\r\n * @param projection defines the projection matrix to use\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static UnprojectFloatsToRef<T extends Vector3>(\r\n sourceX: float,\r\n sourceY: float,\r\n sourceZ: float,\r\n viewportWidth: number,\r\n viewportHeight: number,\r\n world: DeepImmutable<Matrix>,\r\n view: DeepImmutable<Matrix>,\r\n projection: DeepImmutable<Matrix>,\r\n result: T\r\n ): T {\r\n const matrix = MathTmp.Matrix[0];\r\n world.multiplyToRef(view, matrix);\r\n matrix.multiplyToRef(projection, matrix);\r\n matrix.invert();\r\n\r\n const screenSource = MathTmp.Vector3[0];\r\n screenSource.x = (sourceX / viewportWidth) * 2 - 1;\r\n screenSource.y = -((sourceY / viewportHeight) * 2 - 1);\r\n if (EngineStore.LastCreatedEngine?.isNDCHalfZRange) {\r\n screenSource.z = sourceZ;\r\n } else {\r\n screenSource.z = 2 * sourceZ - 1.0;\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(screenSource, matrix, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets the minimal coordinate values between two Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#97\r\n * @param left defines the first operand\r\n * @param right defines the second operand\r\n * @returns the new Vector3\r\n */\r\n public static Minimize(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): Vector3 {\r\n const min = new Vector3();\r\n min.copyFrom(left);\r\n min.minimizeInPlace(right);\r\n return min;\r\n }\r\n\r\n /**\r\n * Gets the maximal coordinate values between two Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#96\r\n * @param left defines the first operand\r\n * @param right defines the second operand\r\n * @returns the new Vector3\r\n */\r\n public static Maximize(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): Vector3 {\r\n const max = new Vector3();\r\n max.copyFrom(left);\r\n max.maximizeInPlace(right);\r\n return max;\r\n }\r\n\r\n /**\r\n * Returns the distance between the vectors \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#81\r\n * @param value1 defines the first operand\r\n * @param value2 defines the second operand\r\n * @returns the distance\r\n */\r\n public static Distance(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>): number {\r\n return Math.sqrt(Vector3.DistanceSquared(value1, value2));\r\n }\r\n\r\n /**\r\n * Returns the squared distance between the vectors \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#80\r\n * @param value1 defines the first operand\r\n * @param value2 defines the second operand\r\n * @returns the squared distance\r\n */\r\n public static DistanceSquared(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>): number {\r\n const x = value1._x - value2._x;\r\n const y = value1._y - value2._y;\r\n const z = value1._z - value2._z;\r\n\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Projects \"vector\" on the triangle determined by its extremities \"p0\", \"p1\" and \"p2\", stores the result in \"ref\"\r\n * and returns the distance to the projected point.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#104\r\n * From http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.104.4264&rep=rep1&type=pdf\r\n *\r\n * @param vector the vector to get distance from\r\n * @param p0 extremity of the triangle\r\n * @param p1 extremity of the triangle\r\n * @param p2 extremity of the triangle\r\n * @param ref variable to store the result to\r\n * @returns The distance between \"ref\" and \"vector\"\r\n */\r\n public static ProjectOnTriangleToRef(vector: DeepImmutable<Vector3>, p0: DeepImmutable<Vector3>, p1: DeepImmutable<Vector3>, p2: DeepImmutable<Vector3>, ref: Vector3): number {\r\n const p1p0 = MathTmp.Vector3[0];\r\n const p2p0 = MathTmp.Vector3[1];\r\n const p2p1 = MathTmp.Vector3[2];\r\n const normal = MathTmp.Vector3[3];\r\n const vectorp0 = MathTmp.Vector3[4];\r\n\r\n // Triangle vectors\r\n p1.subtractToRef(p0, p1p0);\r\n p2.subtractToRef(p0, p2p0);\r\n p2.subtractToRef(p1, p2p1);\r\n\r\n const p1p0L = p1p0.length();\r\n const p2p0L = p2p0.length();\r\n const p2p1L = p2p1.length();\r\n\r\n if (p1p0L < Epsilon || p2p0L < Epsilon || p2p1L < Epsilon) {\r\n // This is a degenerate triangle. As we assume this is part of a non-degenerate mesh,\r\n // we will find a better intersection later.\r\n // Let's just return one of the extremities\r\n ref.copyFrom(p0);\r\n return Vector3.Distance(vector, p0);\r\n }\r\n\r\n // Compute normal and vector to p0\r\n vector.subtractToRef(p0, vectorp0);\r\n Vector3.CrossToRef(p1p0, p2p0, normal);\r\n const nl = normal.length();\r\n if (nl < Epsilon) {\r\n // Extremities are aligned, we are back on the case of a degenerate triangle\r\n ref.copyFrom(p0);\r\n return Vector3.Distance(vector, p0);\r\n }\r\n normal.normalizeFromLength(nl);\r\n let l = vectorp0.length();\r\n if (l < Epsilon) {\r\n // Vector is p0\r\n ref.copyFrom(p0);\r\n return 0;\r\n }\r\n vectorp0.normalizeFromLength(l);\r\n\r\n // Project to \"proj\" that lies on the triangle plane\r\n const cosA = Vector3.Dot(normal, vectorp0);\r\n const projVector = MathTmp.Vector3[5];\r\n const proj = MathTmp.Vector3[6];\r\n projVector.copyFrom(normal).scaleInPlace(-l * cosA);\r\n proj.copyFrom(vector).addInPlace(projVector);\r\n\r\n // Compute barycentric coordinates (v0, v1 and v2 are axis from barycenter to extremities)\r\n const v0 = MathTmp.Vector3[4];\r\n const v1 = MathTmp.Vector3[5];\r\n const v2 = MathTmp.Vector3[7];\r\n const tmp = MathTmp.Vector3[8];\r\n\r\n v0.copyFrom(p1p0).scaleInPlace(1 / p1p0L);\r\n tmp.copyFrom(p2p0).scaleInPlace(1 / p2p0L);\r\n v0.addInPlace(tmp).scaleInPlace(-1);\r\n\r\n v1.copyFrom(p1p0).scaleInPlace(-1 / p1p0L);\r\n tmp.copyFrom(p2p1).scaleInPlace(1 / p2p1L);\r\n v1.addInPlace(tmp).scaleInPlace(-1);\r\n\r\n v2.copyFrom(p2p1).scaleInPlace(-1 / p2p1L);\r\n tmp.copyFrom(p2p0).scaleInPlace(-1 / p2p0L);\r\n v2.addInPlace(tmp).scaleInPlace(-1);\r\n\r\n // Determines which edge of the triangle is closest to \"proj\"\r\n const projP = MathTmp.Vector3[9];\r\n let dot;\r\n projP.copyFrom(proj).subtractInPlace(p0);\r\n Vector3.CrossToRef(v0, projP, tmp);\r\n dot = Vector3.Dot(tmp, normal);\r\n const s0 = dot;\r\n\r\n projP.copyFrom(proj).subtractInPlace(p1);\r\n Vector3.CrossToRef(v1, projP, tmp);\r\n dot = Vector3.Dot(tmp, normal);\r\n const s1 = dot;\r\n\r\n projP.copyFrom(proj).subtractInPlace(p2);\r\n Vector3.CrossToRef(v2, projP, tmp);\r\n dot = Vector3.Dot(tmp, normal);\r\n const s2 = dot;\r\n\r\n const edge = MathTmp.Vector3[10];\r\n let e0, e1;\r\n if (s0 > 0 && s1 < 0) {\r\n edge.copyFrom(p1p0);\r\n e0 = p0;\r\n e1 = p1;\r\n } else if (s1 > 0 && s2 < 0) {\r\n edge.copyFrom(p2p1);\r\n e0 = p1;\r\n e1 = p2;\r\n } else {\r\n edge.copyFrom(p2p0).scaleInPlace(-1);\r\n e0 = p2;\r\n e1 = p0;\r\n }\r\n\r\n // Determines if \"proj\" lies inside the triangle\r\n const tmp2 = MathTmp.Vector3[9];\r\n const tmp3 = MathTmp.Vector3[4];\r\n e0.subtractToRef(proj, tmp);\r\n e1.subtractToRef(proj, tmp2);\r\n Vector3.CrossToRef(tmp, tmp2, tmp3);\r\n const isOutside = Vector3.Dot(tmp3, normal) < 0;\r\n\r\n // If inside, we already found the projected point, \"proj\"\r\n if (!isOutside) {\r\n ref.copyFrom(proj);\r\n return Math.abs(l * cosA);\r\n }\r\n\r\n // If outside, we find \"triProj\", the closest point from \"proj\" on the closest edge\r\n const r = MathTmp.Vector3[5];\r\n Vector3.CrossToRef(edge, tmp3, r);\r\n r.normalize();\r\n const e0proj = MathTmp.Vector3[9];\r\n e0proj.copyFrom(e0).subtractInPlace(proj);\r\n const e0projL = e0proj.length();\r\n if (e0projL < Epsilon) {\r\n // Proj is e0\r\n ref.copyFrom(e0);\r\n return Vector3.Distance(vector, e0);\r\n }\r\n e0proj.normalizeFromLength(e0projL);\r\n const cosG = Vector3.Dot(r, e0proj);\r\n const triProj = MathTmp.Vector3[7];\r\n triProj.copyFrom(proj).addInPlace(r.scaleInPlace(e0projL * cosG));\r\n\r\n // Now we clamp \"triProj\" so it lies between e0 and e1\r\n tmp.copyFrom(triProj).subtractInPlace(e0);\r\n l = edge.length();\r\n edge.normalizeFromLength(l);\r\n let t = Vector3.Dot(tmp, edge) / Math.max(l, Epsilon);\r\n t = Clamp(t, 0, 1);\r\n triProj.copyFrom(e0).addInPlace(edge.scaleInPlace(t * l));\r\n ref.copyFrom(triProj);\r\n\r\n return Vector3.Distance(vector, triProj);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 located at the center between \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#72\r\n * @param value1 defines the first operand\r\n * @param value2 defines the second operand\r\n * @returns the new Vector3\r\n */\r\n public static Center(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>): Vector3 {\r\n return Vector3.CenterToRef(value1, value2, Vector3.Zero());\r\n }\r\n\r\n /**\r\n * Gets the center of the vectors \"value1\" and \"value2\" and stores the result in the vector \"ref\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#73\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @param ref defines third vector\r\n * @returns ref\r\n */\r\n public static CenterToRef<T extends Vector3>(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, ref: T): T {\r\n return ref.copyFromFloats((value1._x + value2._x) / 2, (value1._y + value2._y) / 2, (value1._z + value2._z) / 2);\r\n }\r\n\r\n /**\r\n * Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system),\r\n * RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply\r\n * to something in order to rotate it from its local system to the given target system\r\n * Note: axis1, axis2 and axis3 are normalized during this operation\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#106\r\n * @param axis1 defines the first axis\r\n * @param axis2 defines the second axis\r\n * @param axis3 defines the third axis\r\n * @returns a new Vector3\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/target_align\r\n */\r\n public static RotationFromAxis(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>): Vector3 {\r\n const rotation = new Vector3();\r\n Vector3.RotationFromAxisToRef(axis1, axis2, axis3, rotation);\r\n return rotation;\r\n }\r\n\r\n /**\r\n * The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#107\r\n * @param axis1 defines the first axis\r\n * @param axis2 defines the second axis\r\n * @param axis3 defines the third axis\r\n * @param ref defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static RotationFromAxisToRef<T extends Vector3>(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref: T): T {\r\n const quat = MathTmp.Quaternion[0];\r\n Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat);\r\n quat.toEulerAnglesToRef(ref);\r\n return ref;\r\n }\r\n}\r\n\r\nVector3 satisfies VectorStatic<Vector3, IVector3LikeInternal>;\r\nObject.defineProperties(Vector3.prototype, {\r\n dimension: { value: [3] },\r\n rank: { value: 1 },\r\n});\r\n\r\n/**\r\n * Vector4 class created for EulerAngle class conversion to Quaternion\r\n */\r\nexport class Vector4 implements Vector<Tuple<number, 4>, IVector4Like>, IVector4Like {\r\n /**\r\n * If the first vector is flagged with integers (as everything is 0,0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.\r\n * If subsequent vectors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,\r\n * and henceforth it will use floating-point representation for all Vector4 instances that it creates.\r\n * But the original Vector4 instances are unchanged and has a \"deprecated map\".\r\n * If we keep using the Vector4 instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.\r\n */\r\n static _V8PerformanceHack = new Vector4(0.5, 0.5, 0.5, 0.5) as DeepImmutable<Vector4>;\r\n private static _ZeroReadOnly = Vector4.Zero() as DeepImmutable<Vector4>;\r\n\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n declare public readonly dimension: Readonly<[4]>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n declare public readonly rank: 1;\r\n\r\n /** @internal */\r\n public _x: number;\r\n /** @internal */\r\n public _y: number;\r\n /** @internal */\r\n public _z: number;\r\n /** @internal */\r\n public _w: number;\r\n\r\n /** @internal */\r\n public _isDirty = true;\r\n\r\n // ---------------------------------\r\n // Getters / setters (same pattern as Vector3)\r\n // ---------------------------------\r\n /** Gets or sets the x coordinate */\r\n public get x() {\r\n return this._x;\r\n }\r\n\r\n public set x(value: number) {\r\n this._x = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the y coordinate */\r\n public get y() {\r\n return this._y;\r\n }\r\n\r\n public set y(value: number) {\r\n this._y = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the z coordinate */\r\n public get z() {\r\n return this._z;\r\n }\r\n\r\n public set z(value: number) {\r\n this._z = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the w coordinate */\r\n public get w() {\r\n return this._w;\r\n }\r\n\r\n public set w(value: number) {\r\n this._w = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Creates a Vector4 object from the given floats.\r\n * @param x x value of the vector\r\n * @param y y value of the vector\r\n * @param z z value of the vector\r\n * @param w w value of the vector\r\n */\r\n constructor(x: number = 0, y: number = 0, z: number = 0, w: number = 0) {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._w = w;\r\n }\r\n\r\n /**\r\n * Returns the string with the Vector4 coordinates.\r\n * @returns a string containing all the vector values\r\n */\r\n public toString(): string {\r\n return `{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`;\r\n }\r\n\r\n /**\r\n * Returns the string \"Vector4\".\r\n * @returns \"Vector4\"\r\n */\r\n public getClassName(): string {\r\n return \"Vector4\";\r\n }\r\n\r\n /**\r\n * Returns the Vector4 hash code.\r\n * @returns a unique hash code\r\n */\r\n public getHashCode(): number {\r\n const x = ExtractAsInt(this._x);\r\n const y = ExtractAsInt(this._y);\r\n const z = ExtractAsInt(this._z);\r\n const w = ExtractAsInt(this._w);\r\n\r\n let hash = x;\r\n hash = (hash * 397) ^ y;\r\n hash = (hash * 397) ^ z;\r\n hash = (hash * 397) ^ w;\r\n return hash;\r\n }\r\n\r\n // Operators\r\n /**\r\n * Returns a new array populated with 4 elements : the Vector4 coordinates.\r\n * @returns the resulting array\r\n */\r\n public asArray(): Tuple<number, 4> {\r\n return [this._x, this._y, this._z, this._w];\r\n }\r\n\r\n /**\r\n * Populates the given array from the given index with the Vector4 coordinates.\r\n * @param array array to populate\r\n * @param index index of the array to start at (default: 0)\r\n * @returns the Vector4.\r\n */\r\n public toArray(array: FloatArray, index?: number): this {\r\n if (index === undefined) {\r\n index = 0;\r\n }\r\n array[index] = this._x;\r\n array[index + 1] = this._y;\r\n array[index + 2] = this._z;\r\n array[index + 3] = this._w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Update the current vector from an array\r\n * @param array defines the destination array\r\n * @param offset defines the offset in the destination array\r\n * @returns the current Vector3\r\n */\r\n public fromArray(array: FloatArray, offset: number = 0): this {\r\n Vector4.FromArrayToRef(array, offset, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the given vector to the current Vector4.\r\n * @param otherVector the vector to add\r\n * @returns the updated Vector4.\r\n */\r\n public addInPlace(otherVector: DeepImmutable<Vector4>): this {\r\n this.x += otherVector._x;\r\n this.y += otherVector._y;\r\n this.z += otherVector._z;\r\n this.w += otherVector._w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the given coordinates to the current Vector4\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @param w defines the w coordinate of the operand\r\n * @returns the current updated Vector4\r\n */\r\n public addInPlaceFromFloats(x: number, y: number, z: number, w: number): this {\r\n this.x += x;\r\n this.y += y;\r\n this.z += z;\r\n this.w += w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 as the result of the addition of the current Vector4 and the given one.\r\n * @param otherVector the vector to add\r\n * @returns the resulting vector\r\n */\r\n public add(otherVector: DeepImmutable<IVector4Like>): Vector4 {\r\n return new Vector4(this._x + otherVector.x, this._y + otherVector.y, this._z + otherVector.z, this._w + otherVector.w);\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" with the result of the addition of the current Vector4 and the given one.\r\n * @param otherVector the vector to add\r\n * @param result the vector to store the result\r\n * @returns result input\r\n */\r\n public addToRef<T extends IVector4Like>(otherVector: DeepImmutable<IVector4Like>, result: T): T {\r\n result.x = this._x + otherVector.x;\r\n result.y = this._y + otherVector.y;\r\n result.z = this._z + otherVector.z;\r\n result.w = this._w + otherVector.w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Subtract in place the given vector from the current Vector4.\r\n * @param otherVector the vector to subtract\r\n * @returns the updated Vector4.\r\n */\r\n public subtractInPlace(otherVector: DeepImmutable<IVector4Like>): this {\r\n this.x -= otherVector.x;\r\n this.y -= otherVector.y;\r\n this.z -= otherVector.z;\r\n this.w -= otherVector.w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 with the result of the subtraction of the given vector from the current Vector4.\r\n * @param otherVector the vector to add\r\n * @returns the new vector with the result\r\n */\r\n public subtract(otherVector: DeepImmutable<IVector4Like>): Vector4 {\r\n return new Vector4(this._x - otherVector.x, this._y - otherVector.y, this._z - otherVector.z, this._w - otherVector.w);\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the subtraction of the given vector from the current Vector4.\r\n * @param otherVector the vector to subtract\r\n * @param result the vector to store the result\r\n * @returns result input\r\n */\r\n public subtractToRef<T extends IVector4Like>(otherVector: DeepImmutable<IVector4Like>, result: T): T {\r\n result.x = this._x - otherVector.x;\r\n result.y = this._y - otherVector.y;\r\n result.z = this._z - otherVector.z;\r\n result.w = this._w - otherVector.w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates.\r\n * @param x value to subtract\r\n * @param y value to subtract\r\n * @param z value to subtract\r\n * @param w value to subtract\r\n * @returns new vector containing the result\r\n */\r\n public subtractFromFloats(x: number, y: number, z: number, w: number): Vector4 {\r\n return new Vector4(this._x - x, this._y - y, this._z - z, this._w - w);\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" set with the result of the subtraction of the given floats from the current Vector4 coordinates.\r\n * @param x value to subtract\r\n * @param y value to subtract\r\n * @param z value to subtract\r\n * @param w value to subtract\r\n * @param result the vector to store the result in\r\n * @returns result input\r\n */\r\n public subtractFromFloatsToRef<T extends IVector4Like>(x: number, y: number, z: number, w: number, result: T): T {\r\n result.x = this._x - x;\r\n result.y = this._y - y;\r\n result.z = this._z - z;\r\n result.w = this._w - w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the current Vector4 negated coordinates.\r\n * @returns a new vector with the negated values\r\n */\r\n public negate(): Vector4 {\r\n return new Vector4(-this._x, -this._y, -this._z, -this._w);\r\n }\r\n\r\n /**\r\n * Negate this vector in place\r\n * @returns this\r\n */\r\n public negateInPlace(): this {\r\n this.x *= -1;\r\n this.y *= -1;\r\n this.z *= -1;\r\n this.w *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Negate the current Vector4 and stores the result in the given vector \"result\" coordinates\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public negateToRef<T extends IVector4Like>(result: T): T {\r\n result.x = -this._x;\r\n result.y = -this._y;\r\n result.z = -this._z;\r\n result.w = -this._w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Multiplies the current Vector4 coordinates by scale (float).\r\n * @param scale the number to scale with\r\n * @returns the updated Vector4.\r\n */\r\n public scaleInPlace(scale: number): this {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the current Vector4 coordinates multiplied by scale (float).\r\n * @param scale the number to scale with\r\n * @returns a new vector with the result\r\n */\r\n public scale(scale: number): Vector4 {\r\n return new Vector4(this._x * scale, this._y * scale, this._z * scale, this._w * scale);\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the current Vector4 coordinates multiplied by scale (float).\r\n * @param scale the number to scale with\r\n * @param result a vector to store the result in\r\n * @returns result input\r\n */\r\n public scaleToRef<T extends IVector4Like>(scale: number, result: T): T {\r\n result.x = this._x * scale;\r\n result.y = this._y * scale;\r\n result.z = this._z * scale;\r\n result.w = this._w * scale;\r\n return result;\r\n }\r\n\r\n /**\r\n * Scale the current Vector4 values by a factor and add the result to a given Vector4\r\n * @param scale defines the scale factor\r\n * @param result defines the Vector4 object where to store the result\r\n * @returns result input\r\n */\r\n public scaleAndAddToRef<T extends IVector4Like>(scale: number, result: T): T {\r\n result.x += this._x * scale;\r\n result.y += this._y * scale;\r\n result.z += this._z * scale;\r\n result.w += this._w * scale;\r\n return result;\r\n }\r\n\r\n /**\r\n * Boolean : True if the current Vector4 coordinates are stricly equal to the given ones.\r\n * @param otherVector the vector to compare against\r\n * @returns true if they are equal\r\n */\r\n public equals(otherVector: DeepImmutable<IVector4Like>): boolean {\r\n return otherVector && this._x === otherVector.x && this._y === otherVector.y && this._z === otherVector.z && this._w === otherVector.w;\r\n }\r\n\r\n /**\r\n * Boolean : True if the current Vector4 coordinates are each beneath the distance \"epsilon\" from the given vector ones.\r\n * @param otherVector vector to compare against\r\n * @param epsilon (Default: very small number)\r\n * @returns true if they are equal\r\n */\r\n public equalsWithEpsilon(otherVector: DeepImmutable<IVector4Like>, epsilon: number = Epsilon): boolean {\r\n return (\r\n otherVector &&\r\n WithinEpsilon(this._x, otherVector.x, epsilon) &&\r\n WithinEpsilon(this._y, otherVector.y, epsilon) &&\r\n WithinEpsilon(this._z, otherVector.z, epsilon) &&\r\n WithinEpsilon(this._w, otherVector.w, epsilon)\r\n );\r\n }\r\n\r\n /**\r\n * Boolean : True if the given floats are strictly equal to the current Vector4 coordinates.\r\n * @param x x value to compare against\r\n * @param y y value to compare against\r\n * @param z z value to compare against\r\n * @param w w value to compare against\r\n * @returns true if equal\r\n */\r\n public equalsToFloats(x: number, y: number, z: number, w: number): boolean {\r\n return this._x === x && this._y === y && this._z === z && this._w === w;\r\n }\r\n\r\n /**\r\n * Multiplies in place the current Vector4 by the given one.\r\n * @param otherVector vector to multiple with\r\n * @returns the updated Vector4.\r\n */\r\n public multiplyInPlace(otherVector: DeepImmutable<IVector4Like>): this {\r\n this.x *= otherVector.x;\r\n this.y *= otherVector.y;\r\n this.z *= otherVector.z;\r\n this.w *= otherVector.w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the multiplication result of the current Vector4 and the given one.\r\n * @param otherVector vector to multiple with\r\n * @returns resulting new vector\r\n */\r\n public multiply(otherVector: DeepImmutable<IVector4Like>): Vector4 {\r\n return new Vector4(this._x * otherVector.x, this._y * otherVector.y, this._z * otherVector.z, this._w * otherVector.w);\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" with the multiplication result of the current Vector4 and the given one.\r\n * @param otherVector vector to multiple with\r\n * @param result vector to store the result\r\n * @returns result input\r\n */\r\n public multiplyToRef<T extends IVector4Like>(otherVector: DeepImmutable<IVector4Like>, result: T): T {\r\n result.x = this._x * otherVector.x;\r\n result.y = this._y * otherVector.y;\r\n result.z = this._z * otherVector.z;\r\n result.w = this._w * otherVector.w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the multiplication result of the given floats and the current Vector4 coordinates.\r\n * @param x x value multiply with\r\n * @param y y value multiply with\r\n * @param z z value multiply with\r\n * @param w w value multiply with\r\n * @returns resulting new vector\r\n */\r\n public multiplyByFloats(x: number, y: number, z: number, w: number): Vector4 {\r\n return new Vector4(this._x * x, this._y * y, this._z * z, this._w * w);\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the division result of the current Vector4 by the given one.\r\n * @param otherVector vector to devide with\r\n * @returns resulting new vector\r\n */\r\n public divide(otherVector: DeepImmutable<IVector4Like>): Vector4 {\r\n return new Vector4(this._x / otherVector.x, this._y / otherVector.y, this._z / otherVector.z, this._w / otherVector.w);\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" with the division result of the current Vector4 by the given one.\r\n * @param otherVector vector to devide with\r\n * @param result vector to store the result\r\n * @returns result input\r\n */\r\n public divideToRef<T extends IVector4Like>(otherVector: DeepImmutable<IVector4Like>, result: T): T {\r\n result.x = this._x / otherVector.x;\r\n result.y = this._y / otherVector.y;\r\n result.z = this._z / otherVector.z;\r\n result.w = this._w / otherVector.w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Divides the current Vector3 coordinates by the given ones.\r\n * @param otherVector vector to devide with\r\n * @returns the updated Vector3.\r\n */\r\n public divideInPlace(otherVector: DeepImmutable<IVector4Like>): this {\r\n return this.divideToRef(otherVector, this);\r\n }\r\n\r\n /**\r\n * Updates the Vector4 coordinates with the minimum values between its own and the given vector ones\r\n * @param other defines the second operand\r\n * @returns the current updated Vector4\r\n */\r\n public minimizeInPlace(other: DeepImmutable<IVector4Like>): this {\r\n if (other.x < this._x) {\r\n this.x = other.x;\r\n }\r\n if (other.y < this._y) {\r\n this.y = other.y;\r\n }\r\n if (other.z < this._z) {\r\n this.z = other.z;\r\n }\r\n if (other.w < this._w) {\r\n this.w = other.w;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the Vector4 coordinates with the maximum values between its own and the given vector ones\r\n * @param other defines the second operand\r\n * @returns the current updated Vector4\r\n */\r\n public maximizeInPlace(other: DeepImmutable<IVector4Like>): this {\r\n if (other.x > this._x) {\r\n this.x = other.x;\r\n }\r\n if (other.y > this._y) {\r\n this.y = other.y;\r\n }\r\n if (other.z > this._z) {\r\n this.z = other.z;\r\n }\r\n if (other.w > this._w) {\r\n this.w = other.w;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector4 with the minimal coordinate values between its and the given coordinates\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @param w defines the w coordinate of the operand\r\n * @returns the current updated Vector4\r\n */\r\n public minimizeInPlaceFromFloats(x: number, y: number, z: number, w: number): this {\r\n this.x = Math.min(x, this._x);\r\n this.y = Math.min(y, this._y);\r\n this.z = Math.min(z, this._z);\r\n this.w = Math.min(w, this._w);\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector4 with the maximal coordinate values between its and the given coordinates.\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @param w defines the w coordinate of the operand\r\n * @returns the current updated Vector4\r\n */\r\n public maximizeInPlaceFromFloats(x: number, y: number, z: number, w: number): this {\r\n this.x = Math.max(x, this._x);\r\n this.y = Math.max(y, this._y);\r\n this.z = Math.max(z, this._z);\r\n this.w = Math.max(w, this._w);\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the current Vector4's floored values and stores them in result\r\n * @param result the vector to store the result in\r\n * @returns the result vector\r\n */\r\n public floorToRef<T extends IVector4Like>(result: T): T {\r\n result.x = Math.floor(this._x);\r\n result.y = Math.floor(this._y);\r\n result.z = Math.floor(this._z);\r\n result.w = Math.floor(this._w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector4 from current Vector4 floored values\r\n * @returns a new Vector4\r\n */\r\n public floor(): Vector4 {\r\n return new Vector4(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z), Math.floor(this._w));\r\n }\r\n\r\n /**\r\n * Gets the current Vector4's fractional values and stores them in result\r\n * @param result the vector to store the result in\r\n * @returns the result vector\r\n */\r\n public fractToRef<T extends IVector4Like>(result: T): T {\r\n result.x = this._x - Math.floor(this._x);\r\n result.y = this._y - Math.floor(this._y);\r\n result.z = this._z - Math.floor(this._z);\r\n result.w = this._w - Math.floor(this._w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector4 from current Vector4 fractional values\r\n * @returns a new Vector4\r\n */\r\n public fract(): Vector4 {\r\n return new Vector4(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z), this._w - Math.floor(this._w));\r\n }\r\n\r\n // Properties\r\n /**\r\n * Returns the Vector4 length (float).\r\n * @returns the length\r\n */\r\n public length(): number {\r\n return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\r\n }\r\n\r\n /**\r\n * Returns the Vector4 squared length (float).\r\n * @returns the length squared\r\n */\r\n public lengthSquared(): number {\r\n return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\r\n }\r\n\r\n // Methods\r\n /**\r\n * Normalizes in place the Vector4.\r\n * @returns the updated Vector4.\r\n */\r\n public normalize(): this {\r\n return this.normalizeFromLength(this.length());\r\n }\r\n\r\n /**\r\n * Normalize the current Vector4 with the given input length.\r\n * Please note that this is an in place operation.\r\n * @param len the length of the vector\r\n * @returns the current updated Vector4\r\n */\r\n public normalizeFromLength(len: number): this {\r\n if (len === 0 || len === 1.0) {\r\n return this;\r\n }\r\n\r\n return this.scaleInPlace(1.0 / len);\r\n }\r\n\r\n /**\r\n * Normalize the current Vector4 to a new vector\r\n * @returns the new Vector4\r\n */\r\n public normalizeToNew(): Vector4 {\r\n return this.normalizeToRef(new Vector4());\r\n }\r\n\r\n /**\r\n * Normalize the current Vector4 to the reference\r\n * @param reference define the Vector4 to update\r\n * @returns the updated Vector4\r\n */\r\n public normalizeToRef<T extends IVector4Like>(reference: T): T {\r\n const len = this.length();\r\n if (len === 0 || len === 1.0) {\r\n reference.x = this._x;\r\n reference.y = this._y;\r\n reference.z = this._z;\r\n reference.w = this._w;\r\n return reference;\r\n }\r\n\r\n return this.scaleToRef(1.0 / len, reference);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 from the Vector4 (x, y, z) coordinates.\r\n * @returns this converted to a new vector3\r\n */\r\n public toVector3(): Vector3 {\r\n return new Vector3(this._x, this._y, this._z);\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 copied from the current one.\r\n * @returns the new cloned vector\r\n */\r\n public clone(): Vector4 {\r\n return new Vector4(this._x, this._y, this._z, this._w);\r\n }\r\n\r\n /**\r\n * Updates the current Vector4 with the given one coordinates.\r\n * @param source the source vector to copy from\r\n * @returns the updated Vector4.\r\n */\r\n public copyFrom(source: DeepImmutable<IVector4Like>): this {\r\n this.x = source.x;\r\n this.y = source.y;\r\n this.z = source.z;\r\n this.w = source.w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector4 coordinates with the given floats.\r\n * @param x float to copy from\r\n * @param y float to copy from\r\n * @param z float to copy from\r\n * @param w float to copy from\r\n * @returns the updated Vector4.\r\n */\r\n public copyFromFloats(x: number, y: number, z: number, w: number): this {\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n this.w = w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector4 coordinates with the given floats.\r\n * @param x float to set from\r\n * @param y float to set from\r\n * @param z float to set from\r\n * @param w float to set from\r\n * @returns the updated Vector4.\r\n */\r\n public set(x: number, y: number, z: number, w: number): this {\r\n return this.copyFromFloats(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copies the given float to the current Vector4 coordinates\r\n * @param v defines the x, y, z and w coordinates of the operand\r\n * @returns the current updated Vector4\r\n */\r\n public setAll(v: number): this {\r\n this.x = this.y = this.z = this.w = v;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the current vectors and \"otherVector\"\r\n * @param otherVector defines the right operand\r\n * @returns the dot product\r\n */\r\n public dot(otherVector: DeepImmutable<IVector4Like>): number {\r\n return this._x * otherVector.x + this._y * otherVector.y + this._z * otherVector.z + this._w * otherVector.w;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Returns a new Vector4 set from the starting index of the given array.\r\n * @param array the array to pull values from\r\n * @param offset the offset into the array to start at\r\n * @returns the new vector\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset?: number): Vector4 {\r\n if (!offset) {\r\n offset = 0;\r\n }\r\n return new Vector4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" from the starting index of the given array.\r\n * @param array the array to pull values from\r\n * @param offset the offset into the array to start at\r\n * @param result the vector to store the result in\r\n * @returns result input\r\n */\r\n public static FromArrayToRef<T extends IVector4Like>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T {\r\n result.x = array[offset];\r\n result.y = array[offset + 1];\r\n result.z = array[offset + 2];\r\n result.w = array[offset + 3];\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" from the starting index of the given Float32Array.\r\n * @param array the array to pull values from\r\n * @param offset the offset into the array to start at\r\n * @param result the vector to store the result in\r\n * @returns result input\r\n */\r\n public static FromFloatArrayToRef<T extends IVector4Like>(array: DeepImmutable<Float32Array>, offset: number, result: T): T {\r\n Vector4.FromArrayToRef(array, offset, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" coordinates from the given floats.\r\n * @param x float to set from\r\n * @param y float to set from\r\n * @param z float to set from\r\n * @param w float to set from\r\n * @param result the vector to the floats in\r\n * @returns result input\r\n */\r\n public static FromFloatsToRef<T extends IVector4Like>(x: number, y: number, z: number, w: number, result: T): T {\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set to (0.0, 0.0, 0.0, 0.0)\r\n * @returns the new vector\r\n */\r\n public static Zero(): Vector4 {\r\n return new Vector4(0.0, 0.0, 0.0, 0.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set to (1.0, 1.0, 1.0, 1.0)\r\n * @returns the new vector\r\n */\r\n public static One(): Vector4 {\r\n return new Vector4(1.0, 1.0, 1.0, 1.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @returns a Vector4 with random values between min and max\r\n */\r\n public static Random(min: number = 0, max: number = 1): Vector4 {\r\n return new Vector4(RandomRange(min, max), RandomRange(min, max), RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Sets a Vector4 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @param ref the ref to store the values in\r\n * @returns the ref with random values between min and max\r\n */\r\n public static RandomToRef<T extends IVector4Like>(min: number = 0, max: number = 1, ref: T): T {\r\n ref.x = RandomRange(min, max);\r\n ref.y = RandomRange(min, max);\r\n ref.z = RandomRange(min, max);\r\n ref.w = RandomRange(min, max);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the coordinates of \"value\", if the vector \"value\" is in the cube defined by the vectors \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @returns the new Vector4\r\n */\r\n public static Clamp(value: DeepImmutable<IVector4Like>, min: DeepImmutable<IVector4Like>, max: DeepImmutable<IVector4Like>): Vector4 {\r\n return Vector4.ClampToRef(value, min, max, new Vector4());\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the coordinates of \"value\", if the vector \"value\" is in the cube defined by the vectors \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @param result defines the Vector4 where to store the result\r\n * @returns result input\r\n */\r\n public static ClampToRef<T extends IVector4Like>(value: DeepImmutable<IVector4Like>, min: DeepImmutable<IVector4Like>, max: DeepImmutable<IVector4Like>, result: T): T {\r\n result.x = Clamp(value.x, min.x, max.x);\r\n result.y = Clamp(value.y, min.y, max.y);\r\n result.z = Clamp(value.z, min.z, max.z);\r\n result.w = Clamp(value.w, min.w, max.w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Checks if a given vector is inside a specific range\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#75\r\n * @param v defines the vector to test\r\n * @param min defines the minimum range\r\n * @param max defines the maximum range\r\n */\r\n public static CheckExtends(v: IVector4Like, min: Vector4, max: Vector4): void {\r\n min.minimizeInPlace(v);\r\n max.maximizeInPlace(v);\r\n }\r\n\r\n /**\r\n * Gets a zero Vector4 that must not be updated\r\n */\r\n public static get ZeroReadOnly(): DeepImmutable<Vector4> {\r\n return Vector4._ZeroReadOnly;\r\n }\r\n\r\n /**\r\n * Returns a new normalized Vector4 from the given one.\r\n * @param vector the vector to normalize\r\n * @returns the vector\r\n */\r\n public static Normalize(vector: DeepImmutable<Vector4>): Vector4 {\r\n return Vector4.NormalizeToRef(vector, new Vector4());\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" from the normalization of the given one.\r\n * @param vector the vector to normalize\r\n * @param result the vector to store the result in\r\n * @returns result input\r\n */\r\n public static NormalizeToRef<T extends IVector4Like>(vector: DeepImmutable<Vector4>, result: T): T {\r\n vector.normalizeToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a vector with the minimum values from the left and right vectors\r\n * @param left left vector to minimize\r\n * @param right right vector to minimize\r\n * @returns a new vector with the minimum of the left and right vector values\r\n */\r\n public static Minimize<T extends Vector4>(left: DeepImmutable<T>, right: DeepImmutable<Vector4>): Vector4 {\r\n const min = new Vector4();\r\n min.copyFrom(left);\r\n min.minimizeInPlace(right);\r\n return min;\r\n }\r\n\r\n /**\r\n * Returns a vector with the maximum values from the left and right vectors\r\n * @param left left vector to maximize\r\n * @param right right vector to maximize\r\n * @returns a new vector with the maximum of the left and right vector values\r\n */\r\n public static Maximize(left: DeepImmutable<IVector4Like>, right: DeepImmutable<IVector4Like>): Vector4 {\r\n const max = new Vector4();\r\n max.copyFrom(left);\r\n max.maximizeInPlace(right);\r\n return max;\r\n }\r\n\r\n /**\r\n * Returns the distance (float) between the vectors \"value1\" and \"value2\".\r\n * @param value1 value to calulate the distance between\r\n * @param value2 value to calulate the distance between\r\n * @returns the distance between the two vectors\r\n */\r\n public static Distance(value1: DeepImmutable<IVector4Like>, value2: DeepImmutable<IVector4Like>): number {\r\n return Math.sqrt(Vector4.DistanceSquared(value1, value2));\r\n }\r\n\r\n /**\r\n * Returns the squared distance (float) between the vectors \"value1\" and \"value2\".\r\n * @param value1 value to calulate the distance between\r\n * @param value2 value to calulate the distance between\r\n * @returns the distance between the two vectors squared\r\n */\r\n public static DistanceSquared(value1: DeepImmutable<IVector4Like>, value2: DeepImmutable<IVector4Like>): number {\r\n const x = value1.x - value2.x;\r\n const y = value1.y - value2.y;\r\n const z = value1.z - value2.z;\r\n const w = value1.w - value2.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 located at the center between the vectors \"value1\" and \"value2\".\r\n * @param value1 value to calulate the center between\r\n * @param value2 value to calulate the center between\r\n * @returns the center between the two vectors\r\n */\r\n public static Center(value1: DeepImmutable<IVector4Like>, value2: DeepImmutable<IVector4Like>): Vector4 {\r\n return Vector4.CenterToRef(value1, value2, new Vector4());\r\n }\r\n\r\n /**\r\n * Gets the center of the vectors \"value1\" and \"value2\" and stores the result in the vector \"ref\"\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @param ref defines third vector\r\n * @returns ref\r\n */\r\n public static CenterToRef<T extends IVector4Like>(value1: DeepImmutable<IVector4Like>, value2: DeepImmutable<IVector4Like>, ref: T): T {\r\n ref.x = (value1.x + value2.x) / 2;\r\n ref.y = (value1.y + value2.y) / 2;\r\n ref.z = (value1.z + value2.z) / 2;\r\n ref.w = (value1.w + value2.w) / 2;\r\n return ref;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the result of the transformation by the given matrix of the given vector.\r\n * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\r\n * The difference with Vector3.TransformCoordinates is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @returns the transformed Vector4\r\n */\r\n public static TransformCoordinates(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>): Vector4 {\r\n return Vector4.TransformCoordinatesToRef(vector, transformation, new Vector4());\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given vector\r\n * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\r\n * The difference with Vector3.TransformCoordinatesToRef is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector4 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformCoordinatesToRef<T extends IVector4Like>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T {\r\n Vector4.TransformCoordinatesFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)\r\n * This method computes tranformed coordinates only, not transformed direction vectors\r\n * The difference with Vector3.TransformCoordinatesFromFloatsToRef is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead\r\n * @param x define the x coordinate of the source vector\r\n * @param y define the y coordinate of the source vector\r\n * @param z define the z coordinate of the source vector\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector4 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformCoordinatesFromFloatsToRef<T extends IVector4Like>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n const rx = x * m[0] + y * m[4] + z * m[8] + m[12];\r\n const ry = x * m[1] + y * m[5] + z * m[9] + m[13];\r\n const rz = x * m[2] + y * m[6] + z * m[10] + m[14];\r\n const rw = x * m[3] + y * m[7] + z * m[11] + m[15];\r\n\r\n result.x = rx;\r\n result.y = ry;\r\n result.z = rz;\r\n result.w = rw;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the result of the normal transformation by the given matrix of the given vector.\r\n * This methods computes transformed normalized direction vectors only.\r\n * @param vector the vector to transform\r\n * @param transformation the transformation matrix to apply\r\n * @returns the new vector\r\n */\r\n public static TransformNormal(vector: DeepImmutable<IVector4Like>, transformation: DeepImmutable<Matrix>): Vector4 {\r\n return Vector4.TransformNormalToRef(vector, transformation, new Vector4());\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the normal transformation by the given matrix of the given vector.\r\n * This methods computes transformed normalized direction vectors only.\r\n * @param vector the vector to transform\r\n * @param transformation the transformation matrix to apply\r\n * @param result the vector to store the result in\r\n * @returns result input\r\n */\r\n public static TransformNormalToRef<T extends IVector4Like>(vector: DeepImmutable<IVector4Like>, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n const x = vector.x * m[0] + vector.y * m[4] + vector.z * m[8];\r\n const y = vector.x * m[1] + vector.y * m[5] + vector.z * m[9];\r\n const z = vector.x * m[2] + vector.y * m[6] + vector.z * m[10];\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = vector.w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the normal transformation by the given matrix of the given floats (x, y, z, w).\r\n * This methods computes transformed normalized direction vectors only.\r\n * @param x value to transform\r\n * @param y value to transform\r\n * @param z value to transform\r\n * @param w value to transform\r\n * @param transformation the transformation matrix to apply\r\n * @param result the vector to store the results in\r\n * @returns result input\r\n */\r\n public static TransformNormalFromFloatsToRef<T extends IVector4Like>(x: number, y: number, z: number, w: number, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n result.x = x * m[0] + y * m[4] + z * m[8];\r\n result.y = x * m[1] + y * m[5] + z * m[9];\r\n result.z = x * m[2] + y * m[6] + z * m[10];\r\n result.w = w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new Vector4 from a Vector3\r\n * @param source defines the source data\r\n * @param w defines the 4th component (default is 0)\r\n * @returns a new Vector4\r\n */\r\n public static FromVector3(source: Vector3, w: number = 0): Vector4 {\r\n return new Vector4(source._x, source._y, source._z, w);\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the vectors \"left\" and \"right\"\r\n * @param left defines the left operand\r\n * @param right defines the right operand\r\n * @returns the dot product\r\n */\r\n public static Dot(left: DeepImmutable<IVector4Like>, right: DeepImmutable<IVector4Like>): number {\r\n return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w;\r\n }\r\n}\r\n\r\nVector4 satisfies VectorStatic<Vector4, IVector4Like>;\r\nObject.defineProperties(Vector4.prototype, {\r\n dimension: { value: [4] },\r\n rank: { value: 1 },\r\n});\r\n\r\n/**\r\n * Class used to store quaternion data\r\n * Example Playground - Overview - https://playground.babylonjs.com/#L49EJ7#100\r\n * @see https://en.wikipedia.org/wiki/Quaternion\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms\r\n */\r\nexport class Quaternion implements Tensor<Tuple<number, 4>, Quaternion>, IQuaternionLike {\r\n /**\r\n * If the first quaternion is flagged with integers (as everything is 0,0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.\r\n * If subsequent quaternion are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,\r\n * and henceforth it will use floating-point representation for all quaternion instances that it creates.\r\n * But the original quaternion instances are unchanged and has a \"deprecated map\".\r\n * If we keep using the quaternion instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.\r\n */\r\n static _V8PerformanceHack = new Quaternion(0.5, 0.5, 0.5, 0.5) as DeepImmutable<Quaternion>;\r\n /** @internal */\r\n public _x: number;\r\n\r\n /** @internal */\r\n public _y: number;\r\n\r\n /** @internal */\r\n public _z: number;\r\n\r\n /** @internal */\r\n public _w: number;\r\n\r\n /** @internal */\r\n public _isDirty = true;\r\n\r\n /** Gets or sets the x coordinate */\r\n public get x() {\r\n return this._x;\r\n }\r\n\r\n public set x(value: number) {\r\n this._x = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the y coordinate */\r\n public get y() {\r\n return this._y;\r\n }\r\n\r\n public set y(value: number) {\r\n this._y = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the z coordinate */\r\n public get z() {\r\n return this._z;\r\n }\r\n\r\n public set z(value: number) {\r\n this._z = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the w coordinate */\r\n public get w() {\r\n return this._w;\r\n }\r\n\r\n public set w(value: number) {\r\n this._w = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n declare public readonly dimension: Readonly<[4]>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n declare public readonly rank: 1;\r\n\r\n /**\r\n * Creates a new Quaternion from the given floats\r\n * @param x defines the first component (0 by default)\r\n * @param y defines the second component (0 by default)\r\n * @param z defines the third component (0 by default)\r\n * @param w defines the fourth component (1.0 by default)\r\n */\r\n constructor(x: number = 0.0, y: number = 0.0, z: number = 0.0, w: number = 1.0) {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._w = w;\r\n }\r\n\r\n /**\r\n * Gets a string representation for the current quaternion\r\n * @returns a string with the Quaternion coordinates\r\n */\r\n public toString(): string {\r\n return `{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`;\r\n }\r\n\r\n /**\r\n * Gets the class name of the quaternion\r\n * @returns the string \"Quaternion\"\r\n */\r\n public getClassName(): string {\r\n return \"Quaternion\";\r\n }\r\n\r\n /**\r\n * Gets a hash code for this quaternion\r\n * @returns the quaternion hash code\r\n */\r\n public getHashCode(): number {\r\n const x = ExtractAsInt(this._x);\r\n const y = ExtractAsInt(this._y);\r\n const z = ExtractAsInt(this._z);\r\n const w = ExtractAsInt(this._w);\r\n\r\n let hash = x;\r\n hash = (hash * 397) ^ y;\r\n hash = (hash * 397) ^ z;\r\n hash = (hash * 397) ^ w;\r\n return hash;\r\n }\r\n\r\n /**\r\n * Copy the quaternion to an array\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#13\r\n * @returns a new array populated with 4 elements from the quaternion coordinates\r\n */\r\n public asArray(): Tuple<number, 4> {\r\n return [this._x, this._y, this._z, this._w];\r\n }\r\n\r\n /**\r\n * Stores from the starting index in the given array the Quaternion successive values\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#59\r\n * @param array defines the array where to store the x,y,z,w 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 Quaternion object\r\n */\r\n public toArray(array: FloatArray, index: number = 0): this {\r\n array[index] = this._x;\r\n array[index + 1] = this._y;\r\n array[index + 2] = this._z;\r\n array[index + 3] = this._w;\r\n return this;\r\n }\r\n\r\n public fromArray(array: FloatArray, index: number = 0): this {\r\n return Quaternion.FromArrayToRef(array, index, this);\r\n }\r\n\r\n /**\r\n * Check if two quaternions are equals\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#38\r\n * @param otherQuaternion defines the second operand\r\n * @returns true if the current quaternion and the given one coordinates are strictly equals\r\n */\r\n public equals(otherQuaternion: DeepImmutable<Quaternion>): boolean {\r\n return otherQuaternion && this._x === otherQuaternion._x && this._y === otherQuaternion._y && this._z === otherQuaternion._z && this._w === otherQuaternion._w;\r\n }\r\n\r\n /**\r\n * Gets a boolean if two quaternions are equals (using an epsilon value)\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#37\r\n * @param otherQuaternion defines the other quaternion\r\n * @param epsilon defines the minimal distance to consider equality\r\n * @returns true if the given quaternion coordinates are close to the current ones by a distance of epsilon.\r\n */\r\n public equalsWithEpsilon(otherQuaternion: DeepImmutable<Quaternion>, epsilon: number = Epsilon): boolean {\r\n return (\r\n otherQuaternion &&\r\n WithinEpsilon(this._x, otherQuaternion._x, epsilon) &&\r\n WithinEpsilon(this._y, otherQuaternion._y, epsilon) &&\r\n WithinEpsilon(this._z, otherQuaternion._z, epsilon) &&\r\n WithinEpsilon(this._w, otherQuaternion._w, epsilon)\r\n );\r\n }\r\n\r\n /**\r\n * Gets a boolean if two quaternions are equals (using an epsilon value), taking care of double cover : https://www.reedbeta.com/blog/why-quaternions-double-cover/\r\n * @param otherQuaternion defines the other quaternion\r\n * @param epsilon defines the minimal distance to consider equality\r\n * @returns true if the given quaternion coordinates are close to the current ones by a distance of epsilon.\r\n */\r\n public isApprox(otherQuaternion: DeepImmutable<Quaternion>, epsilon: number = Epsilon): boolean {\r\n return (\r\n otherQuaternion &&\r\n ((WithinEpsilon(this._x, otherQuaternion._x, epsilon) &&\r\n WithinEpsilon(this._y, otherQuaternion._y, epsilon) &&\r\n WithinEpsilon(this._z, otherQuaternion._z, epsilon) &&\r\n WithinEpsilon(this._w, otherQuaternion._w, epsilon)) ||\r\n (WithinEpsilon(this._x, -otherQuaternion._x, epsilon) &&\r\n WithinEpsilon(this._y, -otherQuaternion._y, epsilon) &&\r\n WithinEpsilon(this._z, -otherQuaternion._z, epsilon) &&\r\n WithinEpsilon(this._w, -otherQuaternion._w, epsilon)))\r\n );\r\n }\r\n\r\n /**\r\n * Clone the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#12\r\n * @returns a new quaternion copied from the current one\r\n */\r\n public clone(): Quaternion {\r\n return new Quaternion(this._x, this._y, this._z, this._w);\r\n }\r\n\r\n /**\r\n * Copy a quaternion to the current one\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#86\r\n * @param other defines the other quaternion\r\n * @returns the updated current quaternion\r\n */\r\n public copyFrom(other: DeepImmutable<Quaternion>): this {\r\n this._x = other._x;\r\n this._y = other._y;\r\n this._z = other._z;\r\n this._w = other._w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current quaternion with the given float coordinates\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#87\r\n * @param x defines the x coordinate\r\n * @param y defines the y coordinate\r\n * @param z defines the z coordinate\r\n * @param w defines the w coordinate\r\n * @returns the updated current quaternion\r\n */\r\n public copyFromFloats(x: number, y: number, z: number, w: number): this {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._w = w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current quaternion from the given float coordinates\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#56\r\n * @param x defines the x coordinate\r\n * @param y defines the y coordinate\r\n * @param z defines the z coordinate\r\n * @param w defines the w coordinate\r\n * @returns the updated current quaternion\r\n */\r\n public set(x: number, y: number, z: number, w: number): this {\r\n return this.copyFromFloats(x, y, z, w);\r\n }\r\n\r\n public setAll(value: number): this {\r\n return this.copyFromFloats(value, value, value, value);\r\n }\r\n\r\n /**\r\n * Adds two quaternions\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#10\r\n * @param other defines the second operand\r\n * @returns a new quaternion as the addition result of the given one and the current quaternion\r\n */\r\n public add(other: DeepImmutable<Quaternion>): Quaternion {\r\n return new Quaternion(this._x + other._x, this._y + other._y, this._z + other._z, this._w + other._w);\r\n }\r\n\r\n /**\r\n * Add a quaternion to the current one\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#11\r\n * @param other defines the quaternion to add\r\n * @returns the current quaternion\r\n */\r\n public addInPlace(other: DeepImmutable<Quaternion>): this {\r\n this._x += other._x;\r\n this._y += other._y;\r\n this._z += other._z;\r\n this._w += other._w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n public addToRef<T extends Quaternion>(other: DeepImmutable<this>, result: T): T {\r\n result._x = this._x + other._x;\r\n result._y = this._y + other._y;\r\n result._z = this._z + other._z;\r\n result._w = this._w + other._w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n public addInPlaceFromFloats(x: number, y: number, z: number, w: number): this {\r\n this._x += x;\r\n this._y += y;\r\n this._z += z;\r\n this._w += w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n public subtractToRef<T extends Quaternion>(other: DeepImmutable<this>, result: T): T {\r\n result._x = this._x - other._x;\r\n result._y = this._y - other._y;\r\n result._z = this._z - other._z;\r\n result._w = this._w - other._w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n public subtractFromFloats(x: number, y: number, z: number, w: number): Quaternion {\r\n return this.subtractFromFloatsToRef(x, y, z, w, new Quaternion());\r\n }\r\n\r\n public subtractFromFloatsToRef<T extends Quaternion>(x: number, y: number, z: number, w: number, result: T): T {\r\n result._x = this._x - x;\r\n result._y = this._y - y;\r\n result._z = this._z - z;\r\n result._w = this._w - w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Subtract two quaternions\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#57\r\n * @param other defines the second operand\r\n * @returns a new quaternion as the subtraction result of the given one from the current one\r\n */\r\n public subtract(other: DeepImmutable<this>): Quaternion {\r\n return new Quaternion(this._x - other._x, this._y - other._y, this._z - other._z, this._w - other._w);\r\n }\r\n\r\n /**\r\n * Subtract a quaternion to the current one\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#58\r\n * @param other defines the quaternion to subtract\r\n * @returns the current quaternion\r\n */\r\n public subtractInPlace(other: DeepImmutable<Quaternion>): this {\r\n this._x -= other._x;\r\n this._y -= other._y;\r\n this._z -= other._z;\r\n this._w -= other._w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies the current quaternion by a scale factor\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#88\r\n * @param value defines the scale factor\r\n * @returns a new quaternion set by multiplying the current quaternion coordinates by the float \"scale\"\r\n */\r\n public scale(value: number): Quaternion {\r\n return new Quaternion(this._x * value, this._y * value, this._z * value, this._w * value);\r\n }\r\n\r\n /**\r\n * Scale the current quaternion values by a factor and stores the result to a given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#89\r\n * @param scale defines the scale factor\r\n * @param result defines the Quaternion object where to store the result\r\n * @returns result input\r\n */\r\n public scaleToRef<T extends Quaternion>(scale: number, result: T): T {\r\n result._x = this._x * scale;\r\n result._y = this._y * scale;\r\n result._z = this._z * scale;\r\n result._w = this._w * scale;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Multiplies in place the current quaternion by a scale factor\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#90\r\n * @param value defines the scale factor\r\n * @returns the current modified quaternion\r\n */\r\n public scaleInPlace(value: number): this {\r\n this._x *= value;\r\n this._y *= value;\r\n this._z *= value;\r\n this._w *= value;\r\n this._isDirty = true;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Scale the current quaternion values by a factor and add the result to a given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#91\r\n * @param scale defines the scale factor\r\n * @param result defines the Quaternion object where to store the result\r\n * @returns result input\r\n */\r\n public scaleAndAddToRef<T extends Quaternion>(scale: number, result: T): T {\r\n result._x += this._x * scale;\r\n result._y += this._y * scale;\r\n result._z += this._z * scale;\r\n result._w += this._w * scale;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#43\r\n * @param q1 defines the second operand\r\n * @returns a new quaternion set as the multiplication result of the current one with the given one \"q1\"\r\n */\r\n public multiply(q1: DeepImmutable<Quaternion>): Quaternion {\r\n const result = new Quaternion(0, 0, 0, 1.0);\r\n this.multiplyToRef(q1, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given \"result\" as the multiplication result of the current one with the given one \"q1\"\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#45\r\n * @param q1 defines the second operand\r\n * @param result defines the target quaternion\r\n * @returns the current quaternion\r\n */\r\n public multiplyToRef<T extends Quaternion>(q1: DeepImmutable<Quaternion>, result: T): T {\r\n const x = this._x * q1._w + this._y * q1._z - this._z * q1._y + this._w * q1._x;\r\n const y = -this._x * q1._z + this._y * q1._w + this._z * q1._x + this._w * q1._y;\r\n const z = this._x * q1._y - this._y * q1._x + this._z * q1._w + this._w * q1._z;\r\n const w = -this._x * q1._x - this._y * q1._y - this._z * q1._z + this._w * q1._w;\r\n result.copyFromFloats(x, y, z, w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the current quaternion with the multiplication of itself with the given one \"q1\"\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#46\r\n * @param other defines the second operand\r\n * @returns the currentupdated quaternion\r\n */\r\n public multiplyInPlace(other: DeepImmutable<Quaternion>): this {\r\n return this.multiplyToRef(other, this);\r\n }\r\n\r\n public multiplyByFloats(x: number, y: number, z: number, w: number): this {\r\n this._x *= x;\r\n this._y *= y;\r\n this._z *= z;\r\n this._w *= w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public divide(_other: DeepImmutable<this>): this {\r\n throw new ReferenceError(\"Can not divide a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public divideToRef<T extends Quaternion>(_other: DeepImmutable<this>, _result: T): T {\r\n throw new ReferenceError(\"Can not divide a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public divideInPlace(_other: DeepImmutable<this>): this {\r\n throw new ReferenceError(\"Can not divide a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public minimizeInPlace(): this {\r\n throw new ReferenceError(\"Can not minimize a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public minimizeInPlaceFromFloats(): this {\r\n throw new ReferenceError(\"Can not minimize a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public maximizeInPlace(): this {\r\n throw new ReferenceError(\"Can not maximize a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public maximizeInPlaceFromFloats(): this {\r\n throw new ReferenceError(\"Can not maximize a quaternion\");\r\n }\r\n\r\n public negate(): Quaternion {\r\n return this.negateToRef(new Quaternion());\r\n }\r\n\r\n public negateInPlace(): this {\r\n this._x = -this._x;\r\n this._y = -this._y;\r\n this._z = -this._z;\r\n this._w = -this._w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n public negateToRef<T extends Quaternion>(result: T): T {\r\n result._x = -this._x;\r\n result._y = -this._y;\r\n result._z = -this._z;\r\n result._w = -this._w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n public equalsToFloats(x: number, y: number, z: number, w: number): boolean {\r\n return this._x === x && this._y === y && this._z === z && this._w === w;\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public floorToRef<T extends Quaternion>(_result: T): T {\r\n throw new ReferenceError(\"Can not floor a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public floor(): Quaternion {\r\n throw new ReferenceError(\"Can not floor a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public fractToRef<T extends Quaternion>(_result: T): T {\r\n throw new ReferenceError(\"Can not fract a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public fract(): Quaternion {\r\n throw new ReferenceError(\"Can not fract a quaternion\");\r\n }\r\n\r\n /**\r\n * Conjugates the current quaternion and stores the result in the given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#81\r\n * @param ref defines the target quaternion\r\n * @returns result input\r\n */\r\n public conjugateToRef<T extends Quaternion>(ref: T): T {\r\n ref.copyFromFloats(-this._x, -this._y, -this._z, this._w);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Conjugates in place the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#82\r\n * @returns the current updated quaternion\r\n */\r\n public conjugateInPlace(): this {\r\n this._x *= -1;\r\n this._y *= -1;\r\n this._z *= -1;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Conjugates (1-q) the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#83\r\n * @returns a new quaternion\r\n */\r\n public conjugate(): Quaternion {\r\n return new Quaternion(-this._x, -this._y, -this._z, this._w);\r\n }\r\n\r\n /**\r\n * Returns the inverse of the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#84\r\n * @returns a new quaternion\r\n */\r\n public invert(): Quaternion {\r\n const conjugate = this.conjugate();\r\n const lengthSquared = this.lengthSquared();\r\n if (lengthSquared == 0 || lengthSquared == 1) {\r\n return conjugate;\r\n }\r\n conjugate.scaleInPlace(1 / lengthSquared);\r\n return conjugate;\r\n }\r\n\r\n /**\r\n * Invert in place the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#85\r\n * @returns this quaternion\r\n */\r\n public invertInPlace(): this {\r\n this.conjugateInPlace();\r\n const lengthSquared = this.lengthSquared();\r\n if (lengthSquared == 0 || lengthSquared == 1) {\r\n return this;\r\n }\r\n this.scaleInPlace(1 / lengthSquared);\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets squared length of current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#29\r\n * @returns the quaternion length (float)\r\n */\r\n public lengthSquared(): number {\r\n return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\r\n }\r\n\r\n /**\r\n * Gets length of current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#28\r\n * @returns the quaternion length (float)\r\n */\r\n public length(): number {\r\n return Math.sqrt(this.lengthSquared());\r\n }\r\n\r\n /**\r\n * Normalize in place the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#54\r\n * @returns the current updated quaternion\r\n */\r\n public normalize(): this {\r\n return this.normalizeFromLength(this.length());\r\n }\r\n\r\n /**\r\n * Normalize the current quaternion with the given input length.\r\n * Please note that this is an in place operation.\r\n * @param len the length of the quaternion\r\n * @returns the current updated Quaternion\r\n */\r\n public normalizeFromLength(len: number): this {\r\n if (len === 0 || len === 1.0) {\r\n return this;\r\n }\r\n\r\n return this.scaleInPlace(1.0 / len);\r\n }\r\n\r\n /**\r\n * Normalize a copy of the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#55\r\n * @returns the normalized quaternion\r\n */\r\n public normalizeToNew(): Quaternion {\r\n const normalized = new Quaternion(0, 0, 0, 1);\r\n this.normalizeToRef(normalized);\r\n return normalized;\r\n }\r\n\r\n /**\r\n * Normalize the current Quaternion to the reference\r\n * @param reference define the Quaternion to update\r\n * @returns the updated Quaternion\r\n */\r\n public normalizeToRef<T extends Quaternion>(reference: T): T {\r\n const len = this.length();\r\n if (len === 0 || len === 1.0) {\r\n return reference.copyFromFloats(this._x, this._y, this._z, this._w);\r\n }\r\n\r\n return this.scaleToRef(1.0 / len, reference);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the Euler angles translated from the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#32\r\n * @returns a new Vector3 containing the Euler angles\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions\r\n */\r\n public toEulerAngles(): Vector3 {\r\n const result = Vector3.Zero();\r\n this.toEulerAnglesToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector3 \"result\" with the Euler angles translated from the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#31\r\n * @param result defines the vector which will be filled with the Euler angles\r\n * @returns result input\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions\r\n */\r\n public toEulerAnglesToRef<T extends Vector3>(result: T): T {\r\n const qz = this._z;\r\n const qx = this._x;\r\n const qy = this._y;\r\n const qw = this._w;\r\n\r\n const zAxisY = qy * qz - qx * qw;\r\n const limit = 0.4999999;\r\n\r\n if (zAxisY < -limit) {\r\n result._y = 2 * Math.atan2(qy, qw);\r\n result._x = Math.PI / 2;\r\n result._z = 0;\r\n result._isDirty = true;\r\n } else if (zAxisY > limit) {\r\n result._y = 2 * Math.atan2(qy, qw);\r\n result._x = -Math.PI / 2;\r\n result._z = 0;\r\n result._isDirty = true;\r\n } else {\r\n const sqw = qw * qw;\r\n const sqz = qz * qz;\r\n const sqx = qx * qx;\r\n const sqy = qy * qy;\r\n result._z = Math.atan2(2.0 * (qx * qy + qz * qw), -sqz - sqx + sqy + sqw);\r\n result._x = Math.asin(-2.0 * zAxisY);\r\n result._y = Math.atan2(2.0 * (qz * qx + qy * qw), sqz - sqx - sqy + sqw);\r\n result._isDirty = true;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector3 \"result\" with the Alpha, Beta, Gamma Euler angles translated from the current quaternion\r\n * @param result defines the vector which will be filled with the Euler angles\r\n * @returns result input\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions\r\n */\r\n public toAlphaBetaGammaToRef<T extends Vector3>(result: T): T {\r\n const qz = this._z;\r\n const qx = this._x;\r\n const qy = this._y;\r\n const qw = this._w;\r\n\r\n // Compute intermediate values\r\n const sinHalfBeta = Math.sqrt(qx * qx + qy * qy);\r\n const cosHalfBeta = Math.sqrt(qz * qz + qw * qw);\r\n\r\n // Calculate beta\r\n const beta = 2 * Math.atan2(sinHalfBeta, cosHalfBeta);\r\n\r\n // Calculate gamma + alpha\r\n const gammaPlusAlpha = 2 * Math.atan2(qz, qw);\r\n\r\n // Calculate gamma - alpha\r\n const gammaMinusAlpha = 2 * Math.atan2(qy, qx);\r\n\r\n // Calculate gamma and alpha\r\n const gamma = (gammaPlusAlpha + gammaMinusAlpha) / 2;\r\n const alpha = (gammaPlusAlpha - gammaMinusAlpha) / 2;\r\n\r\n result.set(alpha, beta, gamma);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the given rotation matrix with the current quaternion values\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#67\r\n * @param result defines the target matrix\r\n * @returns the updated matrix with the rotation\r\n */\r\n public toRotationMatrix<T extends Matrix>(result: T): T {\r\n Matrix.FromQuaternionToRef(this, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the current quaternion from the given rotation matrix values\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#41\r\n * @param matrix defines the source matrix\r\n * @returns the current updated quaternion\r\n */\r\n public fromRotationMatrix(matrix: DeepImmutable<Matrix>): this {\r\n Quaternion.FromRotationMatrixToRef(matrix, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the current quaternions and \"other\"\r\n * @param other defines the right operand\r\n * @returns the dot product\r\n */\r\n public dot(other: DeepImmutable<this>): number {\r\n return this._x * other._x + this._y * other._y + this._z * other._z + this._w * other._w;\r\n }\r\n\r\n /**\r\n * Converts the current quaternion to an axis angle representation\r\n * @returns the axis and angle in radians\r\n */\r\n public toAxisAngle(): { axis: Vector3; angle: number } {\r\n const axis = Vector3.Zero();\r\n const angle = this.toAxisAngleToRef(axis);\r\n return { axis, angle };\r\n }\r\n\r\n /**\r\n * Converts the current quaternion to an axis angle representation\r\n * @param axis defines the target axis vector\r\n * @returns the angle in radians\r\n */\r\n public toAxisAngleToRef<T extends Vector3>(axis: T): number {\r\n let angle = 0;\r\n const sinHalfAngle = Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z);\r\n const cosHalfAngle = this._w;\r\n\r\n if (sinHalfAngle > 0) {\r\n angle = 2 * Math.atan2(sinHalfAngle, cosHalfAngle);\r\n axis.set(this._x / sinHalfAngle, this._y / sinHalfAngle, this._z / sinHalfAngle);\r\n } else {\r\n angle = 0;\r\n axis.set(1, 0, 0);\r\n }\r\n\r\n return angle;\r\n }\r\n\r\n // Statics\r\n\r\n /**\r\n * Creates a new quaternion from a rotation matrix\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#101\r\n * @param matrix defines the source matrix\r\n * @returns a new quaternion created from the given rotation matrix values\r\n */\r\n public static FromRotationMatrix(matrix: DeepImmutable<Matrix>): Quaternion {\r\n const result = new Quaternion();\r\n Quaternion.FromRotationMatrixToRef(matrix, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the given quaternion with the given rotation matrix values\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#102\r\n * @param matrix defines the source matrix\r\n * @param result defines the target quaternion\r\n * @returns result input\r\n */\r\n public static FromRotationMatrixToRef<T extends Quaternion>(matrix: DeepImmutable<Matrix>, result: T): T {\r\n const data = matrix.m;\r\n const m11 = data[0],\r\n m12 = data[4],\r\n m13 = data[8];\r\n const m21 = data[1],\r\n m22 = data[5],\r\n m23 = data[9];\r\n const m31 = data[2],\r\n m32 = data[6],\r\n m33 = data[10];\r\n const trace = m11 + m22 + m33;\r\n let s;\r\n\r\n if (trace > 0) {\r\n s = 0.5 / Math.sqrt(trace + 1.0);\r\n\r\n result._w = 0.25 / s;\r\n result._x = (m32 - m23) * s;\r\n result._y = (m13 - m31) * s;\r\n result._z = (m21 - m12) * s;\r\n result._isDirty = true;\r\n } else if (m11 > m22 && m11 > m33) {\r\n s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\r\n\r\n result._w = (m32 - m23) / s;\r\n result._x = 0.25 * s;\r\n result._y = (m12 + m21) / s;\r\n result._z = (m13 + m31) / s;\r\n result._isDirty = true;\r\n } else if (m22 > m33) {\r\n s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\r\n\r\n result._w = (m13 - m31) / s;\r\n result._x = (m12 + m21) / s;\r\n result._y = 0.25 * s;\r\n result._z = (m23 + m32) / s;\r\n result._isDirty = true;\r\n } else {\r\n s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\r\n\r\n result._w = (m21 - m12) / s;\r\n result._x = (m13 + m31) / s;\r\n result._y = (m23 + m32) / s;\r\n result._z = 0.25 * s;\r\n result._isDirty = true;\r\n }\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the quaternions \"left\" and \"right\"\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#61\r\n * @param left defines the left operand\r\n * @param right defines the right operand\r\n * @returns the dot product\r\n */\r\n public static Dot(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>): number {\r\n return left._x * right._x + left._y * right._y + left._z * right._z + left._w * right._w;\r\n }\r\n\r\n /**\r\n * Checks if the orientations of two rotation quaternions are close to each other\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#60\r\n * @param quat0 defines the first quaternion to check\r\n * @param quat1 defines the second quaternion to check\r\n * @param epsilon defines closeness, 0 same orientation, 1 PI apart, default 0.1\r\n * @returns true if the two quaternions are close to each other within epsilon\r\n */\r\n public static AreClose(quat0: DeepImmutable<Quaternion>, quat1: DeepImmutable<Quaternion>, epsilon: number = 0.1): boolean {\r\n const dot = Quaternion.Dot(quat0, quat1);\r\n\r\n return 1 - dot * dot <= epsilon;\r\n }\r\n\r\n /**\r\n * Smooth interpolation between two quaternions using Slerp\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#93\r\n * @param source source quaternion\r\n * @param goal goal quaternion\r\n * @param deltaTime current interpolation frame\r\n * @param lerpTime total interpolation time\r\n * @param result the smoothed quaternion\r\n * @returns the smoothed quaternion\r\n */\r\n public static SmoothToRef<T extends Quaternion>(source: Quaternion, goal: Quaternion, deltaTime: number, lerpTime: number, result: T): T {\r\n let slerp = lerpTime === 0 ? 1 : deltaTime / lerpTime;\r\n slerp = Clamp(slerp, 0, 1);\r\n\r\n Quaternion.SlerpToRef(source, goal, slerp, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates an empty quaternion\r\n * @returns a new quaternion set to (0.0, 0.0, 0.0)\r\n */\r\n public static Zero(): Quaternion {\r\n return new Quaternion(0.0, 0.0, 0.0, 0.0);\r\n }\r\n\r\n /**\r\n * Inverse a given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#103\r\n * @param q defines the source quaternion\r\n * @returns a new quaternion as the inverted current quaternion\r\n */\r\n public static Inverse(q: DeepImmutable<Quaternion>): Quaternion {\r\n return new Quaternion(-q._x, -q._y, -q._z, q._w);\r\n }\r\n\r\n /**\r\n * Inverse a given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#104\r\n * @param q defines the source quaternion\r\n * @param result the quaternion the result will be stored in\r\n * @returns the result quaternion\r\n */\r\n public static InverseToRef<T extends Quaternion>(q: Quaternion, result: T): T {\r\n result.set(-q._x, -q._y, -q._z, q._w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates an identity quaternion\r\n * @returns the identity quaternion\r\n */\r\n public static Identity(): Quaternion {\r\n return new Quaternion(0.0, 0.0, 0.0, 1.0);\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the given quaternion is identity\r\n * @param quaternion defines the quaternion to check\r\n * @returns true if the quaternion is identity\r\n */\r\n public static IsIdentity(quaternion: DeepImmutable<Quaternion>): boolean {\r\n return quaternion && quaternion._x === 0 && quaternion._y === 0 && quaternion._z === 0 && quaternion._w === 1;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from a rotation around an axis\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#72\r\n * @param axis defines the axis to use\r\n * @param angle defines the angle to use\r\n * @returns a new quaternion created from the given axis (Vector3) and angle in radians (float)\r\n */\r\n public static RotationAxis(axis: DeepImmutable<Vector3>, angle: number): Quaternion {\r\n return Quaternion.RotationAxisToRef(axis, angle, new Quaternion());\r\n }\r\n\r\n /**\r\n * Creates a rotation around an axis and stores it into the given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#73\r\n * @param axis defines the axis to use\r\n * @param angle defines the angle to use\r\n * @param result defines the target quaternion\r\n * @returns the target quaternion\r\n */\r\n public static RotationAxisToRef<T extends Quaternion>(axis: DeepImmutable<Vector3>, angle: number, result: T): T {\r\n result._w = Math.cos(angle / 2);\r\n const sinByLength = Math.sin(angle / 2) / axis.length();\r\n result._x = axis._x * sinByLength;\r\n result._y = axis._y * sinByLength;\r\n result._z = axis._z * sinByLength;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new quaternion from data stored into an array\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#63\r\n * @param array defines the data source\r\n * @param offset defines the offset in the source array where the data starts\r\n * @returns a new quaternion\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset?: number): Quaternion {\r\n if (!offset) {\r\n offset = 0;\r\n }\r\n return new Quaternion(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);\r\n }\r\n\r\n /**\r\n * Updates the given quaternion \"result\" from the starting index of the given array.\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#64\r\n * @param array the array to pull values from\r\n * @param offset the offset into the array to start at\r\n * @param result the quaternion to store the result in\r\n * @returns result input\r\n */\r\n public static FromArrayToRef<T extends Quaternion>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T {\r\n result._x = array[offset];\r\n result._y = array[offset + 1];\r\n result._z = array[offset + 2];\r\n result._w = array[offset + 3];\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given quaternion \"result\" with the given floats.\r\n * @param x defines the x coordinate of the source\r\n * @param y defines the y coordinate of the source\r\n * @param z defines the z coordinate of the source\r\n * @param w defines the w coordinate of the source\r\n * @param result defines the quaternion where to store the result\r\n * @returns the result quaternion\r\n */\r\n public static FromFloatsToRef<T extends Quaternion = Quaternion>(x: number, y: number, z: number, w: number, result: T): T {\r\n result.copyFromFloats(x, y, z, w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Create a quaternion from Euler rotation angles\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#33\r\n * @param x Pitch\r\n * @param y Yaw\r\n * @param z Roll\r\n * @returns the new Quaternion\r\n */\r\n public static FromEulerAngles(x: number, y: number, z: number): Quaternion {\r\n const q = new Quaternion();\r\n Quaternion.RotationYawPitchRollToRef(y, x, z, q);\r\n return q;\r\n }\r\n\r\n /**\r\n * Updates a quaternion from Euler rotation angles\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#34\r\n * @param x Pitch\r\n * @param y Yaw\r\n * @param z Roll\r\n * @param result the quaternion to store the result\r\n * @returns the updated quaternion\r\n */\r\n public static FromEulerAnglesToRef<T extends Quaternion>(x: number, y: number, z: number, result: T): T {\r\n Quaternion.RotationYawPitchRollToRef(y, x, z, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Create a quaternion from Euler rotation vector\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#35\r\n * @param vec the Euler vector (x Pitch, y Yaw, z Roll)\r\n * @returns the new Quaternion\r\n */\r\n public static FromEulerVector(vec: DeepImmutable<Vector3>): Quaternion {\r\n const q = new Quaternion();\r\n Quaternion.RotationYawPitchRollToRef(vec._y, vec._x, vec._z, q);\r\n return q;\r\n }\r\n\r\n /**\r\n * Updates a quaternion from Euler rotation vector\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#36\r\n * @param vec the Euler vector (x Pitch, y Yaw, z Roll)\r\n * @param result the quaternion to store the result\r\n * @returns the updated quaternion\r\n */\r\n public static FromEulerVectorToRef<T extends Quaternion>(vec: DeepImmutable<Vector3>, result: T): T {\r\n Quaternion.RotationYawPitchRollToRef(vec._y, vec._x, vec._z, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates a quaternion so that it rotates vector vecFrom to vector vecTo\r\n * Example Playground - https://playground.babylonjs.com/#L49EJ7#70\r\n * @param vecFrom defines the direction vector from which to rotate\r\n * @param vecTo defines the direction vector to which to rotate\r\n * @param result the quaternion to store the result\r\n * @param epsilon defines the minimal dot value to define vecs as opposite. Default: `BABYLON.Epsilon`\r\n * @returns the updated quaternion\r\n */\r\n public static FromUnitVectorsToRef<T extends Quaternion>(vecFrom: DeepImmutable<Vector3>, vecTo: DeepImmutable<Vector3>, result: T, epsilon = Epsilon): T {\r\n const r = Vector3.Dot(vecFrom, vecTo) + 1;\r\n\r\n if (r < epsilon) {\r\n if (Math.abs(vecFrom.x) > Math.abs(vecFrom.z)) {\r\n result.set(-vecFrom.y, vecFrom.x, 0, 0);\r\n } else {\r\n result.set(0, -vecFrom.z, vecFrom.y, 0);\r\n }\r\n } else {\r\n Vector3.CrossToRef(vecFrom, vecTo, TmpVectors.Vector3[0]);\r\n result.set(TmpVectors.Vector3[0].x, TmpVectors.Vector3[0].y, TmpVectors.Vector3[0].z, r);\r\n }\r\n\r\n return result.normalize();\r\n }\r\n\r\n /**\r\n * Creates a new quaternion from the given Euler float angles (y, x, z)\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#77\r\n * @param yaw defines the rotation around Y axis\r\n * @param pitch defines the rotation around X axis\r\n * @param roll defines the rotation around Z axis\r\n * @returns the new quaternion\r\n */\r\n public static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Quaternion {\r\n const q = new Quaternion();\r\n Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, q);\r\n return q;\r\n }\r\n\r\n /**\r\n * Creates a new rotation from the given Euler float angles (y, x, z) and stores it in the target quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#561\r\n * @param yaw defines the rotation around Y axis\r\n * @param pitch defines the rotation around X axis\r\n * @param roll defines the rotation around Z axis\r\n * @param result defines the target quaternion\r\n * @returns result input\r\n */\r\n public static RotationYawPitchRollToRef<T extends Quaternion>(yaw: number, pitch: number, roll: number, result: T): T {\r\n // Produces a quaternion from Euler angles in the y-x-z orientation\r\n const halfRoll = roll * 0.5;\r\n const halfPitch = pitch * 0.5;\r\n const halfYaw = yaw * 0.5;\r\n\r\n const sinRoll = Math.sin(halfRoll);\r\n const cosRoll = Math.cos(halfRoll);\r\n const sinPitch = Math.sin(halfPitch);\r\n const cosPitch = Math.cos(halfPitch);\r\n const sinYaw = Math.sin(halfYaw);\r\n const cosYaw = Math.cos(halfYaw);\r\n\r\n result._x = cosYaw * sinPitch * cosRoll + sinYaw * cosPitch * sinRoll;\r\n result._y = sinYaw * cosPitch * cosRoll - cosYaw * sinPitch * sinRoll;\r\n result._z = cosYaw * cosPitch * sinRoll - sinYaw * sinPitch * cosRoll;\r\n result._w = cosYaw * cosPitch * cosRoll + sinYaw * sinPitch * sinRoll;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#68\r\n * @param alpha defines the rotation around first axis\r\n * @param beta defines the rotation around second axis\r\n * @param gamma defines the rotation around third axis\r\n * @returns the new quaternion\r\n */\r\n public static RotationAlphaBetaGamma(alpha: number, beta: number, gamma: number): Quaternion {\r\n const result = new Quaternion();\r\n Quaternion.RotationAlphaBetaGammaToRef(alpha, beta, gamma, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation and stores it in the target quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#69\r\n * @param alpha defines the rotation around first axis\r\n * @param beta defines the rotation around second axis\r\n * @param gamma defines the rotation around third axis\r\n * @param result defines the target quaternion\r\n * @returns result input\r\n */\r\n public static RotationAlphaBetaGammaToRef<T extends Quaternion>(alpha: number, beta: number, gamma: number, result: T): T {\r\n // Produces a quaternion from Euler angles in the z-x-z orientation\r\n const halfGammaPlusAlpha = (gamma + alpha) * 0.5;\r\n const halfGammaMinusAlpha = (gamma - alpha) * 0.5;\r\n const halfBeta = beta * 0.5;\r\n\r\n result._x = Math.cos(halfGammaMinusAlpha) * Math.sin(halfBeta);\r\n result._y = Math.sin(halfGammaMinusAlpha) * Math.sin(halfBeta);\r\n result._z = Math.sin(halfGammaPlusAlpha) * Math.cos(halfBeta);\r\n result._w = Math.cos(halfGammaPlusAlpha) * Math.cos(halfBeta);\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new quaternion containing the rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation)\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#75\r\n * @param axis1 defines the first axis\r\n * @param axis2 defines the second axis\r\n * @param axis3 defines the third axis\r\n * @returns the new quaternion\r\n */\r\n public static RotationQuaternionFromAxis(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>): Quaternion {\r\n const quat = new Quaternion(0.0, 0.0, 0.0, 0.0);\r\n Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat);\r\n return quat;\r\n }\r\n\r\n /**\r\n * Creates a rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation) and stores it in the target quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#76\r\n * @param axis1 defines the first axis\r\n * @param axis2 defines the second axis\r\n * @param axis3 defines the third axis\r\n * @param ref defines the target quaternion\r\n * @returns result input\r\n */\r\n public static RotationQuaternionFromAxisToRef<T extends Quaternion>(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref: T): T {\r\n const rotMat = MathTmp.Matrix[0];\r\n axis1 = axis1.normalizeToRef(MathTmp.Vector3[0]);\r\n axis2 = axis2.normalizeToRef(MathTmp.Vector3[1]);\r\n axis3 = axis3.normalizeToRef(MathTmp.Vector3[2]);\r\n Matrix.FromXYZAxesToRef(axis1, axis2, axis3, rotMat);\r\n Quaternion.FromRotationMatrixToRef(rotMat, ref);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like \"up\".\r\n * This function works in left handed mode\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#96\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @returns A new quaternion oriented toward the specified forward and up.\r\n */\r\n public static FromLookDirectionLH(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Quaternion {\r\n const quat = new Quaternion();\r\n Quaternion.FromLookDirectionLHToRef(forward, up, quat);\r\n return quat;\r\n }\r\n\r\n /**\r\n * Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like \"up\", and stores it in the target quaternion.\r\n * This function works in left handed mode\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#97\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @param ref defines the target quaternion.\r\n * @returns result input\r\n */\r\n public static FromLookDirectionLHToRef<T extends Quaternion>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref: T): T {\r\n const rotMat = MathTmp.Matrix[0];\r\n Matrix.LookDirectionLHToRef(forward, up, rotMat);\r\n Quaternion.FromRotationMatrixToRef(rotMat, ref);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like \"up\".\r\n * This function works in right handed mode\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#98\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @returns A new quaternion oriented toward the specified forward and up.\r\n */\r\n public static FromLookDirectionRH(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Quaternion {\r\n const quat = new Quaternion();\r\n Quaternion.FromLookDirectionRHToRef(forward, up, quat);\r\n return quat;\r\n }\r\n\r\n /**\r\n * Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like \"up\", and stores it in the target quaternion.\r\n * This function works in right handed mode\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#105\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @param ref defines the target quaternion.\r\n * @returns result input\r\n */\r\n public static FromLookDirectionRHToRef<T extends Quaternion>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref: T): T {\r\n const rotMat = MathTmp.Matrix[0];\r\n Matrix.LookDirectionRHToRef(forward, up, rotMat);\r\n return Quaternion.FromRotationMatrixToRef(rotMat, ref);\r\n }\r\n\r\n /**\r\n * Interpolates between two quaternions\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#79\r\n * @param left defines first quaternion\r\n * @param right defines second quaternion\r\n * @param amount defines the gradient to use\r\n * @returns the new interpolated quaternion\r\n */\r\n public static Slerp(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>, amount: number): Quaternion {\r\n const result = Quaternion.Identity();\r\n\r\n Quaternion.SlerpToRef(left, right, amount, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Interpolates between two quaternions and stores it into a target quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#92\r\n * @param left defines first quaternion\r\n * @param right defines second quaternion\r\n * @param amount defines the gradient to use\r\n * @param result defines the target quaternion\r\n * @returns result input\r\n */\r\n public static SlerpToRef<T extends Quaternion>(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>, amount: number, result: T): T {\r\n let num2;\r\n let num3;\r\n let num4 = left._x * right._x + left._y * right._y + left._z * right._z + left._w * right._w;\r\n let flag = false;\r\n\r\n if (num4 < 0) {\r\n flag = true;\r\n num4 = -num4;\r\n }\r\n\r\n if (num4 > 0.999999) {\r\n num3 = 1 - amount;\r\n num2 = flag ? -amount : amount;\r\n } else {\r\n const num5 = Math.acos(num4);\r\n const num6 = 1.0 / Math.sin(num5);\r\n num3 = Math.sin((1.0 - amount) * num5) * num6;\r\n num2 = flag ? -Math.sin(amount * num5) * num6 : Math.sin(amount * num5) * num6;\r\n }\r\n\r\n result._x = num3 * left._x + num2 * right._x;\r\n result._y = num3 * left._y + num2 * right._y;\r\n result._z = num3 * left._z + num2 * right._z;\r\n result._w = num3 * left._w + num2 * right._w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Interpolate between two quaternions using Hermite interpolation\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#47\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#hermite-quaternion-spline\r\n * @param value1 defines first quaternion\r\n * @param tangent1 defines the incoming tangent\r\n * @param value2 defines second quaternion\r\n * @param tangent2 defines the outgoing tangent\r\n * @param amount defines the target quaternion\r\n * @returns the new interpolated quaternion\r\n */\r\n public static Hermite(\r\n value1: DeepImmutable<Quaternion>,\r\n tangent1: DeepImmutable<Quaternion>,\r\n value2: DeepImmutable<Quaternion>,\r\n tangent2: DeepImmutable<Quaternion>,\r\n amount: number\r\n ): Quaternion {\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 x = value1._x * part1 + value2._x * part2 + tangent1._x * part3 + tangent2._x * part4;\r\n const y = value1._y * part1 + value2._y * part2 + tangent1._y * part3 + tangent2._y * part4;\r\n const z = value1._z * part1 + value2._z * part2 + tangent1._z * part3 + tangent2._z * part4;\r\n const w = value1._w * part1 + value2._w * part2 + tangent1._w * part3 + tangent2._w * part4;\r\n return new Quaternion(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Returns a new Quaternion which is the 1st derivative of the Hermite spline defined by the quaternions \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#48\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<Quaternion>,\r\n tangent1: DeepImmutable<Quaternion>,\r\n value2: DeepImmutable<Quaternion>,\r\n tangent2: DeepImmutable<Quaternion>,\r\n time: number\r\n ): Quaternion {\r\n const result = new Quaternion();\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 Quaternion with the 1st derivative of the Hermite spline defined by the quaternions \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#49\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 * @returns result input\r\n */\r\n public static Hermite1stDerivativeToRef<T extends Quaternion>(\r\n value1: DeepImmutable<Quaternion>,\r\n tangent1: DeepImmutable<Quaternion>,\r\n value2: DeepImmutable<Quaternion>,\r\n tangent2: DeepImmutable<Quaternion>,\r\n time: number,\r\n result: T\r\n ): T {\r\n const t2 = time * time;\r\n\r\n result._x = (t2 - time) * 6 * value1._x + (3 * t2 - 4 * time + 1) * tangent1._x + (-t2 + time) * 6 * value2._x + (3 * t2 - 2 * time) * tangent2._x;\r\n result._y = (t2 - time) * 6 * value1._y + (3 * t2 - 4 * time + 1) * tangent1._y + (-t2 + time) * 6 * value2._y + (3 * t2 - 2 * time) * tangent2._y;\r\n result._z = (t2 - time) * 6 * value1._z + (3 * t2 - 4 * time + 1) * tangent1._z + (-t2 + time) * 6 * value2._z + (3 * t2 - 2 * time) * tangent2._z;\r\n result._w = (t2 - time) * 6 * value1._w + (3 * t2 - 4 * time + 1) * tangent1._w + (-t2 + time) * 6 * value2._w + (3 * t2 - 2 * time) * tangent2._w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Quaternion as the normalization of the given Quaternion\r\n * @param quat defines the Quaternion to normalize\r\n * @returns the new Quaternion\r\n */\r\n public static Normalize(quat: DeepImmutable<Quaternion>): Quaternion {\r\n const result = Quaternion.Zero();\r\n Quaternion.NormalizeToRef(quat, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given Quaternion \"result\" with the normalization of the given first Quaternion\r\n * @param quat defines the Quaternion to normalize\r\n * @param result defines the Quaternion where to store the result\r\n * @returns result input\r\n */\r\n public static NormalizeToRef<T extends Quaternion>(quat: DeepImmutable<Quaternion>, result: T): T {\r\n quat.normalizeToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Quaternion set with the coordinates of \"value\", if the quaternion \"value\" is in the cube defined by the quaternions \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @returns the new Quaternion\r\n */\r\n public static Clamp(value: DeepImmutable<Quaternion>, min: DeepImmutable<Quaternion>, max: DeepImmutable<Quaternion>): Quaternion {\r\n const result = new Quaternion();\r\n Quaternion.ClampToRef(value, min, max, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given quaternion \"result\" with the coordinates of \"value\", if the quaternion \"value\" is in the cube defined by the quaternions \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @param result defines the Quaternion where to store the result\r\n * @returns result input\r\n */\r\n public static ClampToRef<T extends Quaternion>(value: DeepImmutable<Quaternion>, min: DeepImmutable<Quaternion>, max: DeepImmutable<Quaternion>, result: T): T {\r\n return result.copyFromFloats(Clamp(value.x, min.x, max.x), Clamp(value.y, min.y, max.y), Clamp(value.z, min.z, max.z), Clamp(value.w, min.w, max.w));\r\n }\r\n\r\n /**\r\n * Returns a new Quaternion with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @returns a Quaternion with random values between min and max\r\n */\r\n public static Random(min: number = 0, max: number = 1): Quaternion {\r\n return new Quaternion(RandomRange(min, max), RandomRange(min, max), RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Sets a Quaternion with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @param ref the ref to store the values in\r\n * @returns the ref with random values between min and max\r\n */\r\n public static RandomToRef<T extends Quaternion>(min: number = 0, max: number = 1, ref: T): T {\r\n return ref.copyFromFloats(RandomRange(min, max), RandomRange(min, max), RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Do not use\r\n * @internal\r\n */\r\n public static Minimize(): Quaternion {\r\n throw new ReferenceError(\"Quaternion.Minimize does not make sense\");\r\n }\r\n\r\n /**\r\n * Do not use\r\n * @internal\r\n */\r\n public static Maximize(): Quaternion {\r\n throw new ReferenceError(\"Quaternion.Maximize does not make sense\");\r\n }\r\n\r\n /**\r\n * Returns the distance (float) between the quaternions \"value1\" and \"value2\".\r\n * @param value1 value to calulate the distance between\r\n * @param value2 value to calulate the distance between\r\n * @returns the distance between the two quaternions\r\n */\r\n public static Distance(value1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>): number {\r\n return Math.sqrt(Quaternion.DistanceSquared(value1, value2));\r\n }\r\n\r\n /**\r\n * Returns the squared distance (float) between the quaternions \"value1\" and \"value2\".\r\n * @param value1 value to calulate the distance between\r\n * @param value2 value to calulate the distance between\r\n * @returns the distance between the two quaternions squared\r\n */\r\n public static DistanceSquared(value1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>): number {\r\n const x = value1.x - value2.x;\r\n const y = value1.y - value2.y;\r\n const z = value1.z - value2.z;\r\n const w = value1.w - value2.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Returns a new Quaternion located at the center between the quaternions \"value1\" and \"value2\".\r\n * @param value1 value to calulate the center between\r\n * @param value2 value to calulate the center between\r\n * @returns the center between the two quaternions\r\n */\r\n public static Center(value1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>): Quaternion {\r\n return Quaternion.CenterToRef(value1, value2, Quaternion.Zero());\r\n }\r\n\r\n /**\r\n * Gets the center of the quaternions \"value1\" and \"value2\" and stores the result in the quaternion \"ref\"\r\n * @param value1 defines first quaternion\r\n * @param value2 defines second quaternion\r\n * @param ref defines third quaternion\r\n * @returns ref\r\n */\r\n public static CenterToRef<T extends Quaternion>(value1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, ref: T): T {\r\n return ref.copyFromFloats((value1.x + value2.x) / 2, (value1.y + value2.y) / 2, (value1.z + value2.z) / 2, (value1.w + value2.w) / 2);\r\n }\r\n}\r\n\r\nQuaternion satisfies TensorStatic<Quaternion, Quaternion>;\r\nObject.defineProperties(Quaternion.prototype, {\r\n dimension: { value: [4] },\r\n rank: { value: 1 },\r\n});\r\n\r\n/**\r\n * Class used to store matrix data (4x4)\r\n * Note on matrix definitions in Babylon.js for setting values directly\r\n * rather than using one of the methods available.\r\n * Matrix size is given by rows x columns.\r\n * A Vector3 is a 1 X 3 matrix [x, y, z].\r\n *\r\n * In Babylon.js multiplying a 1 x 3 matrix by a 4 x 4 matrix\r\n * is done using BABYLON.Vector4.TransformCoordinates(Vector3, Matrix).\r\n * and extending the passed Vector3 to a Vector4, V = [x, y, z, 1].\r\n * Let M be a matrix with elements m(row, column), so that\r\n * m(2, 3) is the element in row 2 column 3 of M.\r\n *\r\n * Multiplication is of the form VM and has the resulting Vector4\r\n * VM = [xm(0, 0) + ym(1, 0) + zm(2, 0) + m(3, 0), xm(0, 1) + ym(1, 1) + zm(2, 1) + m(3, 1), xm(0, 2) + ym(1, 2) + zm(2, 2) + m(3, 2), xm(0, 3) + ym(1, 3) + zm(2, 3) + m(3, 3)].\r\n * On the web you will find many examples that use the opposite convention of MV,\r\n * in which case to make use of the examples you will need to transpose the matrix.\r\n *\r\n * Example Playground - Overview Linear Algebra - https://playground.babylonjs.com/#AV9X17\r\n * Example Playground - Overview Transformation - https://playground.babylonjs.com/#AV9X17#1\r\n * Example Playground - Overview Projection - https://playground.babylonjs.com/#AV9X17#2\r\n */\r\nexport class Matrix implements Tensor<Tuple<Tuple<number, 4>, 4>, Matrix>, IMatrixLike {\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n declare public readonly dimension: Readonly<[4, 4]>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n declare public readonly rank: 2;\r\n\r\n /**\r\n * Gets the precision of matrix computations\r\n */\r\n public static get Use64Bits(): boolean {\r\n return PerformanceConfigurator.MatrixUse64Bits;\r\n }\r\n\r\n private static _IdentityReadOnly = Matrix.Identity() as DeepImmutable<Matrix>;\r\n\r\n private _isIdentity = false;\r\n private _isIdentityDirty = true;\r\n private _isIdentity3x2 = true;\r\n private _isIdentity3x2Dirty = true;\r\n /**\r\n * Gets the update flag of the matrix which is an unique number for the matrix.\r\n * It will be incremented every time the matrix data change.\r\n * You can use it to speed the comparison between two versions of the same matrix.\r\n */\r\n public updateFlag: number = -1;\r\n\r\n private readonly _m: Tuple<number, 16>;\r\n\r\n /**\r\n * Gets the internal data of the matrix\r\n */\r\n public get m(): DeepImmutable<Tuple<number, 16>> {\r\n return this._m;\r\n }\r\n\r\n /**\r\n * Update the updateFlag to indicate that the matrix has been updated\r\n */\r\n public markAsUpdated() {\r\n this.updateFlag = MatrixManagement._UpdateFlagSeed++;\r\n this._isIdentity = false;\r\n this._isIdentity3x2 = false;\r\n this._isIdentityDirty = true;\r\n this._isIdentity3x2Dirty = true;\r\n }\r\n\r\n private _updateIdentityStatus(isIdentity: boolean, isIdentityDirty: boolean = false, isIdentity3x2: boolean = false, isIdentity3x2Dirty: boolean = true) {\r\n this._isIdentity = isIdentity;\r\n this._isIdentity3x2 = isIdentity || isIdentity3x2;\r\n this._isIdentityDirty = this._isIdentity ? false : isIdentityDirty;\r\n this._isIdentity3x2Dirty = this._isIdentity3x2 ? false : isIdentity3x2Dirty;\r\n }\r\n\r\n /**\r\n * Creates an empty matrix (filled with zeros)\r\n */\r\n public constructor() {\r\n if (PerformanceConfigurator.MatrixTrackPrecisionChange) {\r\n PerformanceConfigurator.MatrixTrackedMatrices!.push(this);\r\n }\r\n\r\n this._m = new PerformanceConfigurator.MatrixCurrentType(16);\r\n\r\n this.markAsUpdated();\r\n }\r\n\r\n // Properties\r\n\r\n /**\r\n * Check if the current matrix is identity\r\n * @returns true is the matrix is the identity matrix\r\n */\r\n public isIdentity(): boolean {\r\n if (this._isIdentityDirty) {\r\n this._isIdentityDirty = false;\r\n const m = this._m;\r\n this._isIdentity =\r\n m[0] === 1.0 &&\r\n m[1] === 0.0 &&\r\n m[2] === 0.0 &&\r\n m[3] === 0.0 &&\r\n m[4] === 0.0 &&\r\n m[5] === 1.0 &&\r\n m[6] === 0.0 &&\r\n m[7] === 0.0 &&\r\n m[8] === 0.0 &&\r\n m[9] === 0.0 &&\r\n m[10] === 1.0 &&\r\n m[11] === 0.0 &&\r\n m[12] === 0.0 &&\r\n m[13] === 0.0 &&\r\n m[14] === 0.0 &&\r\n m[15] === 1.0;\r\n }\r\n\r\n return this._isIdentity;\r\n }\r\n\r\n /**\r\n * Check if the current matrix is identity as a texture matrix (3x2 store in 4x4)\r\n * @returns true is the matrix is the identity matrix\r\n */\r\n public isIdentityAs3x2(): boolean {\r\n if (this._isIdentity3x2Dirty) {\r\n this._isIdentity3x2Dirty = false;\r\n if (this._m[0] !== 1.0 || this._m[5] !== 1.0 || this._m[15] !== 1.0) {\r\n this._isIdentity3x2 = false;\r\n } else if (\r\n this._m[1] !== 0.0 ||\r\n this._m[2] !== 0.0 ||\r\n this._m[3] !== 0.0 ||\r\n this._m[4] !== 0.0 ||\r\n this._m[6] !== 0.0 ||\r\n this._m[7] !== 0.0 ||\r\n this._m[8] !== 0.0 ||\r\n this._m[9] !== 0.0 ||\r\n this._m[10] !== 0.0 ||\r\n this._m[11] !== 0.0 ||\r\n this._m[12] !== 0.0 ||\r\n this._m[13] !== 0.0 ||\r\n this._m[14] !== 0.0\r\n ) {\r\n this._isIdentity3x2 = false;\r\n } else {\r\n this._isIdentity3x2 = true;\r\n }\r\n }\r\n\r\n return this._isIdentity3x2;\r\n }\r\n\r\n /**\r\n * Gets the determinant of the matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#34\r\n * @returns the matrix determinant\r\n */\r\n public determinant(): number {\r\n if (this._isIdentity === true) {\r\n return 1;\r\n }\r\n\r\n const m = this._m;\r\n const m00 = m[0],\r\n m01 = m[1],\r\n m02 = m[2],\r\n m03 = m[3];\r\n const m10 = m[4],\r\n m11 = m[5],\r\n m12 = m[6],\r\n m13 = m[7];\r\n const m20 = m[8],\r\n m21 = m[9],\r\n m22 = m[10],\r\n m23 = m[11];\r\n const m30 = m[12],\r\n m31 = m[13],\r\n m32 = m[14],\r\n m33 = m[15];\r\n // https://en.wikipedia.org/wiki/Laplace_expansion\r\n // to compute the deterrminant of a 4x4 Matrix we compute the cofactors of any row or column,\r\n // then we multiply each Cofactor by its corresponding matrix value and sum them all to get the determinant\r\n // Cofactor(i, j) = sign(i,j) * det(Minor(i, j))\r\n // where\r\n // - sign(i,j) = (i+j) % 2 === 0 ? 1 : -1\r\n // - Minor(i, j) is the 3x3 matrix we get by removing row i and column j from current Matrix\r\n //\r\n // Here we do that for the 1st row.\r\n\r\n const det_22_33 = m22 * m33 - m32 * m23;\r\n const det_21_33 = m21 * m33 - m31 * m23;\r\n const det_21_32 = m21 * m32 - m31 * m22;\r\n const det_20_33 = m20 * m33 - m30 * m23;\r\n const det_20_32 = m20 * m32 - m22 * m30;\r\n const det_20_31 = m20 * m31 - m30 * m21;\r\n const cofact_00 = +(m11 * det_22_33 - m12 * det_21_33 + m13 * det_21_32);\r\n const cofact_01 = -(m10 * det_22_33 - m12 * det_20_33 + m13 * det_20_32);\r\n const cofact_02 = +(m10 * det_21_33 - m11 * det_20_33 + m13 * det_20_31);\r\n const cofact_03 = -(m10 * det_21_32 - m11 * det_20_32 + m12 * det_20_31);\r\n return m00 * cofact_00 + m01 * cofact_01 + m02 * cofact_02 + m03 * cofact_03;\r\n }\r\n\r\n // Methods\r\n\r\n /**\r\n * Gets a string with the Matrix values\r\n * @returns a string with the Matrix values\r\n */\r\n public toString(): string {\r\n return `{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}\\n${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}\\n${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}\\n${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`;\r\n }\r\n\r\n /**\r\n * Returns the matrix as a Float32Array or Array<number>\r\n * @deprecated Use asArray\r\n */\r\n public toArray(): FloatArray;\r\n\r\n /**\r\n * Stores the matrix in a Float32Array or Array<number>\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#49\r\n * @param array The destination array\r\n * @param index The destination index to start ay\r\n * @returns the matrix\r\n */\r\n public toArray(array: FloatArray, index: number): this;\r\n public toArray(array: Nullable<FloatArray> = null, index: number = 0): this | FloatArray {\r\n if (!array) {\r\n return this._m;\r\n }\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n array[index + i] = m[i];\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns the matrix as a Float32Array or Array<number>\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#114\r\n * @returns the matrix underlying array.\r\n */\r\n public asArray(): Tuple<number, 16> {\r\n return this._m;\r\n }\r\n\r\n public fromArray(array: FloatArray, index: number = 0): this {\r\n return Matrix.FromArrayToRef(array, index, this);\r\n }\r\n\r\n public copyFromFloats(...floats: Tuple<number, 16>): this {\r\n return Matrix.FromArrayToRef(floats, 0, this);\r\n }\r\n\r\n public set(...values: Tuple<number, 16>): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = values[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public setAll(value: number): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = value;\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the current matrix in place\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#118\r\n * @returns the current inverted matrix\r\n */\r\n public invert(): this {\r\n this.invertToRef(this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets all the matrix elements to zero\r\n * @returns the current matrix\r\n */\r\n public reset(): this {\r\n Matrix.FromValuesToRef(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, this);\r\n this._updateIdentityStatus(false);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the current matrix with a second one\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#44\r\n * @param other defines the matrix to add\r\n * @returns a new matrix as the addition of the current matrix and the given one\r\n */\r\n public add(other: DeepImmutable<Matrix>): Matrix {\r\n const result = new Matrix();\r\n this.addToRef(other, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given matrix \"result\" to the addition of the current matrix and the given one\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#45\r\n * @param other defines the matrix to add\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public addToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T {\r\n const m = this._m;\r\n const resultM = result._m;\r\n const otherM = other.m;\r\n for (let index = 0; index < 16; index++) {\r\n resultM[index] = m[index] + otherM[index];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Adds in place the given matrix to the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#46\r\n * @param other defines the second operand\r\n * @returns the current updated matrix\r\n */\r\n public addToSelf(other: DeepImmutable<Matrix>): this {\r\n const m = this._m;\r\n const otherM = other.m;\r\n m[0] += otherM[0];\r\n m[1] += otherM[1];\r\n m[2] += otherM[2];\r\n m[3] += otherM[3];\r\n m[4] += otherM[4];\r\n m[5] += otherM[5];\r\n m[6] += otherM[6];\r\n m[7] += otherM[7];\r\n m[8] += otherM[8];\r\n m[9] += otherM[9];\r\n m[10] += otherM[10];\r\n m[11] += otherM[11];\r\n m[12] += otherM[12];\r\n m[13] += otherM[13];\r\n m[14] += otherM[14];\r\n m[15] += otherM[15];\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public addInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] += otherM[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public addInPlaceFromFloats(...floats: Tuple<number, 16>): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] += floats[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public subtract(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] -= otherM[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public subtractToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T {\r\n const m = this._m,\r\n otherM = other.m,\r\n resultM = result._m;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = m[i] - otherM[i];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n public subtractInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] -= otherM[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public subtractFromFloats(...floats: Tuple<number, 16>): Matrix {\r\n return this.subtractFromFloatsToRef(...floats, new Matrix());\r\n }\r\n\r\n public subtractFromFloatsToRef<T extends Matrix>(...args: [...Tuple<number, 16>, T]): T {\r\n const result = args.pop() as T,\r\n m = this._m,\r\n resultM = result._m,\r\n values = args as unknown as Tuple<number, 16>;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = m[i] - values[i];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given matrix to the current inverted Matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#119\r\n * @param other defines the target matrix\r\n * @returns result input\r\n */\r\n public invertToRef<T extends Matrix>(other: T): T {\r\n if (this._isIdentity === true) {\r\n Matrix.IdentityToRef(other);\r\n return other;\r\n }\r\n\r\n if (InvertMatrixToArray(this, other.asArray())) {\r\n other.markAsUpdated();\r\n } else {\r\n other.copyFrom(this);\r\n }\r\n return other;\r\n }\r\n\r\n /**\r\n * add a value at the specified position in the current Matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#47\r\n * @param index the index of the value within the matrix. between 0 and 15.\r\n * @param value the value to be added\r\n * @returns the current updated matrix\r\n */\r\n public addAtIndex(index: number, value: number): this {\r\n this._m[index] += value;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * mutiply the specified position in the current Matrix by a value\r\n * @param index the index of the value within the matrix. between 0 and 15.\r\n * @param value the value to be added\r\n * @returns the current updated matrix\r\n */\r\n public multiplyAtIndex(index: number, value: number): this {\r\n this._m[index] *= value;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Inserts the translation vector (using 3 floats) in the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#120\r\n * @param x defines the 1st component of the translation\r\n * @param y defines the 2nd component of the translation\r\n * @param z defines the 3rd component of the translation\r\n * @returns the current updated matrix\r\n */\r\n public setTranslationFromFloats(x: number, y: number, z: number): this {\r\n this._m[12] = x;\r\n this._m[13] = y;\r\n this._m[14] = z;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the translation vector (using 3 floats) in the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#20\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#48\r\n * @param x defines the 1st component of the translation\r\n * @param y defines the 2nd component of the translation\r\n * @param z defines the 3rd component of the translation\r\n * @returns the current updated matrix\r\n */\r\n public addTranslationFromFloats(x: number, y: number, z: number): this {\r\n this._m[12] += x;\r\n this._m[13] += y;\r\n this._m[14] += z;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Inserts the translation vector in the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#121\r\n * @param vector3 defines the translation to insert\r\n * @returns the current updated matrix\r\n */\r\n public setTranslation(vector3: DeepImmutable<Vector3>): this {\r\n return this.setTranslationFromFloats(vector3._x, vector3._y, vector3._z);\r\n }\r\n\r\n /**\r\n * Gets the translation value of the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#122\r\n * @returns a new Vector3 as the extracted translation from the matrix\r\n */\r\n public getTranslation(): Vector3 {\r\n return new Vector3(this._m[12], this._m[13], this._m[14]);\r\n }\r\n\r\n /**\r\n * Fill a Vector3 with the extracted translation from the matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#123\r\n * @param result defines the Vector3 where to store the translation\r\n * @returns the current matrix\r\n */\r\n public getTranslationToRef<T extends Vector3>(result: T): T {\r\n result.x = this._m[12];\r\n result.y = this._m[13];\r\n result.z = this._m[14];\r\n return result;\r\n }\r\n\r\n /**\r\n * Remove rotation and scaling part from the matrix\r\n * @returns the updated matrix\r\n */\r\n public removeRotationAndScaling(): this {\r\n const m = this.m;\r\n Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, m[12], m[13], m[14], m[15], this);\r\n this._updateIdentityStatus(m[12] === 0 && m[13] === 0 && m[14] === 0 && m[15] === 1);\r\n return this;\r\n }\r\n\r\n /**\r\n * Copy the current matrix from the given one\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#21\r\n * @param other defines the source matrix\r\n * @returns the current updated matrix\r\n */\r\n public copyFrom(other: DeepImmutable<Matrix>): this {\r\n other.copyToArray(this._m);\r\n const o = other as Matrix;\r\n this.updateFlag = o.updateFlag;\r\n this._updateIdentityStatus(o._isIdentity, o._isIdentityDirty, o._isIdentity3x2, o._isIdentity3x2Dirty);\r\n return this;\r\n }\r\n\r\n /**\r\n * Populates the given array from the starting index with the current matrix values\r\n * @param array defines the target array\r\n * @param offset defines the offset in the target array where to start storing values\r\n * @returns the current matrix\r\n */\r\n public copyToArray(array: Float32Array | Array<number>, offset: number = 0): this {\r\n CopyMatrixToArray(this, array, offset);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiply two matrices\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#15\r\n * A.multiply(B) means apply B to A so result is B x A\r\n * @param other defines the second operand\r\n * @returns a new matrix set with the multiplication result of the current Matrix and the given one\r\n */\r\n public multiply(other: DeepImmutable<Matrix>): Matrix {\r\n const result = new Matrix();\r\n this.multiplyToRef(other, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * This method performs component-by-component in-place multiplication, rather than true matrix multiplication.\r\n * Use multiply or multiplyToRef for matrix multiplication.\r\n * @param other defines the second operand\r\n * @returns the current updated matrix\r\n */\r\n public multiplyInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] *= otherM[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * This method performs a component-by-component multiplication of the current matrix with the array of transmitted numbers.\r\n * Use multiply or multiplyToRef for matrix multiplication.\r\n * @param floats defines the array of numbers to multiply the matrix by\r\n * @returns the current updated matrix\r\n */\r\n public multiplyByFloats(...floats: Tuple<number, 16>): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] *= floats[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiples the current matrix by the given floats and stores them in the given ref\r\n * @param args The floats and ref\r\n * @returns The updated ref\r\n */\r\n public multiplyByFloatsToRef<T extends Matrix>(...args: [...Tuple<number, 16>, T]): T {\r\n const result = args.pop() as T,\r\n m = this._m,\r\n resultM = result._m,\r\n values = args as unknown as Tuple<number, 16>;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = m[i] * values[i];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given matrix \"result\" with the multiplication result of the current Matrix and the given one\r\n * A.multiplyToRef(B, R) means apply B to A and store in R and R = B x A\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#16\r\n * @param other defines the second operand\r\n * @param result defines the matrix where to store the multiplication\r\n * @returns result input\r\n */\r\n public multiplyToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T {\r\n if (this._isIdentity) {\r\n result.copyFrom(other);\r\n return result;\r\n }\r\n if ((other as Matrix)._isIdentity) {\r\n result.copyFrom(this);\r\n return result;\r\n }\r\n\r\n this.multiplyToArray(other, result._m, 0);\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the Float32Array \"result\" from the given index \"offset\" with the multiplication of the current matrix and the given one\r\n * @param other defines the second operand\r\n * @param result defines the array where to store the multiplication\r\n * @param offset defines the offset in the target array where to start storing values\r\n * @returns the current matrix\r\n */\r\n public multiplyToArray(other: DeepImmutable<Matrix>, result: Float32Array | Array<number>, offset: number): this {\r\n MultiplyMatricesToArray(this, other, result, offset);\r\n return this;\r\n }\r\n\r\n public divide(other: DeepImmutable<Matrix>): Matrix {\r\n return this.divideToRef(other, new Matrix());\r\n }\r\n\r\n public divideToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T {\r\n const m = this._m,\r\n otherM = other.m,\r\n resultM = result._m;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = m[i] / otherM[i];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n public divideInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] /= otherM[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public minimizeInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = Math.min(m[i], otherM[i]);\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public minimizeInPlaceFromFloats(...floats: Tuple<number, 16>): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = Math.min(m[i], floats[i]);\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public maximizeInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = Math.min(m[i], otherM[i]);\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public maximizeInPlaceFromFloats(...floats: Tuple<number, 16>): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = Math.min(m[i], floats[i]);\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public negate(): Matrix {\r\n return this.negateToRef(new Matrix());\r\n }\r\n\r\n public negateInPlace(): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = -m[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public negateToRef<T extends Matrix>(result: T): T {\r\n const m = this._m,\r\n resultM = result._m;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = -m[i];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Check equality between this matrix and a second one\r\n * @param value defines the second matrix to compare\r\n * @returns true is the current matrix and the given one values are strictly equal\r\n */\r\n public equals(value: DeepImmutable<Matrix>): boolean {\r\n const other = value as Matrix;\r\n if (!other) {\r\n return false;\r\n }\r\n\r\n if (this._isIdentity || other._isIdentity) {\r\n if (!this._isIdentityDirty && !other._isIdentityDirty) {\r\n return this._isIdentity && other._isIdentity;\r\n }\r\n }\r\n\r\n const m = this.m;\r\n const om = other.m;\r\n return (\r\n m[0] === om[0] &&\r\n m[1] === om[1] &&\r\n m[2] === om[2] &&\r\n m[3] === om[3] &&\r\n m[4] === om[4] &&\r\n m[5] === om[5] &&\r\n m[6] === om[6] &&\r\n m[7] === om[7] &&\r\n m[8] === om[8] &&\r\n m[9] === om[9] &&\r\n m[10] === om[10] &&\r\n m[11] === om[11] &&\r\n m[12] === om[12] &&\r\n m[13] === om[13] &&\r\n m[14] === om[14] &&\r\n m[15] === om[15]\r\n );\r\n }\r\n\r\n public equalsWithEpsilon(other: DeepImmutable<Matrix>, epsilon: number = 0): boolean {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n if (!WithinEpsilon(m[i], otherM[i], epsilon)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n public equalsToFloats(...floats: Tuple<number, 16>): boolean {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n if (m[i] != floats[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n public floor(): Matrix {\r\n return this.floorToRef(new Matrix());\r\n }\r\n\r\n public floorToRef<T extends Matrix>(result: T): T {\r\n const m = this._m,\r\n resultM = result._m;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = Math.floor(m[i]);\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n public fract(): Matrix {\r\n return this.fractToRef(new Matrix());\r\n }\r\n\r\n public fractToRef<T extends Matrix>(result: T): T {\r\n const m = this._m,\r\n resultM = result._m;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = m[i] - Math.floor(m[i]);\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Clone the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#18\r\n * @returns a new matrix from the current matrix\r\n */\r\n public clone(): Matrix {\r\n const matrix = new Matrix();\r\n matrix.copyFrom(this);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Returns the name of the current matrix class\r\n * @returns the string \"Matrix\"\r\n */\r\n public getClassName(): string {\r\n return \"Matrix\";\r\n }\r\n\r\n /**\r\n * Gets the hash code of the current matrix\r\n * @returns the hash code\r\n */\r\n public getHashCode(): number {\r\n let hash = ExtractAsInt(this._m[0]);\r\n for (let i = 1; i < 16; i++) {\r\n hash = (hash * 397) ^ ExtractAsInt(this._m[i]);\r\n }\r\n return hash;\r\n }\r\n\r\n /**\r\n * Decomposes the current Matrix into a translation, rotation and scaling components of the provided node\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#13\r\n * @param node the node to decompose the matrix to\r\n * @returns true if operation was successful\r\n */\r\n public decomposeToTransformNode(node: TransformNode): boolean {\r\n node.rotationQuaternion = node.rotationQuaternion || new Quaternion();\r\n return this.decompose(node.scaling, node.rotationQuaternion, node.position);\r\n }\r\n\r\n /**\r\n * Decomposes the current Matrix into a translation, rotation and scaling components\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#12\r\n * @param scale defines the scale vector3 given as a reference to update\r\n * @param rotation defines the rotation quaternion given as a reference to update\r\n * @param translation defines the translation vector3 given as a reference to update\r\n * @param preserveScalingNode Use scaling sign coming from this node. Otherwise scaling sign might change.\r\n * @param useAbsoluteScaling Use scaling sign coming from this absoluteScaling when true or scaling otherwise.\r\n * @returns true if operation was successful\r\n */\r\n public decompose(scale?: Vector3, rotation?: Quaternion, translation?: Vector3, preserveScalingNode?: TransformNode, useAbsoluteScaling: boolean = true): boolean {\r\n if (this._isIdentity) {\r\n if (translation) {\r\n translation.setAll(0);\r\n }\r\n if (scale) {\r\n scale.setAll(1);\r\n }\r\n if (rotation) {\r\n rotation.copyFromFloats(0, 0, 0, 1);\r\n }\r\n return true;\r\n }\r\n\r\n const m = this._m;\r\n if (translation) {\r\n translation.copyFromFloats(m[12], m[13], m[14]);\r\n }\r\n\r\n scale = scale || MathTmp.Vector3[0];\r\n\r\n scale.x = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]);\r\n scale.y = Math.sqrt(m[4] * m[4] + m[5] * m[5] + m[6] * m[6]);\r\n scale.z = Math.sqrt(m[8] * m[8] + m[9] * m[9] + m[10] * m[10]);\r\n\r\n if (preserveScalingNode) {\r\n const signX = (useAbsoluteScaling ? preserveScalingNode.absoluteScaling.x : preserveScalingNode.scaling.x) < 0 ? -1 : 1;\r\n const signY = (useAbsoluteScaling ? preserveScalingNode.absoluteScaling.y : preserveScalingNode.scaling.y) < 0 ? -1 : 1;\r\n const signZ = (useAbsoluteScaling ? preserveScalingNode.absoluteScaling.z : preserveScalingNode.scaling.z) < 0 ? -1 : 1;\r\n\r\n scale.x *= signX;\r\n scale.y *= signY;\r\n scale.z *= signZ;\r\n } else {\r\n if (this.determinant() <= 0) {\r\n scale.y *= -1;\r\n }\r\n }\r\n\r\n if (scale._x === 0 || scale._y === 0 || scale._z === 0) {\r\n if (rotation) {\r\n rotation.copyFromFloats(0.0, 0.0, 0.0, 1.0);\r\n }\r\n return false;\r\n }\r\n\r\n if (rotation) {\r\n const sx = 1 / scale._x,\r\n sy = 1 / scale._y,\r\n sz = 1 / scale._z;\r\n Matrix.FromValuesToRef(\r\n m[0] * sx,\r\n m[1] * sx,\r\n m[2] * sx,\r\n 0.0,\r\n m[4] * sy,\r\n m[5] * sy,\r\n m[6] * sy,\r\n 0.0,\r\n m[8] * sz,\r\n m[9] * sz,\r\n m[10] * sz,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0,\r\n MathTmp.Matrix[0]\r\n );\r\n\r\n Quaternion.FromRotationMatrixToRef(MathTmp.Matrix[0], rotation);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Gets specific row of the matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\r\n * @param index defines the number of the row to get\r\n * @returns the index-th row of the current matrix as a new Vector4\r\n */\r\n public getRow(index: number): Nullable<Vector4> {\r\n if (index < 0 || index > 3) {\r\n return null;\r\n }\r\n const i = index * 4;\r\n return new Vector4(this._m[i + 0], this._m[i + 1], this._m[i + 2], this._m[i + 3]);\r\n }\r\n\r\n /**\r\n * Gets specific row of the matrix to ref\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\r\n * @param index defines the number of the row to get\r\n * @param rowVector vector to store the index-th row of the current matrix\r\n * @returns result input\r\n */\r\n public getRowToRef<T extends Vector4>(index: number, rowVector: T): T {\r\n if (index >= 0 && index <= 3) {\r\n const i = index * 4;\r\n rowVector.x = this._m[i + 0];\r\n rowVector.y = this._m[i + 1];\r\n rowVector.z = this._m[i + 2];\r\n rowVector.w = this._m[i + 3];\r\n }\r\n return rowVector;\r\n }\r\n\r\n /**\r\n * Sets the index-th row of the current matrix to the vector4 values\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\r\n * @param index defines the number of the row to set\r\n * @param row defines the target vector4\r\n * @returns the updated current matrix\r\n */\r\n public setRow(index: number, row: Vector4): this {\r\n return this.setRowFromFloats(index, row.x, row.y, row.z, row.w);\r\n }\r\n\r\n /**\r\n * Compute the transpose of the matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#40\r\n * @returns the new transposed matrix\r\n */\r\n public transpose(): Matrix {\r\n const result = new Matrix();\r\n Matrix.TransposeToRef(this, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Compute the transpose of the matrix and store it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#41\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public transposeToRef<T extends Matrix>(result: T): T {\r\n Matrix.TransposeToRef(this, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the index-th row of the current matrix with the given 4 x float values\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\r\n * @param index defines the row index\r\n * @param x defines the x component to set\r\n * @param y defines the y component to set\r\n * @param z defines the z component to set\r\n * @param w defines the w component to set\r\n * @returns the updated current matrix\r\n */\r\n public setRowFromFloats(index: number, x: number, y: number, z: number, w: number): this {\r\n if (index < 0 || index > 3) {\r\n return this;\r\n }\r\n const i = index * 4;\r\n this._m[i + 0] = x;\r\n this._m[i + 1] = y;\r\n this._m[i + 2] = z;\r\n this._m[i + 3] = w;\r\n\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Compute a new matrix set with the current matrix values multiplied by scale (float)\r\n * @param scale defines the scale factor\r\n * @returns a new matrix\r\n */\r\n public scale(scale: number): Matrix {\r\n const result = new Matrix();\r\n this.scaleToRef(scale, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Scale the current matrix values by a factor to a given result matrix\r\n * @param scale defines the scale factor\r\n * @param result defines the matrix to store the result\r\n * @returns result input\r\n */\r\n public scaleToRef<T extends Matrix>(scale: number, result: T): T {\r\n for (let index = 0; index < 16; index++) {\r\n result._m[index] = this._m[index] * scale;\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Scale the current matrix values by a factor and add the result to a given matrix\r\n * @param scale defines the scale factor\r\n * @param result defines the Matrix to store the result\r\n * @returns result input\r\n */\r\n public scaleAndAddToRef<T extends Matrix>(scale: number, result: T): T {\r\n for (let index = 0; index < 16; index++) {\r\n result._m[index] += this._m[index] * scale;\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n public scaleInPlace(scale: number): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] *= scale;\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Writes to the given matrix a normal matrix, computed from this one (using values from identity matrix for fourth row and column).\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#17\r\n * @param ref matrix to store the result\r\n * @returns the reference matrix\r\n */\r\n public toNormalMatrix<T extends Matrix>(ref: T): T {\r\n const tmp = MathTmp.Matrix[0];\r\n this.invertToRef(tmp);\r\n tmp.transposeToRef(ref);\r\n const m = ref._m;\r\n Matrix.FromValuesToRef(m[0], m[1], m[2], 0.0, m[4], m[5], m[6], 0.0, m[8], m[9], m[10], 0.0, 0.0, 0.0, 0.0, 1.0, ref);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Gets only rotation part of the current matrix\r\n * @returns a new matrix sets to the extracted rotation matrix from the current one\r\n */\r\n public getRotationMatrix(): Matrix {\r\n const result = new Matrix();\r\n this.getRotationMatrixToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Extracts the rotation matrix from the current one and sets it as the given \"result\"\r\n * @param result defines the target matrix to store data to\r\n * @returns result input\r\n */\r\n public getRotationMatrixToRef<T extends Matrix>(result: T): T {\r\n const scale = MathTmp.Vector3[0];\r\n if (!this.decompose(scale)) {\r\n Matrix.IdentityToRef(result);\r\n return result;\r\n }\r\n\r\n const m = this._m;\r\n const sx = 1 / scale._x,\r\n sy = 1 / scale._y,\r\n sz = 1 / scale._z;\r\n Matrix.FromValuesToRef(m[0] * sx, m[1] * sx, m[2] * sx, 0.0, m[4] * sy, m[5] * sy, m[6] * sy, 0.0, m[8] * sz, m[9] * sz, m[10] * sz, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Toggles model matrix from being right handed to left handed in place and vice versa\r\n * @returns the current updated matrix\r\n */\r\n public toggleModelMatrixHandInPlace(): this {\r\n const m = this._m;\r\n m[2] *= -1;\r\n m[6] *= -1;\r\n m[8] *= -1;\r\n m[9] *= -1;\r\n m[14] *= -1;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Toggles projection matrix from being right handed to left handed in place and vice versa\r\n * @returns the current updated matrix\r\n */\r\n public toggleProjectionMatrixHandInPlace(): this {\r\n const m = this._m;\r\n m[8] *= -1;\r\n m[9] *= -1;\r\n m[10] *= -1;\r\n m[11] *= -1;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Creates a matrix from an array\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#42\r\n * @param array defines the source array\r\n * @param offset defines an offset in the source array\r\n * @returns a new Matrix set from the starting index of the given array\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Matrix {\r\n const result = new Matrix();\r\n Matrix.FromArrayToRef(array, offset, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the content of an array into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#43\r\n * @param array defines the source array\r\n * @param offset defines an offset in the source array\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static FromArrayToRef<T extends Matrix>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T {\r\n for (let index = 0; index < 16; index++) {\r\n result._m[index] = array[index + offset];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Stores an array into a matrix after having multiplied each component by a given factor\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#50\r\n * @param array defines the source array\r\n * @param offset defines the offset in the source array\r\n * @param scale defines the scaling factor\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static FromFloat32ArrayToRefScaled<T extends Matrix>(array: DeepImmutable<Float32Array | Array<number>>, offset: number, scale: number, result: T): T {\r\n result._m[0] = array[0 + offset] * scale;\r\n result._m[1] = array[1 + offset] * scale;\r\n result._m[2] = array[2 + offset] * scale;\r\n result._m[3] = array[3 + offset] * scale;\r\n result._m[4] = array[4 + offset] * scale;\r\n result._m[5] = array[5 + offset] * scale;\r\n result._m[6] = array[6 + offset] * scale;\r\n result._m[7] = array[7 + offset] * scale;\r\n result._m[8] = array[8 + offset] * scale;\r\n result._m[9] = array[9 + offset] * scale;\r\n result._m[10] = array[10 + offset] * scale;\r\n result._m[11] = array[11 + offset] * scale;\r\n result._m[12] = array[12 + offset] * scale;\r\n result._m[13] = array[13 + offset] * scale;\r\n result._m[14] = array[14 + offset] * scale;\r\n result._m[15] = array[15 + offset] * scale;\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets an identity matrix that must not be updated\r\n */\r\n public static get IdentityReadOnly(): DeepImmutable<Matrix> {\r\n return Matrix._IdentityReadOnly;\r\n }\r\n\r\n /**\r\n * Stores a list of values (16) inside a given matrix\r\n * @param initialM11 defines 1st value of 1st row\r\n * @param initialM12 defines 2nd value of 1st row\r\n * @param initialM13 defines 3rd value of 1st row\r\n * @param initialM14 defines 4th value of 1st row\r\n * @param initialM21 defines 1st value of 2nd row\r\n * @param initialM22 defines 2nd value of 2nd row\r\n * @param initialM23 defines 3rd value of 2nd row\r\n * @param initialM24 defines 4th value of 2nd row\r\n * @param initialM31 defines 1st value of 3rd row\r\n * @param initialM32 defines 2nd value of 3rd row\r\n * @param initialM33 defines 3rd value of 3rd row\r\n * @param initialM34 defines 4th value of 3rd row\r\n * @param initialM41 defines 1st value of 4th row\r\n * @param initialM42 defines 2nd value of 4th row\r\n * @param initialM43 defines 3rd value of 4th row\r\n * @param initialM44 defines 4th value of 4th row\r\n * @param result defines the target matrix\r\n */\r\n public static FromValuesToRef(\r\n initialM11: number,\r\n initialM12: number,\r\n initialM13: number,\r\n initialM14: number,\r\n initialM21: number,\r\n initialM22: number,\r\n initialM23: number,\r\n initialM24: number,\r\n initialM31: number,\r\n initialM32: number,\r\n initialM33: number,\r\n initialM34: number,\r\n initialM41: number,\r\n initialM42: number,\r\n initialM43: number,\r\n initialM44: number,\r\n result: Matrix\r\n ): void {\r\n const m = result._m;\r\n m[0] = initialM11;\r\n m[1] = initialM12;\r\n m[2] = initialM13;\r\n m[3] = initialM14;\r\n m[4] = initialM21;\r\n m[5] = initialM22;\r\n m[6] = initialM23;\r\n m[7] = initialM24;\r\n m[8] = initialM31;\r\n m[9] = initialM32;\r\n m[10] = initialM33;\r\n m[11] = initialM34;\r\n m[12] = initialM41;\r\n m[13] = initialM42;\r\n m[14] = initialM43;\r\n m[15] = initialM44;\r\n\r\n result.markAsUpdated();\r\n }\r\n\r\n /**\r\n * Creates new matrix from a list of values (16)\r\n * @param initialM11 defines 1st value of 1st row\r\n * @param initialM12 defines 2nd value of 1st row\r\n * @param initialM13 defines 3rd value of 1st row\r\n * @param initialM14 defines 4th value of 1st row\r\n * @param initialM21 defines 1st value of 2nd row\r\n * @param initialM22 defines 2nd value of 2nd row\r\n * @param initialM23 defines 3rd value of 2nd row\r\n * @param initialM24 defines 4th value of 2nd row\r\n * @param initialM31 defines 1st value of 3rd row\r\n * @param initialM32 defines 2nd value of 3rd row\r\n * @param initialM33 defines 3rd value of 3rd row\r\n * @param initialM34 defines 4th value of 3rd row\r\n * @param initialM41 defines 1st value of 4th row\r\n * @param initialM42 defines 2nd value of 4th row\r\n * @param initialM43 defines 3rd value of 4th row\r\n * @param initialM44 defines 4th value of 4th row\r\n * @returns the new matrix\r\n */\r\n public static FromValues(\r\n initialM11: number,\r\n initialM12: number,\r\n initialM13: number,\r\n initialM14: number,\r\n initialM21: number,\r\n initialM22: number,\r\n initialM23: number,\r\n initialM24: number,\r\n initialM31: number,\r\n initialM32: number,\r\n initialM33: number,\r\n initialM34: number,\r\n initialM41: number,\r\n initialM42: number,\r\n initialM43: number,\r\n initialM44: number\r\n ): Matrix {\r\n const result = new Matrix();\r\n const m = result._m;\r\n m[0] = initialM11;\r\n m[1] = initialM12;\r\n m[2] = initialM13;\r\n m[3] = initialM14;\r\n m[4] = initialM21;\r\n m[5] = initialM22;\r\n m[6] = initialM23;\r\n m[7] = initialM24;\r\n m[8] = initialM31;\r\n m[9] = initialM32;\r\n m[10] = initialM33;\r\n m[11] = initialM34;\r\n m[12] = initialM41;\r\n m[13] = initialM42;\r\n m[14] = initialM43;\r\n m[15] = initialM44;\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix composed by merging scale (vector3), rotation (quaternion) and translation (vector3)\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#24\r\n * @param scale defines the scale vector3\r\n * @param rotation defines the rotation quaternion\r\n * @param translation defines the translation vector3\r\n * @returns a new matrix\r\n */\r\n public static Compose(scale: DeepImmutable<Vector3>, rotation: DeepImmutable<Quaternion>, translation: DeepImmutable<Vector3>): Matrix {\r\n const result = new Matrix();\r\n Matrix.ComposeToRef(scale, rotation, translation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets a matrix to a value composed by merging scale (vector3), rotation (quaternion) and translation (vector3)\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#25\r\n * @param scale defines the scale vector3\r\n * @param rotation defines the rotation quaternion\r\n * @param translation defines the translation vector3\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static ComposeToRef<T extends Matrix>(scale: DeepImmutable<Vector3>, rotation: DeepImmutable<Quaternion>, translation: DeepImmutable<Vector3>, result: T): T {\r\n const m = result._m;\r\n const x = rotation._x,\r\n y = rotation._y,\r\n z = rotation._z,\r\n w = rotation._w;\r\n const x2 = x + x,\r\n y2 = y + y,\r\n z2 = z + z;\r\n const xx = x * x2,\r\n xy = x * y2,\r\n xz = x * z2;\r\n const yy = y * y2,\r\n yz = y * z2,\r\n zz = z * z2;\r\n const wx = w * x2,\r\n wy = w * y2,\r\n wz = w * z2;\r\n\r\n const sx = scale._x,\r\n sy = scale._y,\r\n sz = scale._z;\r\n\r\n m[0] = (1 - (yy + zz)) * sx;\r\n m[1] = (xy + wz) * sx;\r\n m[2] = (xz - wy) * sx;\r\n m[3] = 0;\r\n\r\n m[4] = (xy - wz) * sy;\r\n m[5] = (1 - (xx + zz)) * sy;\r\n m[6] = (yz + wx) * sy;\r\n m[7] = 0;\r\n\r\n m[8] = (xz + wy) * sz;\r\n m[9] = (yz - wx) * sz;\r\n m[10] = (1 - (xx + yy)) * sz;\r\n m[11] = 0;\r\n\r\n m[12] = translation._x;\r\n m[13] = translation._y;\r\n m[14] = translation._z;\r\n m[15] = 1;\r\n\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new identity matrix\r\n * @returns a new identity matrix\r\n */\r\n public static Identity(): Matrix {\r\n const identity = Matrix.FromValues(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);\r\n identity._updateIdentityStatus(true);\r\n return identity;\r\n }\r\n\r\n /**\r\n * Creates a new identity matrix and stores the result in a given matrix\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static IdentityToRef<T extends Matrix>(result: T): T {\r\n Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n result._updateIdentityStatus(true);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new zero matrix\r\n * @returns a new zero matrix\r\n */\r\n public static Zero(): Matrix {\r\n const zero = Matrix.FromValues(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);\r\n zero._updateIdentityStatus(false);\r\n return zero;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the X axis\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#97\r\n * @param angle defines the angle (in radians) to use\r\n * @returns the new matrix\r\n */\r\n public static RotationX(angle: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.RotationXToRef(angle, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix as the invert of a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#124\r\n * @param source defines the source matrix\r\n * @returns the new matrix\r\n */\r\n public static Invert(source: DeepImmutable<Matrix>): Matrix {\r\n const result = new Matrix();\r\n source.invertToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the X axis and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#98\r\n * @param angle defines the angle (in radians) to use\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static RotationXToRef<T extends Matrix>(angle: number, result: T): T {\r\n const s = Math.sin(angle);\r\n const c = Math.cos(angle);\r\n Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, c, s, 0.0, 0.0, -s, c, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n\r\n result._updateIdentityStatus(c === 1 && s === 0);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the Y axis\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#99\r\n * @param angle defines the angle (in radians) to use\r\n * @returns the new matrix\r\n */\r\n public static RotationY(angle: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.RotationYToRef(angle, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the Y axis and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#100\r\n * @param angle defines the angle (in radians) to use\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static RotationYToRef<T extends Matrix>(angle: number, result: T): T {\r\n const s = Math.sin(angle);\r\n const c = Math.cos(angle);\r\n Matrix.FromValuesToRef(c, 0.0, -s, 0.0, 0.0, 1.0, 0.0, 0.0, s, 0.0, c, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n\r\n result._updateIdentityStatus(c === 1 && s === 0);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the Z axis\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#101\r\n * @param angle defines the angle (in radians) to use\r\n * @returns the new matrix\r\n */\r\n public static RotationZ(angle: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.RotationZToRef(angle, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the Z axis and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#102\r\n * @param angle defines the angle (in radians) to use\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static RotationZToRef<T extends Matrix>(angle: number, result: T): T {\r\n const s = Math.sin(angle);\r\n const c = Math.cos(angle);\r\n Matrix.FromValuesToRef(c, s, 0.0, 0.0, -s, c, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n\r\n result._updateIdentityStatus(c === 1 && s === 0);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the given axis\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#96\r\n * @param axis defines the axis to use\r\n * @param angle defines the angle (in radians) to use\r\n * @returns the new matrix\r\n */\r\n public static RotationAxis(axis: DeepImmutable<Vector3>, angle: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.RotationAxisToRef(axis, angle, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the given axis and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#94\r\n * @param axis defines the axis to use\r\n * @param angle defines the angle (in radians) to use\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static RotationAxisToRef<T extends Matrix>(axis: DeepImmutable<Vector3>, angle: number, result: T): T {\r\n const s = Math.sin(-angle);\r\n const c = Math.cos(-angle);\r\n const c1 = 1 - c;\r\n\r\n axis = axis.normalizeToRef(MathTmp.Vector3[0]);\r\n const m = result._m;\r\n m[0] = axis._x * axis._x * c1 + c;\r\n m[1] = axis._x * axis._y * c1 - axis._z * s;\r\n m[2] = axis._x * axis._z * c1 + axis._y * s;\r\n m[3] = 0.0;\r\n\r\n m[4] = axis._y * axis._x * c1 + axis._z * s;\r\n m[5] = axis._y * axis._y * c1 + c;\r\n m[6] = axis._y * axis._z * c1 - axis._x * s;\r\n m[7] = 0.0;\r\n\r\n m[8] = axis._z * axis._x * c1 - axis._y * s;\r\n m[9] = axis._z * axis._y * c1 + axis._x * s;\r\n m[10] = axis._z * axis._z * c1 + c;\r\n m[11] = 0.0;\r\n\r\n m[12] = 0.0;\r\n m[13] = 0.0;\r\n m[14] = 0.0;\r\n m[15] = 1.0;\r\n\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Takes normalised vectors and returns a rotation matrix to align \"from\" with \"to\".\r\n * Taken from http://www.iquilezles.org/www/articles/noacos/noacos.htm\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#93\r\n * @param from defines the vector to align\r\n * @param to defines the vector to align to\r\n * @param result defines the target matrix\r\n * @param useYAxisForCoplanar defines a boolean indicating that we should favor Y axis for coplanar vectors (default is false)\r\n * @returns result input\r\n */\r\n public static RotationAlignToRef<T extends Matrix>(from: DeepImmutable<Vector3>, to: DeepImmutable<Vector3>, result: T, useYAxisForCoplanar = false): T {\r\n const c = Vector3.Dot(to, from);\r\n const m = result._m;\r\n if (c < -1 + Epsilon) {\r\n // from and to are colinear and opposite direction.\r\n // compute a PI rotation on Y axis\r\n m[0] = -1;\r\n m[1] = 0;\r\n m[2] = 0;\r\n m[3] = 0;\r\n m[4] = 0;\r\n m[5] = useYAxisForCoplanar ? 1 : -1;\r\n m[6] = 0;\r\n m[7] = 0;\r\n m[8] = 0;\r\n m[9] = 0;\r\n m[10] = useYAxisForCoplanar ? -1 : 1;\r\n m[11] = 0;\r\n } else {\r\n const v = Vector3.Cross(to, from);\r\n const k = 1 / (1 + c);\r\n\r\n m[0] = v._x * v._x * k + c;\r\n m[1] = v._y * v._x * k - v._z;\r\n m[2] = v._z * v._x * k + v._y;\r\n m[3] = 0;\r\n m[4] = v._x * v._y * k + v._z;\r\n m[5] = v._y * v._y * k + c;\r\n m[6] = v._z * v._y * k - v._x;\r\n m[7] = 0;\r\n m[8] = v._x * v._z * k - v._y;\r\n m[9] = v._y * v._z * k + v._x;\r\n m[10] = v._z * v._z * k + c;\r\n m[11] = 0;\r\n }\r\n m[12] = 0;\r\n m[13] = 0;\r\n m[14] = 0;\r\n m[15] = 1;\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a rotation matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#103\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#105\r\n * @param yaw defines the yaw angle in radians (Y axis)\r\n * @param pitch defines the pitch angle in radians (X axis)\r\n * @param roll defines the roll angle in radians (Z axis)\r\n * @returns the new rotation matrix\r\n */\r\n public static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a rotation matrix and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#104\r\n * @param yaw defines the yaw angle in radians (Y axis)\r\n * @param pitch defines the pitch angle in radians (X axis)\r\n * @param roll defines the roll angle in radians (Z axis)\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static RotationYawPitchRollToRef<T extends Matrix>(yaw: number, pitch: number, roll: number, result: T): T {\r\n Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, MathTmp.Quaternion[0]);\r\n MathTmp.Quaternion[0].toRotationMatrix(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a scaling matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#107\r\n * @param x defines the scale factor on X axis\r\n * @param y defines the scale factor on Y axis\r\n * @param z defines the scale factor on Z axis\r\n * @returns the new matrix\r\n */\r\n public static Scaling(x: number, y: number, z: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.ScalingToRef(x, y, z, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a scaling matrix and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#108\r\n * @param x defines the scale factor on X axis\r\n * @param y defines the scale factor on Y axis\r\n * @param z defines the scale factor on Z axis\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static ScalingToRef<T extends Matrix>(x: number, y: number, z: number, result: T): T {\r\n Matrix.FromValuesToRef(x, 0.0, 0.0, 0.0, 0.0, y, 0.0, 0.0, 0.0, 0.0, z, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n\r\n result._updateIdentityStatus(x === 1 && y === 1 && z === 1);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a translation matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#109\r\n * @param x defines the translation on X axis\r\n * @param y defines the translation on Y axis\r\n * @param z defines the translationon Z axis\r\n * @returns the new matrix\r\n */\r\n public static Translation(x: number, y: number, z: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.TranslationToRef(x, y, z, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a translation matrix and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#110\r\n * @param x defines the translation on X axis\r\n * @param y defines the translation on Y axis\r\n * @param z defines the translationon Z axis\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static TranslationToRef<T extends Matrix>(x: number, y: number, z: number, result: T): T {\r\n Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, x, y, z, 1.0, result);\r\n result._updateIdentityStatus(x === 0 && y === 0 && z === 0);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Matrix whose values are the interpolated values for \"gradient\" (float) between the ones of the matrices \"startValue\" and \"endValue\".\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#55\r\n * @param startValue defines the start value\r\n * @param endValue defines the end value\r\n * @param gradient defines the gradient factor\r\n * @returns the new matrix\r\n */\r\n public static Lerp(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.LerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Set the given matrix \"result\" as the interpolated values for \"gradient\" (float) between the ones of the matrices \"startValue\" and \"endValue\".\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#54\r\n * @param startValue defines the start value\r\n * @param endValue defines the end value\r\n * @param gradient defines the gradient factor\r\n * @param result defines the Matrix object where to store data\r\n * @returns result input\r\n */\r\n public static LerpToRef<T extends Matrix>(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result: T): T {\r\n const resultM = result._m;\r\n const startM = startValue.m;\r\n const endM = endValue.m;\r\n for (let index = 0; index < 16; index++) {\r\n resultM[index] = startM[index] * (1.0 - gradient) + endM[index] * gradient;\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Builds a new matrix whose values are computed by:\r\n * * decomposing the \"startValue\" and \"endValue\" matrices into their respective scale, rotation and translation matrices\r\n * * interpolating for \"gradient\" (float) the values between each of these decomposed matrices between the start and the end\r\n * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#22\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#51\r\n * @param startValue defines the first matrix\r\n * @param endValue defines the second matrix\r\n * @param gradient defines the gradient between the two matrices\r\n * @returns the new matrix\r\n */\r\n public static DecomposeLerp(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.DecomposeLerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Update a matrix to values which are computed by:\r\n * * decomposing the \"startValue\" and \"endValue\" matrices into their respective scale, rotation and translation matrices\r\n * * interpolating for \"gradient\" (float) the values between each of these decomposed matrices between the start and the end\r\n * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#23\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#53\r\n * @param startValue defines the first matrix\r\n * @param endValue defines the second matrix\r\n * @param gradient defines the gradient between the two matrices\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static DecomposeLerpToRef<T extends Matrix>(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result: T): T {\r\n const startScale = MathTmp.Vector3[0];\r\n const startRotation = MathTmp.Quaternion[0];\r\n const startTranslation = MathTmp.Vector3[1];\r\n startValue.decompose(startScale, startRotation, startTranslation);\r\n\r\n const endScale = MathTmp.Vector3[2];\r\n const endRotation = MathTmp.Quaternion[1];\r\n const endTranslation = MathTmp.Vector3[3];\r\n endValue.decompose(endScale, endRotation, endTranslation);\r\n\r\n const resultScale = MathTmp.Vector3[4];\r\n Vector3.LerpToRef(startScale, endScale, gradient, resultScale);\r\n const resultRotation = MathTmp.Quaternion[2];\r\n Quaternion.SlerpToRef(startRotation, endRotation, gradient, resultRotation);\r\n\r\n const resultTranslation = MathTmp.Vector3[5];\r\n Vector3.LerpToRef(startTranslation, endTranslation, gradient, resultTranslation);\r\n\r\n Matrix.ComposeToRef(resultScale, resultRotation, resultTranslation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.\r\n * This function generates a matrix suitable for a left handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#58\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#59\r\n * @param eye defines the final position of the entity\r\n * @param target defines where the entity should look at\r\n * @param up defines the up vector for the entity\r\n * @returns the new matrix\r\n */\r\n public static LookAtLH(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Matrix {\r\n const result = new Matrix();\r\n Matrix.LookAtLHToRef(eye, target, up, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given \"result\" Matrix to a matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.\r\n * This function generates a matrix suitable for a left handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#60\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#61\r\n * @param eye defines the final position of the entity\r\n * @param target defines where the entity should look at\r\n * @param up defines the up vector for the entity\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static LookAtLHToRef(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: Matrix): Matrix {\r\n const xAxis = MathTmp.Vector3[0];\r\n const yAxis = MathTmp.Vector3[1];\r\n const zAxis = MathTmp.Vector3[2];\r\n\r\n // Z axis\r\n target.subtractToRef(eye, zAxis);\r\n zAxis.normalize();\r\n\r\n // X axis\r\n Vector3.CrossToRef(up, zAxis, xAxis);\r\n\r\n const xSquareLength = xAxis.lengthSquared();\r\n if (xSquareLength === 0) {\r\n xAxis.x = 1.0;\r\n } else {\r\n xAxis.normalizeFromLength(Math.sqrt(xSquareLength));\r\n }\r\n\r\n // Y axis\r\n Vector3.CrossToRef(zAxis, xAxis, yAxis);\r\n yAxis.normalize();\r\n\r\n // Eye angles\r\n const ex = -Vector3.Dot(xAxis, eye);\r\n const ey = -Vector3.Dot(yAxis, eye);\r\n const ez = -Vector3.Dot(zAxis, eye);\r\n\r\n Matrix.FromValuesToRef(xAxis._x, yAxis._x, zAxis._x, 0.0, xAxis._y, yAxis._y, zAxis._y, 0.0, xAxis._z, yAxis._z, zAxis._z, 0.0, ex, ey, ez, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.\r\n * This function generates a matrix suitable for a right handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#62\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#63\r\n * @param eye defines the final position of the entity\r\n * @param target defines where the entity should look at\r\n * @param up defines the up vector for the entity\r\n * @returns the new matrix\r\n */\r\n public static LookAtRH(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Matrix {\r\n const result = new Matrix();\r\n Matrix.LookAtRHToRef(eye, target, up, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given \"result\" Matrix to a matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.\r\n * This function generates a matrix suitable for a right handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#64\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#65\r\n * @param eye defines the final position of the entity\r\n * @param target defines where the entity should look at\r\n * @param up defines the up vector for the entity\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static LookAtRHToRef<T extends Matrix>(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T {\r\n const xAxis = MathTmp.Vector3[0];\r\n const yAxis = MathTmp.Vector3[1];\r\n const zAxis = MathTmp.Vector3[2];\r\n\r\n // Z axis\r\n eye.subtractToRef(target, zAxis);\r\n zAxis.normalize();\r\n\r\n // X axis\r\n Vector3.CrossToRef(up, zAxis, xAxis);\r\n\r\n const xSquareLength = xAxis.lengthSquared();\r\n if (xSquareLength === 0) {\r\n xAxis.x = 1.0;\r\n } else {\r\n xAxis.normalizeFromLength(Math.sqrt(xSquareLength));\r\n }\r\n\r\n // Y axis\r\n Vector3.CrossToRef(zAxis, xAxis, yAxis);\r\n yAxis.normalize();\r\n\r\n // Eye angles\r\n const ex = -Vector3.Dot(xAxis, eye);\r\n const ey = -Vector3.Dot(yAxis, eye);\r\n const ez = -Vector3.Dot(zAxis, eye);\r\n\r\n Matrix.FromValuesToRef(xAxis._x, yAxis._x, zAxis._x, 0.0, xAxis._y, yAxis._y, zAxis._y, 0.0, xAxis._z, yAxis._z, zAxis._z, 0.0, ex, ey, ez, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)\r\n * This function generates a matrix suitable for a left handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#66\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @returns the new matrix\r\n */\r\n public static LookDirectionLH(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Matrix {\r\n const result = new Matrix();\r\n Matrix.LookDirectionLHToRef(forward, up, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given \"result\" Matrix to a matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)\r\n * This function generates a matrix suitable for a left handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#67\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static LookDirectionLHToRef<T extends Matrix>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T {\r\n const back = MathTmp.Vector3[0];\r\n back.copyFrom(forward);\r\n back.scaleInPlace(-1);\r\n const left = MathTmp.Vector3[1];\r\n Vector3.CrossToRef(up, back, left);\r\n\r\n // Generate the rotation matrix.\r\n Matrix.FromValuesToRef(left._x, left._y, left._z, 0.0, up._x, up._y, up._z, 0.0, back._x, back._y, back._z, 0.0, 0, 0, 0, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)\r\n * This function generates a matrix suitable for a right handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#68\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @returns the new matrix\r\n */\r\n public static LookDirectionRH(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Matrix {\r\n const result = new Matrix();\r\n Matrix.LookDirectionRHToRef(forward, up, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given \"result\" Matrix to a matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)\r\n * This function generates a matrix suitable for a right handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#69\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static LookDirectionRHToRef<T extends Matrix>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T {\r\n const right = MathTmp.Vector3[2];\r\n Vector3.CrossToRef(up, forward, right);\r\n\r\n // Generate the rotation matrix.\r\n Matrix.FromValuesToRef(right._x, right._y, right._z, 0.0, up._x, up._y, up._z, 0.0, forward._x, forward._y, forward._z, 0.0, 0, 0, 0, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Create a left-handed orthographic projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#70\r\n * @param width defines the viewport width\r\n * @param height defines the viewport height\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns a new matrix as a left-handed orthographic projection matrix\r\n */\r\n public static OrthoLH(width: number, height: number, znear: number, zfar: number, halfZRange?: boolean): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.OrthoLHToRef(width, height, znear, zfar, matrix, halfZRange);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Store a left-handed orthographic projection to a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#71\r\n * @param width defines the viewport width\r\n * @param height defines the viewport height\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param result defines the target matrix\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns result input\r\n */\r\n public static OrthoLHToRef<T extends Matrix>(width: number, height: number, znear: number, zfar: number, result: T, halfZRange?: boolean): T {\r\n const n = znear;\r\n const f = zfar;\r\n\r\n const a = 2.0 / width;\r\n const b = 2.0 / height;\r\n const c = 2.0 / (f - n);\r\n const d = -(f + n) / (f - n);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, 0.0, 0.0, d, 1.0, result);\r\n\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n\r\n result._updateIdentityStatus(a === 1 && b === 1 && c === 1 && d === 0);\r\n return result;\r\n }\r\n\r\n /**\r\n * Create a left-handed orthographic projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#72\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns a new matrix as a left-handed orthographic projection matrix\r\n */\r\n public static OrthoOffCenterLH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, halfZRange?: boolean): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, matrix, halfZRange);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Stores a left-handed orthographic projection into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#73\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param result defines the target matrix\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns result input\r\n */\r\n public static OrthoOffCenterLHToRef<T extends Matrix>(\r\n left: number,\r\n right: number,\r\n bottom: number,\r\n top: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n halfZRange?: boolean\r\n ): T {\r\n const n = znear;\r\n const f = zfar;\r\n\r\n const a = 2.0 / (right - left);\r\n const b = 2.0 / (top - bottom);\r\n const c = 2.0 / (f - n);\r\n const d = -(f + n) / (f - n);\r\n const i0 = (left + right) / (left - right);\r\n const i1 = (top + bottom) / (bottom - top);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, i0, i1, d, 1.0, result);\r\n\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Stores a left-handed oblique projection into a given matrix\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param length Length of the shear\r\n * @param angle Angle (along X/Y Plane) to apply shear\r\n * @param distance Distance from shear point\r\n * @param result defines the target matrix\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns result input\r\n */\r\n public static ObliqueOffCenterLHToRef<T extends Matrix>(\r\n left: number,\r\n right: number,\r\n bottom: number,\r\n top: number,\r\n znear: number,\r\n zfar: number,\r\n length: number,\r\n angle: number,\r\n distance: number,\r\n result: T,\r\n halfZRange?: boolean\r\n ): T {\r\n const a = -length * Math.cos(angle);\r\n const b = -length * Math.sin(angle);\r\n\r\n Matrix.TranslationToRef(0, 0, -distance, MathTmp.Matrix[1]);\r\n Matrix.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, a, b, 1, 0, 0, 0, 0, 1, MathTmp.Matrix[0]);\r\n MathTmp.Matrix[1].multiplyToRef(MathTmp.Matrix[0], MathTmp.Matrix[0]);\r\n Matrix.TranslationToRef(0, 0, distance, MathTmp.Matrix[1]);\r\n MathTmp.Matrix[0].multiplyToRef(MathTmp.Matrix[1], MathTmp.Matrix[0]);\r\n\r\n Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result, halfZRange);\r\n MathTmp.Matrix[0].multiplyToRef(result, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a right-handed orthographic projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#76\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns a new matrix as a right-handed orthographic projection matrix\r\n */\r\n public static OrthoOffCenterRH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, halfZRange?: boolean): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, matrix, halfZRange);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Stores a right-handed orthographic projection into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#77\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param result defines the target matrix\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns result input\r\n */\r\n public static OrthoOffCenterRHToRef<T extends Matrix>(\r\n left: number,\r\n right: number,\r\n bottom: number,\r\n top: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n halfZRange?: boolean\r\n ): T {\r\n Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result, halfZRange);\r\n result._m[10] *= -1; // No need to call markAsUpdated as previous function already called it and let _isIdentityDirty to true\r\n return result;\r\n }\r\n\r\n /**\r\n * Stores a right-handed oblique projection into a given matrix\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param length Length of the shear\r\n * @param angle Angle (along X/Y Plane) to apply shear\r\n * @param distance Distance from shear point\r\n * @param result defines the target matrix\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns result input\r\n */\r\n public static ObliqueOffCenterRHToRef<T extends Matrix>(\r\n left: number,\r\n right: number,\r\n bottom: number,\r\n top: number,\r\n znear: number,\r\n zfar: number,\r\n length: number,\r\n angle: number,\r\n distance: number,\r\n result: T,\r\n halfZRange?: boolean\r\n ): T {\r\n const a = length * Math.cos(angle);\r\n const b = length * Math.sin(angle);\r\n\r\n Matrix.TranslationToRef(0, 0, distance, MathTmp.Matrix[1]);\r\n Matrix.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, a, b, 1, 0, 0, 0, 0, 1, MathTmp.Matrix[0]);\r\n MathTmp.Matrix[1].multiplyToRef(MathTmp.Matrix[0], MathTmp.Matrix[0]);\r\n Matrix.TranslationToRef(0, 0, -distance, MathTmp.Matrix[1]);\r\n MathTmp.Matrix[0].multiplyToRef(MathTmp.Matrix[1], MathTmp.Matrix[0]);\r\n\r\n Matrix.OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, result, halfZRange);\r\n MathTmp.Matrix[0].multiplyToRef(result, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a left-handed perspective projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#85\r\n * @param width defines the viewport width\r\n * @param height defines the viewport height\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @returns a new matrix as a left-handed perspective projection matrix\r\n */\r\n public static PerspectiveLH(width: number, height: number, znear: number, zfar: number, halfZRange?: boolean, projectionPlaneTilt: number = 0): Matrix {\r\n const matrix = new Matrix();\r\n\r\n const n = znear;\r\n const f = zfar;\r\n\r\n const a = (2.0 * n) / width;\r\n const b = (2.0 * n) / height;\r\n const c = (f + n) / (f - n);\r\n const d = (-2.0 * f * n) / (f - n);\r\n const rot = Math.tan(projectionPlaneTilt);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, matrix);\r\n\r\n if (halfZRange) {\r\n matrix.multiplyToRef(mtxConvertNDCToHalfZRange, matrix);\r\n }\r\n\r\n matrix._updateIdentityStatus(false);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Creates a left-handed perspective projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#78\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)\r\n * @returns a new matrix as a left-handed perspective projection matrix\r\n */\r\n public static PerspectiveFovLH(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0,\r\n reverseDepthBufferMode: boolean = false\r\n ): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.PerspectiveFovLHToRef(fov, aspect, znear, zfar, matrix, true, halfZRange, projectionPlaneTilt, reverseDepthBufferMode);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Stores a left-handed perspective projection into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#81\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\r\n * @param result defines the target matrix\r\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)\r\n * @returns result input\r\n */\r\n public static PerspectiveFovLHToRef<T extends Matrix>(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n isVerticalFovFixed = true,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0,\r\n reverseDepthBufferMode: boolean = false\r\n ): T {\r\n const n = znear;\r\n const f = zfar;\r\n\r\n const t = 1.0 / Math.tan(fov * 0.5);\r\n const a = isVerticalFovFixed ? t / aspect : t;\r\n const b = isVerticalFovFixed ? t : t * aspect;\r\n const c = reverseDepthBufferMode && n === 0 ? -1 : f !== 0 ? (f + n) / (f - n) : 1;\r\n const d = reverseDepthBufferMode && n === 0 ? 2 * f : f !== 0 ? (-2.0 * f * n) / (f - n) : -2 * n;\r\n const rot = Math.tan(projectionPlaneTilt);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, result);\r\n\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n\r\n result._updateIdentityStatus(false);\r\n return result;\r\n }\r\n\r\n /**\r\n * Stores a left-handed perspective projection into a given matrix with depth reversed\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#89\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar not used as infinity is used as far clip\r\n * @param result defines the target matrix\r\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @returns result input\r\n */\r\n public static PerspectiveFovReverseLHToRef<T extends Matrix>(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n isVerticalFovFixed = true,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0\r\n ): T {\r\n const t = 1.0 / Math.tan(fov * 0.5);\r\n const a = isVerticalFovFixed ? t / aspect : t;\r\n const b = isVerticalFovFixed ? t : t * aspect;\r\n const rot = Math.tan(projectionPlaneTilt);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, -znear, 1.0, 0.0, 0.0, 1.0, 0.0, result);\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n result._updateIdentityStatus(false);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a right-handed perspective projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#83\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)\r\n * @returns a new matrix as a right-handed perspective projection matrix\r\n */\r\n public static PerspectiveFovRH(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0,\r\n reverseDepthBufferMode: boolean = false\r\n ): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.PerspectiveFovRHToRef(fov, aspect, znear, zfar, matrix, true, halfZRange, projectionPlaneTilt, reverseDepthBufferMode);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Stores a right-handed perspective projection into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#84\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\r\n * @param result defines the target matrix\r\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)\r\n * @returns result input\r\n */\r\n public static PerspectiveFovRHToRef<T extends Matrix>(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n isVerticalFovFixed = true,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0,\r\n reverseDepthBufferMode: boolean = false\r\n ): T {\r\n //alternatively this could be expressed as:\r\n // m = PerspectiveFovLHToRef\r\n // m[10] *= -1.0;\r\n // m[11] *= -1.0;\r\n\r\n const n = znear;\r\n const f = zfar;\r\n\r\n const t = 1.0 / Math.tan(fov * 0.5);\r\n const a = isVerticalFovFixed ? t / aspect : t;\r\n const b = isVerticalFovFixed ? t : t * aspect;\r\n const c = reverseDepthBufferMode && n === 0 ? 1 : f !== 0 ? -(f + n) / (f - n) : -1;\r\n const d = reverseDepthBufferMode && n === 0 ? 2 * f : f !== 0 ? (-2 * f * n) / (f - n) : -2 * n;\r\n const rot = Math.tan(projectionPlaneTilt);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, c, -1.0, 0.0, 0.0, d, 0.0, result);\r\n\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n\r\n result._updateIdentityStatus(false);\r\n return result;\r\n }\r\n\r\n /**\r\n * Stores a right-handed perspective projection into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#90\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar not used as infinity is used as far clip\r\n * @param result defines the target matrix\r\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @returns result input\r\n */\r\n public static PerspectiveFovReverseRHToRef<T extends Matrix>(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n isVerticalFovFixed = true,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0\r\n ): T {\r\n const t = 1.0 / Math.tan(fov * 0.5);\r\n const a = isVerticalFovFixed ? t / aspect : t;\r\n const b = isVerticalFovFixed ? t : t * aspect;\r\n const rot = Math.tan(projectionPlaneTilt);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, -znear, -1.0, 0.0, 0.0, -1.0, 0.0, result);\r\n\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n\r\n result._updateIdentityStatus(false);\r\n return result;\r\n }\r\n\r\n /**\r\n * Computes a complete transformation matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#113\r\n * @param viewport defines the viewport to use\r\n * @param world defines the world matrix\r\n * @param view defines the view matrix\r\n * @param projection defines the projection matrix\r\n * @param zmin defines the near clip plane\r\n * @param zmax defines the far clip plane\r\n * @returns the transformation matrix\r\n */\r\n public static GetFinalMatrix(\r\n viewport: DeepImmutable<Viewport>,\r\n world: DeepImmutable<Matrix>,\r\n view: DeepImmutable<Matrix>,\r\n projection: DeepImmutable<Matrix>,\r\n zmin: number,\r\n zmax: number\r\n ): Matrix {\r\n const cw = viewport.width;\r\n const ch = viewport.height;\r\n const cx = viewport.x;\r\n const cy = viewport.y;\r\n\r\n const viewportMatrix = Matrix.FromValues(cw / 2.0, 0.0, 0.0, 0.0, 0.0, -ch / 2.0, 0.0, 0.0, 0.0, 0.0, zmax - zmin, 0.0, cx + cw / 2.0, ch / 2.0 + cy, zmin, 1.0);\r\n\r\n const matrix = new Matrix();\r\n world.multiplyToRef(view, matrix);\r\n matrix.multiplyToRef(projection, matrix);\r\n return matrix.multiplyToRef(viewportMatrix, matrix);\r\n }\r\n\r\n /**\r\n * Extracts a 2x2 matrix from a given matrix and store the result in a Float32Array\r\n * @param matrix defines the matrix to use\r\n * @returns a new Float32Array array with 4 elements : the 2x2 matrix extracted from the given matrix\r\n */\r\n public static GetAsMatrix2x2(matrix: DeepImmutable<Matrix>): Float32Array | Array<number> {\r\n const m = matrix.m;\r\n const arr = [m[0], m[1], m[4], m[5]];\r\n return PerformanceConfigurator.MatrixUse64Bits ? arr : new Float32Array(arr);\r\n }\r\n\r\n /**\r\n * Extracts a 3x3 matrix from a given matrix and store the result in a Float32Array\r\n * @param matrix defines the matrix to use\r\n * @returns a new Float32Array array with 9 elements : the 3x3 matrix extracted from the given matrix\r\n */\r\n public static GetAsMatrix3x3(matrix: DeepImmutable<Matrix>): Float32Array | Array<number> {\r\n const m = matrix.m;\r\n const arr = [m[0], m[1], m[2], m[4], m[5], m[6], m[8], m[9], m[10]];\r\n return PerformanceConfigurator.MatrixUse64Bits ? arr : new Float32Array(arr);\r\n }\r\n\r\n /**\r\n * Compute the transpose of a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#111\r\n * @param matrix defines the matrix to transpose\r\n * @returns the new matrix\r\n */\r\n public static Transpose(matrix: DeepImmutable<Matrix>): Matrix {\r\n const result = new Matrix();\r\n Matrix.TransposeToRef(matrix, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Compute the transpose of a matrix and store it in a target matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#112\r\n * @param matrix defines the matrix to transpose\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static TransposeToRef<T extends Matrix>(matrix: DeepImmutable<Matrix>, result: T): T {\r\n const mm = matrix.m;\r\n const rm0 = mm[0];\r\n const rm1 = mm[4];\r\n const rm2 = mm[8];\r\n const rm3 = mm[12];\r\n\r\n const rm4 = mm[1];\r\n const rm5 = mm[5];\r\n const rm6 = mm[9];\r\n const rm7 = mm[13];\r\n\r\n const rm8 = mm[2];\r\n const rm9 = mm[6];\r\n const rm10 = mm[10];\r\n const rm11 = mm[14];\r\n\r\n const rm12 = mm[3];\r\n const rm13 = mm[7];\r\n const rm14 = mm[11];\r\n const rm15 = mm[15];\r\n\r\n const rm = result._m;\r\n rm[0] = rm0;\r\n rm[1] = rm1;\r\n rm[2] = rm2;\r\n rm[3] = rm3;\r\n rm[4] = rm4;\r\n rm[5] = rm5;\r\n rm[6] = rm6;\r\n rm[7] = rm7;\r\n rm[8] = rm8;\r\n rm[9] = rm9;\r\n rm[10] = rm10;\r\n rm[11] = rm11;\r\n rm[12] = rm12;\r\n rm[13] = rm13;\r\n rm[14] = rm14;\r\n rm[15] = rm15;\r\n result.markAsUpdated();\r\n\r\n // identity-ness does not change when transposing\r\n result._updateIdentityStatus((matrix as Matrix)._isIdentity, (matrix as Matrix)._isIdentityDirty);\r\n return result;\r\n }\r\n\r\n /**\r\n * Computes a reflection matrix from a plane\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#87\r\n * @param plane defines the reflection plane\r\n * @returns a new matrix\r\n */\r\n public static Reflection(plane: DeepImmutable<IPlaneLike>): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.ReflectionToRef(plane, matrix);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Computes a reflection matrix from a plane\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#88\r\n * @param plane defines the reflection plane\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static ReflectionToRef<T extends Matrix>(plane: DeepImmutable<IPlaneLike>, result: T): T {\r\n plane.normalize();\r\n const x = plane.normal.x;\r\n const y = plane.normal.y;\r\n const z = plane.normal.z;\r\n const temp = -2 * x;\r\n const temp2 = -2 * y;\r\n const temp3 = -2 * z;\r\n Matrix.FromValuesToRef(\r\n temp * x + 1,\r\n temp2 * x,\r\n temp3 * x,\r\n 0.0,\r\n temp * y,\r\n temp2 * y + 1,\r\n temp3 * y,\r\n 0.0,\r\n temp * z,\r\n temp2 * z,\r\n temp3 * z + 1,\r\n 0.0,\r\n temp * plane.d,\r\n temp2 * plane.d,\r\n temp3 * plane.d,\r\n 1.0,\r\n result\r\n );\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given matrix as a rotation matrix composed from the 3 left handed axes\r\n * @param xaxis defines the value of the 1st axis\r\n * @param yaxis defines the value of the 2nd axis\r\n * @param zaxis defines the value of the 3rd axis\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static FromXYZAxesToRef<T extends Matrix>(xaxis: DeepImmutable<Vector3>, yaxis: DeepImmutable<Vector3>, zaxis: DeepImmutable<Vector3>, result: T): T {\r\n Matrix.FromValuesToRef(xaxis._x, xaxis._y, xaxis._z, 0.0, yaxis._x, yaxis._y, yaxis._z, 0.0, zaxis._x, zaxis._y, zaxis._z, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a rotation matrix from a quaternion and stores it in a target matrix\r\n * @param quat defines the quaternion to use\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static FromQuaternionToRef<T extends Matrix>(quat: DeepImmutable<Quaternion>, result: T): T {\r\n const xx = quat._x * quat._x;\r\n const yy = quat._y * quat._y;\r\n const zz = quat._z * quat._z;\r\n const xy = quat._x * quat._y;\r\n const zw = quat._z * quat._w;\r\n const zx = quat._z * quat._x;\r\n const yw = quat._y * quat._w;\r\n const yz = quat._y * quat._z;\r\n const xw = quat._x * quat._w;\r\n\r\n result._m[0] = 1.0 - 2.0 * (yy + zz);\r\n result._m[1] = 2.0 * (xy + zw);\r\n result._m[2] = 2.0 * (zx - yw);\r\n result._m[3] = 0.0;\r\n\r\n result._m[4] = 2.0 * (xy - zw);\r\n result._m[5] = 1.0 - 2.0 * (zz + xx);\r\n result._m[6] = 2.0 * (yz + xw);\r\n result._m[7] = 0.0;\r\n\r\n result._m[8] = 2.0 * (zx + yw);\r\n result._m[9] = 2.0 * (yz - xw);\r\n result._m[10] = 1.0 - 2.0 * (yy + xx);\r\n result._m[11] = 0.0;\r\n\r\n result._m[12] = 0.0;\r\n result._m[13] = 0.0;\r\n result._m[14] = 0.0;\r\n result._m[15] = 1.0;\r\n\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n}\r\n\r\nObject.defineProperties(Matrix.prototype, {\r\n dimension: { value: [4, 4] },\r\n rank: { value: 2 },\r\n});\r\n\r\n/**\r\n * @internal\r\n * Same as Tmp but not exported to keep it only for math functions to avoid conflicts\r\n */\r\nclass MathTmp {\r\n // Temporary Vector3s\r\n public static Vector3 = BuildTuple(11, Vector3.Zero);\r\n\r\n // Temporary Matricies\r\n public static Matrix = BuildTuple(2, Matrix.Identity);\r\n\r\n // Temporary Quaternions\r\n public static Quaternion = BuildTuple(3, Quaternion.Zero);\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class TmpVectors {\r\n /** 3 temp Vector2 at once should be enough */\r\n public static Vector2 = BuildTuple(3, Vector2.Zero);\r\n\r\n /** 13 temp Vector3 at once should be enough */\r\n public static Vector3 = BuildTuple(13, Vector3.Zero);\r\n\r\n /** 3 temp Vector4 at once should be enough */\r\n public static Vector4 = BuildTuple(3, Vector4.Zero);\r\n\r\n /** 3 temp Quaternion at once should be enough */\r\n public static Quaternion = BuildTuple(3, Quaternion.Zero);\r\n\r\n /** 8 temp Matrices at once should be enough */\r\n public static Matrix = BuildTuple(8, Matrix.Identity);\r\n}\r\n\r\nRegisterClass(\"BABYLON.Vector2\", Vector2);\r\nRegisterClass(\"BABYLON.Vector3\", Vector3);\r\nRegisterClass(\"BABYLON.Vector4\", Vector4);\r\nRegisterClass(\"BABYLON.Matrix\", Matrix);\r\n\r\nconst mtxConvertNDCToHalfZRange = Matrix.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1);\r\n"]}
1
+ {"version":3,"file":"math.vector.js","sourceRoot":"","sources":["../../../../dev/core/src/Maths/math.vector.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACpG,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAE1I,gEAAgE;AAChE,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,EAAE;IACnC,OAAO,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,CAA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ript-eslint/naming-convention */\r\nimport { Epsilon } from \"./math.constants\";\r\nimport type { Viewport } from \"./math.viewport\";\r\nimport type { DeepImmutable, Nullable, FloatArray, float, Tuple } from \"../types\";\r\nimport { BuildTuple } from \"../Misc/arrayTools\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport type { Plane } from \"./math.plane\";\r\nimport { PerformanceConfigurator } from \"../Engines/performanceConfigurator\";\r\nimport { EngineStore } from \"../Engines/engineStore\";\r\nimport type { TransformNode } from \"../Meshes/transformNode\";\r\nimport type { Dimension, Tensor, TensorLike, TensorStatic } from \"./tensor\";\r\nimport type { IVector2Like, IVector3Like, IVector4Like, IQuaternionLike, IMatrixLike, IPlaneLike, IVector3LikeInternal } from \"./math.like\";\r\nimport { Clamp, Lerp, NormalizeRadians, RandomRange, WithinEpsilon } from \"./math.scalar.functions\";\r\nimport { CopyMatrixToArray, InvertMatrixToArray, MatrixManagement, MultiplyMatricesToArray } from \"./ThinMaths/thinMath.matrix.functions\";\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nconst ExtractAsInt = (value: number) => {\r\n return parseInt(value.toString().replace(/\\W/g, \"\"));\r\n};\r\n\r\n/**\r\n * Represents a vector of any dimension\r\n */\r\nexport interface Vector<N extends number[], I> extends Tensor<N, I> {\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n readonly dimension: Readonly<Dimension<N>>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n readonly rank: 1;\r\n\r\n /**\r\n * Gets the length of the vector\r\n * @returns the vector length (float)\r\n */\r\n length(): number;\r\n\r\n /**\r\n * Gets the vector squared length\r\n * @returns the vector squared length (float)\r\n */\r\n lengthSquared(): number;\r\n\r\n /**\r\n * Normalize the vector\r\n * @returns the current updated Vector\r\n */\r\n normalize(): this;\r\n\r\n /**\r\n * Normalize the current Vector with the given input length.\r\n * Please note that this is an in place operation.\r\n * @param len the length of the vector\r\n * @returns the current updated Vector\r\n */\r\n normalizeFromLength(len: number): this;\r\n\r\n /**\r\n * Normalize the current Vector to a new vector\r\n * @returns the new Vector\r\n */\r\n normalizeToNew(): Vector<N, I>;\r\n\r\n /**\r\n * Normalize the current Vector to the reference\r\n * @param reference define the Vector to update\r\n * @returns the updated Vector\r\n */\r\n normalizeToRef<T extends I>(reference: T): T;\r\n}\r\n\r\n/**\r\n * Static side of Vector\r\n */\r\nexport interface VectorStatic<T extends Vector<any[], _I>, _I = TensorLike<T>> extends TensorStatic<T, _I> {\r\n /**\r\n * Checks if a given vector is inside a specific range\r\n * @param value defines the vector to test\r\n * @param min defines the minimum range\r\n * @param max defines the maximum range\r\n */\r\n CheckExtends(value: _I, min: _I, max: _I): void;\r\n\r\n /**\r\n * Returns a new Vector equal to the normalized given vector\r\n * @param vector defines the vector to normalize\r\n * @returns a new Vector\r\n */\r\n Normalize(vector: DeepImmutable<T>): T;\r\n\r\n /**\r\n * Normalize a given vector into a second one\r\n * @param vector defines the vector to normalize\r\n * @param result defines the vector where to store the result\r\n * @returns result input\r\n */\r\n NormalizeToRef(vector: DeepImmutable<T>, result: T): T;\r\n}\r\n\r\n/**\r\n * Class representing a vector containing 2 coordinates\r\n * Example Playground - Overview - https://playground.babylonjs.com/#QYBWV4#9\r\n */\r\nexport class Vector2 implements Vector<Tuple<number, 2>, IVector2Like>, IVector2Like {\r\n /**\r\n * If the first vector is flagged with integers (as everything is 0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.\r\n * If subsequent vectors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,\r\n * and henceforth it will use floating-point representation for all Vector2 instances that it creates.\r\n * But the original Vector2 instances are unchanged and has a \"deprecated map\".\r\n * If we keep using the Vector2 instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.\r\n */\r\n static _V8PerformanceHack = new Vector2(0.5, 0.5) as DeepImmutable<Vector2>;\r\n private static _ZeroReadOnly = Vector2.Zero() as DeepImmutable<Vector2>;\r\n\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n declare public readonly dimension: Readonly<[2]>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n declare public readonly rank: 1;\r\n\r\n /**\r\n * Creates a new Vector2 from the given x and y coordinates\r\n * @param x defines the first coordinate\r\n * @param y defines the second coordinate\r\n */\r\n constructor(\r\n /** [0] defines the first coordinate */\r\n public x: number = 0,\r\n /** [0] defines the second coordinate */\r\n public y: number = 0\r\n ) {}\r\n\r\n /**\r\n * Gets a string with the Vector2 coordinates\r\n * @returns a string with the Vector2 coordinates\r\n */\r\n public toString(): string {\r\n return `{X: ${this.x} Y: ${this.y}}`;\r\n }\r\n\r\n /**\r\n * Gets class name\r\n * @returns the string \"Vector2\"\r\n */\r\n public getClassName(): string {\r\n return \"Vector2\";\r\n }\r\n\r\n /**\r\n * Gets current vector hash code\r\n * @returns the Vector2 hash code as a number\r\n */\r\n public getHashCode(): number {\r\n const x = ExtractAsInt(this.x);\r\n const y = ExtractAsInt(this.y);\r\n let hash = x;\r\n hash = (hash * 397) ^ y;\r\n return hash;\r\n }\r\n\r\n // Operators\r\n\r\n /**\r\n * Sets the Vector2 coordinates in the given array or Float32Array from the given index.\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#15\r\n * @param array defines the source array\r\n * @param index defines the offset in source array\r\n * @returns the current Vector2\r\n */\r\n public toArray(array: FloatArray, index: number = 0): this {\r\n array[index] = this.x;\r\n array[index + 1] = this.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Update the current vector from an array\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#39\r\n * @param array defines the destination array\r\n * @param offset defines the offset in the destination array\r\n * @returns the current Vector2\r\n */\r\n public fromArray(array: FloatArray, offset: number = 0): this {\r\n Vector2.FromArrayToRef(array, offset, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Copy the current vector to an array\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#40\r\n * @returns a new array with 2 elements: the Vector2 coordinates.\r\n */\r\n public asArray(): [number, number] {\r\n return [this.x, this.y];\r\n }\r\n\r\n /**\r\n * Sets the Vector2 coordinates with the given Vector2 coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#24\r\n * @param source defines the source Vector2\r\n * @returns the current updated Vector2\r\n */\r\n public copyFrom(source: DeepImmutable<IVector2Like>): this {\r\n this.x = source.x;\r\n this.y = source.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the Vector2 coordinates with the given floats\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#25\r\n * @param x defines the first coordinate\r\n * @param y defines the second coordinate\r\n * @returns the current updated Vector2\r\n */\r\n public copyFromFloats(x: number, y: number): this {\r\n this.x = x;\r\n this.y = y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets the Vector2 coordinates with the given floats\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#62\r\n * @param x defines the first coordinate\r\n * @param y defines the second coordinate\r\n * @returns the current updated Vector2\r\n */\r\n public set(x: number, y: number): this {\r\n return this.copyFromFloats(x, y);\r\n }\r\n\r\n /**\r\n * Copies the given float to the current Vector2 coordinates\r\n * @param v defines the x and y coordinates of the operand\r\n * @returns the current updated Vector2\r\n */\r\n public setAll(v: number): this {\r\n return this.copyFromFloats(v, v);\r\n }\r\n\r\n /**\r\n * Add another vector with the current one\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#11\r\n * @param otherVector defines the other vector\r\n * @returns a new Vector2 set with the addition of the current Vector2 and the given one coordinates\r\n */\r\n public add(otherVector: DeepImmutable<IVector2Like>): Vector2 {\r\n return new Vector2(this.x + otherVector.x, this.y + otherVector.y);\r\n }\r\n\r\n /**\r\n * Sets the \"result\" coordinates with the addition of the current Vector2 and the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#12\r\n * @param otherVector defines the other vector\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public addToRef<T extends IVector2Like>(otherVector: DeepImmutable<IVector2Like>, result: T): T {\r\n result.x = this.x + otherVector.x;\r\n result.y = this.y + otherVector.y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Set the Vector2 coordinates by adding the given Vector2 coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#13\r\n * @param otherVector defines the other vector\r\n * @returns the current updated Vector2\r\n */\r\n public addInPlace(otherVector: DeepImmutable<IVector2Like>): this {\r\n this.x += otherVector.x;\r\n this.y += otherVector.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the given coordinates to the current Vector2\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @returns the current updated Vector2\r\n */\r\n public addInPlaceFromFloats(x: number, y: number): this {\r\n this.x += x;\r\n this.y += y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 by adding the current Vector2 coordinates to the given Vector3 x, y coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#14\r\n * @param otherVector defines the other vector\r\n * @returns a new Vector2\r\n */\r\n public addVector3(otherVector: IVector3Like): Vector2 {\r\n return new Vector2(this.x + otherVector.x, this.y + otherVector.y);\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set with the subtracted coordinates of the given one from the current Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#61\r\n * @param otherVector defines the other vector\r\n * @returns a new Vector2\r\n */\r\n public subtract(otherVector: DeepImmutable<IVector2Like>): Vector2 {\r\n return new Vector2(this.x - otherVector.x, this.y - otherVector.y);\r\n }\r\n\r\n /**\r\n * Sets the \"result\" coordinates with the subtraction of the given one from the current Vector2 coordinates.\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#63\r\n * @param otherVector defines the other vector\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public subtractToRef<T extends IVector2Like>(otherVector: DeepImmutable<IVector2Like>, result: T): T {\r\n result.x = this.x - otherVector.x;\r\n result.y = this.y - otherVector.y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the current Vector2 coordinates by subtracting from it the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#88\r\n * @param otherVector defines the other vector\r\n * @returns the current updated Vector2\r\n */\r\n public subtractInPlace(otherVector: DeepImmutable<IVector2Like>): this {\r\n this.x -= otherVector.x;\r\n this.y -= otherVector.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies in place the current Vector2 coordinates by the given ones\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#43\r\n * @param otherVector defines the other vector\r\n * @returns the current updated Vector2\r\n */\r\n public multiplyInPlace(otherVector: DeepImmutable<IVector2Like>): this {\r\n this.x *= otherVector.x;\r\n this.y *= otherVector.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 set with the multiplication of the current Vector2 and the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#42\r\n * @param otherVector defines the other vector\r\n * @returns a new Vector2\r\n */\r\n public multiply(otherVector: DeepImmutable<IVector2Like>): Vector2 {\r\n return new Vector2(this.x * otherVector.x, this.y * otherVector.y);\r\n }\r\n\r\n /**\r\n * Sets \"result\" coordinates with the multiplication of the current Vector2 and the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#44\r\n * @param otherVector defines the other vector\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public multiplyToRef<T extends IVector2Like>(otherVector: DeepImmutable<IVector2Like>, result: T): T {\r\n result.x = this.x * otherVector.x;\r\n result.y = this.y * otherVector.y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set with the Vector2 coordinates multiplied by the given floats\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#89\r\n * @param x defines the first coordinate\r\n * @param y defines the second coordinate\r\n * @returns a new Vector2\r\n */\r\n public multiplyByFloats(x: number, y: number): Vector2 {\r\n return new Vector2(this.x * x, this.y * y);\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 set with the Vector2 coordinates divided by the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#27\r\n * @param otherVector defines the other vector\r\n * @returns a new Vector2\r\n */\r\n public divide(otherVector: DeepImmutable<IVector2Like>): Vector2 {\r\n return new Vector2(this.x / otherVector.x, this.y / otherVector.y);\r\n }\r\n\r\n /**\r\n * Sets the \"result\" coordinates with the Vector2 divided by the given one coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#30\r\n * @param otherVector defines the other vector\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public divideToRef<T extends IVector2Like>(otherVector: DeepImmutable<IVector2Like>, result: T): T {\r\n result.x = this.x / otherVector.x;\r\n result.y = this.y / otherVector.y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Divides the current Vector2 coordinates by the given ones\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#28\r\n * @param otherVector defines the other vector\r\n * @returns the current updated Vector2\r\n */\r\n public divideInPlace(otherVector: DeepImmutable<IVector2Like>): this {\r\n this.x = this.x / otherVector.x;\r\n this.y = this.y / otherVector.y;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector2 with the minimal coordinate values between its and the given vector ones\r\n * @param other defines the second operand\r\n * @returns the current updated Vector2\r\n */\r\n public minimizeInPlace(other: DeepImmutable<IVector2Like>): this {\r\n return this.minimizeInPlaceFromFloats(other.x, other.y);\r\n }\r\n\r\n /**\r\n * Updates the current Vector2 with the maximal coordinate values between its and the given vector ones.\r\n * @param other defines the second operand\r\n * @returns the current updated Vector2\r\n */\r\n public maximizeInPlace(other: DeepImmutable<IVector2Like>): this {\r\n return this.maximizeInPlaceFromFloats(other.x, other.y);\r\n }\r\n\r\n /**\r\n * Updates the current Vector2 with the minimal coordinate values between its and the given coordinates\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @returns the current updated Vector2\r\n */\r\n public minimizeInPlaceFromFloats(x: number, y: number): this {\r\n this.x = Math.min(x, this.x);\r\n this.y = Math.min(y, this.y);\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector2 with the maximal coordinate values between its and the given coordinates.\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @returns the current updated Vector2\r\n */\r\n public maximizeInPlaceFromFloats(x: number, y: number): this {\r\n this.x = Math.max(x, this.x);\r\n this.y = Math.max(y, this.y);\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 set with the subtraction of the given floats from the current Vector2 coordinates\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @returns the resulting Vector2\r\n */\r\n public subtractFromFloats(x: number, y: number): Vector2 {\r\n return new Vector2(this.x - x, this.y - y);\r\n }\r\n\r\n /**\r\n * Subtracts the given floats from the current Vector2 coordinates and set the given vector \"result\" with this result\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param result defines the Vector2 object where to store the result\r\n * @returns the result\r\n */\r\n public subtractFromFloatsToRef<T extends IVector2Like>(x: number, y: number, result: T): T {\r\n result.x = this.x - x;\r\n result.y = this.y - y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 with current Vector2 negated coordinates\r\n * @returns a new Vector2\r\n */\r\n public negate(): Vector2 {\r\n return new Vector2(-this.x, -this.y);\r\n }\r\n\r\n /**\r\n * Negate this vector in place\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#23\r\n * @returns this\r\n */\r\n public negateInPlace(): this {\r\n this.x *= -1;\r\n this.y *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Negate the current Vector2 and stores the result in the given vector \"result\" coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#41\r\n * @param result defines the Vector2 object where to store the result\r\n * @returns the result\r\n */\r\n public negateToRef<T extends IVector2Like>(result: T): T {\r\n result.x = -this.x;\r\n result.y = -this.y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Multiply the Vector2 coordinates by\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#59\r\n * @param scale defines the scaling factor\r\n * @returns the current updated Vector2\r\n */\r\n public scaleInPlace(scale: number): this {\r\n this.x *= scale;\r\n this.y *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 scaled by \"scale\" from the current Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#52\r\n * @param scale defines the scaling factor\r\n * @returns a new Vector2\r\n */\r\n public scale(scale: number): Vector2 {\r\n return new Vector2(this.x * scale, this.y * scale);\r\n }\r\n\r\n /**\r\n * Scale the current Vector2 values by a factor to a given Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#57\r\n * @param scale defines the scale factor\r\n * @param result defines the Vector2 object where to store the result\r\n * @returns result input\r\n */\r\n public scaleToRef<T extends IVector2Like>(scale: number, result: T): T {\r\n result.x = this.x * scale;\r\n result.y = this.y * scale;\r\n return result;\r\n }\r\n\r\n /**\r\n * Scale the current Vector2 values by a factor and add the result to a given Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#58\r\n * @param scale defines the scale factor\r\n * @param result defines the Vector2 object where to store the result\r\n * @returns result input\r\n */\r\n public scaleAndAddToRef<T extends IVector2Like>(scale: number, result: T): T {\r\n result.x += this.x * scale;\r\n result.y += this.y * scale;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a boolean if two vectors are equals\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#31\r\n * @param otherVector defines the other vector\r\n * @returns true if the given vector coordinates strictly equal the current Vector2 ones\r\n */\r\n public equals(otherVector: DeepImmutable<IVector2Like>): boolean {\r\n return otherVector && this.x === otherVector.x && this.y === otherVector.y;\r\n }\r\n\r\n /**\r\n * Gets a boolean if two vectors are equals (using an epsilon value)\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#32\r\n * @param otherVector defines the other vector\r\n * @param epsilon defines the minimal distance to consider equality\r\n * @returns true if the given vector coordinates are close to the current ones by a distance of epsilon.\r\n */\r\n public equalsWithEpsilon(otherVector: DeepImmutable<IVector2Like>, epsilon: number = Epsilon): boolean {\r\n return otherVector && WithinEpsilon(this.x, otherVector.x, epsilon) && WithinEpsilon(this.y, otherVector.y, epsilon);\r\n }\r\n\r\n /**\r\n * Returns true if the current Vector2 coordinates equals the given floats\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @returns true if both vectors are equal\r\n */\r\n public equalsToFloats(x: number, y: number): boolean {\r\n return this.x === x && this.y === y;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 from current Vector2 floored values\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#35\r\n * eg (1.2, 2.31) returns (1, 2)\r\n * @returns a new Vector2\r\n */\r\n public floor(): Vector2 {\r\n return new Vector2(Math.floor(this.x), Math.floor(this.y));\r\n }\r\n\r\n /**\r\n * Gets the current Vector2's floored values and stores them in result\r\n * @param result the Vector2 to store the result in\r\n * @returns the result Vector2\r\n */\r\n public floorToRef<T extends IVector2Like>(result: T): T {\r\n result.x = Math.floor(this.x);\r\n result.y = Math.floor(this.y);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 from current Vector2 fractional values\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#34\r\n * eg (1.2, 2.31) returns (0.2, 0.31)\r\n * @returns a new Vector2\r\n */\r\n public fract(): Vector2 {\r\n return new Vector2(this.x - Math.floor(this.x), this.y - Math.floor(this.y));\r\n }\r\n\r\n /**\r\n * Gets the current Vector2's fractional values and stores them in result\r\n * @param result the Vector2 to store the result in\r\n * @returns the result Vector2\r\n */\r\n public fractToRef<T extends IVector2Like>(result: T): T {\r\n result.x = this.x - Math.floor(this.x);\r\n result.y = this.y - Math.floor(this.y);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 rotated by the given angle\r\n * @param angle defines the rotation angle\r\n * @returns a new Vector2\r\n */\r\n public rotate(angle: number): Vector2 {\r\n return this.rotateToRef(angle, new Vector2());\r\n }\r\n\r\n /**\r\n * Rotate the current vector into a given result vector\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#49\r\n * @param angle defines the rotation angle\r\n * @param result defines the result vector where to store the rotated vector\r\n * @returns result input\r\n */\r\n public rotateToRef<T extends IVector2Like>(angle: number, result: T): T {\r\n const cos = Math.cos(angle);\r\n const sin = Math.sin(angle);\r\n result.x = cos * this.x - sin * this.y;\r\n result.y = sin * this.x + cos * this.y;\r\n return result;\r\n }\r\n\r\n // Properties\r\n\r\n /**\r\n * Gets the length of the vector\r\n * @returns the vector length (float)\r\n */\r\n public length(): number {\r\n return Math.sqrt(this.x * this.x + this.y * this.y);\r\n }\r\n\r\n /**\r\n * Gets the vector squared length\r\n * @returns the vector squared length (float)\r\n */\r\n public lengthSquared(): number {\r\n return this.x * this.x + this.y * this.y;\r\n }\r\n\r\n // Methods\r\n\r\n /**\r\n * Normalize the vector\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#48\r\n * @returns the current updated Vector2\r\n */\r\n public normalize(): this {\r\n return this.normalizeFromLength(this.length());\r\n }\r\n\r\n /**\r\n * Normalize the current Vector2 with the given input length.\r\n * Please note that this is an in place operation.\r\n * @param len the length of the vector\r\n * @returns the current updated Vector2\r\n */\r\n public normalizeFromLength(len: number): this {\r\n if (len === 0 || len === 1.0) {\r\n return this;\r\n }\r\n\r\n return this.scaleInPlace(1.0 / len);\r\n }\r\n\r\n /**\r\n * Normalize the current Vector2 to a new vector\r\n * @returns the new Vector2\r\n */\r\n public normalizeToNew(): Vector2 {\r\n const normalized = new Vector2();\r\n this.normalizeToRef(normalized);\r\n return normalized;\r\n }\r\n\r\n /**\r\n * Normalize the current Vector2 to the reference\r\n * @param result define the Vector to update\r\n * @returns the updated Vector2\r\n */\r\n public normalizeToRef<T extends IVector2Like>(result: T): T {\r\n const len = this.length();\r\n if (len === 0) {\r\n result.x = this.x;\r\n result.y = this.y;\r\n }\r\n return this.scaleToRef(1.0 / len, result);\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 copied from the Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#20\r\n * @returns a new Vector2\r\n */\r\n public clone(): Vector2 {\r\n return new Vector2(this.x, this.y);\r\n }\r\n\r\n /**\r\n * Gets the dot product of the current vector and the vector \"otherVector\"\r\n * @param otherVector defines second vector\r\n * @returns the dot product (float)\r\n */\r\n public dot(otherVector: DeepImmutable<IVector2Like>): number {\r\n return this.x * otherVector.x + this.y * otherVector.y;\r\n }\r\n\r\n // Statics\r\n\r\n /**\r\n * Gets a new Vector2(0, 0)\r\n * @returns a new Vector2\r\n */\r\n public static Zero(): Vector2 {\r\n return new Vector2(0, 0);\r\n }\r\n\r\n /**\r\n * Gets a new Vector2(1, 1)\r\n * @returns a new Vector2\r\n */\r\n public static One(): Vector2 {\r\n return new Vector2(1, 1);\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @returns a Vector2 with random values between min and max\r\n */\r\n public static Random(min: number = 0, max: number = 1): Vector2 {\r\n return new Vector2(RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Sets a Vector2 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @param ref the ref to store the values in\r\n * @returns the ref with random values between min and max\r\n */\r\n public static RandomToRef<T extends Vector2>(min: number = 0, max: number = 1, ref: T): T {\r\n return ref.copyFromFloats(RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Gets a zero Vector2 that must not be updated\r\n */\r\n public static get ZeroReadOnly(): DeepImmutable<Vector2> {\r\n return Vector2._ZeroReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set from the given index element of the given array\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#79\r\n * @param array defines the data source\r\n * @param offset defines the offset in the data source\r\n * @returns a new Vector2\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Vector2 {\r\n return new Vector2(array[offset], array[offset + 1]);\r\n }\r\n\r\n /**\r\n * Sets \"result\" from the given index element of the given array\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#80\r\n * @param array defines the data source\r\n * @param offset defines the offset in the data source\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public static FromArrayToRef<T extends Vector2>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T {\r\n result.x = array[offset];\r\n result.y = array[offset + 1];\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the given floats.\r\n * @param x defines the x coordinate of the source\r\n * @param y defines the y coordinate of the source\r\n * @param result defines the Vector2 where to store the result\r\n * @returns the result vector\r\n */\r\n public static FromFloatsToRef<T extends Vector2>(x: number, y: number, result: T): T {\r\n result.copyFromFloats(x, y);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 located for \"amount\" (float) on the CatmullRom spline defined by the given four Vector2\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#65\r\n * @param value1 defines 1st point of control\r\n * @param value2 defines 2nd point of control\r\n * @param value3 defines 3rd point of control\r\n * @param value4 defines 4th point of control\r\n * @param amount defines the interpolation factor\r\n * @returns a new Vector2\r\n */\r\n public static CatmullRom(\r\n value1: DeepImmutable<IVector2Like>,\r\n value2: DeepImmutable<IVector2Like>,\r\n value3: DeepImmutable<IVector2Like>,\r\n value4: DeepImmutable<IVector2Like>,\r\n amount: number\r\n ): Vector2 {\r\n const squared = amount * amount;\r\n const cubed = amount * squared;\r\n\r\n const x =\r\n 0.5 *\r\n (2.0 * value2.x +\r\n (-value1.x + value3.x) * amount +\r\n (2.0 * value1.x - 5.0 * value2.x + 4.0 * value3.x - value4.x) * squared +\r\n (-value1.x + 3.0 * value2.x - 3.0 * value3.x + value4.x) * cubed);\r\n\r\n const y =\r\n 0.5 *\r\n (2.0 * value2.y +\r\n (-value1.y + value3.y) * amount +\r\n (2.0 * value1.y - 5.0 * value2.y + 4.0 * value3.y - value4.y) * squared +\r\n (-value1.y + 3.0 * value2.y - 3.0 * value3.y + value4.y) * cubed);\r\n\r\n return new Vector2(x, y);\r\n }\r\n\r\n /**\r\n * Sets reference with same the coordinates than \"value\" ones if the vector \"value\" is in the square defined by \"min\" and \"max\".\r\n * If a coordinate of \"value\" is lower than \"min\" coordinates, the returned Vector2 is given this \"min\" coordinate.\r\n * If a coordinate of \"value\" is greater than \"max\" coordinates, the returned Vector2 is given this \"max\" coordinate\r\n * @param value defines the value to clamp\r\n * @param min defines the lower limit\r\n * @param max defines the upper limit\r\n * @param ref the reference\r\n * @returns the reference\r\n */\r\n public static ClampToRef<T extends Vector2>(value: DeepImmutable<IVector2Like>, min: DeepImmutable<IVector2Like>, max: DeepImmutable<IVector2Like>, ref: T): T {\r\n ref.x = Clamp(value.x, min.x, max.x);\r\n ref.y = Clamp(value.y, min.y, max.y);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 set with same the coordinates than \"value\" ones if the vector \"value\" is in the square defined by \"min\" and \"max\".\r\n * If a coordinate of \"value\" is lower than \"min\" coordinates, the returned Vector2 is given this \"min\" coordinate.\r\n * If a coordinate of \"value\" is greater than \"max\" coordinates, the returned Vector2 is given this \"max\" coordinate\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#76\r\n * @param value defines the value to clamp\r\n * @param min defines the lower limit\r\n * @param max defines the upper limit\r\n * @returns a new Vector2\r\n */\r\n public static Clamp(value: DeepImmutable<IVector2Like>, min: DeepImmutable<IVector2Like>, max: DeepImmutable<IVector2Like>): Vector2 {\r\n const x = Clamp(value.x, min.x, max.x);\r\n const y = Clamp(value.y, min.y, max.y);\r\n return new Vector2(x, y);\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 located for \"amount\" (float) on the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#81\r\n * @param value1 defines the 1st control point\r\n * @param tangent1 defines the outgoing tangent\r\n * @param value2 defines the 2nd control point\r\n * @param tangent2 defines the incoming tangent\r\n * @param amount defines the interpolation factor\r\n * @returns a new Vector2\r\n */\r\n public static Hermite(\r\n value1: DeepImmutable<IVector2Like>,\r\n tangent1: DeepImmutable<IVector2Like>,\r\n value2: DeepImmutable<IVector2Like>,\r\n tangent2: DeepImmutable<IVector2Like>,\r\n amount: number\r\n ): Vector2 {\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 x = value1.x * part1 + value2.x * part2 + tangent1.x * part3 + tangent2.x * part4;\r\n const y = value1.y * part1 + value2.y * part2 + tangent1.y * part3 + tangent2.y * part4;\r\n\r\n return new Vector2(x, y);\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#82\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<IVector2Like>,\r\n tangent1: DeepImmutable<IVector2Like>,\r\n value2: DeepImmutable<IVector2Like>,\r\n tangent2: DeepImmutable<IVector2Like>,\r\n time: number\r\n ): Vector2 {\r\n return this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, new Vector2());\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#83\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 the derivative will be stored\r\n * @returns result input\r\n */\r\n public static Hermite1stDerivativeToRef<T extends Vector2>(\r\n value1: DeepImmutable<IVector2Like>,\r\n tangent1: DeepImmutable<IVector2Like>,\r\n value2: DeepImmutable<IVector2Like>,\r\n tangent2: DeepImmutable<IVector2Like>,\r\n time: number,\r\n result: T\r\n ): T {\r\n const t2 = time * time;\r\n\r\n result.x = (t2 - time) * 6 * value1.x + (3 * t2 - 4 * time + 1) * tangent1.x + (-t2 + time) * 6 * value2.x + (3 * t2 - 2 * time) * tangent2.x;\r\n result.y = (t2 - time) * 6 * value1.y + (3 * t2 - 4 * time + 1) * tangent1.y + (-t2 + time) * 6 * value2.y + (3 * t2 - 2 * time) * tangent2.y;\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 located for \"amount\" (float) on the linear interpolation between the vector \"start\" adn the vector \"end\".\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#84\r\n * @param start defines the start vector\r\n * @param end defines the end vector\r\n * @param amount defines the interpolation factor\r\n * @returns a new Vector2\r\n */\r\n public static Lerp(start: DeepImmutable<IVector2Like>, end: DeepImmutable<IVector2Like>, amount: number): Vector2 {\r\n return Vector2.LerpToRef(start, end, amount, new Vector2());\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the linear interpolation from the vector \"start\" for \"amount\" to the vector \"end\"\r\n * @param start defines the start value\r\n * @param end defines the end value\r\n * @param amount max defines amount between both (between 0 and 1)\r\n * @param result defines the Vector2 where to store the result\r\n * @returns result input\r\n */\r\n public static LerpToRef(start: DeepImmutable<IVector2Like>, end: DeepImmutable<IVector2Like>, amount: number, result: Vector2): Vector2 {\r\n result.x = start.x + (end.x - start.x) * amount;\r\n result.y = start.y + (end.y - start.y) * amount;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets the dot product of the vector \"left\" and the vector \"right\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#90\r\n * @param left defines first vector\r\n * @param right defines second vector\r\n * @returns the dot product (float)\r\n */\r\n public static Dot(left: DeepImmutable<IVector2Like>, right: DeepImmutable<IVector2Like>): number {\r\n return left.x * right.x + left.y * right.y;\r\n }\r\n\r\n /**\r\n * Returns a new Vector2 equal to the normalized given vector\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#46\r\n * @param vector defines the vector to normalize\r\n * @returns a new Vector2\r\n */\r\n public static Normalize(vector: DeepImmutable<Vector2>): Vector2 {\r\n return Vector2.NormalizeToRef(vector, new Vector2());\r\n }\r\n\r\n /**\r\n * Normalize a given vector into a second one\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#50\r\n * @param vector defines the vector to normalize\r\n * @param result defines the vector where to store the result\r\n * @returns result input\r\n */\r\n public static NormalizeToRef<T extends Vector2>(vector: DeepImmutable<Vector2>, result: T): T {\r\n vector.normalizeToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set with the minimal coordinate values from the \"left\" and \"right\" vectors\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#86\r\n * @param left defines 1st vector\r\n * @param right defines 2nd vector\r\n * @returns a new Vector2\r\n */\r\n public static Minimize(left: DeepImmutable<IVector2Like>, right: DeepImmutable<IVector2Like>): Vector2 {\r\n const x = left.x < right.x ? left.x : right.x;\r\n const y = left.y < right.y ? left.y : right.y;\r\n return new Vector2(x, y);\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set with the maximal coordinate values from the \"left\" and \"right\" vectors\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#86\r\n * @param left defines 1st vector\r\n * @param right defines 2nd vector\r\n * @returns a new Vector2\r\n */\r\n public static Maximize(left: DeepImmutable<IVector2Like>, right: DeepImmutable<IVector2Like>): Vector2 {\r\n const x = left.x > right.x ? left.x : right.x;\r\n const y = left.y > right.y ? left.y : right.y;\r\n return new Vector2(x, y);\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 set with the transformed coordinates of the given vector by the given transformation matrix\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#17\r\n * @param vector defines the vector to transform\r\n * @param transformation defines the matrix to apply\r\n * @returns a new Vector2\r\n */\r\n public static Transform(vector: DeepImmutable<IVector2Like>, transformation: DeepImmutable<Matrix>): Vector2 {\r\n return Vector2.TransformToRef(vector, transformation, new Vector2());\r\n }\r\n\r\n /**\r\n * Transforms the given vector coordinates by the given transformation matrix and stores the result in the vector \"result\" coordinates\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#19\r\n * @param vector defines the vector to transform\r\n * @param transformation defines the matrix to apply\r\n * @param result defines the target vector\r\n * @returns result input\r\n */\r\n public static TransformToRef<T extends Vector2>(vector: DeepImmutable<IVector2Like>, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n const x = vector.x * m[0] + vector.y * m[4] + m[12];\r\n const y = vector.x * m[1] + vector.y * m[5] + m[13];\r\n result.x = x;\r\n result.y = y;\r\n return result;\r\n }\r\n\r\n /**\r\n * Determines if a given vector is included in a triangle\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#87\r\n * @param p defines the vector to test\r\n * @param p0 defines 1st triangle point\r\n * @param p1 defines 2nd triangle point\r\n * @param p2 defines 3rd triangle point\r\n * @returns true if the point \"p\" is in the triangle defined by the vectors \"p0\", \"p1\", \"p2\"\r\n */\r\n public static PointInTriangle(p: DeepImmutable<IVector2Like>, p0: DeepImmutable<IVector2Like>, p1: DeepImmutable<IVector2Like>, p2: DeepImmutable<IVector2Like>): boolean {\r\n const a = (1 / 2) * (-p1.y * p2.x + p0.y * (-p1.x + p2.x) + p0.x * (p1.y - p2.y) + p1.x * p2.y);\r\n const sign = a < 0 ? -1 : 1;\r\n const s = (p0.y * p2.x - p0.x * p2.y + (p2.y - p0.y) * p.x + (p0.x - p2.x) * p.y) * sign;\r\n const t = (p0.x * p1.y - p0.y * p1.x + (p0.y - p1.y) * p.x + (p1.x - p0.x) * p.y) * sign;\r\n\r\n return s > 0 && t > 0 && s + t < 2 * a * sign;\r\n }\r\n\r\n /**\r\n * Gets the distance between the vectors \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#71\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @returns the distance between vectors\r\n */\r\n public static Distance(value1: DeepImmutable<IVector2Like>, value2: DeepImmutable<IVector2Like>): number {\r\n return Math.sqrt(Vector2.DistanceSquared(value1, value2));\r\n }\r\n\r\n /**\r\n * Returns the squared distance between the vectors \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#72\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @returns the squared distance between vectors\r\n */\r\n public static DistanceSquared(value1: DeepImmutable<IVector2Like>, value2: DeepImmutable<IVector2Like>): number {\r\n const x = value1.x - value2.x;\r\n const y = value1.y - value2.y;\r\n return x * x + y * y;\r\n }\r\n\r\n /**\r\n * Gets a new Vector2 located at the center of the vectors \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#86\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#66\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @returns a new Vector2\r\n */\r\n public static Center(value1: DeepImmutable<IVector2Like>, value2: DeepImmutable<IVector2Like>): Vector2 {\r\n return Vector2.CenterToRef(value1, value2, new Vector2());\r\n }\r\n\r\n /**\r\n * Gets the center of the vectors \"value1\" and \"value2\" and stores the result in the vector \"ref\"\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#66\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @param ref defines third vector\r\n * @returns ref\r\n */\r\n public static CenterToRef<T extends Vector2>(value1: DeepImmutable<IVector2Like>, value2: DeepImmutable<IVector2Like>, ref: T): T {\r\n return ref.copyFromFloats((value1.x + value2.x) / 2, (value1.y + value2.y) / 2);\r\n }\r\n\r\n /**\r\n * Gets the shortest distance (float) between the point \"p\" and the segment defined by the two points \"segA\" and \"segB\".\r\n * Example Playground https://playground.babylonjs.com/#QYBWV4#77\r\n * @param p defines the middle point\r\n * @param segA defines one point of the segment\r\n * @param segB defines the other point of the segment\r\n * @returns the shortest distance\r\n */\r\n public static DistanceOfPointFromSegment(p: DeepImmutable<Vector2>, segA: DeepImmutable<Vector2>, segB: DeepImmutable<Vector2>): number {\r\n const l2 = Vector2.DistanceSquared(segA, segB);\r\n if (l2 === 0.0) {\r\n return Vector2.Distance(p, segA);\r\n }\r\n const v = segB.subtract(segA);\r\n const t = Math.max(0, Math.min(1, Vector2.Dot(p.subtract(segA), v) / l2));\r\n const proj = segA.add(v.multiplyByFloats(t, t));\r\n return Vector2.Distance(p, proj);\r\n }\r\n}\r\n\r\nVector2 satisfies TensorStatic<Vector2, IVector2Like>;\r\nObject.defineProperties(Vector2.prototype, {\r\n dimension: { value: [2] },\r\n rank: { value: 1 },\r\n});\r\n\r\ntype VectorInterceptor = (newValue: { x?: number; y?: number; z?: number }) => boolean;\r\n\r\n/**\r\n * Class used to store (x,y,z) vector representation\r\n * A Vector3 is the main object used in 3D geometry\r\n * It can represent either the coordinates of a point the space, either a direction\r\n * Reminder: js uses a left handed forward facing system\r\n * Example Playground - Overview - https://playground.babylonjs.com/#R1F8YU\r\n */\r\nexport class Vector3 implements Vector<Tuple<number, 3>, IVector3LikeInternal>, IVector3Like {\r\n /**\r\n * If the first vector is flagged with integers (as everything is 0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.\r\n * If subsequent vectors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,\r\n * and henceforth it will use floating-point representation for all Vector3 instances that it creates.\r\n * But the original Vector3 instances are unchanged and has a \"deprecated map\".\r\n * If we keep using the Vector3 instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.\r\n */\r\n static _V8PerformanceHack = new Vector3(0.5, 0.5, 0.5) as DeepImmutable<Vector3>;\r\n private static _UpReadOnly = Vector3.Up() as DeepImmutable<Vector3>;\r\n private static _DownReadOnly = Vector3.Down() as DeepImmutable<Vector3>;\r\n private static _LeftHandedForwardReadOnly = Vector3.Forward(false) as DeepImmutable<Vector3>;\r\n private static _RightHandedForwardReadOnly = Vector3.Forward(true) as DeepImmutable<Vector3>;\r\n private static _LeftHandedBackwardReadOnly = Vector3.Backward(false) as DeepImmutable<Vector3>;\r\n private static _RightHandedBackwardReadOnly = Vector3.Backward(true) as DeepImmutable<Vector3>;\r\n private static _RightReadOnly = Vector3.Right() as DeepImmutable<Vector3>;\r\n private static _LeftReadOnly = Vector3.Left() as DeepImmutable<Vector3>;\r\n private static _ZeroReadOnly = Vector3.Zero() as DeepImmutable<Vector3>;\r\n private static _OneReadOnly = Vector3.One() as DeepImmutable<Vector3>;\r\n\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n declare public readonly dimension: Readonly<[3]>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n declare public readonly rank: 1;\r\n\r\n /** @internal */\r\n public _x: number;\r\n\r\n /** @internal */\r\n public _y: number;\r\n\r\n /** @internal */\r\n public _z: number;\r\n\r\n /** @internal */\r\n public _isDirty = true;\r\n\r\n /** @internal */\r\n private _interceptor?: Nullable<VectorInterceptor> = null;\r\n\r\n /** Gets or sets the x coordinate */\r\n public get x() {\r\n return this._x;\r\n }\r\n\r\n public set x(value: number) {\r\n if (this._interceptor && this._interceptor({ x: value })) {\r\n return;\r\n }\r\n this._x = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the y coordinate */\r\n public get y() {\r\n return this._y;\r\n }\r\n\r\n public set y(value: number) {\r\n if (this._interceptor && this._interceptor({ y: value })) {\r\n return;\r\n }\r\n this._y = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the z coordinate */\r\n public get z() {\r\n return this._z;\r\n }\r\n\r\n public set z(value: number) {\r\n if (this._interceptor && this._interceptor({ z: value })) {\r\n return;\r\n }\r\n this._z = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Creates a new Vector3 object from the given x, y, z (floats) coordinates.\r\n * @param x defines the first coordinates (on X axis)\r\n * @param y defines the second coordinates (on Y axis)\r\n * @param z defines the third coordinates (on Z axis)\r\n * @param interceptor defines intercept the value change function\r\n */\r\n constructor(x: number = 0, y: number = 0, z: number = 0, interceptor?: VectorInterceptor) {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n if (interceptor) {\r\n this._interceptor = interceptor;\r\n }\r\n }\r\n\r\n /**\r\n * Creates a string representation of the Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#67\r\n * @returns a string with the Vector3 coordinates.\r\n */\r\n public toString(): string {\r\n return `{X: ${this._x} Y: ${this._y} Z: ${this._z}}`;\r\n }\r\n\r\n /**\r\n * Gets the class name\r\n * @returns the string \"Vector3\"\r\n */\r\n public getClassName(): string {\r\n return \"Vector3\";\r\n }\r\n\r\n /**\r\n * Creates the Vector3 hash code\r\n * @returns a number which tends to be unique between Vector3 instances\r\n */\r\n public getHashCode(): number {\r\n const x = ExtractAsInt(this._x);\r\n const y = ExtractAsInt(this._y);\r\n const z = ExtractAsInt(this._z);\r\n\r\n let hash = x;\r\n hash = (hash * 397) ^ y;\r\n hash = (hash * 397) ^ z;\r\n return hash;\r\n }\r\n\r\n // Operators\r\n\r\n /**\r\n * Creates an array containing three elements : the coordinates of the Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#10\r\n * @returns a new array of numbers\r\n */\r\n public asArray(): Tuple<number, 3> {\r\n return [this._x, this._y, this._z];\r\n }\r\n\r\n /**\r\n * Populates the given array or Float32Array from the given index with the successive coordinates of the Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#65\r\n * @param array defines the destination array\r\n * @param index defines the offset in the destination array\r\n * @returns the current Vector3\r\n */\r\n public toArray(array: FloatArray, index: number = 0): this {\r\n array[index] = this._x;\r\n array[index + 1] = this._y;\r\n array[index + 2] = this._z;\r\n return this;\r\n }\r\n\r\n /**\r\n * Update the current vector from an array\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#24\r\n * @param array defines the destination array\r\n * @param offset defines the offset in the destination array\r\n * @returns the current Vector3\r\n */\r\n public fromArray(array: DeepImmutable<FloatArray>, offset: number = 0): this {\r\n Vector3.FromArrayToRef(array, offset, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Intercept the x,y,z value change\r\n * @param interceptor\r\n */\r\n public setInterceptor(interceptor: (newValue: { x?: number; y?: number; z?: number }) => boolean) {\r\n this._interceptor = interceptor;\r\n }\r\n\r\n /**\r\n * Get the current interceptor\r\n * @returns the current vector interceptor\r\n */\r\n public getInterceptor(): Nullable<VectorInterceptor> | undefined {\r\n return this._interceptor;\r\n }\r\n\r\n /**\r\n * Converts the current Vector3 into a quaternion (considering that the Vector3 contains Euler angles representation of a rotation)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#66\r\n * @returns a new Quaternion object, computed from the Vector3 coordinates\r\n */\r\n public toQuaternion(): Quaternion {\r\n return Quaternion.RotationYawPitchRoll(this._y, this._x, this._z);\r\n }\r\n\r\n /**\r\n * Adds the given vector to the current Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#4\r\n * @param otherVector defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public addInPlace(otherVector: DeepImmutable<Vector3>): this {\r\n this._x += otherVector._x;\r\n this._y += otherVector._y;\r\n this._z += otherVector._z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the given coordinates to the current Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#5\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public addInPlaceFromFloats(x: number, y: number, z: number): this {\r\n this._x += x;\r\n this._y += y;\r\n this._z += z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets a new Vector3, result of the addition the current Vector3 and the given vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#3\r\n * @param otherVector defines the second operand\r\n * @returns the resulting Vector3\r\n */\r\n public add(otherVector: DeepImmutable<IVector3LikeInternal>): Vector3 {\r\n return new Vector3(this._x + otherVector._x, this._y + otherVector._y, this._z + otherVector._z);\r\n }\r\n\r\n /**\r\n * Adds the current Vector3 to the given one and stores the result in the vector \"result\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#6\r\n * @param otherVector defines the second operand\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public addToRef<T extends IVector3LikeInternal>(otherVector: DeepImmutable<IVector3LikeInternal>, result: T): T {\r\n result._x = this._x + otherVector._x;\r\n result._y = this._y + otherVector._y;\r\n result._z = this._z + otherVector._z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Subtract the given vector from the current Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#61\r\n * @param otherVector defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public subtractInPlace(otherVector: DeepImmutable<IVector3LikeInternal>): this {\r\n this._x -= otherVector._x;\r\n this._y -= otherVector._y;\r\n this._z -= otherVector._z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3, result of the subtraction of the given vector from the current Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#60\r\n * @param otherVector defines the second operand\r\n * @returns the resulting Vector3\r\n */\r\n public subtract(otherVector: DeepImmutable<IVector3LikeInternal>): Vector3 {\r\n return new Vector3(this._x - otherVector._x, this._y - otherVector._y, this._z - otherVector._z);\r\n }\r\n\r\n /**\r\n * Subtracts the given vector from the current Vector3 and stores the result in the vector \"result\".\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#63\r\n * @param otherVector defines the second operand\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public subtractToRef<T extends IVector3LikeInternal>(otherVector: DeepImmutable<IVector3LikeInternal>, result: T): T {\r\n return this.subtractFromFloatsToRef(otherVector._x, otherVector._y, otherVector._z, result);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the subtraction of the given floats from the current Vector3 coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#62\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the resulting Vector3\r\n */\r\n public subtractFromFloats(x: number, y: number, z: number): Vector3 {\r\n return new Vector3(this._x - x, this._y - y, this._z - z);\r\n }\r\n\r\n /**\r\n * Subtracts the given floats from the current Vector3 coordinates and set the given vector \"result\" with this result\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#64\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public subtractFromFloatsToRef<T extends IVector3LikeInternal>(x: number, y: number, z: number, result: T): T {\r\n result._x = this._x - x;\r\n result._y = this._y - y;\r\n result._z = this._z - z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector3 set with the current Vector3 negated coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#35\r\n * @returns a new Vector3\r\n */\r\n public negate(): Vector3 {\r\n return new Vector3(-this._x, -this._y, -this._z);\r\n }\r\n\r\n /**\r\n * Negate this vector in place\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#36\r\n * @returns this\r\n */\r\n public negateInPlace(): this {\r\n this._x *= -1;\r\n this._y *= -1;\r\n this._z *= -1;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Negate the current Vector3 and stores the result in the given vector \"result\" coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#37\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public negateToRef<T extends IVector3LikeInternal>(result: T): T {\r\n result._x = this._x * -1;\r\n result._y = this._y * -1;\r\n result._z = this._z * -1;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Multiplies the Vector3 coordinates by the float \"scale\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#56\r\n * @param scale defines the multiplier factor\r\n * @returns the current updated Vector3\r\n */\r\n public scaleInPlace(scale: number): this {\r\n this._x *= scale;\r\n this._y *= scale;\r\n this._z *= scale;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float \"scale\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#53\r\n * @param scale defines the multiplier factor\r\n * @returns a new Vector3\r\n */\r\n public scale(scale: number): Vector3 {\r\n return new Vector3(this._x * scale, this._y * scale, this._z * scale);\r\n }\r\n\r\n /**\r\n * Multiplies the current Vector3 coordinates by the float \"scale\" and stores the result in the given vector \"result\" coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#57\r\n * @param scale defines the multiplier factor\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public scaleToRef<T extends IVector3LikeInternal>(scale: number, result: T): T {\r\n result._x = this._x * scale;\r\n result._y = this._y * scale;\r\n result._z = this._z * scale;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a vector normal (perpendicular) to the current Vector3 and stores the result in the given vector\r\n * Out of the infinite possibilities the normal chosen is the one formed by rotating the current vector\r\n * 90 degrees about an axis which lies perpendicular to the current vector\r\n * and its projection on the xz plane. In the case of a current vector in the xz plane\r\n * the normal is calculated to be along the y axis.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#230\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#231\r\n * @param result defines the Vector3 object where to store the resultant normal\r\n * @returns the result\r\n */\r\n public getNormalToRef(result: Vector3): Vector3 {\r\n /**\r\n * Calculates the spherical coordinates of the current vector\r\n * so saves on memory rather than importing whole Spherical Class\r\n */\r\n const radius: number = this.length();\r\n let theta: number = Math.acos(this._y / radius);\r\n const phi = Math.atan2(this._z, this._x);\r\n //makes angle 90 degs to current vector\r\n if (theta > Math.PI / 2) {\r\n theta -= Math.PI / 2;\r\n } else {\r\n theta += Math.PI / 2;\r\n }\r\n //Calculates resutant normal vector from spherical coordinate of perpendicular vector\r\n const x = radius * Math.sin(theta) * Math.cos(phi);\r\n const y = radius * Math.cos(theta);\r\n const z = radius * Math.sin(theta) * Math.sin(phi);\r\n result.set(x, y, z);\r\n return result;\r\n }\r\n\r\n /**\r\n * Rotates the vector using the given unit quaternion and stores the new vector in result\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#9\r\n * @param q the unit quaternion representing the rotation\r\n * @param result the output vector\r\n * @returns the result\r\n */\r\n public applyRotationQuaternionToRef<T extends Vector3>(q: Quaternion, result: T): T {\r\n // Derived from https://raw.org/proof/vector-rotation-using-quaternions/\r\n\r\n const vx = this._x,\r\n vy = this._y,\r\n vz = this._z;\r\n const qx = q._x,\r\n qy = q._y,\r\n qz = q._z,\r\n qw = q._w;\r\n\r\n // t = 2q x v\r\n const tx = 2 * (qy * vz - qz * vy);\r\n const ty = 2 * (qz * vx - qx * vz);\r\n const tz = 2 * (qx * vy - qy * vx);\r\n\r\n // v + w t + q x t\r\n result._x = vx + qw * tx + qy * tz - qz * ty;\r\n result._y = vy + qw * ty + qz * tx - qx * tz;\r\n result._z = vz + qw * tz + qx * ty - qy * tx;\r\n\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Rotates the vector in place using the given unit quaternion\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#8\r\n * @param q the unit quaternion representing the rotation\r\n * @returns the current updated Vector3\r\n */\r\n public applyRotationQuaternionInPlace(q: Quaternion): this {\r\n return this.applyRotationQuaternionToRef(q, this);\r\n }\r\n\r\n /**\r\n * Rotates the vector using the given unit quaternion and returns the new vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#7\r\n * @param q the unit quaternion representing the rotation\r\n * @returns a new Vector3\r\n */\r\n public applyRotationQuaternion(q: Quaternion): Vector3 {\r\n return this.applyRotationQuaternionToRef(q, new Vector3());\r\n }\r\n\r\n /**\r\n * Scale the current Vector3 values by a factor and add the result to a given Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#55\r\n * @param scale defines the scale factor\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns result input\r\n */\r\n public scaleAndAddToRef<T extends IVector3LikeInternal>(scale: number, result: T): T {\r\n result._x += this._x * scale;\r\n result._y += this._y * scale;\r\n result._z += this._z * scale;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#48\r\n * @param plane defines the plane to project to\r\n * @param origin defines the origin of the projection ray\r\n * @returns the projected vector3\r\n */\r\n public projectOnPlane(plane: Plane, origin: Vector3): Vector3 {\r\n return this.projectOnPlaneToRef(plane, origin, new Vector3());\r\n }\r\n\r\n /**\r\n * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#49\r\n * @param plane defines the plane to project to\r\n * @param origin defines the origin of the projection ray\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public projectOnPlaneToRef<T extends Vector3>(plane: Plane, origin: Vector3, result: T): T {\r\n const n = plane.normal;\r\n const d = plane.d;\r\n\r\n const V = MathTmp.Vector3[0];\r\n\r\n // ray direction\r\n this.subtractToRef(origin, V);\r\n\r\n V.normalize();\r\n\r\n const denom = Vector3.Dot(V, n);\r\n\r\n //When the ray is close to parallel to the plane return infinity vector\r\n if (Math.abs(denom) < 0.0000000001) {\r\n result.setAll(Infinity);\r\n } else {\r\n const t = -(Vector3.Dot(origin, n) + d) / denom;\r\n\r\n // P = P0 + t*V\r\n const scaledV = V.scaleInPlace(t);\r\n origin.addToRef(scaledV, result);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns true if the current Vector3 and the given vector coordinates are strictly equal\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#19\r\n * @param otherVector defines the second operand\r\n * @returns true if both vectors are equals\r\n */\r\n public equals(otherVector: DeepImmutable<Vector3>): boolean {\r\n return otherVector && this._x === otherVector._x && this._y === otherVector._y && this._z === otherVector._z;\r\n }\r\n\r\n /**\r\n * Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#21\r\n * @param otherVector defines the second operand\r\n * @param epsilon defines the minimal distance to define values as equals\r\n * @returns true if both vectors are distant less than epsilon\r\n */\r\n public equalsWithEpsilon(otherVector: DeepImmutable<Vector3>, epsilon: number = Epsilon): boolean {\r\n return otherVector && WithinEpsilon(this._x, otherVector._x, epsilon) && WithinEpsilon(this._y, otherVector._y, epsilon) && WithinEpsilon(this._z, otherVector._z, epsilon);\r\n }\r\n\r\n /**\r\n * Returns true if the current Vector3 coordinates equals the given floats\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#20\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns true if both vectors are equal\r\n */\r\n public equalsToFloats(x: number, y: number, z: number): boolean {\r\n return this._x === x && this._y === y && this._z === z;\r\n }\r\n\r\n /**\r\n * Multiplies the current Vector3 coordinates by the given ones\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#32\r\n * @param otherVector defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public multiplyInPlace(otherVector: DeepImmutable<IVector3LikeInternal>): this {\r\n this._x *= otherVector._x;\r\n this._y *= otherVector._y;\r\n this._z *= otherVector._z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#31\r\n * @param otherVector defines the second operand\r\n * @returns the new Vector3\r\n */\r\n public multiply(otherVector: DeepImmutable<IVector3LikeInternal>): Vector3 {\r\n return this.multiplyByFloats(otherVector._x, otherVector._y, otherVector._z);\r\n }\r\n\r\n /**\r\n * Multiplies the current Vector3 by the given one and stores the result in the given vector \"result\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#33\r\n * @param otherVector defines the second operand\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public multiplyToRef<T extends IVector3LikeInternal>(otherVector: DeepImmutable<IVector3LikeInternal>, result: T): T {\r\n result._x = this._x * otherVector._x;\r\n result._y = this._y * otherVector._y;\r\n result._z = this._z * otherVector._z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the result of the multiplication of the current Vector3 coordinates by the given floats\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#34\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the new Vector3\r\n */\r\n public multiplyByFloats(x: number, y: number, z: number): Vector3 {\r\n return new Vector3(this._x * x, this._y * y, this._z * z);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#16\r\n * @param otherVector defines the second operand\r\n * @returns the new Vector3\r\n */\r\n public divide(otherVector: DeepImmutable<IVector3LikeInternal>): Vector3 {\r\n return new Vector3(this._x / otherVector._x, this._y / otherVector._y, this._z / otherVector._z);\r\n }\r\n\r\n /**\r\n * Divides the current Vector3 coordinates by the given ones and stores the result in the given vector \"result\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#18\r\n * @param otherVector defines the second operand\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public divideToRef<T extends IVector3LikeInternal>(otherVector: DeepImmutable<IVector3LikeInternal>, result: T): T {\r\n result._x = this._x / otherVector._x;\r\n result._y = this._y / otherVector._y;\r\n result._z = this._z / otherVector._z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Divides the current Vector3 coordinates by the given ones.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#17\r\n * @param otherVector defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public divideInPlace(otherVector: DeepImmutable<IVector3LikeInternal>): this {\r\n this._x = this._x / otherVector._x;\r\n this._y = this._y / otherVector._y;\r\n this._z = this._z / otherVector._z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector3 with the minimal coordinate values between its and the given vector ones\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#29\r\n * @param other defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public minimizeInPlace(other: DeepImmutable<IVector3LikeInternal>): this {\r\n return this.minimizeInPlaceFromFloats(other._x, other._y, other._z);\r\n }\r\n\r\n /**\r\n * Updates the current Vector3 with the maximal coordinate values between its and the given vector ones.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#27\r\n * @param other defines the second operand\r\n * @returns the current updated Vector3\r\n */\r\n public maximizeInPlace(other: DeepImmutable<IVector3LikeInternal>): this {\r\n return this.maximizeInPlaceFromFloats(other._x, other._y, other._z);\r\n }\r\n\r\n /**\r\n * Updates the current Vector3 with the minimal coordinate values between its and the given coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#30\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public minimizeInPlaceFromFloats(x: number, y: number, z: number): this {\r\n if (x < this._x) {\r\n this.x = x;\r\n }\r\n if (y < this._y) {\r\n this.y = y;\r\n }\r\n if (z < this._z) {\r\n this.z = z;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector3 with the maximal coordinate values between its and the given coordinates.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#28\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public maximizeInPlaceFromFloats(x: number, y: number, z: number): this {\r\n if (x > this._x) {\r\n this.x = x;\r\n }\r\n if (y > this._y) {\r\n this.y = y;\r\n }\r\n if (z > this._z) {\r\n this.z = z;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Due to float precision, scale of a mesh could be uniform but float values are off by a small fraction\r\n * Check if is non uniform within a certain amount of decimal places to account for this\r\n * @param epsilon the amount the values can differ\r\n * @returns if the vector is non uniform to a certain number of decimal places\r\n */\r\n public isNonUniformWithinEpsilon(epsilon: number) {\r\n const absX = Math.abs(this._x);\r\n const absY = Math.abs(this._y);\r\n if (!WithinEpsilon(absX, absY, epsilon)) {\r\n return true;\r\n }\r\n\r\n const absZ = Math.abs(this._z);\r\n if (!WithinEpsilon(absX, absZ, epsilon)) {\r\n return true;\r\n }\r\n\r\n if (!WithinEpsilon(absY, absZ, epsilon)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that the vector is non uniform meaning x, y or z are not all the same\r\n */\r\n public get isNonUniform(): boolean {\r\n const absX = Math.abs(this._x);\r\n const absY = Math.abs(this._y);\r\n if (absX !== absY) {\r\n return true;\r\n }\r\n\r\n const absZ = Math.abs(this._z);\r\n if (absX !== absZ) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets the current Vector3's floored values and stores them in result\r\n * @param result the vector to store the result in\r\n * @returns the result vector\r\n */\r\n public floorToRef<T extends IVector3LikeInternal>(result: T): T {\r\n result._x = Math.floor(this._x);\r\n result._y = Math.floor(this._y);\r\n result._z = Math.floor(this._z);\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector3 from current Vector3 floored values\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#22\r\n * @returns a new Vector3\r\n */\r\n public floor(): Vector3 {\r\n return new Vector3(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));\r\n }\r\n\r\n /**\r\n * Gets the current Vector3's fractional values and stores them in result\r\n * @param result the vector to store the result in\r\n * @returns the result vector\r\n */\r\n public fractToRef<T extends IVector3LikeInternal>(result: T): T {\r\n result._x = this._x - Math.floor(this._x);\r\n result._y = this._y - Math.floor(this._y);\r\n result._z = this._z - Math.floor(this._z);\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector3 from current Vector3 fractional values\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#23\r\n * @returns a new Vector3\r\n */\r\n public fract(): Vector3 {\r\n return new Vector3(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z));\r\n }\r\n\r\n // Properties\r\n /**\r\n * Gets the length of the Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#25\r\n * @returns the length of the Vector3\r\n */\r\n public length(): number {\r\n return Math.sqrt(this.lengthSquared());\r\n }\r\n\r\n /**\r\n * Gets the squared length of the Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#26\r\n * @returns squared length of the Vector3\r\n */\r\n public lengthSquared(): number {\r\n return this._x * this._x + this._y * this._y + this._z * this._z;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the vector contains a zero in one of its components\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#1\r\n */\r\n public get hasAZeroComponent(): boolean {\r\n return this._x * this._y * this._z === 0;\r\n }\r\n\r\n /**\r\n * Normalize the current Vector3.\r\n * Please note that this is an in place operation.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#122\r\n * @returns the current updated Vector3\r\n */\r\n public normalize(): this {\r\n return this.normalizeFromLength(this.length());\r\n }\r\n\r\n /**\r\n * Reorders the x y z properties of the vector in place\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#44\r\n * @param order new ordering of the properties (eg. for vector 1,2,3 with \"ZYX\" will produce 3,2,1)\r\n * @returns the current updated vector\r\n */\r\n public reorderInPlace(order: string) {\r\n order = order.toLowerCase();\r\n if (order === \"xyz\") {\r\n return this;\r\n }\r\n const tem = MathTmp.Vector3[0].copyFrom(this);\r\n this.x = (<any>tem)[order[0]];\r\n this.y = (<any>tem)[order[1]];\r\n this.z = (<any>tem)[order[2]];\r\n return this;\r\n }\r\n\r\n /**\r\n * Rotates the vector around 0,0,0 by a quaternion\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#47\r\n * @param quaternion the rotation quaternion\r\n * @param result vector to store the result\r\n * @returns the resulting vector\r\n */\r\n public rotateByQuaternionToRef<T extends Vector3>(quaternion: Quaternion, result: T): T {\r\n quaternion.toRotationMatrix(MathTmp.Matrix[0]);\r\n Vector3.TransformCoordinatesToRef(this, MathTmp.Matrix[0], result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Rotates a vector around a given point\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#46\r\n * @param quaternion the rotation quaternion\r\n * @param point the point to rotate around\r\n * @param result vector to store the result\r\n * @returns the resulting vector\r\n */\r\n public rotateByQuaternionAroundPointToRef<T extends Vector3>(quaternion: Quaternion, point: Vector3, result: T): T {\r\n this.subtractToRef(point, MathTmp.Vector3[0]);\r\n MathTmp.Vector3[0].rotateByQuaternionToRef(quaternion, MathTmp.Vector3[0]);\r\n point.addToRef(MathTmp.Vector3[0], result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 as the cross product of the current vector and the \"other\" one\r\n * The cross product is then orthogonal to both current and \"other\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#14\r\n * @param other defines the right operand\r\n * @returns the cross product\r\n */\r\n public cross(other: Vector3): Vector3 {\r\n return Vector3.CrossToRef(this, other, new Vector3());\r\n }\r\n\r\n /**\r\n * Normalize the current Vector3 with the given input length.\r\n * Please note that this is an in place operation.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#123\r\n * @param len the length of the vector\r\n * @returns the current updated Vector3\r\n */\r\n public normalizeFromLength(len: number): this {\r\n if (len === 0 || len === 1.0) {\r\n return this;\r\n }\r\n\r\n return this.scaleInPlace(1.0 / len);\r\n }\r\n\r\n /**\r\n * Normalize the current Vector3 to a new vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#124\r\n * @returns the new Vector3\r\n */\r\n public normalizeToNew(): Vector3 {\r\n return this.normalizeToRef(new Vector3());\r\n }\r\n\r\n /**\r\n * Normalize the current Vector3 to the reference\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#125\r\n * @param result define the Vector3 to update\r\n * @returns the updated Vector3\r\n */\r\n public normalizeToRef<T extends IVector3LikeInternal>(result: T): T {\r\n const len = this.length();\r\n if (len === 0 || len === 1.0) {\r\n result._x = this._x;\r\n result._y = this._y;\r\n result._z = this._z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n return this.scaleToRef(1.0 / len, result);\r\n }\r\n\r\n /**\r\n * Creates a new Vector3 copied from the current Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#11\r\n * @returns the new Vector3\r\n */\r\n public clone(): Vector3 {\r\n return new Vector3(this._x, this._y, this._z);\r\n }\r\n\r\n /**\r\n * Copies the given vector coordinates to the current Vector3 ones\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#12\r\n * @param source defines the source Vector3\r\n * @returns the current updated Vector3\r\n */\r\n public copyFrom(source: DeepImmutable<Vector3>): this {\r\n return this.copyFromFloats(source._x, source._y, source._z);\r\n }\r\n\r\n /**\r\n * Copies the given floats to the current Vector3 coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#13\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public copyFromFloats(x: number, y: number, z: number): this {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Copies the given floats to the current Vector3 coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#58\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public set(x: number, y: number, z: number): this {\r\n return this.copyFromFloats(x, y, z);\r\n }\r\n\r\n /**\r\n * Copies the given float to the current Vector3 coordinates\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#59\r\n * @param v defines the x, y and z coordinates of the operand\r\n * @returns the current updated Vector3\r\n */\r\n public setAll(v: number): this {\r\n this._x = this._y = this._z = v;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n // Statics\r\n\r\n /**\r\n * Get the clip factor between two vectors\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#126\r\n * @param vector0 defines the first operand\r\n * @param vector1 defines the second operand\r\n * @param axis defines the axis to use\r\n * @param size defines the size along the axis\r\n * @returns the clip factor\r\n */\r\n public static GetClipFactor(vector0: DeepImmutable<Vector3>, vector1: DeepImmutable<Vector3>, axis: DeepImmutable<Vector3>, size: number): number {\r\n const d0 = Vector3.Dot(vector0, axis);\r\n const d1 = Vector3.Dot(vector1, axis);\r\n\r\n return (d0 - size) / (d0 - d1);\r\n }\r\n\r\n /**\r\n * Get angle between two vectors\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#86\r\n * @param vector0 the starting point\r\n * @param vector1 the ending point\r\n * @param normal direction of the normal\r\n * @returns the angle between vector0 and vector1\r\n */\r\n public static GetAngleBetweenVectors(vector0: DeepImmutable<Vector3>, vector1: DeepImmutable<Vector3>, normal: DeepImmutable<Vector3>): number {\r\n const v0: Vector3 = vector0.normalizeToRef(MathTmp.Vector3[1]);\r\n const v1: Vector3 = vector1.normalizeToRef(MathTmp.Vector3[2]);\r\n let dot: number = Vector3.Dot(v0, v1);\r\n // Vectors are normalized so dot will be in [-1, 1] (aside precision issues enough to break the result which explains the below clamp)\r\n dot = Clamp(dot, -1, 1);\r\n\r\n const angle = Math.acos(dot);\r\n const n = MathTmp.Vector3[3];\r\n Vector3.CrossToRef(v0, v1, n);\r\n if (Vector3.Dot(n, normal) > 0) {\r\n return isNaN(angle) ? 0 : angle;\r\n }\r\n return isNaN(angle) ? -Math.PI : -Math.acos(dot);\r\n }\r\n\r\n /**\r\n * Get angle between two vectors projected on a plane\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#87\r\n * Expectation compute time: 0.01 ms (median) and 0.02 ms (percentile 95%)\r\n * @param vector0 angle between vector0 and vector1\r\n * @param vector1 angle between vector0 and vector1\r\n * @param normal Normal of the projection plane\r\n * @returns the angle in radians (float) between vector0 and vector1 projected on the plane with the specified normal\r\n */\r\n public static GetAngleBetweenVectorsOnPlane(vector0: DeepImmutable<Vector3>, vector1: DeepImmutable<Vector3>, normal: DeepImmutable<Vector3>): number {\r\n MathTmp.Vector3[0].copyFrom(vector0);\r\n const v0 = MathTmp.Vector3[0];\r\n MathTmp.Vector3[1].copyFrom(vector1);\r\n const v1 = MathTmp.Vector3[1];\r\n MathTmp.Vector3[2].copyFrom(normal);\r\n const vNormal = MathTmp.Vector3[2];\r\n const right = MathTmp.Vector3[3];\r\n const forward = MathTmp.Vector3[4];\r\n\r\n v0.normalize();\r\n v1.normalize();\r\n vNormal.normalize();\r\n\r\n Vector3.CrossToRef(vNormal, v0, right);\r\n Vector3.CrossToRef(right, vNormal, forward);\r\n\r\n const angle = Math.atan2(Vector3.Dot(v1, right), Vector3.Dot(v1, forward));\r\n\r\n return NormalizeRadians(angle);\r\n }\r\n\r\n /**\r\n * Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point and stores it in the ref Vector3\r\n * Example PG https://playground.babylonjs.com/#R1F8YU#189\r\n * @param start the starting point\r\n * @param target the target point\r\n * @param ref the vector3 to store the result\r\n * @returns ref in the form (pitch, yaw, 0)\r\n */\r\n public static PitchYawRollToMoveBetweenPointsToRef<T extends Vector3>(start: Vector3, target: Vector3, ref: T): T {\r\n const diff = TmpVectors.Vector3[0];\r\n target.subtractToRef(start, diff);\r\n ref._y = Math.atan2(diff.x, diff.z) || 0;\r\n ref._x = Math.atan2(Math.sqrt(diff.x ** 2 + diff.z ** 2), diff.y) || 0;\r\n ref._z = 0;\r\n ref._isDirty = true;\r\n return ref;\r\n }\r\n\r\n /**\r\n * Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point\r\n * Example PG https://playground.babylonjs.com/#R1F8YU#188\r\n * @param start the starting point\r\n * @param target the target point\r\n * @returns the rotation in the form (pitch, yaw, 0)\r\n */\r\n public static PitchYawRollToMoveBetweenPoints(start: Vector3, target: Vector3): Vector3 {\r\n const ref = Vector3.Zero();\r\n return Vector3.PitchYawRollToMoveBetweenPointsToRef(start, target, ref);\r\n }\r\n\r\n /**\r\n * Slerp between two vectors. See also `SmoothToRef`\r\n * Slerp is a spherical linear interpolation\r\n * giving a slow in and out effect\r\n * Example Playground 1 https://playground.babylonjs.com/#R1F8YU#108\r\n * Example Playground 2 https://playground.babylonjs.com/#R1F8YU#109\r\n * @param vector0 Start vector\r\n * @param vector1 End vector\r\n * @param slerp amount (will be clamped between 0 and 1)\r\n * @param result The slerped vector\r\n * @returns The slerped vector\r\n */\r\n public static SlerpToRef<T extends Vector3 = Vector3>(vector0: Vector3, vector1: Vector3, slerp: number, result: T): T {\r\n slerp = Clamp(slerp, 0, 1);\r\n const vector0Dir = MathTmp.Vector3[0];\r\n const vector1Dir = MathTmp.Vector3[1];\r\n\r\n vector0Dir.copyFrom(vector0);\r\n const vector0Length = vector0Dir.length();\r\n vector0Dir.normalizeFromLength(vector0Length);\r\n\r\n vector1Dir.copyFrom(vector1);\r\n const vector1Length = vector1Dir.length();\r\n vector1Dir.normalizeFromLength(vector1Length);\r\n\r\n const dot = Vector3.Dot(vector0Dir, vector1Dir);\r\n\r\n let scale0;\r\n let scale1;\r\n\r\n if (dot < 1 - Epsilon) {\r\n const omega = Math.acos(dot);\r\n const invSin = 1 / Math.sin(omega);\r\n scale0 = Math.sin((1 - slerp) * omega) * invSin;\r\n scale1 = Math.sin(slerp * omega) * invSin;\r\n } else {\r\n // Use linear interpolation\r\n scale0 = 1 - slerp;\r\n scale1 = slerp;\r\n }\r\n\r\n vector0Dir.scaleInPlace(scale0);\r\n vector1Dir.scaleInPlace(scale1);\r\n result.copyFrom(vector0Dir).addInPlace(vector1Dir);\r\n result.scaleInPlace(Lerp(vector0Length, vector1Length, slerp));\r\n return result;\r\n }\r\n\r\n /**\r\n * Smooth interpolation between two vectors using Slerp\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#110\r\n * @param source source vector\r\n * @param goal goal vector\r\n * @param deltaTime current interpolation frame\r\n * @param lerpTime total interpolation time\r\n * @param result the smoothed vector\r\n * @returns the smoothed vector\r\n */\r\n public static SmoothToRef<T extends Vector3 = Vector3>(source: Vector3, goal: Vector3, deltaTime: number, lerpTime: number, result: T): T {\r\n Vector3.SlerpToRef(source, goal, lerpTime === 0 ? 1 : deltaTime / lerpTime, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set from the index \"offset\" of the given array\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#83\r\n * @param array defines the source array\r\n * @param offset defines the offset in the source array\r\n * @returns the new Vector3\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Vector3 {\r\n return new Vector3(array[offset], array[offset + 1], array[offset + 2]);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set from the index \"offset\" of the given Float32Array\r\n * @param array defines the source array\r\n * @param offset defines the offset in the source array\r\n * @returns the new Vector3\r\n * @deprecated Please use FromArray instead.\r\n */\r\n public static FromFloatArray(array: DeepImmutable<Float32Array>, offset?: number): Vector3 {\r\n return Vector3.FromArray(array, offset);\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the element values from the index \"offset\" of the given array\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#84\r\n * @param array defines the source array\r\n * @param offset defines the offset in the source array\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static FromArrayToRef<T extends Vector3>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T {\r\n result._x = array[offset];\r\n result._y = array[offset + 1];\r\n result._z = array[offset + 2];\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the element values from the index \"offset\" of the given Float32Array\r\n * @param array defines the source array\r\n * @param offset defines the offset in the source array\r\n * @param result defines the Vector3 where to store the result\r\n * @deprecated Please use FromArrayToRef instead.\r\n * @returns result input\r\n */\r\n public static FromFloatArrayToRef<T extends Vector3>(array: DeepImmutable<Float32Array>, offset: number, result: T): T {\r\n return Vector3.FromArrayToRef<T>(array, offset, result);\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the given floats.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#85\r\n * @param x defines the x coordinate of the source\r\n * @param y defines the y coordinate of the source\r\n * @param z defines the z coordinate of the source\r\n * @param result defines the Vector3 where to store the result\r\n * @returns the result vector\r\n */\r\n public static FromFloatsToRef<T extends Vector3 = Vector3>(x: number, y: number, z: number, result: T): T {\r\n result.copyFromFloats(x, y, z);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (0.0, 0.0, 0.0)\r\n * @returns a new empty Vector3\r\n */\r\n public static Zero(): Vector3 {\r\n return new Vector3(0.0, 0.0, 0.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (1.0, 1.0, 1.0)\r\n * @returns a new Vector3\r\n */\r\n public static One(): Vector3 {\r\n return new Vector3(1.0, 1.0, 1.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (0.0, 1.0, 0.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @returns a new up Vector3\r\n */\r\n public static Up(): Vector3 {\r\n return new Vector3(0.0, 1.0, 0.0);\r\n }\r\n\r\n /**\r\n * Gets an up Vector3 that must not be updated\r\n */\r\n public static get UpReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._UpReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a down Vector3 that must not be updated\r\n */\r\n public static get DownReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._DownReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a right Vector3 that must not be updated\r\n */\r\n public static get RightReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._RightReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a left Vector3 that must not be updated\r\n */\r\n public static get LeftReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._LeftReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a forward Vector3 that must not be updated\r\n */\r\n public static get LeftHandedForwardReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._LeftHandedForwardReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a forward Vector3 that must not be updated\r\n */\r\n public static get RightHandedForwardReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._RightHandedForwardReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a backward Vector3 that must not be updated\r\n */\r\n public static get LeftHandedBackwardReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._LeftHandedBackwardReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a backward Vector3 that must not be updated\r\n */\r\n public static get RightHandedBackwardReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._RightHandedBackwardReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a zero Vector3 that must not be updated\r\n */\r\n public static get ZeroReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._ZeroReadOnly;\r\n }\r\n\r\n /**\r\n * Gets a one Vector3 that must not be updated\r\n */\r\n public static get OneReadOnly(): DeepImmutable<Vector3> {\r\n return Vector3._OneReadOnly;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (0.0, -1.0, 0.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @returns a new down Vector3\r\n */\r\n public static Down(): Vector3 {\r\n return new Vector3(0.0, -1.0, 0.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (0.0, 0.0, 1.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @param rightHandedSystem is the scene right-handed (negative z)\r\n * @returns a new forward Vector3\r\n */\r\n public static Forward(rightHandedSystem: boolean = false): Vector3 {\r\n return new Vector3(0.0, 0.0, rightHandedSystem ? -1.0 : 1.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (0.0, 0.0, -1.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @param rightHandedSystem is the scene right-handed (negative-z)\r\n * @returns a new Backward Vector3\r\n */\r\n public static Backward(rightHandedSystem: boolean = false): Vector3 {\r\n return new Vector3(0.0, 0.0, rightHandedSystem ? 1.0 : -1.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (1.0, 0.0, 0.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @returns a new right Vector3\r\n */\r\n public static Right(): Vector3 {\r\n return new Vector3(1.0, 0.0, 0.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set to (-1.0, 0.0, 0.0)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\r\n * @returns a new left Vector3\r\n */\r\n public static Left(): Vector3 {\r\n return new Vector3(-1.0, 0.0, 0.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @returns a Vector3 with random values between min and max\r\n */\r\n public static Random(min: number = 0, max: number = 1): Vector3 {\r\n return new Vector3(RandomRange(min, max), RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Sets a Vector3 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @param ref the ref to store the values in\r\n * @returns the ref with random values between min and max\r\n */\r\n public static RandomToRef<T extends Vector3>(min: number = 0, max: number = 1, ref: T): T {\r\n return ref.copyFromFloats(RandomRange(min, max), RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the result of the transformation by the given matrix of the given vector.\r\n * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#111\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @returns the transformed Vector3\r\n */\r\n public static TransformCoordinates(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>): Vector3 {\r\n const result = Vector3.Zero();\r\n Vector3.TransformCoordinatesToRef(vector, transformation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given vector\r\n * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#113\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformCoordinatesToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T {\r\n Vector3.TransformCoordinatesFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)\r\n * This method computes transformed coordinates only, not transformed direction vectors\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#115\r\n * @param x define the x coordinate of the source vector\r\n * @param y define the y coordinate of the source vector\r\n * @param z define the z coordinate of the source vector\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformCoordinatesFromFloatsToRef<T extends Vector3>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n const rx = x * m[0] + y * m[4] + z * m[8] + m[12];\r\n const ry = x * m[1] + y * m[5] + z * m[9] + m[13];\r\n const rz = x * m[2] + y * m[6] + z * m[10] + m[14];\r\n const rw = 1 / (x * m[3] + y * m[7] + z * m[11] + m[15]);\r\n\r\n result._x = rx * rw;\r\n result._y = ry * rw;\r\n result._z = rz * rw;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector\r\n * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#112\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @returns the new Vector3\r\n */\r\n public static TransformNormal(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>): Vector3 {\r\n const result = Vector3.Zero();\r\n Vector3.TransformNormalToRef(vector, transformation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the normal transformation by the given matrix of the given vector\r\n * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#114\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformNormalToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T {\r\n this.TransformNormalFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the normal transformation by the given matrix of the given floats (x, y, z)\r\n * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#116\r\n * @param x define the x coordinate of the source vector\r\n * @param y define the y coordinate of the source vector\r\n * @param z define the z coordinate of the source vector\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformNormalFromFloatsToRef<T extends Vector3>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n result._x = x * m[0] + y * m[4] + z * m[8];\r\n result._y = x * m[1] + y * m[5] + z * m[9];\r\n result._z = x * m[2] + y * m[6] + z * m[10];\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 located for \"amount\" on the CatmullRom interpolation spline defined by the vectors \"value1\", \"value2\", \"value3\", \"value4\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#69\r\n * @param value1 defines the first control point\r\n * @param value2 defines the second control point\r\n * @param value3 defines the third control point\r\n * @param value4 defines the fourth control point\r\n * @param amount defines the amount on the spline to use\r\n * @returns the new Vector3\r\n */\r\n public static CatmullRom(\r\n value1: DeepImmutable<Vector3>,\r\n value2: DeepImmutable<Vector3>,\r\n value3: DeepImmutable<Vector3>,\r\n value4: DeepImmutable<Vector3>,\r\n amount: number\r\n ): Vector3 {\r\n const squared = amount * amount;\r\n const cubed = amount * squared;\r\n\r\n const x =\r\n 0.5 *\r\n (2.0 * value2._x +\r\n (-value1._x + value3._x) * amount +\r\n (2.0 * value1._x - 5.0 * value2._x + 4.0 * value3._x - value4._x) * squared +\r\n (-value1._x + 3.0 * value2._x - 3.0 * value3._x + value4._x) * cubed);\r\n\r\n const y =\r\n 0.5 *\r\n (2.0 * value2._y +\r\n (-value1._y + value3._y) * amount +\r\n (2.0 * value1._y - 5.0 * value2._y + 4.0 * value3._y - value4._y) * squared +\r\n (-value1._y + 3.0 * value2._y - 3.0 * value3._y + value4._y) * cubed);\r\n\r\n const z =\r\n 0.5 *\r\n (2.0 * value2._z +\r\n (-value1._z + value3._z) * amount +\r\n (2.0 * value1._z - 5.0 * value2._z + 4.0 * value3._z - value4._z) * squared +\r\n (-value1._z + 3.0 * value2._z - 3.0 * value3._z + value4._z) * cubed);\r\n\r\n return new Vector3(x, y, z);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the coordinates of \"value\", if the vector \"value\" is in the cube defined by the vectors \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#76\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @returns the new Vector3\r\n */\r\n public static Clamp(value: DeepImmutable<Vector3>, min: DeepImmutable<Vector3>, max: DeepImmutable<Vector3>): Vector3 {\r\n const result = new Vector3();\r\n Vector3.ClampToRef(value, min, max, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the coordinates of \"value\", if the vector \"value\" is in the cube defined by the vectors \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#77\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static ClampToRef<T extends Vector3>(value: DeepImmutable<Vector3>, min: DeepImmutable<Vector3>, max: DeepImmutable<Vector3>, result: T): T {\r\n let x = value._x;\r\n x = x > max._x ? max._x : x;\r\n x = x < min._x ? min._x : x;\r\n\r\n let y = value._y;\r\n y = y > max._y ? max._y : y;\r\n y = y < min._y ? min._y : y;\r\n\r\n let z = value._z;\r\n z = z > max._z ? max._z : z;\r\n z = z < min._z ? min._z : z;\r\n\r\n result.copyFromFloats(x, y, z);\r\n return result;\r\n }\r\n\r\n /**\r\n * Checks if a given vector is inside a specific range\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#75\r\n * @param v defines the vector to test\r\n * @param min defines the minimum range\r\n * @param max defines the maximum range\r\n */\r\n public static CheckExtends(v: Vector3, min: Vector3, max: Vector3): void {\r\n min.minimizeInPlace(v);\r\n max.maximizeInPlace(v);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 located for \"amount\" (float) on the Hermite interpolation spline defined by the vectors \"value1\", \"tangent1\", \"value2\", \"tangent2\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#89\r\n * @param value1 defines the first control point\r\n * @param tangent1 defines the first tangent vector\r\n * @param value2 defines the second control point\r\n * @param tangent2 defines the second tangent vector\r\n * @param amount defines the amount on the interpolation spline (between 0 and 1)\r\n * @returns the new Vector3\r\n */\r\n public static Hermite(\r\n value1: DeepImmutable<Vector3>,\r\n tangent1: DeepImmutable<Vector3>,\r\n value2: DeepImmutable<Vector3>,\r\n tangent2: DeepImmutable<Vector3>,\r\n amount: number\r\n ): Vector3 {\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 x = value1._x * part1 + value2._x * part2 + tangent1._x * part3 + tangent2._x * part4;\r\n const y = value1._y * part1 + value2._y * part2 + tangent1._y * part3 + tangent2._y * part4;\r\n const z = value1._z * part1 + value2._z * part2 + tangent1._z * part3 + tangent2._z * part4;\r\n return new Vector3(x, y, z);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 which is the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#90\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<Vector3>,\r\n tangent1: DeepImmutable<Vector3>,\r\n value2: DeepImmutable<Vector3>,\r\n tangent2: DeepImmutable<Vector3>,\r\n time: number\r\n ): Vector3 {\r\n const result = new Vector3();\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 Vector3 with the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#91\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 * @returns result input\r\n */\r\n public static Hermite1stDerivativeToRef<T extends Vector3>(\r\n value1: DeepImmutable<Vector3>,\r\n tangent1: DeepImmutable<Vector3>,\r\n value2: DeepImmutable<Vector3>,\r\n tangent2: DeepImmutable<Vector3>,\r\n time: number,\r\n result: T\r\n ): T {\r\n const t2 = time * time;\r\n\r\n result._x = (t2 - time) * 6 * value1._x + (3 * t2 - 4 * time + 1) * tangent1._x + (-t2 + time) * 6 * value2._x + (3 * t2 - 2 * time) * tangent2._x;\r\n result._y = (t2 - time) * 6 * value1._y + (3 * t2 - 4 * time + 1) * tangent1._y + (-t2 + time) * 6 * value2._y + (3 * t2 - 2 * time) * tangent2._y;\r\n result._z = (t2 - time) * 6 * value1._z + (3 * t2 - 4 * time + 1) * tangent1._z + (-t2 + time) * 6 * value2._z + (3 * t2 - 2 * time) * tangent2._z;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 located for \"amount\" (float) on the linear interpolation between the vectors \"start\" and \"end\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#95\r\n * @param start defines the start value\r\n * @param end defines the end value\r\n * @param amount max defines amount between both (between 0 and 1)\r\n * @returns the new Vector3\r\n */\r\n public static Lerp(start: DeepImmutable<Vector3>, end: DeepImmutable<Vector3>, amount: number): Vector3 {\r\n const result = new Vector3(0, 0, 0);\r\n Vector3.LerpToRef(start, end, amount, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the linear interpolation from the vector \"start\" for \"amount\" to the vector \"end\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#93\r\n * @param start defines the start value\r\n * @param end defines the end value\r\n * @param amount max defines amount between both (between 0 and 1)\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static LerpToRef<T extends Vector3>(start: DeepImmutable<Vector3>, end: DeepImmutable<Vector3>, amount: number, result: T): T {\r\n result._x = start._x + (end._x - start._x) * amount;\r\n result._y = start._y + (end._y - start._y) * amount;\r\n result._z = start._z + (end._z - start._z) * amount;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the vectors \"left\" and \"right\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#82\r\n * @param left defines the left operand\r\n * @param right defines the right operand\r\n * @returns the dot product\r\n */\r\n public static Dot(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): number {\r\n return left._x * right._x + left._y * right._y + left._z * right._z;\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the current vectors and \"otherVector\"\r\n * @param otherVector defines the right operand\r\n * @returns the dot product\r\n */\r\n public dot(otherVector: DeepImmutable<Vector3>): number {\r\n return this._x * otherVector._x + this._y * otherVector._y + this._z * otherVector._z;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 as the cross product of the vectors \"left\" and \"right\"\r\n * The cross product is then orthogonal to both \"left\" and \"right\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#15\r\n * @param left defines the left operand\r\n * @param right defines the right operand\r\n * @returns the cross product\r\n */\r\n public static Cross(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): Vector3 {\r\n const result = new Vector3();\r\n Vector3.CrossToRef(left, right, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the cross product of \"left\" and \"right\"\r\n * The cross product is then orthogonal to both \"left\" and \"right\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#78\r\n * @param left defines the left operand\r\n * @param right defines the right operand\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static CrossToRef<T extends Vector3>(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>, result: T): T {\r\n const x = left._y * right._z - left._z * right._y;\r\n const y = left._z * right._x - left._x * right._z;\r\n const z = left._x * right._y - left._y * right._x;\r\n result.copyFromFloats(x, y, z);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 as the normalization of the given vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#98\r\n * @param vector defines the Vector3 to normalize\r\n * @returns the new Vector3\r\n */\r\n public static Normalize(vector: DeepImmutable<Vector3>): Vector3 {\r\n const result = Vector3.Zero();\r\n Vector3.NormalizeToRef(vector, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the normalization of the given first vector\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#98\r\n * @param vector defines the Vector3 to normalize\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static NormalizeToRef<T extends Vector3>(vector: DeepImmutable<Vector3>, result: T): T {\r\n vector.normalizeToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Project a Vector3 onto screen space\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#101\r\n * @param vector defines the Vector3 to project\r\n * @param world defines the world matrix to use\r\n * @param transform defines the transform (view x projection) matrix to use\r\n * @param viewport defines the screen viewport to use\r\n * @returns the new Vector3\r\n */\r\n public static Project(vector: DeepImmutable<Vector3>, world: DeepImmutable<Matrix>, transform: DeepImmutable<Matrix>, viewport: DeepImmutable<Viewport>): Vector3 {\r\n const result = new Vector3();\r\n Vector3.ProjectToRef(vector, world, transform, viewport, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Project a Vector3 onto screen space to reference\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#102\r\n * @param vector defines the Vector3 to project\r\n * @param world defines the world matrix to use\r\n * @param transform defines the transform (view x projection) matrix to use\r\n * @param viewport defines the screen viewport to use\r\n * @param result the vector in which the screen space will be stored\r\n * @returns result input\r\n */\r\n public static ProjectToRef<T extends Vector3>(\r\n vector: DeepImmutable<Vector3>,\r\n world: DeepImmutable<Matrix>,\r\n transform: DeepImmutable<Matrix>,\r\n viewport: DeepImmutable<Viewport>,\r\n result: T\r\n ): T {\r\n const cw = viewport.width;\r\n const ch = viewport.height;\r\n const cx = viewport.x;\r\n const cy = viewport.y;\r\n\r\n const viewportMatrix = MathTmp.Matrix[1];\r\n\r\n const isNDCHalfZRange = EngineStore.LastCreatedEngine?.isNDCHalfZRange;\r\n const zScale = isNDCHalfZRange ? 1 : 0.5;\r\n const zOffset = isNDCHalfZRange ? 0 : 0.5;\r\n\r\n Matrix.FromValuesToRef(cw / 2.0, 0, 0, 0, 0, -ch / 2.0, 0, 0, 0, 0, zScale, 0, cx + cw / 2.0, ch / 2.0 + cy, zOffset, 1, viewportMatrix);\r\n\r\n const matrix = MathTmp.Matrix[0];\r\n world.multiplyToRef(transform, matrix);\r\n matrix.multiplyToRef(viewportMatrix, matrix);\r\n\r\n Vector3.TransformCoordinatesToRef(vector, matrix, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Reflects a vector off the plane defined by a normalized normal\r\n * @param inDirection defines the vector direction\r\n * @param normal defines the normal - Must be normalized\r\n * @returns the resulting vector\r\n */\r\n public static Reflect(inDirection: DeepImmutable<Vector3>, normal: DeepImmutable<Vector3>): Vector3 {\r\n return this.ReflectToRef(inDirection, normal, new Vector3());\r\n }\r\n\r\n /**\r\n * Reflects a vector off the plane defined by a normalized normal to reference\r\n * @param inDirection defines the vector direction\r\n * @param normal defines the normal - Must be normalized\r\n * @param ref defines the Vector3 where to store the result\r\n * @returns the resulting vector\r\n */\r\n public static ReflectToRef<T extends Vector3>(inDirection: DeepImmutable<Vector3>, normal: DeepImmutable<Vector3>, ref: T): T {\r\n const tmp = TmpVectors.Vector3[0];\r\n tmp.copyFrom(normal).scaleInPlace(2 * Vector3.Dot(inDirection, normal));\r\n\r\n return ref.copyFrom(inDirection).subtractInPlace(tmp);\r\n }\r\n\r\n /**\r\n * Unproject from screen space to object space\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#121\r\n * @param source defines the screen space Vector3 to use\r\n * @param viewportWidth defines the current width of the viewport\r\n * @param viewportHeight defines the current height of the viewport\r\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\r\n * @param transform defines the transform (view x projection) matrix to use\r\n * @returns the new Vector3\r\n */\r\n public static UnprojectFromTransform(\r\n source: DeepImmutable<Vector3>,\r\n viewportWidth: number,\r\n viewportHeight: number,\r\n world: DeepImmutable<Matrix>,\r\n transform: DeepImmutable<Matrix>\r\n ): Vector3 {\r\n return this.Unproject(source, viewportWidth, viewportHeight, world, transform, Matrix.IdentityReadOnly);\r\n }\r\n\r\n /**\r\n * Unproject from screen space to object space\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#117\r\n * @param source defines the screen space Vector3 to use\r\n * @param viewportWidth defines the current width of the viewport\r\n * @param viewportHeight defines the current height of the viewport\r\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\r\n * @param view defines the view matrix to use\r\n * @param projection defines the projection matrix to use\r\n * @returns the new Vector3\r\n */\r\n public static Unproject(\r\n source: DeepImmutable<Vector3>,\r\n viewportWidth: number,\r\n viewportHeight: number,\r\n world: DeepImmutable<Matrix>,\r\n view: DeepImmutable<Matrix>,\r\n projection: DeepImmutable<Matrix>\r\n ): Vector3 {\r\n const result = new Vector3();\r\n\r\n Vector3.UnprojectToRef(source, viewportWidth, viewportHeight, world, view, projection, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Unproject from screen space to object space\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#119\r\n * @param source defines the screen space Vector3 to use\r\n * @param viewportWidth defines the current width of the viewport\r\n * @param viewportHeight defines the current height of the viewport\r\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\r\n * @param view defines the view matrix to use\r\n * @param projection defines the projection matrix to use\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static UnprojectToRef<T extends Vector3>(\r\n source: DeepImmutable<Vector3>,\r\n viewportWidth: number,\r\n viewportHeight: number,\r\n world: DeepImmutable<Matrix>,\r\n view: DeepImmutable<Matrix>,\r\n projection: DeepImmutable<Matrix>,\r\n result: T\r\n ): T {\r\n Vector3.UnprojectFloatsToRef(source._x, source._y, source._z, viewportWidth, viewportHeight, world, view, projection, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Unproject from screen space to object space\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#120\r\n * @param sourceX defines the screen space x coordinate to use\r\n * @param sourceY defines the screen space y coordinate to use\r\n * @param sourceZ defines the screen space z coordinate to use\r\n * @param viewportWidth defines the current width of the viewport\r\n * @param viewportHeight defines the current height of the viewport\r\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\r\n * @param view defines the view matrix to use\r\n * @param projection defines the projection matrix to use\r\n * @param result defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static UnprojectFloatsToRef<T extends Vector3>(\r\n sourceX: float,\r\n sourceY: float,\r\n sourceZ: float,\r\n viewportWidth: number,\r\n viewportHeight: number,\r\n world: DeepImmutable<Matrix>,\r\n view: DeepImmutable<Matrix>,\r\n projection: DeepImmutable<Matrix>,\r\n result: T\r\n ): T {\r\n const matrix = MathTmp.Matrix[0];\r\n world.multiplyToRef(view, matrix);\r\n matrix.multiplyToRef(projection, matrix);\r\n matrix.invert();\r\n\r\n const screenSource = MathTmp.Vector3[0];\r\n screenSource.x = (sourceX / viewportWidth) * 2 - 1;\r\n screenSource.y = -((sourceY / viewportHeight) * 2 - 1);\r\n if (EngineStore.LastCreatedEngine?.isNDCHalfZRange) {\r\n screenSource.z = sourceZ;\r\n } else {\r\n screenSource.z = 2 * sourceZ - 1.0;\r\n }\r\n\r\n Vector3.TransformCoordinatesToRef(screenSource, matrix, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets the minimal coordinate values between two Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#97\r\n * @param left defines the first operand\r\n * @param right defines the second operand\r\n * @returns the new Vector3\r\n */\r\n public static Minimize(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): Vector3 {\r\n const min = new Vector3();\r\n min.copyFrom(left);\r\n min.minimizeInPlace(right);\r\n return min;\r\n }\r\n\r\n /**\r\n * Gets the maximal coordinate values between two Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#96\r\n * @param left defines the first operand\r\n * @param right defines the second operand\r\n * @returns the new Vector3\r\n */\r\n public static Maximize(left: DeepImmutable<Vector3>, right: DeepImmutable<Vector3>): Vector3 {\r\n const max = new Vector3();\r\n max.copyFrom(left);\r\n max.maximizeInPlace(right);\r\n return max;\r\n }\r\n\r\n /**\r\n * Returns the distance between the vectors \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#81\r\n * @param value1 defines the first operand\r\n * @param value2 defines the second operand\r\n * @returns the distance\r\n */\r\n public static Distance(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>): number {\r\n return Math.sqrt(Vector3.DistanceSquared(value1, value2));\r\n }\r\n\r\n /**\r\n * Returns the squared distance between the vectors \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#80\r\n * @param value1 defines the first operand\r\n * @param value2 defines the second operand\r\n * @returns the squared distance\r\n */\r\n public static DistanceSquared(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>): number {\r\n const x = value1._x - value2._x;\r\n const y = value1._y - value2._y;\r\n const z = value1._z - value2._z;\r\n\r\n return x * x + y * y + z * z;\r\n }\r\n\r\n /**\r\n * Projects \"vector\" on the triangle determined by its extremities \"p0\", \"p1\" and \"p2\", stores the result in \"ref\"\r\n * and returns the distance to the projected point.\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#104\r\n * From http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.104.4264&rep=rep1&type=pdf\r\n *\r\n * @param vector the vector to get distance from\r\n * @param p0 extremity of the triangle\r\n * @param p1 extremity of the triangle\r\n * @param p2 extremity of the triangle\r\n * @param ref variable to store the result to\r\n * @returns The distance between \"ref\" and \"vector\"\r\n */\r\n public static ProjectOnTriangleToRef(vector: DeepImmutable<Vector3>, p0: DeepImmutable<Vector3>, p1: DeepImmutable<Vector3>, p2: DeepImmutable<Vector3>, ref: Vector3): number {\r\n const p1p0 = MathTmp.Vector3[0];\r\n const p2p0 = MathTmp.Vector3[1];\r\n const p2p1 = MathTmp.Vector3[2];\r\n const normal = MathTmp.Vector3[3];\r\n const vectorp0 = MathTmp.Vector3[4];\r\n\r\n // Triangle vectors\r\n p1.subtractToRef(p0, p1p0);\r\n p2.subtractToRef(p0, p2p0);\r\n p2.subtractToRef(p1, p2p1);\r\n\r\n const p1p0L = p1p0.length();\r\n const p2p0L = p2p0.length();\r\n const p2p1L = p2p1.length();\r\n\r\n if (p1p0L < Epsilon || p2p0L < Epsilon || p2p1L < Epsilon) {\r\n // This is a degenerate triangle. As we assume this is part of a non-degenerate mesh,\r\n // we will find a better intersection later.\r\n // Let's just return one of the extremities\r\n ref.copyFrom(p0);\r\n return Vector3.Distance(vector, p0);\r\n }\r\n\r\n // Compute normal and vector to p0\r\n vector.subtractToRef(p0, vectorp0);\r\n Vector3.CrossToRef(p1p0, p2p0, normal);\r\n const nl = normal.length();\r\n if (nl < Epsilon) {\r\n // Extremities are aligned, we are back on the case of a degenerate triangle\r\n ref.copyFrom(p0);\r\n return Vector3.Distance(vector, p0);\r\n }\r\n normal.normalizeFromLength(nl);\r\n let l = vectorp0.length();\r\n if (l < Epsilon) {\r\n // Vector is p0\r\n ref.copyFrom(p0);\r\n return 0;\r\n }\r\n vectorp0.normalizeFromLength(l);\r\n\r\n // Project to \"proj\" that lies on the triangle plane\r\n const cosA = Vector3.Dot(normal, vectorp0);\r\n const projVector = MathTmp.Vector3[5];\r\n const proj = MathTmp.Vector3[6];\r\n projVector.copyFrom(normal).scaleInPlace(-l * cosA);\r\n proj.copyFrom(vector).addInPlace(projVector);\r\n\r\n // Compute barycentric coordinates (v0, v1 and v2 are axis from barycenter to extremities)\r\n const v0 = MathTmp.Vector3[4];\r\n const v1 = MathTmp.Vector3[5];\r\n const v2 = MathTmp.Vector3[7];\r\n const tmp = MathTmp.Vector3[8];\r\n\r\n v0.copyFrom(p1p0).scaleInPlace(1 / p1p0L);\r\n tmp.copyFrom(p2p0).scaleInPlace(1 / p2p0L);\r\n v0.addInPlace(tmp).scaleInPlace(-1);\r\n\r\n v1.copyFrom(p1p0).scaleInPlace(-1 / p1p0L);\r\n tmp.copyFrom(p2p1).scaleInPlace(1 / p2p1L);\r\n v1.addInPlace(tmp).scaleInPlace(-1);\r\n\r\n v2.copyFrom(p2p1).scaleInPlace(-1 / p2p1L);\r\n tmp.copyFrom(p2p0).scaleInPlace(-1 / p2p0L);\r\n v2.addInPlace(tmp).scaleInPlace(-1);\r\n\r\n // Determines which edge of the triangle is closest to \"proj\"\r\n const projP = MathTmp.Vector3[9];\r\n let dot;\r\n projP.copyFrom(proj).subtractInPlace(p0);\r\n Vector3.CrossToRef(v0, projP, tmp);\r\n dot = Vector3.Dot(tmp, normal);\r\n const s0 = dot;\r\n\r\n projP.copyFrom(proj).subtractInPlace(p1);\r\n Vector3.CrossToRef(v1, projP, tmp);\r\n dot = Vector3.Dot(tmp, normal);\r\n const s1 = dot;\r\n\r\n projP.copyFrom(proj).subtractInPlace(p2);\r\n Vector3.CrossToRef(v2, projP, tmp);\r\n dot = Vector3.Dot(tmp, normal);\r\n const s2 = dot;\r\n\r\n const edge = MathTmp.Vector3[10];\r\n let e0, e1;\r\n if (s0 > 0 && s1 < 0) {\r\n edge.copyFrom(p1p0);\r\n e0 = p0;\r\n e1 = p1;\r\n } else if (s1 > 0 && s2 < 0) {\r\n edge.copyFrom(p2p1);\r\n e0 = p1;\r\n e1 = p2;\r\n } else {\r\n edge.copyFrom(p2p0).scaleInPlace(-1);\r\n e0 = p2;\r\n e1 = p0;\r\n }\r\n\r\n // Determines if \"proj\" lies inside the triangle\r\n const tmp2 = MathTmp.Vector3[9];\r\n const tmp3 = MathTmp.Vector3[4];\r\n e0.subtractToRef(proj, tmp);\r\n e1.subtractToRef(proj, tmp2);\r\n Vector3.CrossToRef(tmp, tmp2, tmp3);\r\n const isOutside = Vector3.Dot(tmp3, normal) < 0;\r\n\r\n // If inside, we already found the projected point, \"proj\"\r\n if (!isOutside) {\r\n ref.copyFrom(proj);\r\n return Math.abs(l * cosA);\r\n }\r\n\r\n // If outside, we find \"triProj\", the closest point from \"proj\" on the closest edge\r\n const r = MathTmp.Vector3[5];\r\n Vector3.CrossToRef(edge, tmp3, r);\r\n r.normalize();\r\n const e0proj = MathTmp.Vector3[9];\r\n e0proj.copyFrom(e0).subtractInPlace(proj);\r\n const e0projL = e0proj.length();\r\n if (e0projL < Epsilon) {\r\n // Proj is e0\r\n ref.copyFrom(e0);\r\n return Vector3.Distance(vector, e0);\r\n }\r\n e0proj.normalizeFromLength(e0projL);\r\n const cosG = Vector3.Dot(r, e0proj);\r\n const triProj = MathTmp.Vector3[7];\r\n triProj.copyFrom(proj).addInPlace(r.scaleInPlace(e0projL * cosG));\r\n\r\n // Now we clamp \"triProj\" so it lies between e0 and e1\r\n tmp.copyFrom(triProj).subtractInPlace(e0);\r\n l = edge.length();\r\n edge.normalizeFromLength(l);\r\n let t = Vector3.Dot(tmp, edge) / Math.max(l, Epsilon);\r\n t = Clamp(t, 0, 1);\r\n triProj.copyFrom(e0).addInPlace(edge.scaleInPlace(t * l));\r\n ref.copyFrom(triProj);\r\n\r\n return Vector3.Distance(vector, triProj);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 located at the center between \"value1\" and \"value2\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#72\r\n * @param value1 defines the first operand\r\n * @param value2 defines the second operand\r\n * @returns the new Vector3\r\n */\r\n public static Center(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>): Vector3 {\r\n return Vector3.CenterToRef(value1, value2, Vector3.Zero());\r\n }\r\n\r\n /**\r\n * Gets the center of the vectors \"value1\" and \"value2\" and stores the result in the vector \"ref\"\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#73\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @param ref defines third vector\r\n * @returns ref\r\n */\r\n public static CenterToRef<T extends Vector3>(value1: DeepImmutable<Vector3>, value2: DeepImmutable<Vector3>, ref: T): T {\r\n return ref.copyFromFloats((value1._x + value2._x) / 2, (value1._y + value2._y) / 2, (value1._z + value2._z) / 2);\r\n }\r\n\r\n /**\r\n * Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system),\r\n * RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply\r\n * to something in order to rotate it from its local system to the given target system\r\n * Note: axis1, axis2 and axis3 are normalized during this operation\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#106\r\n * @param axis1 defines the first axis\r\n * @param axis2 defines the second axis\r\n * @param axis3 defines the third axis\r\n * @returns a new Vector3\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/target_align\r\n */\r\n public static RotationFromAxis(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>): Vector3 {\r\n const rotation = new Vector3();\r\n Vector3.RotationFromAxisToRef(axis1, axis2, axis3, rotation);\r\n return rotation;\r\n }\r\n\r\n /**\r\n * The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#107\r\n * @param axis1 defines the first axis\r\n * @param axis2 defines the second axis\r\n * @param axis3 defines the third axis\r\n * @param ref defines the Vector3 where to store the result\r\n * @returns result input\r\n */\r\n public static RotationFromAxisToRef<T extends Vector3>(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref: T): T {\r\n const quat = MathTmp.Quaternion[0];\r\n Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat);\r\n quat.toEulerAnglesToRef(ref);\r\n return ref;\r\n }\r\n}\r\n\r\nVector3 satisfies VectorStatic<Vector3, IVector3LikeInternal>;\r\nObject.defineProperties(Vector3.prototype, {\r\n dimension: { value: [3] },\r\n rank: { value: 1 },\r\n});\r\n\r\n/**\r\n * Vector4 class created for EulerAngle class conversion to Quaternion\r\n */\r\nexport class Vector4 implements Vector<Tuple<number, 4>, IVector4Like>, IVector4Like {\r\n /**\r\n * If the first vector is flagged with integers (as everything is 0,0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.\r\n * If subsequent vectors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,\r\n * and henceforth it will use floating-point representation for all Vector4 instances that it creates.\r\n * But the original Vector4 instances are unchanged and has a \"deprecated map\".\r\n * If we keep using the Vector4 instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.\r\n */\r\n static _V8PerformanceHack = new Vector4(0.5, 0.5, 0.5, 0.5) as DeepImmutable<Vector4>;\r\n private static _ZeroReadOnly = Vector4.Zero() as DeepImmutable<Vector4>;\r\n\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n declare public readonly dimension: Readonly<[4]>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n declare public readonly rank: 1;\r\n\r\n /** @internal */\r\n public _x: number;\r\n /** @internal */\r\n public _y: number;\r\n /** @internal */\r\n public _z: number;\r\n /** @internal */\r\n public _w: number;\r\n\r\n /** @internal */\r\n public _isDirty = true;\r\n\r\n // ---------------------------------\r\n // Getters / setters (same pattern as Vector3)\r\n // ---------------------------------\r\n /** Gets or sets the x coordinate */\r\n public get x() {\r\n return this._x;\r\n }\r\n\r\n public set x(value: number) {\r\n this._x = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the y coordinate */\r\n public get y() {\r\n return this._y;\r\n }\r\n\r\n public set y(value: number) {\r\n this._y = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the z coordinate */\r\n public get z() {\r\n return this._z;\r\n }\r\n\r\n public set z(value: number) {\r\n this._z = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the w coordinate */\r\n public get w() {\r\n return this._w;\r\n }\r\n\r\n public set w(value: number) {\r\n this._w = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * Creates a Vector4 object from the given floats.\r\n * @param x x value of the vector\r\n * @param y y value of the vector\r\n * @param z z value of the vector\r\n * @param w w value of the vector\r\n */\r\n constructor(x: number = 0, y: number = 0, z: number = 0, w: number = 0) {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._w = w;\r\n }\r\n\r\n /**\r\n * Returns the string with the Vector4 coordinates.\r\n * @returns a string containing all the vector values\r\n */\r\n public toString(): string {\r\n return `{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`;\r\n }\r\n\r\n /**\r\n * Returns the string \"Vector4\".\r\n * @returns \"Vector4\"\r\n */\r\n public getClassName(): string {\r\n return \"Vector4\";\r\n }\r\n\r\n /**\r\n * Returns the Vector4 hash code.\r\n * @returns a unique hash code\r\n */\r\n public getHashCode(): number {\r\n const x = ExtractAsInt(this._x);\r\n const y = ExtractAsInt(this._y);\r\n const z = ExtractAsInt(this._z);\r\n const w = ExtractAsInt(this._w);\r\n\r\n let hash = x;\r\n hash = (hash * 397) ^ y;\r\n hash = (hash * 397) ^ z;\r\n hash = (hash * 397) ^ w;\r\n return hash;\r\n }\r\n\r\n // Operators\r\n /**\r\n * Returns a new array populated with 4 elements : the Vector4 coordinates.\r\n * @returns the resulting array\r\n */\r\n public asArray(): Tuple<number, 4> {\r\n return [this._x, this._y, this._z, this._w];\r\n }\r\n\r\n /**\r\n * Populates the given array from the given index with the Vector4 coordinates.\r\n * @param array array to populate\r\n * @param index index of the array to start at (default: 0)\r\n * @returns the Vector4.\r\n */\r\n public toArray(array: FloatArray, index?: number): this {\r\n if (index === undefined) {\r\n index = 0;\r\n }\r\n array[index] = this._x;\r\n array[index + 1] = this._y;\r\n array[index + 2] = this._z;\r\n array[index + 3] = this._w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Update the current vector from an array\r\n * @param array defines the destination array\r\n * @param offset defines the offset in the destination array\r\n * @returns the current Vector3\r\n */\r\n public fromArray(array: FloatArray, offset: number = 0): this {\r\n Vector4.FromArrayToRef(array, offset, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the given vector to the current Vector4.\r\n * @param otherVector the vector to add\r\n * @returns the updated Vector4.\r\n */\r\n public addInPlace(otherVector: DeepImmutable<Vector4>): this {\r\n this.x += otherVector._x;\r\n this.y += otherVector._y;\r\n this.z += otherVector._z;\r\n this.w += otherVector._w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the given coordinates to the current Vector4\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @param w defines the w coordinate of the operand\r\n * @returns the current updated Vector4\r\n */\r\n public addInPlaceFromFloats(x: number, y: number, z: number, w: number): this {\r\n this.x += x;\r\n this.y += y;\r\n this.z += z;\r\n this.w += w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 as the result of the addition of the current Vector4 and the given one.\r\n * @param otherVector the vector to add\r\n * @returns the resulting vector\r\n */\r\n public add(otherVector: DeepImmutable<IVector4Like>): Vector4 {\r\n return new Vector4(this._x + otherVector.x, this._y + otherVector.y, this._z + otherVector.z, this._w + otherVector.w);\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" with the result of the addition of the current Vector4 and the given one.\r\n * @param otherVector the vector to add\r\n * @param result the vector to store the result\r\n * @returns result input\r\n */\r\n public addToRef<T extends IVector4Like>(otherVector: DeepImmutable<IVector4Like>, result: T): T {\r\n result.x = this._x + otherVector.x;\r\n result.y = this._y + otherVector.y;\r\n result.z = this._z + otherVector.z;\r\n result.w = this._w + otherVector.w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Subtract in place the given vector from the current Vector4.\r\n * @param otherVector the vector to subtract\r\n * @returns the updated Vector4.\r\n */\r\n public subtractInPlace(otherVector: DeepImmutable<IVector4Like>): this {\r\n this.x -= otherVector.x;\r\n this.y -= otherVector.y;\r\n this.z -= otherVector.z;\r\n this.w -= otherVector.w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 with the result of the subtraction of the given vector from the current Vector4.\r\n * @param otherVector the vector to add\r\n * @returns the new vector with the result\r\n */\r\n public subtract(otherVector: DeepImmutable<IVector4Like>): Vector4 {\r\n return new Vector4(this._x - otherVector.x, this._y - otherVector.y, this._z - otherVector.z, this._w - otherVector.w);\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the subtraction of the given vector from the current Vector4.\r\n * @param otherVector the vector to subtract\r\n * @param result the vector to store the result\r\n * @returns result input\r\n */\r\n public subtractToRef<T extends IVector4Like>(otherVector: DeepImmutable<IVector4Like>, result: T): T {\r\n result.x = this._x - otherVector.x;\r\n result.y = this._y - otherVector.y;\r\n result.z = this._z - otherVector.z;\r\n result.w = this._w - otherVector.w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates.\r\n * @param x value to subtract\r\n * @param y value to subtract\r\n * @param z value to subtract\r\n * @param w value to subtract\r\n * @returns new vector containing the result\r\n */\r\n public subtractFromFloats(x: number, y: number, z: number, w: number): Vector4 {\r\n return new Vector4(this._x - x, this._y - y, this._z - z, this._w - w);\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" set with the result of the subtraction of the given floats from the current Vector4 coordinates.\r\n * @param x value to subtract\r\n * @param y value to subtract\r\n * @param z value to subtract\r\n * @param w value to subtract\r\n * @param result the vector to store the result in\r\n * @returns result input\r\n */\r\n public subtractFromFloatsToRef<T extends IVector4Like>(x: number, y: number, z: number, w: number, result: T): T {\r\n result.x = this._x - x;\r\n result.y = this._y - y;\r\n result.z = this._z - z;\r\n result.w = this._w - w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the current Vector4 negated coordinates.\r\n * @returns a new vector with the negated values\r\n */\r\n public negate(): Vector4 {\r\n return new Vector4(-this._x, -this._y, -this._z, -this._w);\r\n }\r\n\r\n /**\r\n * Negate this vector in place\r\n * @returns this\r\n */\r\n public negateInPlace(): this {\r\n this.x *= -1;\r\n this.y *= -1;\r\n this.z *= -1;\r\n this.w *= -1;\r\n return this;\r\n }\r\n\r\n /**\r\n * Negate the current Vector4 and stores the result in the given vector \"result\" coordinates\r\n * @param result defines the Vector3 object where to store the result\r\n * @returns the result\r\n */\r\n public negateToRef<T extends IVector4Like>(result: T): T {\r\n result.x = -this._x;\r\n result.y = -this._y;\r\n result.z = -this._z;\r\n result.w = -this._w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Multiplies the current Vector4 coordinates by scale (float).\r\n * @param scale the number to scale with\r\n * @returns the updated Vector4.\r\n */\r\n public scaleInPlace(scale: number): this {\r\n this.x *= scale;\r\n this.y *= scale;\r\n this.z *= scale;\r\n this.w *= scale;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the current Vector4 coordinates multiplied by scale (float).\r\n * @param scale the number to scale with\r\n * @returns a new vector with the result\r\n */\r\n public scale(scale: number): Vector4 {\r\n return new Vector4(this._x * scale, this._y * scale, this._z * scale, this._w * scale);\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the current Vector4 coordinates multiplied by scale (float).\r\n * @param scale the number to scale with\r\n * @param result a vector to store the result in\r\n * @returns result input\r\n */\r\n public scaleToRef<T extends IVector4Like>(scale: number, result: T): T {\r\n result.x = this._x * scale;\r\n result.y = this._y * scale;\r\n result.z = this._z * scale;\r\n result.w = this._w * scale;\r\n return result;\r\n }\r\n\r\n /**\r\n * Scale the current Vector4 values by a factor and add the result to a given Vector4\r\n * @param scale defines the scale factor\r\n * @param result defines the Vector4 object where to store the result\r\n * @returns result input\r\n */\r\n public scaleAndAddToRef<T extends IVector4Like>(scale: number, result: T): T {\r\n result.x += this._x * scale;\r\n result.y += this._y * scale;\r\n result.z += this._z * scale;\r\n result.w += this._w * scale;\r\n return result;\r\n }\r\n\r\n /**\r\n * Boolean : True if the current Vector4 coordinates are stricly equal to the given ones.\r\n * @param otherVector the vector to compare against\r\n * @returns true if they are equal\r\n */\r\n public equals(otherVector: DeepImmutable<IVector4Like>): boolean {\r\n return otherVector && this._x === otherVector.x && this._y === otherVector.y && this._z === otherVector.z && this._w === otherVector.w;\r\n }\r\n\r\n /**\r\n * Boolean : True if the current Vector4 coordinates are each beneath the distance \"epsilon\" from the given vector ones.\r\n * @param otherVector vector to compare against\r\n * @param epsilon (Default: very small number)\r\n * @returns true if they are equal\r\n */\r\n public equalsWithEpsilon(otherVector: DeepImmutable<IVector4Like>, epsilon: number = Epsilon): boolean {\r\n return (\r\n otherVector &&\r\n WithinEpsilon(this._x, otherVector.x, epsilon) &&\r\n WithinEpsilon(this._y, otherVector.y, epsilon) &&\r\n WithinEpsilon(this._z, otherVector.z, epsilon) &&\r\n WithinEpsilon(this._w, otherVector.w, epsilon)\r\n );\r\n }\r\n\r\n /**\r\n * Boolean : True if the given floats are strictly equal to the current Vector4 coordinates.\r\n * @param x x value to compare against\r\n * @param y y value to compare against\r\n * @param z z value to compare against\r\n * @param w w value to compare against\r\n * @returns true if equal\r\n */\r\n public equalsToFloats(x: number, y: number, z: number, w: number): boolean {\r\n return this._x === x && this._y === y && this._z === z && this._w === w;\r\n }\r\n\r\n /**\r\n * Multiplies in place the current Vector4 by the given one.\r\n * @param otherVector vector to multiple with\r\n * @returns the updated Vector4.\r\n */\r\n public multiplyInPlace(otherVector: DeepImmutable<IVector4Like>): this {\r\n this.x *= otherVector.x;\r\n this.y *= otherVector.y;\r\n this.z *= otherVector.z;\r\n this.w *= otherVector.w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the multiplication result of the current Vector4 and the given one.\r\n * @param otherVector vector to multiple with\r\n * @returns resulting new vector\r\n */\r\n public multiply(otherVector: DeepImmutable<IVector4Like>): Vector4 {\r\n return new Vector4(this._x * otherVector.x, this._y * otherVector.y, this._z * otherVector.z, this._w * otherVector.w);\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" with the multiplication result of the current Vector4 and the given one.\r\n * @param otherVector vector to multiple with\r\n * @param result vector to store the result\r\n * @returns result input\r\n */\r\n public multiplyToRef<T extends IVector4Like>(otherVector: DeepImmutable<IVector4Like>, result: T): T {\r\n result.x = this._x * otherVector.x;\r\n result.y = this._y * otherVector.y;\r\n result.z = this._z * otherVector.z;\r\n result.w = this._w * otherVector.w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the multiplication result of the given floats and the current Vector4 coordinates.\r\n * @param x x value multiply with\r\n * @param y y value multiply with\r\n * @param z z value multiply with\r\n * @param w w value multiply with\r\n * @returns resulting new vector\r\n */\r\n public multiplyByFloats(x: number, y: number, z: number, w: number): Vector4 {\r\n return new Vector4(this._x * x, this._y * y, this._z * z, this._w * w);\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the division result of the current Vector4 by the given one.\r\n * @param otherVector vector to devide with\r\n * @returns resulting new vector\r\n */\r\n public divide(otherVector: DeepImmutable<IVector4Like>): Vector4 {\r\n return new Vector4(this._x / otherVector.x, this._y / otherVector.y, this._z / otherVector.z, this._w / otherVector.w);\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" with the division result of the current Vector4 by the given one.\r\n * @param otherVector vector to devide with\r\n * @param result vector to store the result\r\n * @returns result input\r\n */\r\n public divideToRef<T extends IVector4Like>(otherVector: DeepImmutable<IVector4Like>, result: T): T {\r\n result.x = this._x / otherVector.x;\r\n result.y = this._y / otherVector.y;\r\n result.z = this._z / otherVector.z;\r\n result.w = this._w / otherVector.w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Divides the current Vector3 coordinates by the given ones.\r\n * @param otherVector vector to devide with\r\n * @returns the updated Vector3.\r\n */\r\n public divideInPlace(otherVector: DeepImmutable<IVector4Like>): this {\r\n return this.divideToRef(otherVector, this);\r\n }\r\n\r\n /**\r\n * Updates the Vector4 coordinates with the minimum values between its own and the given vector ones\r\n * @param other defines the second operand\r\n * @returns the current updated Vector4\r\n */\r\n public minimizeInPlace(other: DeepImmutable<IVector4Like>): this {\r\n if (other.x < this._x) {\r\n this.x = other.x;\r\n }\r\n if (other.y < this._y) {\r\n this.y = other.y;\r\n }\r\n if (other.z < this._z) {\r\n this.z = other.z;\r\n }\r\n if (other.w < this._w) {\r\n this.w = other.w;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the Vector4 coordinates with the maximum values between its own and the given vector ones\r\n * @param other defines the second operand\r\n * @returns the current updated Vector4\r\n */\r\n public maximizeInPlace(other: DeepImmutable<IVector4Like>): this {\r\n if (other.x > this._x) {\r\n this.x = other.x;\r\n }\r\n if (other.y > this._y) {\r\n this.y = other.y;\r\n }\r\n if (other.z > this._z) {\r\n this.z = other.z;\r\n }\r\n if (other.w > this._w) {\r\n this.w = other.w;\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector4 with the minimal coordinate values between its and the given coordinates\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @param w defines the w coordinate of the operand\r\n * @returns the current updated Vector4\r\n */\r\n public minimizeInPlaceFromFloats(x: number, y: number, z: number, w: number): this {\r\n this.x = Math.min(x, this._x);\r\n this.y = Math.min(y, this._y);\r\n this.z = Math.min(z, this._z);\r\n this.w = Math.min(w, this._w);\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector4 with the maximal coordinate values between its and the given coordinates.\r\n * @param x defines the x coordinate of the operand\r\n * @param y defines the y coordinate of the operand\r\n * @param z defines the z coordinate of the operand\r\n * @param w defines the w coordinate of the operand\r\n * @returns the current updated Vector4\r\n */\r\n public maximizeInPlaceFromFloats(x: number, y: number, z: number, w: number): this {\r\n this.x = Math.max(x, this._x);\r\n this.y = Math.max(y, this._y);\r\n this.z = Math.max(z, this._z);\r\n this.w = Math.max(w, this._w);\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the current Vector4's floored values and stores them in result\r\n * @param result the vector to store the result in\r\n * @returns the result vector\r\n */\r\n public floorToRef<T extends IVector4Like>(result: T): T {\r\n result.x = Math.floor(this._x);\r\n result.y = Math.floor(this._y);\r\n result.z = Math.floor(this._z);\r\n result.w = Math.floor(this._w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector4 from current Vector4 floored values\r\n * @returns a new Vector4\r\n */\r\n public floor(): Vector4 {\r\n return new Vector4(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z), Math.floor(this._w));\r\n }\r\n\r\n /**\r\n * Gets the current Vector4's fractional values and stores them in result\r\n * @param result the vector to store the result in\r\n * @returns the result vector\r\n */\r\n public fractToRef<T extends IVector4Like>(result: T): T {\r\n result.x = this._x - Math.floor(this._x);\r\n result.y = this._y - Math.floor(this._y);\r\n result.z = this._z - Math.floor(this._z);\r\n result.w = this._w - Math.floor(this._w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets a new Vector4 from current Vector4 fractional values\r\n * @returns a new Vector4\r\n */\r\n public fract(): Vector4 {\r\n return new Vector4(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z), this._w - Math.floor(this._w));\r\n }\r\n\r\n // Properties\r\n /**\r\n * Returns the Vector4 length (float).\r\n * @returns the length\r\n */\r\n public length(): number {\r\n return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\r\n }\r\n\r\n /**\r\n * Returns the Vector4 squared length (float).\r\n * @returns the length squared\r\n */\r\n public lengthSquared(): number {\r\n return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\r\n }\r\n\r\n // Methods\r\n /**\r\n * Normalizes in place the Vector4.\r\n * @returns the updated Vector4.\r\n */\r\n public normalize(): this {\r\n return this.normalizeFromLength(this.length());\r\n }\r\n\r\n /**\r\n * Normalize the current Vector4 with the given input length.\r\n * Please note that this is an in place operation.\r\n * @param len the length of the vector\r\n * @returns the current updated Vector4\r\n */\r\n public normalizeFromLength(len: number): this {\r\n if (len === 0 || len === 1.0) {\r\n return this;\r\n }\r\n\r\n return this.scaleInPlace(1.0 / len);\r\n }\r\n\r\n /**\r\n * Normalize the current Vector4 to a new vector\r\n * @returns the new Vector4\r\n */\r\n public normalizeToNew(): Vector4 {\r\n return this.normalizeToRef(new Vector4());\r\n }\r\n\r\n /**\r\n * Normalize the current Vector4 to the reference\r\n * @param reference define the Vector4 to update\r\n * @returns the updated Vector4\r\n */\r\n public normalizeToRef<T extends IVector4Like>(reference: T): T {\r\n const len = this.length();\r\n if (len === 0 || len === 1.0) {\r\n reference.x = this._x;\r\n reference.y = this._y;\r\n reference.z = this._z;\r\n reference.w = this._w;\r\n return reference;\r\n }\r\n\r\n return this.scaleToRef(1.0 / len, reference);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 from the Vector4 (x, y, z) coordinates.\r\n * @returns this converted to a new vector3\r\n */\r\n public toVector3(): Vector3 {\r\n return new Vector3(this._x, this._y, this._z);\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 copied from the current one.\r\n * @returns the new cloned vector\r\n */\r\n public clone(): Vector4 {\r\n return new Vector4(this._x, this._y, this._z, this._w);\r\n }\r\n\r\n /**\r\n * Updates the current Vector4 with the given one coordinates.\r\n * @param source the source vector to copy from\r\n * @returns the updated Vector4.\r\n */\r\n public copyFrom(source: DeepImmutable<IVector4Like>): this {\r\n this.x = source.x;\r\n this.y = source.y;\r\n this.z = source.z;\r\n this.w = source.w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector4 coordinates with the given floats.\r\n * @param x float to copy from\r\n * @param y float to copy from\r\n * @param z float to copy from\r\n * @param w float to copy from\r\n * @returns the updated Vector4.\r\n */\r\n public copyFromFloats(x: number, y: number, z: number, w: number): this {\r\n this.x = x;\r\n this.y = y;\r\n this.z = z;\r\n this.w = w;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current Vector4 coordinates with the given floats.\r\n * @param x float to set from\r\n * @param y float to set from\r\n * @param z float to set from\r\n * @param w float to set from\r\n * @returns the updated Vector4.\r\n */\r\n public set(x: number, y: number, z: number, w: number): this {\r\n return this.copyFromFloats(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Copies the given float to the current Vector4 coordinates\r\n * @param v defines the x, y, z and w coordinates of the operand\r\n * @returns the current updated Vector4\r\n */\r\n public setAll(v: number): this {\r\n this.x = this.y = this.z = this.w = v;\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the current vectors and \"otherVector\"\r\n * @param otherVector defines the right operand\r\n * @returns the dot product\r\n */\r\n public dot(otherVector: DeepImmutable<IVector4Like>): number {\r\n return this._x * otherVector.x + this._y * otherVector.y + this._z * otherVector.z + this._w * otherVector.w;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Returns a new Vector4 set from the starting index of the given array.\r\n * @param array the array to pull values from\r\n * @param offset the offset into the array to start at\r\n * @returns the new vector\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset?: number): Vector4 {\r\n if (!offset) {\r\n offset = 0;\r\n }\r\n return new Vector4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" from the starting index of the given array.\r\n * @param array the array to pull values from\r\n * @param offset the offset into the array to start at\r\n * @param result the vector to store the result in\r\n * @returns result input\r\n */\r\n public static FromArrayToRef<T extends IVector4Like>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T {\r\n result.x = array[offset];\r\n result.y = array[offset + 1];\r\n result.z = array[offset + 2];\r\n result.w = array[offset + 3];\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" from the starting index of the given Float32Array.\r\n * @param array the array to pull values from\r\n * @param offset the offset into the array to start at\r\n * @param result the vector to store the result in\r\n * @returns result input\r\n */\r\n public static FromFloatArrayToRef<T extends IVector4Like>(array: DeepImmutable<Float32Array>, offset: number, result: T): T {\r\n Vector4.FromArrayToRef(array, offset, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" coordinates from the given floats.\r\n * @param x float to set from\r\n * @param y float to set from\r\n * @param z float to set from\r\n * @param w float to set from\r\n * @param result the vector to the floats in\r\n * @returns result input\r\n */\r\n public static FromFloatsToRef<T extends IVector4Like>(x: number, y: number, z: number, w: number, result: T): T {\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set to (0.0, 0.0, 0.0, 0.0)\r\n * @returns the new vector\r\n */\r\n public static Zero(): Vector4 {\r\n return new Vector4(0.0, 0.0, 0.0, 0.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set to (1.0, 1.0, 1.0, 1.0)\r\n * @returns the new vector\r\n */\r\n public static One(): Vector4 {\r\n return new Vector4(1.0, 1.0, 1.0, 1.0);\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @returns a Vector4 with random values between min and max\r\n */\r\n public static Random(min: number = 0, max: number = 1): Vector4 {\r\n return new Vector4(RandomRange(min, max), RandomRange(min, max), RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Sets a Vector4 with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @param ref the ref to store the values in\r\n * @returns the ref with random values between min and max\r\n */\r\n public static RandomToRef<T extends IVector4Like>(min: number = 0, max: number = 1, ref: T): T {\r\n ref.x = RandomRange(min, max);\r\n ref.y = RandomRange(min, max);\r\n ref.z = RandomRange(min, max);\r\n ref.w = RandomRange(min, max);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the coordinates of \"value\", if the vector \"value\" is in the cube defined by the vectors \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @returns the new Vector4\r\n */\r\n public static Clamp(value: DeepImmutable<IVector4Like>, min: DeepImmutable<IVector4Like>, max: DeepImmutable<IVector4Like>): Vector4 {\r\n return Vector4.ClampToRef(value, min, max, new Vector4());\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the coordinates of \"value\", if the vector \"value\" is in the cube defined by the vectors \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @param result defines the Vector4 where to store the result\r\n * @returns result input\r\n */\r\n public static ClampToRef<T extends IVector4Like>(value: DeepImmutable<IVector4Like>, min: DeepImmutable<IVector4Like>, max: DeepImmutable<IVector4Like>, result: T): T {\r\n result.x = Clamp(value.x, min.x, max.x);\r\n result.y = Clamp(value.y, min.y, max.y);\r\n result.z = Clamp(value.z, min.z, max.z);\r\n result.w = Clamp(value.w, min.w, max.w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Checks if a given vector is inside a specific range\r\n * Example Playground https://playground.babylonjs.com/#R1F8YU#75\r\n * @param v defines the vector to test\r\n * @param min defines the minimum range\r\n * @param max defines the maximum range\r\n */\r\n public static CheckExtends(v: IVector4Like, min: Vector4, max: Vector4): void {\r\n min.minimizeInPlace(v);\r\n max.maximizeInPlace(v);\r\n }\r\n\r\n /**\r\n * Gets a zero Vector4 that must not be updated\r\n */\r\n public static get ZeroReadOnly(): DeepImmutable<Vector4> {\r\n return Vector4._ZeroReadOnly;\r\n }\r\n\r\n /**\r\n * Returns a new normalized Vector4 from the given one.\r\n * @param vector the vector to normalize\r\n * @returns the vector\r\n */\r\n public static Normalize(vector: DeepImmutable<Vector4>): Vector4 {\r\n return Vector4.NormalizeToRef(vector, new Vector4());\r\n }\r\n\r\n /**\r\n * Updates the given vector \"result\" from the normalization of the given one.\r\n * @param vector the vector to normalize\r\n * @param result the vector to store the result in\r\n * @returns result input\r\n */\r\n public static NormalizeToRef<T extends IVector4Like>(vector: DeepImmutable<Vector4>, result: T): T {\r\n vector.normalizeToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a vector with the minimum values from the left and right vectors\r\n * @param left left vector to minimize\r\n * @param right right vector to minimize\r\n * @returns a new vector with the minimum of the left and right vector values\r\n */\r\n public static Minimize<T extends Vector4>(left: DeepImmutable<T>, right: DeepImmutable<Vector4>): Vector4 {\r\n const min = new Vector4();\r\n min.copyFrom(left);\r\n min.minimizeInPlace(right);\r\n return min;\r\n }\r\n\r\n /**\r\n * Returns a vector with the maximum values from the left and right vectors\r\n * @param left left vector to maximize\r\n * @param right right vector to maximize\r\n * @returns a new vector with the maximum of the left and right vector values\r\n */\r\n public static Maximize(left: DeepImmutable<IVector4Like>, right: DeepImmutable<IVector4Like>): Vector4 {\r\n const max = new Vector4();\r\n max.copyFrom(left);\r\n max.maximizeInPlace(right);\r\n return max;\r\n }\r\n\r\n /**\r\n * Returns the distance (float) between the vectors \"value1\" and \"value2\".\r\n * @param value1 value to calulate the distance between\r\n * @param value2 value to calulate the distance between\r\n * @returns the distance between the two vectors\r\n */\r\n public static Distance(value1: DeepImmutable<IVector4Like>, value2: DeepImmutable<IVector4Like>): number {\r\n return Math.sqrt(Vector4.DistanceSquared(value1, value2));\r\n }\r\n\r\n /**\r\n * Returns the squared distance (float) between the vectors \"value1\" and \"value2\".\r\n * @param value1 value to calulate the distance between\r\n * @param value2 value to calulate the distance between\r\n * @returns the distance between the two vectors squared\r\n */\r\n public static DistanceSquared(value1: DeepImmutable<IVector4Like>, value2: DeepImmutable<IVector4Like>): number {\r\n const x = value1.x - value2.x;\r\n const y = value1.y - value2.y;\r\n const z = value1.z - value2.z;\r\n const w = value1.w - value2.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 located at the center between the vectors \"value1\" and \"value2\".\r\n * @param value1 value to calulate the center between\r\n * @param value2 value to calulate the center between\r\n * @returns the center between the two vectors\r\n */\r\n public static Center(value1: DeepImmutable<IVector4Like>, value2: DeepImmutable<IVector4Like>): Vector4 {\r\n return Vector4.CenterToRef(value1, value2, new Vector4());\r\n }\r\n\r\n /**\r\n * Gets the center of the vectors \"value1\" and \"value2\" and stores the result in the vector \"ref\"\r\n * @param value1 defines first vector\r\n * @param value2 defines second vector\r\n * @param ref defines third vector\r\n * @returns ref\r\n */\r\n public static CenterToRef<T extends IVector4Like>(value1: DeepImmutable<IVector4Like>, value2: DeepImmutable<IVector4Like>, ref: T): T {\r\n ref.x = (value1.x + value2.x) / 2;\r\n ref.y = (value1.y + value2.y) / 2;\r\n ref.z = (value1.z + value2.z) / 2;\r\n ref.w = (value1.w + value2.w) / 2;\r\n return ref;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the result of the transformation by the given matrix of the given vector.\r\n * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\r\n * The difference with Vector3.TransformCoordinates is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @returns the transformed Vector4\r\n */\r\n public static TransformCoordinates(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>): Vector4 {\r\n return Vector4.TransformCoordinatesToRef(vector, transformation, new Vector4());\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given vector\r\n * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\r\n * The difference with Vector3.TransformCoordinatesToRef is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead\r\n * @param vector defines the Vector3 to transform\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector4 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformCoordinatesToRef<T extends IVector4Like>(vector: DeepImmutable<Vector3>, transformation: DeepImmutable<Matrix>, result: T): T {\r\n Vector4.TransformCoordinatesFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)\r\n * This method computes tranformed coordinates only, not transformed direction vectors\r\n * The difference with Vector3.TransformCoordinatesFromFloatsToRef is that the w component is not used to divide the other coordinates but is returned in the w coordinate instead\r\n * @param x define the x coordinate of the source vector\r\n * @param y define the y coordinate of the source vector\r\n * @param z define the z coordinate of the source vector\r\n * @param transformation defines the transformation matrix\r\n * @param result defines the Vector4 where to store the result\r\n * @returns result input\r\n */\r\n public static TransformCoordinatesFromFloatsToRef<T extends IVector4Like>(x: number, y: number, z: number, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n const rx = x * m[0] + y * m[4] + z * m[8] + m[12];\r\n const ry = x * m[1] + y * m[5] + z * m[9] + m[13];\r\n const rz = x * m[2] + y * m[6] + z * m[10] + m[14];\r\n const rw = x * m[3] + y * m[7] + z * m[11] + m[15];\r\n\r\n result.x = rx;\r\n result.y = ry;\r\n result.z = rz;\r\n result.w = rw;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Vector4 set with the result of the normal transformation by the given matrix of the given vector.\r\n * This methods computes transformed normalized direction vectors only.\r\n * @param vector the vector to transform\r\n * @param transformation the transformation matrix to apply\r\n * @returns the new vector\r\n */\r\n public static TransformNormal(vector: DeepImmutable<IVector4Like>, transformation: DeepImmutable<Matrix>): Vector4 {\r\n return Vector4.TransformNormalToRef(vector, transformation, new Vector4());\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the normal transformation by the given matrix of the given vector.\r\n * This methods computes transformed normalized direction vectors only.\r\n * @param vector the vector to transform\r\n * @param transformation the transformation matrix to apply\r\n * @param result the vector to store the result in\r\n * @returns result input\r\n */\r\n public static TransformNormalToRef<T extends IVector4Like>(vector: DeepImmutable<IVector4Like>, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n const x = vector.x * m[0] + vector.y * m[4] + vector.z * m[8];\r\n const y = vector.x * m[1] + vector.y * m[5] + vector.z * m[9];\r\n const z = vector.x * m[2] + vector.y * m[6] + vector.z * m[10];\r\n result.x = x;\r\n result.y = y;\r\n result.z = z;\r\n result.w = vector.w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector \"result\" with the result of the normal transformation by the given matrix of the given floats (x, y, z, w).\r\n * This methods computes transformed normalized direction vectors only.\r\n * @param x value to transform\r\n * @param y value to transform\r\n * @param z value to transform\r\n * @param w value to transform\r\n * @param transformation the transformation matrix to apply\r\n * @param result the vector to store the results in\r\n * @returns result input\r\n */\r\n public static TransformNormalFromFloatsToRef<T extends IVector4Like>(x: number, y: number, z: number, w: number, transformation: DeepImmutable<Matrix>, result: T): T {\r\n const m = transformation.m;\r\n result.x = x * m[0] + y * m[4] + z * m[8];\r\n result.y = x * m[1] + y * m[5] + z * m[9];\r\n result.z = x * m[2] + y * m[6] + z * m[10];\r\n result.w = w;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new Vector4 from a Vector3\r\n * @param source defines the source data\r\n * @param w defines the 4th component (default is 0)\r\n * @returns a new Vector4\r\n */\r\n public static FromVector3(source: Vector3, w: number = 0): Vector4 {\r\n return new Vector4(source._x, source._y, source._z, w);\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the vectors \"left\" and \"right\"\r\n * @param left defines the left operand\r\n * @param right defines the right operand\r\n * @returns the dot product\r\n */\r\n public static Dot(left: DeepImmutable<IVector4Like>, right: DeepImmutable<IVector4Like>): number {\r\n return left.x * right.x + left.y * right.y + left.z * right.z + left.w * right.w;\r\n }\r\n}\r\n\r\nVector4 satisfies VectorStatic<Vector4, IVector4Like>;\r\nObject.defineProperties(Vector4.prototype, {\r\n dimension: { value: [4] },\r\n rank: { value: 1 },\r\n});\r\n\r\n/**\r\n * Class used to store quaternion data\r\n * Example Playground - Overview - https://playground.babylonjs.com/#L49EJ7#100\r\n * @see https://en.wikipedia.org/wiki/Quaternion\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms\r\n */\r\nexport class Quaternion implements Tensor<Tuple<number, 4>, Quaternion>, IQuaternionLike {\r\n /**\r\n * If the first quaternion is flagged with integers (as everything is 0,0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.\r\n * If subsequent quaternion are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,\r\n * and henceforth it will use floating-point representation for all quaternion instances that it creates.\r\n * But the original quaternion instances are unchanged and has a \"deprecated map\".\r\n * If we keep using the quaternion instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.\r\n */\r\n static _V8PerformanceHack = new Quaternion(0.5, 0.5, 0.5, 0.5) as DeepImmutable<Quaternion>;\r\n /** @internal */\r\n public _x: number;\r\n\r\n /** @internal */\r\n public _y: number;\r\n\r\n /** @internal */\r\n public _z: number;\r\n\r\n /** @internal */\r\n public _w: number;\r\n\r\n /** @internal */\r\n public _isDirty = true;\r\n\r\n /** Gets or sets the x coordinate */\r\n public get x() {\r\n return this._x;\r\n }\r\n\r\n public set x(value: number) {\r\n this._x = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the y coordinate */\r\n public get y() {\r\n return this._y;\r\n }\r\n\r\n public set y(value: number) {\r\n this._y = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the z coordinate */\r\n public get z() {\r\n return this._z;\r\n }\r\n\r\n public set z(value: number) {\r\n this._z = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /** Gets or sets the w coordinate */\r\n public get w() {\r\n return this._w;\r\n }\r\n\r\n public set w(value: number) {\r\n this._w = value;\r\n this._isDirty = true;\r\n }\r\n\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n declare public readonly dimension: Readonly<[4]>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n declare public readonly rank: 1;\r\n\r\n /**\r\n * Creates a new Quaternion from the given floats\r\n * @param x defines the first component (0 by default)\r\n * @param y defines the second component (0 by default)\r\n * @param z defines the third component (0 by default)\r\n * @param w defines the fourth component (1.0 by default)\r\n */\r\n constructor(x: number = 0.0, y: number = 0.0, z: number = 0.0, w: number = 1.0) {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._w = w;\r\n }\r\n\r\n /**\r\n * Gets a string representation for the current quaternion\r\n * @returns a string with the Quaternion coordinates\r\n */\r\n public toString(): string {\r\n return `{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`;\r\n }\r\n\r\n /**\r\n * Gets the class name of the quaternion\r\n * @returns the string \"Quaternion\"\r\n */\r\n public getClassName(): string {\r\n return \"Quaternion\";\r\n }\r\n\r\n /**\r\n * Gets a hash code for this quaternion\r\n * @returns the quaternion hash code\r\n */\r\n public getHashCode(): number {\r\n const x = ExtractAsInt(this._x);\r\n const y = ExtractAsInt(this._y);\r\n const z = ExtractAsInt(this._z);\r\n const w = ExtractAsInt(this._w);\r\n\r\n let hash = x;\r\n hash = (hash * 397) ^ y;\r\n hash = (hash * 397) ^ z;\r\n hash = (hash * 397) ^ w;\r\n return hash;\r\n }\r\n\r\n /**\r\n * Copy the quaternion to an array\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#13\r\n * @returns a new array populated with 4 elements from the quaternion coordinates\r\n */\r\n public asArray(): Tuple<number, 4> {\r\n return [this._x, this._y, this._z, this._w];\r\n }\r\n\r\n /**\r\n * Stores from the starting index in the given array the Quaternion successive values\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#59\r\n * @param array defines the array where to store the x,y,z,w 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 Quaternion object\r\n */\r\n public toArray(array: FloatArray, index: number = 0): this {\r\n array[index] = this._x;\r\n array[index + 1] = this._y;\r\n array[index + 2] = this._z;\r\n array[index + 3] = this._w;\r\n return this;\r\n }\r\n\r\n public fromArray(array: FloatArray, index: number = 0): this {\r\n return Quaternion.FromArrayToRef(array, index, this);\r\n }\r\n\r\n /**\r\n * Check if two quaternions are equals\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#38\r\n * @param otherQuaternion defines the second operand\r\n * @returns true if the current quaternion and the given one coordinates are strictly equals\r\n */\r\n public equals(otherQuaternion: DeepImmutable<Quaternion>): boolean {\r\n return otherQuaternion && this._x === otherQuaternion._x && this._y === otherQuaternion._y && this._z === otherQuaternion._z && this._w === otherQuaternion._w;\r\n }\r\n\r\n /**\r\n * Gets a boolean if two quaternions are equals (using an epsilon value)\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#37\r\n * @param otherQuaternion defines the other quaternion\r\n * @param epsilon defines the minimal distance to consider equality\r\n * @returns true if the given quaternion coordinates are close to the current ones by a distance of epsilon.\r\n */\r\n public equalsWithEpsilon(otherQuaternion: DeepImmutable<Quaternion>, epsilon: number = Epsilon): boolean {\r\n return (\r\n otherQuaternion &&\r\n WithinEpsilon(this._x, otherQuaternion._x, epsilon) &&\r\n WithinEpsilon(this._y, otherQuaternion._y, epsilon) &&\r\n WithinEpsilon(this._z, otherQuaternion._z, epsilon) &&\r\n WithinEpsilon(this._w, otherQuaternion._w, epsilon)\r\n );\r\n }\r\n\r\n /**\r\n * Gets a boolean if two quaternions are equals (using an epsilon value), taking care of double cover : https://www.reedbeta.com/blog/why-quaternions-double-cover/\r\n * @param otherQuaternion defines the other quaternion\r\n * @param epsilon defines the minimal distance to consider equality\r\n * @returns true if the given quaternion coordinates are close to the current ones by a distance of epsilon.\r\n */\r\n public isApprox(otherQuaternion: DeepImmutable<Quaternion>, epsilon: number = Epsilon): boolean {\r\n return (\r\n otherQuaternion &&\r\n ((WithinEpsilon(this._x, otherQuaternion._x, epsilon) &&\r\n WithinEpsilon(this._y, otherQuaternion._y, epsilon) &&\r\n WithinEpsilon(this._z, otherQuaternion._z, epsilon) &&\r\n WithinEpsilon(this._w, otherQuaternion._w, epsilon)) ||\r\n (WithinEpsilon(this._x, -otherQuaternion._x, epsilon) &&\r\n WithinEpsilon(this._y, -otherQuaternion._y, epsilon) &&\r\n WithinEpsilon(this._z, -otherQuaternion._z, epsilon) &&\r\n WithinEpsilon(this._w, -otherQuaternion._w, epsilon)))\r\n );\r\n }\r\n\r\n /**\r\n * Clone the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#12\r\n * @returns a new quaternion copied from the current one\r\n */\r\n public clone(): Quaternion {\r\n return new Quaternion(this._x, this._y, this._z, this._w);\r\n }\r\n\r\n /**\r\n * Copy a quaternion to the current one\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#86\r\n * @param other defines the other quaternion\r\n * @returns the updated current quaternion\r\n */\r\n public copyFrom(other: DeepImmutable<Quaternion>): this {\r\n this._x = other._x;\r\n this._y = other._y;\r\n this._z = other._z;\r\n this._w = other._w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current quaternion with the given float coordinates\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#87\r\n * @param x defines the x coordinate\r\n * @param y defines the y coordinate\r\n * @param z defines the z coordinate\r\n * @param w defines the w coordinate\r\n * @returns the updated current quaternion\r\n */\r\n public copyFromFloats(x: number, y: number, z: number, w: number): this {\r\n this._x = x;\r\n this._y = y;\r\n this._z = z;\r\n this._w = w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Updates the current quaternion from the given float coordinates\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#56\r\n * @param x defines the x coordinate\r\n * @param y defines the y coordinate\r\n * @param z defines the z coordinate\r\n * @param w defines the w coordinate\r\n * @returns the updated current quaternion\r\n */\r\n public set(x: number, y: number, z: number, w: number): this {\r\n return this.copyFromFloats(x, y, z, w);\r\n }\r\n\r\n public setAll(value: number): this {\r\n return this.copyFromFloats(value, value, value, value);\r\n }\r\n\r\n /**\r\n * Adds two quaternions\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#10\r\n * @param other defines the second operand\r\n * @returns a new quaternion as the addition result of the given one and the current quaternion\r\n */\r\n public add(other: DeepImmutable<Quaternion>): Quaternion {\r\n return new Quaternion(this._x + other._x, this._y + other._y, this._z + other._z, this._w + other._w);\r\n }\r\n\r\n /**\r\n * Add a quaternion to the current one\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#11\r\n * @param other defines the quaternion to add\r\n * @returns the current quaternion\r\n */\r\n public addInPlace(other: DeepImmutable<Quaternion>): this {\r\n this._x += other._x;\r\n this._y += other._y;\r\n this._z += other._z;\r\n this._w += other._w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n public addToRef<T extends Quaternion>(other: DeepImmutable<this>, result: T): T {\r\n result._x = this._x + other._x;\r\n result._y = this._y + other._y;\r\n result._z = this._z + other._z;\r\n result._w = this._w + other._w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n public addInPlaceFromFloats(x: number, y: number, z: number, w: number): this {\r\n this._x += x;\r\n this._y += y;\r\n this._z += z;\r\n this._w += w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n public subtractToRef<T extends Quaternion>(other: DeepImmutable<this>, result: T): T {\r\n result._x = this._x - other._x;\r\n result._y = this._y - other._y;\r\n result._z = this._z - other._z;\r\n result._w = this._w - other._w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n public subtractFromFloats(x: number, y: number, z: number, w: number): Quaternion {\r\n return this.subtractFromFloatsToRef(x, y, z, w, new Quaternion());\r\n }\r\n\r\n public subtractFromFloatsToRef<T extends Quaternion>(x: number, y: number, z: number, w: number, result: T): T {\r\n result._x = this._x - x;\r\n result._y = this._y - y;\r\n result._z = this._z - z;\r\n result._w = this._w - w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Subtract two quaternions\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#57\r\n * @param other defines the second operand\r\n * @returns a new quaternion as the subtraction result of the given one from the current one\r\n */\r\n public subtract(other: DeepImmutable<this>): Quaternion {\r\n return new Quaternion(this._x - other._x, this._y - other._y, this._z - other._z, this._w - other._w);\r\n }\r\n\r\n /**\r\n * Subtract a quaternion to the current one\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#58\r\n * @param other defines the quaternion to subtract\r\n * @returns the current quaternion\r\n */\r\n public subtractInPlace(other: DeepImmutable<Quaternion>): this {\r\n this._x -= other._x;\r\n this._y -= other._y;\r\n this._z -= other._z;\r\n this._w -= other._w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiplies the current quaternion by a scale factor\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#88\r\n * @param value defines the scale factor\r\n * @returns a new quaternion set by multiplying the current quaternion coordinates by the float \"scale\"\r\n */\r\n public scale(value: number): Quaternion {\r\n return new Quaternion(this._x * value, this._y * value, this._z * value, this._w * value);\r\n }\r\n\r\n /**\r\n * Scale the current quaternion values by a factor and stores the result to a given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#89\r\n * @param scale defines the scale factor\r\n * @param result defines the Quaternion object where to store the result\r\n * @returns result input\r\n */\r\n public scaleToRef<T extends Quaternion>(scale: number, result: T): T {\r\n result._x = this._x * scale;\r\n result._y = this._y * scale;\r\n result._z = this._z * scale;\r\n result._w = this._w * scale;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Multiplies in place the current quaternion by a scale factor\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#90\r\n * @param value defines the scale factor\r\n * @returns the current modified quaternion\r\n */\r\n public scaleInPlace(value: number): this {\r\n this._x *= value;\r\n this._y *= value;\r\n this._z *= value;\r\n this._w *= value;\r\n this._isDirty = true;\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Scale the current quaternion values by a factor and add the result to a given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#91\r\n * @param scale defines the scale factor\r\n * @param result defines the Quaternion object where to store the result\r\n * @returns result input\r\n */\r\n public scaleAndAddToRef<T extends Quaternion>(scale: number, result: T): T {\r\n result._x += this._x * scale;\r\n result._y += this._y * scale;\r\n result._z += this._z * scale;\r\n result._w += this._w * scale;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Multiplies two quaternions\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#43\r\n * @param q1 defines the second operand\r\n * @returns a new quaternion set as the multiplication result of the current one with the given one \"q1\"\r\n */\r\n public multiply(q1: DeepImmutable<Quaternion>): Quaternion {\r\n const result = new Quaternion(0, 0, 0, 1.0);\r\n this.multiplyToRef(q1, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given \"result\" as the multiplication result of the current one with the given one \"q1\"\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#45\r\n * @param q1 defines the second operand\r\n * @param result defines the target quaternion\r\n * @returns the current quaternion\r\n */\r\n public multiplyToRef<T extends Quaternion>(q1: DeepImmutable<Quaternion>, result: T): T {\r\n const x = this._x * q1._w + this._y * q1._z - this._z * q1._y + this._w * q1._x;\r\n const y = -this._x * q1._z + this._y * q1._w + this._z * q1._x + this._w * q1._y;\r\n const z = this._x * q1._y - this._y * q1._x + this._z * q1._w + this._w * q1._z;\r\n const w = -this._x * q1._x - this._y * q1._y - this._z * q1._z + this._w * q1._w;\r\n result.copyFromFloats(x, y, z, w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the current quaternion with the multiplication of itself with the given one \"q1\"\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#46\r\n * @param other defines the second operand\r\n * @returns the currentupdated quaternion\r\n */\r\n public multiplyInPlace(other: DeepImmutable<Quaternion>): this {\r\n return this.multiplyToRef(other, this);\r\n }\r\n\r\n public multiplyByFloats(x: number, y: number, z: number, w: number): this {\r\n this._x *= x;\r\n this._y *= y;\r\n this._z *= z;\r\n this._w *= w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public divide(_other: DeepImmutable<this>): this {\r\n throw new ReferenceError(\"Can not divide a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public divideToRef<T extends Quaternion>(_other: DeepImmutable<this>, _result: T): T {\r\n throw new ReferenceError(\"Can not divide a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public divideInPlace(_other: DeepImmutable<this>): this {\r\n throw new ReferenceError(\"Can not divide a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public minimizeInPlace(): this {\r\n throw new ReferenceError(\"Can not minimize a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public minimizeInPlaceFromFloats(): this {\r\n throw new ReferenceError(\"Can not minimize a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public maximizeInPlace(): this {\r\n throw new ReferenceError(\"Can not maximize a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public maximizeInPlaceFromFloats(): this {\r\n throw new ReferenceError(\"Can not maximize a quaternion\");\r\n }\r\n\r\n public negate(): Quaternion {\r\n return this.negateToRef(new Quaternion());\r\n }\r\n\r\n public negateInPlace(): this {\r\n this._x = -this._x;\r\n this._y = -this._y;\r\n this._z = -this._z;\r\n this._w = -this._w;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n public negateToRef<T extends Quaternion>(result: T): T {\r\n result._x = -this._x;\r\n result._y = -this._y;\r\n result._z = -this._z;\r\n result._w = -this._w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n public equalsToFloats(x: number, y: number, z: number, w: number): boolean {\r\n return this._x === x && this._y === y && this._z === z && this._w === w;\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public floorToRef<T extends Quaternion>(_result: T): T {\r\n throw new ReferenceError(\"Can not floor a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public floor(): Quaternion {\r\n throw new ReferenceError(\"Can not floor a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public fractToRef<T extends Quaternion>(_result: T): T {\r\n throw new ReferenceError(\"Can not fract a quaternion\");\r\n }\r\n\r\n /**\r\n * @internal\r\n * Do not use\r\n */\r\n public fract(): Quaternion {\r\n throw new ReferenceError(\"Can not fract a quaternion\");\r\n }\r\n\r\n /**\r\n * Conjugates the current quaternion and stores the result in the given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#81\r\n * @param ref defines the target quaternion\r\n * @returns result input\r\n */\r\n public conjugateToRef<T extends Quaternion>(ref: T): T {\r\n ref.copyFromFloats(-this._x, -this._y, -this._z, this._w);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Conjugates in place the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#82\r\n * @returns the current updated quaternion\r\n */\r\n public conjugateInPlace(): this {\r\n this._x *= -1;\r\n this._y *= -1;\r\n this._z *= -1;\r\n this._isDirty = true;\r\n return this;\r\n }\r\n\r\n /**\r\n * Conjugates (1-q) the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#83\r\n * @returns a new quaternion\r\n */\r\n public conjugate(): Quaternion {\r\n return new Quaternion(-this._x, -this._y, -this._z, this._w);\r\n }\r\n\r\n /**\r\n * Returns the inverse of the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#84\r\n * @returns a new quaternion\r\n */\r\n public invert(): Quaternion {\r\n const conjugate = this.conjugate();\r\n const lengthSquared = this.lengthSquared();\r\n if (lengthSquared == 0 || lengthSquared == 1) {\r\n return conjugate;\r\n }\r\n conjugate.scaleInPlace(1 / lengthSquared);\r\n return conjugate;\r\n }\r\n\r\n /**\r\n * Invert in place the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#85\r\n * @returns this quaternion\r\n */\r\n public invertInPlace(): this {\r\n this.conjugateInPlace();\r\n const lengthSquared = this.lengthSquared();\r\n if (lengthSquared == 0 || lengthSquared == 1) {\r\n return this;\r\n }\r\n this.scaleInPlace(1 / lengthSquared);\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets squared length of current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#29\r\n * @returns the quaternion length (float)\r\n */\r\n public lengthSquared(): number {\r\n return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\r\n }\r\n\r\n /**\r\n * Gets length of current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#28\r\n * @returns the quaternion length (float)\r\n */\r\n public length(): number {\r\n return Math.sqrt(this.lengthSquared());\r\n }\r\n\r\n /**\r\n * Normalize in place the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#54\r\n * @returns the current updated quaternion\r\n */\r\n public normalize(): this {\r\n return this.normalizeFromLength(this.length());\r\n }\r\n\r\n /**\r\n * Normalize the current quaternion with the given input length.\r\n * Please note that this is an in place operation.\r\n * @param len the length of the quaternion\r\n * @returns the current updated Quaternion\r\n */\r\n public normalizeFromLength(len: number): this {\r\n if (len === 0 || len === 1.0) {\r\n return this;\r\n }\r\n\r\n return this.scaleInPlace(1.0 / len);\r\n }\r\n\r\n /**\r\n * Normalize a copy of the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#55\r\n * @returns the normalized quaternion\r\n */\r\n public normalizeToNew(): Quaternion {\r\n const normalized = new Quaternion(0, 0, 0, 1);\r\n this.normalizeToRef(normalized);\r\n return normalized;\r\n }\r\n\r\n /**\r\n * Normalize the current Quaternion to the reference\r\n * @param reference define the Quaternion to update\r\n * @returns the updated Quaternion\r\n */\r\n public normalizeToRef<T extends Quaternion>(reference: T): T {\r\n const len = this.length();\r\n if (len === 0 || len === 1.0) {\r\n return reference.copyFromFloats(this._x, this._y, this._z, this._w);\r\n }\r\n\r\n return this.scaleToRef(1.0 / len, reference);\r\n }\r\n\r\n /**\r\n * Returns a new Vector3 set with the Euler angles translated from the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#32\r\n * @returns a new Vector3 containing the Euler angles\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions\r\n */\r\n public toEulerAngles(): Vector3 {\r\n const result = Vector3.Zero();\r\n this.toEulerAnglesToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector3 \"result\" with the Euler angles translated from the current quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#31\r\n * @param result defines the vector which will be filled with the Euler angles\r\n * @returns result input\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions\r\n */\r\n public toEulerAnglesToRef<T extends Vector3>(result: T): T {\r\n const qz = this._z;\r\n const qx = this._x;\r\n const qy = this._y;\r\n const qw = this._w;\r\n\r\n const zAxisY = qy * qz - qx * qw;\r\n const limit = 0.4999999;\r\n\r\n if (zAxisY < -limit) {\r\n result._y = 2 * Math.atan2(qy, qw);\r\n result._x = Math.PI / 2;\r\n result._z = 0;\r\n result._isDirty = true;\r\n } else if (zAxisY > limit) {\r\n result._y = 2 * Math.atan2(qy, qw);\r\n result._x = -Math.PI / 2;\r\n result._z = 0;\r\n result._isDirty = true;\r\n } else {\r\n const sqw = qw * qw;\r\n const sqz = qz * qz;\r\n const sqx = qx * qx;\r\n const sqy = qy * qy;\r\n result._z = Math.atan2(2.0 * (qx * qy + qz * qw), -sqz - sqx + sqy + sqw);\r\n result._x = Math.asin(-2.0 * zAxisY);\r\n result._y = Math.atan2(2.0 * (qz * qx + qy * qw), sqz - sqx - sqy + sqw);\r\n result._isDirty = true;\r\n }\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given vector3 \"result\" with the Alpha, Beta, Gamma Euler angles translated from the current quaternion\r\n * @param result defines the vector which will be filled with the Euler angles\r\n * @returns result input\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions\r\n */\r\n public toAlphaBetaGammaToRef<T extends Vector3>(result: T): T {\r\n const qz = this._z;\r\n const qx = this._x;\r\n const qy = this._y;\r\n const qw = this._w;\r\n\r\n // Compute intermediate values\r\n const sinHalfBeta = Math.sqrt(qx * qx + qy * qy);\r\n const cosHalfBeta = Math.sqrt(qz * qz + qw * qw);\r\n\r\n // Calculate beta\r\n const beta = 2 * Math.atan2(sinHalfBeta, cosHalfBeta);\r\n\r\n // Calculate gamma + alpha\r\n const gammaPlusAlpha = 2 * Math.atan2(qz, qw);\r\n\r\n // Calculate gamma - alpha\r\n const gammaMinusAlpha = 2 * Math.atan2(qy, qx);\r\n\r\n // Calculate gamma and alpha\r\n const gamma = (gammaPlusAlpha + gammaMinusAlpha) / 2;\r\n const alpha = (gammaPlusAlpha - gammaMinusAlpha) / 2;\r\n\r\n result.set(alpha, beta, gamma);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the given rotation matrix with the current quaternion values\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#67\r\n * @param result defines the target matrix\r\n * @returns the updated matrix with the rotation\r\n */\r\n public toRotationMatrix<T extends Matrix>(result: T): T {\r\n Matrix.FromQuaternionToRef(this, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the current quaternion from the given rotation matrix values\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#41\r\n * @param matrix defines the source matrix\r\n * @returns the current updated quaternion\r\n */\r\n public fromRotationMatrix(matrix: DeepImmutable<Matrix>): this {\r\n Quaternion.FromRotationMatrixToRef(matrix, this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the current quaternions and \"other\"\r\n * @param other defines the right operand\r\n * @returns the dot product\r\n */\r\n public dot(other: DeepImmutable<this>): number {\r\n return this._x * other._x + this._y * other._y + this._z * other._z + this._w * other._w;\r\n }\r\n\r\n /**\r\n * Converts the current quaternion to an axis angle representation\r\n * @returns the axis and angle in radians\r\n */\r\n public toAxisAngle(): { axis: Vector3; angle: number } {\r\n const axis = Vector3.Zero();\r\n const angle = this.toAxisAngleToRef(axis);\r\n return { axis, angle };\r\n }\r\n\r\n /**\r\n * Converts the current quaternion to an axis angle representation\r\n * @param axis defines the target axis vector\r\n * @returns the angle in radians\r\n */\r\n public toAxisAngleToRef<T extends Vector3>(axis: T): number {\r\n let angle = 0;\r\n const sinHalfAngle = Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z);\r\n const cosHalfAngle = this._w;\r\n\r\n if (sinHalfAngle > 0) {\r\n angle = 2 * Math.atan2(sinHalfAngle, cosHalfAngle);\r\n axis.set(this._x / sinHalfAngle, this._y / sinHalfAngle, this._z / sinHalfAngle);\r\n } else {\r\n angle = 0;\r\n axis.set(1, 0, 0);\r\n }\r\n\r\n return angle;\r\n }\r\n\r\n // Statics\r\n\r\n /**\r\n * Creates a new quaternion from a rotation matrix\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#101\r\n * @param matrix defines the source matrix\r\n * @returns a new quaternion created from the given rotation matrix values\r\n */\r\n public static FromRotationMatrix(matrix: DeepImmutable<Matrix>): Quaternion {\r\n const result = new Quaternion();\r\n Quaternion.FromRotationMatrixToRef(matrix, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates the given quaternion with the given rotation matrix values\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#102\r\n * @param matrix defines the source matrix\r\n * @param result defines the target quaternion\r\n * @returns result input\r\n */\r\n public static FromRotationMatrixToRef<T extends Quaternion>(matrix: DeepImmutable<Matrix>, result: T): T {\r\n const data = matrix.m;\r\n const m11 = data[0],\r\n m12 = data[4],\r\n m13 = data[8];\r\n const m21 = data[1],\r\n m22 = data[5],\r\n m23 = data[9];\r\n const m31 = data[2],\r\n m32 = data[6],\r\n m33 = data[10];\r\n const trace = m11 + m22 + m33;\r\n let s;\r\n\r\n if (trace > 0) {\r\n s = 0.5 / Math.sqrt(trace + 1.0);\r\n\r\n result._w = 0.25 / s;\r\n result._x = (m32 - m23) * s;\r\n result._y = (m13 - m31) * s;\r\n result._z = (m21 - m12) * s;\r\n result._isDirty = true;\r\n } else if (m11 > m22 && m11 > m33) {\r\n s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\r\n\r\n result._w = (m32 - m23) / s;\r\n result._x = 0.25 * s;\r\n result._y = (m12 + m21) / s;\r\n result._z = (m13 + m31) / s;\r\n result._isDirty = true;\r\n } else if (m22 > m33) {\r\n s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\r\n\r\n result._w = (m13 - m31) / s;\r\n result._x = (m12 + m21) / s;\r\n result._y = 0.25 * s;\r\n result._z = (m23 + m32) / s;\r\n result._isDirty = true;\r\n } else {\r\n s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\r\n\r\n result._w = (m21 - m12) / s;\r\n result._x = (m13 + m31) / s;\r\n result._y = (m23 + m32) / s;\r\n result._z = 0.25 * s;\r\n result._isDirty = true;\r\n }\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns the dot product (float) between the quaternions \"left\" and \"right\"\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#61\r\n * @param left defines the left operand\r\n * @param right defines the right operand\r\n * @returns the dot product\r\n */\r\n public static Dot(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>): number {\r\n return left._x * right._x + left._y * right._y + left._z * right._z + left._w * right._w;\r\n }\r\n\r\n /**\r\n * Checks if the orientations of two rotation quaternions are close to each other\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#60\r\n * @param quat0 defines the first quaternion to check\r\n * @param quat1 defines the second quaternion to check\r\n * @param epsilon defines closeness, 0 same orientation, 1 PI apart, default 0.1\r\n * @returns true if the two quaternions are close to each other within epsilon\r\n */\r\n public static AreClose(quat0: DeepImmutable<Quaternion>, quat1: DeepImmutable<Quaternion>, epsilon: number = 0.1): boolean {\r\n const dot = Quaternion.Dot(quat0, quat1);\r\n\r\n return 1 - dot * dot <= epsilon;\r\n }\r\n\r\n /**\r\n * Smooth interpolation between two quaternions using Slerp\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#93\r\n * @param source source quaternion\r\n * @param goal goal quaternion\r\n * @param deltaTime current interpolation frame\r\n * @param lerpTime total interpolation time\r\n * @param result the smoothed quaternion\r\n * @returns the smoothed quaternion\r\n */\r\n public static SmoothToRef<T extends Quaternion>(source: Quaternion, goal: Quaternion, deltaTime: number, lerpTime: number, result: T): T {\r\n let slerp = lerpTime === 0 ? 1 : deltaTime / lerpTime;\r\n slerp = Clamp(slerp, 0, 1);\r\n\r\n Quaternion.SlerpToRef(source, goal, slerp, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates an empty quaternion\r\n * @returns a new quaternion set to (0.0, 0.0, 0.0)\r\n */\r\n public static Zero(): Quaternion {\r\n return new Quaternion(0.0, 0.0, 0.0, 0.0);\r\n }\r\n\r\n /**\r\n * Inverse a given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#103\r\n * @param q defines the source quaternion\r\n * @returns a new quaternion as the inverted current quaternion\r\n */\r\n public static Inverse(q: DeepImmutable<Quaternion>): Quaternion {\r\n return new Quaternion(-q._x, -q._y, -q._z, q._w);\r\n }\r\n\r\n /**\r\n * Inverse a given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#104\r\n * @param q defines the source quaternion\r\n * @param result the quaternion the result will be stored in\r\n * @returns the result quaternion\r\n */\r\n public static InverseToRef<T extends Quaternion>(q: Quaternion, result: T): T {\r\n result.set(-q._x, -q._y, -q._z, q._w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates an identity quaternion\r\n * @returns the identity quaternion\r\n */\r\n public static Identity(): Quaternion {\r\n return new Quaternion(0.0, 0.0, 0.0, 1.0);\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating if the given quaternion is identity\r\n * @param quaternion defines the quaternion to check\r\n * @returns true if the quaternion is identity\r\n */\r\n public static IsIdentity(quaternion: DeepImmutable<Quaternion>): boolean {\r\n return quaternion && quaternion._x === 0 && quaternion._y === 0 && quaternion._z === 0 && quaternion._w === 1;\r\n }\r\n\r\n /**\r\n * Creates a quaternion from a rotation around an axis\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#72\r\n * @param axis defines the axis to use\r\n * @param angle defines the angle to use\r\n * @returns a new quaternion created from the given axis (Vector3) and angle in radians (float)\r\n */\r\n public static RotationAxis(axis: DeepImmutable<Vector3>, angle: number): Quaternion {\r\n return Quaternion.RotationAxisToRef(axis, angle, new Quaternion());\r\n }\r\n\r\n /**\r\n * Creates a rotation around an axis and stores it into the given quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#73\r\n * @param axis defines the axis to use\r\n * @param angle defines the angle to use\r\n * @param result defines the target quaternion\r\n * @returns the target quaternion\r\n */\r\n public static RotationAxisToRef<T extends Quaternion>(axis: DeepImmutable<Vector3>, angle: number, result: T): T {\r\n result._w = Math.cos(angle / 2);\r\n const sinByLength = Math.sin(angle / 2) / axis.length();\r\n result._x = axis._x * sinByLength;\r\n result._y = axis._y * sinByLength;\r\n result._z = axis._z * sinByLength;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new quaternion from data stored into an array\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#63\r\n * @param array defines the data source\r\n * @param offset defines the offset in the source array where the data starts\r\n * @returns a new quaternion\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset?: number): Quaternion {\r\n if (!offset) {\r\n offset = 0;\r\n }\r\n return new Quaternion(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);\r\n }\r\n\r\n /**\r\n * Updates the given quaternion \"result\" from the starting index of the given array.\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#64\r\n * @param array the array to pull values from\r\n * @param offset the offset into the array to start at\r\n * @param result the quaternion to store the result in\r\n * @returns result input\r\n */\r\n public static FromArrayToRef<T extends Quaternion>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T {\r\n result._x = array[offset];\r\n result._y = array[offset + 1];\r\n result._z = array[offset + 2];\r\n result._w = array[offset + 3];\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given quaternion \"result\" with the given floats.\r\n * @param x defines the x coordinate of the source\r\n * @param y defines the y coordinate of the source\r\n * @param z defines the z coordinate of the source\r\n * @param w defines the w coordinate of the source\r\n * @param result defines the quaternion where to store the result\r\n * @returns the result quaternion\r\n */\r\n public static FromFloatsToRef<T extends Quaternion = Quaternion>(x: number, y: number, z: number, w: number, result: T): T {\r\n result.copyFromFloats(x, y, z, w);\r\n return result;\r\n }\r\n\r\n /**\r\n * Create a quaternion from Euler rotation angles\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#33\r\n * @param x Pitch\r\n * @param y Yaw\r\n * @param z Roll\r\n * @returns the new Quaternion\r\n */\r\n public static FromEulerAngles(x: number, y: number, z: number): Quaternion {\r\n const q = new Quaternion();\r\n Quaternion.RotationYawPitchRollToRef(y, x, z, q);\r\n return q;\r\n }\r\n\r\n /**\r\n * Updates a quaternion from Euler rotation angles\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#34\r\n * @param x Pitch\r\n * @param y Yaw\r\n * @param z Roll\r\n * @param result the quaternion to store the result\r\n * @returns the updated quaternion\r\n */\r\n public static FromEulerAnglesToRef<T extends Quaternion>(x: number, y: number, z: number, result: T): T {\r\n Quaternion.RotationYawPitchRollToRef(y, x, z, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Create a quaternion from Euler rotation vector\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#35\r\n * @param vec the Euler vector (x Pitch, y Yaw, z Roll)\r\n * @returns the new Quaternion\r\n */\r\n public static FromEulerVector(vec: DeepImmutable<Vector3>): Quaternion {\r\n const q = new Quaternion();\r\n Quaternion.RotationYawPitchRollToRef(vec._y, vec._x, vec._z, q);\r\n return q;\r\n }\r\n\r\n /**\r\n * Updates a quaternion from Euler rotation vector\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#36\r\n * @param vec the Euler vector (x Pitch, y Yaw, z Roll)\r\n * @param result the quaternion to store the result\r\n * @returns the updated quaternion\r\n */\r\n public static FromEulerVectorToRef<T extends Quaternion>(vec: DeepImmutable<Vector3>, result: T): T {\r\n Quaternion.RotationYawPitchRollToRef(vec._y, vec._x, vec._z, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Updates a quaternion so that it rotates vector vecFrom to vector vecTo\r\n * Example Playground - https://playground.babylonjs.com/#L49EJ7#70\r\n * @param vecFrom defines the direction vector from which to rotate\r\n * @param vecTo defines the direction vector to which to rotate\r\n * @param result the quaternion to store the result\r\n * @param epsilon defines the minimal dot value to define vecs as opposite. Default: `BABYLON.Epsilon`\r\n * @returns the updated quaternion\r\n */\r\n public static FromUnitVectorsToRef<T extends Quaternion>(vecFrom: DeepImmutable<Vector3>, vecTo: DeepImmutable<Vector3>, result: T, epsilon = Epsilon): T {\r\n const r = Vector3.Dot(vecFrom, vecTo) + 1;\r\n\r\n if (r < epsilon) {\r\n if (Math.abs(vecFrom.x) > Math.abs(vecFrom.z)) {\r\n result.set(-vecFrom.y, vecFrom.x, 0, 0);\r\n } else {\r\n result.set(0, -vecFrom.z, vecFrom.y, 0);\r\n }\r\n } else {\r\n Vector3.CrossToRef(vecFrom, vecTo, TmpVectors.Vector3[0]);\r\n result.set(TmpVectors.Vector3[0].x, TmpVectors.Vector3[0].y, TmpVectors.Vector3[0].z, r);\r\n }\r\n\r\n return result.normalize();\r\n }\r\n\r\n /**\r\n * Creates a new quaternion from the given Euler float angles (y, x, z)\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#77\r\n * @param yaw defines the rotation around Y axis\r\n * @param pitch defines the rotation around X axis\r\n * @param roll defines the rotation around Z axis\r\n * @returns the new quaternion\r\n */\r\n public static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Quaternion {\r\n const q = new Quaternion();\r\n Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, q);\r\n return q;\r\n }\r\n\r\n /**\r\n * Creates a new rotation from the given Euler float angles (y, x, z) and stores it in the target quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#561\r\n * @param yaw defines the rotation around Y axis\r\n * @param pitch defines the rotation around X axis\r\n * @param roll defines the rotation around Z axis\r\n * @param result defines the target quaternion\r\n * @returns result input\r\n */\r\n public static RotationYawPitchRollToRef<T extends Quaternion>(yaw: number, pitch: number, roll: number, result: T): T {\r\n // Produces a quaternion from Euler angles in the y-x-z orientation\r\n const halfRoll = roll * 0.5;\r\n const halfPitch = pitch * 0.5;\r\n const halfYaw = yaw * 0.5;\r\n\r\n const sinRoll = Math.sin(halfRoll);\r\n const cosRoll = Math.cos(halfRoll);\r\n const sinPitch = Math.sin(halfPitch);\r\n const cosPitch = Math.cos(halfPitch);\r\n const sinYaw = Math.sin(halfYaw);\r\n const cosYaw = Math.cos(halfYaw);\r\n\r\n result._x = cosYaw * sinPitch * cosRoll + sinYaw * cosPitch * sinRoll;\r\n result._y = sinYaw * cosPitch * cosRoll - cosYaw * sinPitch * sinRoll;\r\n result._z = cosYaw * cosPitch * sinRoll - sinYaw * sinPitch * cosRoll;\r\n result._w = cosYaw * cosPitch * cosRoll + sinYaw * sinPitch * sinRoll;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#68\r\n * @param alpha defines the rotation around first axis\r\n * @param beta defines the rotation around second axis\r\n * @param gamma defines the rotation around third axis\r\n * @returns the new quaternion\r\n */\r\n public static RotationAlphaBetaGamma(alpha: number, beta: number, gamma: number): Quaternion {\r\n const result = new Quaternion();\r\n Quaternion.RotationAlphaBetaGammaToRef(alpha, beta, gamma, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation and stores it in the target quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#69\r\n * @param alpha defines the rotation around first axis\r\n * @param beta defines the rotation around second axis\r\n * @param gamma defines the rotation around third axis\r\n * @param result defines the target quaternion\r\n * @returns result input\r\n */\r\n public static RotationAlphaBetaGammaToRef<T extends Quaternion>(alpha: number, beta: number, gamma: number, result: T): T {\r\n // Produces a quaternion from Euler angles in the z-x-z orientation\r\n const halfGammaPlusAlpha = (gamma + alpha) * 0.5;\r\n const halfGammaMinusAlpha = (gamma - alpha) * 0.5;\r\n const halfBeta = beta * 0.5;\r\n\r\n result._x = Math.cos(halfGammaMinusAlpha) * Math.sin(halfBeta);\r\n result._y = Math.sin(halfGammaMinusAlpha) * Math.sin(halfBeta);\r\n result._z = Math.sin(halfGammaPlusAlpha) * Math.cos(halfBeta);\r\n result._w = Math.cos(halfGammaPlusAlpha) * Math.cos(halfBeta);\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new quaternion containing the rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation)\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#75\r\n * @param axis1 defines the first axis\r\n * @param axis2 defines the second axis\r\n * @param axis3 defines the third axis\r\n * @returns the new quaternion\r\n */\r\n public static RotationQuaternionFromAxis(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>): Quaternion {\r\n const quat = new Quaternion(0.0, 0.0, 0.0, 0.0);\r\n Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat);\r\n return quat;\r\n }\r\n\r\n /**\r\n * Creates a rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation) and stores it in the target quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#76\r\n * @param axis1 defines the first axis\r\n * @param axis2 defines the second axis\r\n * @param axis3 defines the third axis\r\n * @param ref defines the target quaternion\r\n * @returns result input\r\n */\r\n public static RotationQuaternionFromAxisToRef<T extends Quaternion>(axis1: DeepImmutable<Vector3>, axis2: DeepImmutable<Vector3>, axis3: DeepImmutable<Vector3>, ref: T): T {\r\n const rotMat = MathTmp.Matrix[0];\r\n axis1 = axis1.normalizeToRef(MathTmp.Vector3[0]);\r\n axis2 = axis2.normalizeToRef(MathTmp.Vector3[1]);\r\n axis3 = axis3.normalizeToRef(MathTmp.Vector3[2]);\r\n Matrix.FromXYZAxesToRef(axis1, axis2, axis3, rotMat);\r\n Quaternion.FromRotationMatrixToRef(rotMat, ref);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like \"up\".\r\n * This function works in left handed mode\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#96\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @returns A new quaternion oriented toward the specified forward and up.\r\n */\r\n public static FromLookDirectionLH(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Quaternion {\r\n const quat = new Quaternion();\r\n Quaternion.FromLookDirectionLHToRef(forward, up, quat);\r\n return quat;\r\n }\r\n\r\n /**\r\n * Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like \"up\", and stores it in the target quaternion.\r\n * This function works in left handed mode\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#97\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @param ref defines the target quaternion.\r\n * @returns result input\r\n */\r\n public static FromLookDirectionLHToRef<T extends Quaternion>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref: T): T {\r\n const rotMat = MathTmp.Matrix[0];\r\n Matrix.LookDirectionLHToRef(forward, up, rotMat);\r\n Quaternion.FromRotationMatrixToRef(rotMat, ref);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like \"up\".\r\n * This function works in right handed mode\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#98\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @returns A new quaternion oriented toward the specified forward and up.\r\n */\r\n public static FromLookDirectionRH(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Quaternion {\r\n const quat = new Quaternion();\r\n Quaternion.FromLookDirectionRHToRef(forward, up, quat);\r\n return quat;\r\n }\r\n\r\n /**\r\n * Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like \"up\", and stores it in the target quaternion.\r\n * This function works in right handed mode\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#105\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @param ref defines the target quaternion.\r\n * @returns result input\r\n */\r\n public static FromLookDirectionRHToRef<T extends Quaternion>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, ref: T): T {\r\n const rotMat = MathTmp.Matrix[0];\r\n Matrix.LookDirectionRHToRef(forward, up, rotMat);\r\n return Quaternion.FromRotationMatrixToRef(rotMat, ref);\r\n }\r\n\r\n /**\r\n * Interpolates between two quaternions\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#79\r\n * @param left defines first quaternion\r\n * @param right defines second quaternion\r\n * @param amount defines the gradient to use\r\n * @returns the new interpolated quaternion\r\n */\r\n public static Slerp(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>, amount: number): Quaternion {\r\n const result = Quaternion.Identity();\r\n\r\n Quaternion.SlerpToRef(left, right, amount, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Interpolates between two quaternions and stores it into a target quaternion\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#92\r\n * @param left defines first quaternion\r\n * @param right defines second quaternion\r\n * @param amount defines the gradient to use\r\n * @param result defines the target quaternion\r\n * @returns result input\r\n */\r\n public static SlerpToRef<T extends Quaternion>(left: DeepImmutable<Quaternion>, right: DeepImmutable<Quaternion>, amount: number, result: T): T {\r\n let num2;\r\n let num3;\r\n let num4 = left._x * right._x + left._y * right._y + left._z * right._z + left._w * right._w;\r\n let flag = false;\r\n\r\n if (num4 < 0) {\r\n flag = true;\r\n num4 = -num4;\r\n }\r\n\r\n if (num4 > 0.999999) {\r\n num3 = 1 - amount;\r\n num2 = flag ? -amount : amount;\r\n } else {\r\n const num5 = Math.acos(num4);\r\n const num6 = 1.0 / Math.sin(num5);\r\n num3 = Math.sin((1.0 - amount) * num5) * num6;\r\n num2 = flag ? -Math.sin(amount * num5) * num6 : Math.sin(amount * num5) * num6;\r\n }\r\n\r\n result._x = num3 * left._x + num2 * right._x;\r\n result._y = num3 * left._y + num2 * right._y;\r\n result._z = num3 * left._z + num2 * right._z;\r\n result._w = num3 * left._w + num2 * right._w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Interpolate between two quaternions using Hermite interpolation\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#47\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#hermite-quaternion-spline\r\n * @param value1 defines first quaternion\r\n * @param tangent1 defines the incoming tangent\r\n * @param value2 defines second quaternion\r\n * @param tangent2 defines the outgoing tangent\r\n * @param amount defines the target quaternion\r\n * @returns the new interpolated quaternion\r\n */\r\n public static Hermite(\r\n value1: DeepImmutable<Quaternion>,\r\n tangent1: DeepImmutable<Quaternion>,\r\n value2: DeepImmutable<Quaternion>,\r\n tangent2: DeepImmutable<Quaternion>,\r\n amount: number\r\n ): Quaternion {\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 x = value1._x * part1 + value2._x * part2 + tangent1._x * part3 + tangent2._x * part4;\r\n const y = value1._y * part1 + value2._y * part2 + tangent1._y * part3 + tangent2._y * part4;\r\n const z = value1._z * part1 + value2._z * part2 + tangent1._z * part3 + tangent2._z * part4;\r\n const w = value1._w * part1 + value2._w * part2 + tangent1._w * part3 + tangent2._w * part4;\r\n return new Quaternion(x, y, z, w);\r\n }\r\n\r\n /**\r\n * Returns a new Quaternion which is the 1st derivative of the Hermite spline defined by the quaternions \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#48\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<Quaternion>,\r\n tangent1: DeepImmutable<Quaternion>,\r\n value2: DeepImmutable<Quaternion>,\r\n tangent2: DeepImmutable<Quaternion>,\r\n time: number\r\n ): Quaternion {\r\n const result = new Quaternion();\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 Quaternion with the 1st derivative of the Hermite spline defined by the quaternions \"value1\", \"value2\", \"tangent1\", \"tangent2\".\r\n * Example Playground https://playground.babylonjs.com/#L49EJ7#49\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 * @returns result input\r\n */\r\n public static Hermite1stDerivativeToRef<T extends Quaternion>(\r\n value1: DeepImmutable<Quaternion>,\r\n tangent1: DeepImmutable<Quaternion>,\r\n value2: DeepImmutable<Quaternion>,\r\n tangent2: DeepImmutable<Quaternion>,\r\n time: number,\r\n result: T\r\n ): T {\r\n const t2 = time * time;\r\n\r\n result._x = (t2 - time) * 6 * value1._x + (3 * t2 - 4 * time + 1) * tangent1._x + (-t2 + time) * 6 * value2._x + (3 * t2 - 2 * time) * tangent2._x;\r\n result._y = (t2 - time) * 6 * value1._y + (3 * t2 - 4 * time + 1) * tangent1._y + (-t2 + time) * 6 * value2._y + (3 * t2 - 2 * time) * tangent2._y;\r\n result._z = (t2 - time) * 6 * value1._z + (3 * t2 - 4 * time + 1) * tangent1._z + (-t2 + time) * 6 * value2._z + (3 * t2 - 2 * time) * tangent2._z;\r\n result._w = (t2 - time) * 6 * value1._w + (3 * t2 - 4 * time + 1) * tangent1._w + (-t2 + time) * 6 * value2._w + (3 * t2 - 2 * time) * tangent2._w;\r\n result._isDirty = true;\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Quaternion as the normalization of the given Quaternion\r\n * @param quat defines the Quaternion to normalize\r\n * @returns the new Quaternion\r\n */\r\n public static Normalize(quat: DeepImmutable<Quaternion>): Quaternion {\r\n const result = Quaternion.Zero();\r\n Quaternion.NormalizeToRef(quat, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given Quaternion \"result\" with the normalization of the given first Quaternion\r\n * @param quat defines the Quaternion to normalize\r\n * @param result defines the Quaternion where to store the result\r\n * @returns result input\r\n */\r\n public static NormalizeToRef<T extends Quaternion>(quat: DeepImmutable<Quaternion>, result: T): T {\r\n quat.normalizeToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Quaternion set with the coordinates of \"value\", if the quaternion \"value\" is in the cube defined by the quaternions \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @returns the new Quaternion\r\n */\r\n public static Clamp(value: DeepImmutable<Quaternion>, min: DeepImmutable<Quaternion>, max: DeepImmutable<Quaternion>): Quaternion {\r\n const result = new Quaternion();\r\n Quaternion.ClampToRef(value, min, max, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given quaternion \"result\" with the coordinates of \"value\", if the quaternion \"value\" is in the cube defined by the quaternions \"min\" and \"max\"\r\n * If a coordinate value of \"value\" is lower than one of the \"min\" coordinate, then this \"value\" coordinate is set with the \"min\" one\r\n * If a coordinate value of \"value\" is greater than one of the \"max\" coordinate, then this \"value\" coordinate is set with the \"max\" one\r\n * @param value defines the current value\r\n * @param min defines the lower range value\r\n * @param max defines the upper range value\r\n * @param result defines the Quaternion where to store the result\r\n * @returns result input\r\n */\r\n public static ClampToRef<T extends Quaternion>(value: DeepImmutable<Quaternion>, min: DeepImmutable<Quaternion>, max: DeepImmutable<Quaternion>, result: T): T {\r\n return result.copyFromFloats(Clamp(value.x, min.x, max.x), Clamp(value.y, min.y, max.y), Clamp(value.z, min.z, max.z), Clamp(value.w, min.w, max.w));\r\n }\r\n\r\n /**\r\n * Returns a new Quaternion with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @returns a Quaternion with random values between min and max\r\n */\r\n public static Random(min: number = 0, max: number = 1): Quaternion {\r\n return new Quaternion(RandomRange(min, max), RandomRange(min, max), RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Sets a Quaternion with random values between min and max\r\n * @param min the minimum random value\r\n * @param max the maximum random value\r\n * @param ref the ref to store the values in\r\n * @returns the ref with random values between min and max\r\n */\r\n public static RandomToRef<T extends Quaternion>(min: number = 0, max: number = 1, ref: T): T {\r\n return ref.copyFromFloats(RandomRange(min, max), RandomRange(min, max), RandomRange(min, max), RandomRange(min, max));\r\n }\r\n\r\n /**\r\n * Do not use\r\n * @internal\r\n */\r\n public static Minimize(): Quaternion {\r\n throw new ReferenceError(\"Quaternion.Minimize does not make sense\");\r\n }\r\n\r\n /**\r\n * Do not use\r\n * @internal\r\n */\r\n public static Maximize(): Quaternion {\r\n throw new ReferenceError(\"Quaternion.Maximize does not make sense\");\r\n }\r\n\r\n /**\r\n * Returns the distance (float) between the quaternions \"value1\" and \"value2\".\r\n * @param value1 value to calulate the distance between\r\n * @param value2 value to calulate the distance between\r\n * @returns the distance between the two quaternions\r\n */\r\n public static Distance(value1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>): number {\r\n return Math.sqrt(Quaternion.DistanceSquared(value1, value2));\r\n }\r\n\r\n /**\r\n * Returns the squared distance (float) between the quaternions \"value1\" and \"value2\".\r\n * @param value1 value to calulate the distance between\r\n * @param value2 value to calulate the distance between\r\n * @returns the distance between the two quaternions squared\r\n */\r\n public static DistanceSquared(value1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>): number {\r\n const x = value1.x - value2.x;\r\n const y = value1.y - value2.y;\r\n const z = value1.z - value2.z;\r\n const w = value1.w - value2.w;\r\n\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n\r\n /**\r\n * Returns a new Quaternion located at the center between the quaternions \"value1\" and \"value2\".\r\n * @param value1 value to calulate the center between\r\n * @param value2 value to calulate the center between\r\n * @returns the center between the two quaternions\r\n */\r\n public static Center(value1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>): Quaternion {\r\n return Quaternion.CenterToRef(value1, value2, Quaternion.Zero());\r\n }\r\n\r\n /**\r\n * Gets the center of the quaternions \"value1\" and \"value2\" and stores the result in the quaternion \"ref\"\r\n * @param value1 defines first quaternion\r\n * @param value2 defines second quaternion\r\n * @param ref defines third quaternion\r\n * @returns ref\r\n */\r\n public static CenterToRef<T extends Quaternion>(value1: DeepImmutable<Quaternion>, value2: DeepImmutable<Quaternion>, ref: T): T {\r\n return ref.copyFromFloats((value1.x + value2.x) / 2, (value1.y + value2.y) / 2, (value1.z + value2.z) / 2, (value1.w + value2.w) / 2);\r\n }\r\n}\r\n\r\nQuaternion satisfies TensorStatic<Quaternion, Quaternion>;\r\nObject.defineProperties(Quaternion.prototype, {\r\n dimension: { value: [4] },\r\n rank: { value: 1 },\r\n});\r\n\r\n/**\r\n * Class used to store matrix data (4x4)\r\n * Note on matrix definitions in Babylon.js for setting values directly\r\n * rather than using one of the methods available.\r\n * Matrix size is given by rows x columns.\r\n * A Vector3 is a 1 X 3 matrix [x, y, z].\r\n *\r\n * In Babylon.js multiplying a 1 x 3 matrix by a 4 x 4 matrix\r\n * is done using BABYLON.Vector4.TransformCoordinates(Vector3, Matrix).\r\n * and extending the passed Vector3 to a Vector4, V = [x, y, z, 1].\r\n * Let M be a matrix with elements m(row, column), so that\r\n * m(2, 3) is the element in row 2 column 3 of M.\r\n *\r\n * Multiplication is of the form VM and has the resulting Vector4\r\n * VM = [xm(0, 0) + ym(1, 0) + zm(2, 0) + m(3, 0), xm(0, 1) + ym(1, 1) + zm(2, 1) + m(3, 1), xm(0, 2) + ym(1, 2) + zm(2, 2) + m(3, 2), xm(0, 3) + ym(1, 3) + zm(2, 3) + m(3, 3)].\r\n * On the web you will find many examples that use the opposite convention of MV,\r\n * in which case to make use of the examples you will need to transpose the matrix.\r\n *\r\n * Example Playground - Overview Linear Algebra - https://playground.babylonjs.com/#AV9X17\r\n * Example Playground - Overview Transformation - https://playground.babylonjs.com/#AV9X17#1\r\n * Example Playground - Overview Projection - https://playground.babylonjs.com/#AV9X17#2\r\n */\r\nexport class Matrix implements Tensor<Tuple<Tuple<number, 4>, 4>, Matrix>, IMatrixLike {\r\n /**\r\n * @see Tensor.dimension\r\n */\r\n declare public readonly dimension: Readonly<[4, 4]>;\r\n\r\n /**\r\n * @see Tensor.rank\r\n */\r\n declare public readonly rank: 2;\r\n\r\n /**\r\n * Gets the precision of matrix computations\r\n */\r\n public static get Use64Bits(): boolean {\r\n return PerformanceConfigurator.MatrixUse64Bits;\r\n }\r\n\r\n private static _IdentityReadOnly = Matrix.Identity() as DeepImmutable<Matrix>;\r\n\r\n private _isIdentity = false;\r\n private _isIdentityDirty = true;\r\n private _isIdentity3x2 = true;\r\n private _isIdentity3x2Dirty = true;\r\n /**\r\n * Gets the update flag of the matrix which is an unique number for the matrix.\r\n * It will be incremented every time the matrix data change.\r\n * You can use it to speed the comparison between two versions of the same matrix.\r\n */\r\n public updateFlag: number = -1;\r\n\r\n private readonly _m: Tuple<number, 16>;\r\n\r\n /**\r\n * Gets the internal data of the matrix\r\n */\r\n public get m(): DeepImmutable<Tuple<number, 16>> {\r\n return this._m;\r\n }\r\n\r\n /**\r\n * Update the updateFlag to indicate that the matrix has been updated\r\n */\r\n public markAsUpdated() {\r\n this.updateFlag = MatrixManagement._UpdateFlagSeed++;\r\n this._isIdentity = false;\r\n this._isIdentity3x2 = false;\r\n this._isIdentityDirty = true;\r\n this._isIdentity3x2Dirty = true;\r\n }\r\n\r\n private _updateIdentityStatus(isIdentity: boolean, isIdentityDirty: boolean = false, isIdentity3x2: boolean = false, isIdentity3x2Dirty: boolean = true) {\r\n this._isIdentity = isIdentity;\r\n this._isIdentity3x2 = isIdentity || isIdentity3x2;\r\n this._isIdentityDirty = this._isIdentity ? false : isIdentityDirty;\r\n this._isIdentity3x2Dirty = this._isIdentity3x2 ? false : isIdentity3x2Dirty;\r\n }\r\n\r\n /**\r\n * Creates an empty matrix (filled with zeros)\r\n */\r\n public constructor() {\r\n if (PerformanceConfigurator.MatrixTrackPrecisionChange) {\r\n PerformanceConfigurator.MatrixTrackedMatrices!.push(this);\r\n }\r\n\r\n this._m = new PerformanceConfigurator.MatrixCurrentType(16);\r\n\r\n this.markAsUpdated();\r\n }\r\n\r\n // Properties\r\n\r\n /**\r\n * Check if the current matrix is identity\r\n * @returns true is the matrix is the identity matrix\r\n */\r\n public isIdentity(): boolean {\r\n if (this._isIdentityDirty) {\r\n this._isIdentityDirty = false;\r\n const m = this._m;\r\n this._isIdentity =\r\n m[0] === 1.0 &&\r\n m[1] === 0.0 &&\r\n m[2] === 0.0 &&\r\n m[3] === 0.0 &&\r\n m[4] === 0.0 &&\r\n m[5] === 1.0 &&\r\n m[6] === 0.0 &&\r\n m[7] === 0.0 &&\r\n m[8] === 0.0 &&\r\n m[9] === 0.0 &&\r\n m[10] === 1.0 &&\r\n m[11] === 0.0 &&\r\n m[12] === 0.0 &&\r\n m[13] === 0.0 &&\r\n m[14] === 0.0 &&\r\n m[15] === 1.0;\r\n }\r\n\r\n return this._isIdentity;\r\n }\r\n\r\n /**\r\n * Check if the current matrix is identity as a texture matrix (3x2 store in 4x4)\r\n * @returns true is the matrix is the identity matrix\r\n */\r\n public isIdentityAs3x2(): boolean {\r\n if (this._isIdentity3x2Dirty) {\r\n this._isIdentity3x2Dirty = false;\r\n if (this._m[0] !== 1.0 || this._m[5] !== 1.0 || this._m[15] !== 1.0) {\r\n this._isIdentity3x2 = false;\r\n } else if (\r\n this._m[1] !== 0.0 ||\r\n this._m[2] !== 0.0 ||\r\n this._m[3] !== 0.0 ||\r\n this._m[4] !== 0.0 ||\r\n this._m[6] !== 0.0 ||\r\n this._m[7] !== 0.0 ||\r\n this._m[8] !== 0.0 ||\r\n this._m[9] !== 0.0 ||\r\n this._m[10] !== 0.0 ||\r\n this._m[11] !== 0.0 ||\r\n this._m[12] !== 0.0 ||\r\n this._m[13] !== 0.0 ||\r\n this._m[14] !== 0.0\r\n ) {\r\n this._isIdentity3x2 = false;\r\n } else {\r\n this._isIdentity3x2 = true;\r\n }\r\n }\r\n\r\n return this._isIdentity3x2;\r\n }\r\n\r\n /**\r\n * Gets the determinant of the matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#34\r\n * @returns the matrix determinant\r\n */\r\n public determinant(): number {\r\n if (this._isIdentity === true) {\r\n return 1;\r\n }\r\n\r\n const m = this._m;\r\n const m00 = m[0],\r\n m01 = m[1],\r\n m02 = m[2],\r\n m03 = m[3];\r\n const m10 = m[4],\r\n m11 = m[5],\r\n m12 = m[6],\r\n m13 = m[7];\r\n const m20 = m[8],\r\n m21 = m[9],\r\n m22 = m[10],\r\n m23 = m[11];\r\n const m30 = m[12],\r\n m31 = m[13],\r\n m32 = m[14],\r\n m33 = m[15];\r\n // https://en.wikipedia.org/wiki/Laplace_expansion\r\n // to compute the deterrminant of a 4x4 Matrix we compute the cofactors of any row or column,\r\n // then we multiply each Cofactor by its corresponding matrix value and sum them all to get the determinant\r\n // Cofactor(i, j) = sign(i,j) * det(Minor(i, j))\r\n // where\r\n // - sign(i,j) = (i+j) % 2 === 0 ? 1 : -1\r\n // - Minor(i, j) is the 3x3 matrix we get by removing row i and column j from current Matrix\r\n //\r\n // Here we do that for the 1st row.\r\n\r\n const det_22_33 = m22 * m33 - m32 * m23;\r\n const det_21_33 = m21 * m33 - m31 * m23;\r\n const det_21_32 = m21 * m32 - m31 * m22;\r\n const det_20_33 = m20 * m33 - m30 * m23;\r\n const det_20_32 = m20 * m32 - m22 * m30;\r\n const det_20_31 = m20 * m31 - m30 * m21;\r\n const cofact_00 = +(m11 * det_22_33 - m12 * det_21_33 + m13 * det_21_32);\r\n const cofact_01 = -(m10 * det_22_33 - m12 * det_20_33 + m13 * det_20_32);\r\n const cofact_02 = +(m10 * det_21_33 - m11 * det_20_33 + m13 * det_20_31);\r\n const cofact_03 = -(m10 * det_21_32 - m11 * det_20_32 + m12 * det_20_31);\r\n return m00 * cofact_00 + m01 * cofact_01 + m02 * cofact_02 + m03 * cofact_03;\r\n }\r\n\r\n // Methods\r\n\r\n /**\r\n * Gets a string with the Matrix values\r\n * @returns a string with the Matrix values\r\n */\r\n public toString(): string {\r\n return `{${this.m[0]}, ${this.m[1]}, ${this.m[2]}, ${this.m[3]}\\n${this.m[4]}, ${this.m[5]}, ${this.m[6]}, ${this.m[7]}\\n${this.m[8]}, ${this.m[9]}, ${this.m[10]}, ${this.m[11]}\\n${this.m[12]}, ${this.m[13]}, ${this.m[14]}, ${this.m[15]}}`;\r\n }\r\n\r\n /**\r\n * Returns the matrix as a Float32Array or Array<number>\r\n * @deprecated Use asArray\r\n */\r\n public toArray(): FloatArray;\r\n\r\n /**\r\n * Stores the matrix in a Float32Array or Array<number>\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#49\r\n * @param array The destination array\r\n * @param index The destination index to start ay\r\n * @returns the matrix\r\n */\r\n public toArray(array: FloatArray, index: number): this;\r\n public toArray(array: Nullable<FloatArray> = null, index: number = 0): this | FloatArray {\r\n if (!array) {\r\n return this._m;\r\n }\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n array[index + i] = m[i];\r\n }\r\n return this;\r\n }\r\n\r\n /**\r\n * Returns the matrix as a Float32Array or Array<number>\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#114\r\n * @returns the matrix underlying array.\r\n */\r\n public asArray(): Tuple<number, 16> {\r\n return this._m;\r\n }\r\n\r\n public fromArray(array: FloatArray, index: number = 0): this {\r\n return Matrix.FromArrayToRef(array, index, this);\r\n }\r\n\r\n public copyFromFloats(...floats: Tuple<number, 16>): this {\r\n return Matrix.FromArrayToRef(floats, 0, this);\r\n }\r\n\r\n public set(...values: Tuple<number, 16>): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = values[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public setAll(value: number): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = value;\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Inverts the current matrix in place\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#118\r\n * @returns the current inverted matrix\r\n */\r\n public invert(): this {\r\n this.invertToRef(this);\r\n return this;\r\n }\r\n\r\n /**\r\n * Sets all the matrix elements to zero\r\n * @returns the current matrix\r\n */\r\n public reset(): this {\r\n Matrix.FromValuesToRef(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, this);\r\n this._updateIdentityStatus(false);\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the current matrix with a second one\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#44\r\n * @param other defines the matrix to add\r\n * @returns a new matrix as the addition of the current matrix and the given one\r\n */\r\n public add(other: DeepImmutable<Matrix>): Matrix {\r\n const result = new Matrix();\r\n this.addToRef(other, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given matrix \"result\" to the addition of the current matrix and the given one\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#45\r\n * @param other defines the matrix to add\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public addToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T {\r\n const m = this._m;\r\n const resultM = result._m;\r\n const otherM = other.m;\r\n for (let index = 0; index < 16; index++) {\r\n resultM[index] = m[index] + otherM[index];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Adds in place the given matrix to the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#46\r\n * @param other defines the second operand\r\n * @returns the current updated matrix\r\n */\r\n public addToSelf(other: DeepImmutable<Matrix>): this {\r\n const m = this._m;\r\n const otherM = other.m;\r\n m[0] += otherM[0];\r\n m[1] += otherM[1];\r\n m[2] += otherM[2];\r\n m[3] += otherM[3];\r\n m[4] += otherM[4];\r\n m[5] += otherM[5];\r\n m[6] += otherM[6];\r\n m[7] += otherM[7];\r\n m[8] += otherM[8];\r\n m[9] += otherM[9];\r\n m[10] += otherM[10];\r\n m[11] += otherM[11];\r\n m[12] += otherM[12];\r\n m[13] += otherM[13];\r\n m[14] += otherM[14];\r\n m[15] += otherM[15];\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public addInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] += otherM[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public addInPlaceFromFloats(...floats: Tuple<number, 16>): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] += floats[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public subtract(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] -= otherM[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public subtractToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T {\r\n const m = this._m,\r\n otherM = other.m,\r\n resultM = result._m;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = m[i] - otherM[i];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n public subtractInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] -= otherM[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public subtractFromFloats(...floats: Tuple<number, 16>): Matrix {\r\n return this.subtractFromFloatsToRef(...floats, new Matrix());\r\n }\r\n\r\n public subtractFromFloatsToRef<T extends Matrix>(...args: [...Tuple<number, 16>, T]): T {\r\n const result = args.pop() as T,\r\n m = this._m,\r\n resultM = result._m,\r\n values = args as unknown as Tuple<number, 16>;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = m[i] - values[i];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given matrix to the current inverted Matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#119\r\n * @param other defines the target matrix\r\n * @returns result input\r\n */\r\n public invertToRef<T extends Matrix>(other: T): T {\r\n if (this._isIdentity === true) {\r\n Matrix.IdentityToRef(other);\r\n return other;\r\n }\r\n\r\n if (InvertMatrixToArray(this, other.asArray())) {\r\n other.markAsUpdated();\r\n } else {\r\n other.copyFrom(this);\r\n }\r\n return other;\r\n }\r\n\r\n /**\r\n * add a value at the specified position in the current Matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#47\r\n * @param index the index of the value within the matrix. between 0 and 15.\r\n * @param value the value to be added\r\n * @returns the current updated matrix\r\n */\r\n public addAtIndex(index: number, value: number): this {\r\n this._m[index] += value;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * mutiply the specified position in the current Matrix by a value\r\n * @param index the index of the value within the matrix. between 0 and 15.\r\n * @param value the value to be added\r\n * @returns the current updated matrix\r\n */\r\n public multiplyAtIndex(index: number, value: number): this {\r\n this._m[index] *= value;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Inserts the translation vector (using 3 floats) in the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#120\r\n * @param x defines the 1st component of the translation\r\n * @param y defines the 2nd component of the translation\r\n * @param z defines the 3rd component of the translation\r\n * @returns the current updated matrix\r\n */\r\n public setTranslationFromFloats(x: number, y: number, z: number): this {\r\n this._m[12] = x;\r\n this._m[13] = y;\r\n this._m[14] = z;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds the translation vector (using 3 floats) in the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#20\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#48\r\n * @param x defines the 1st component of the translation\r\n * @param y defines the 2nd component of the translation\r\n * @param z defines the 3rd component of the translation\r\n * @returns the current updated matrix\r\n */\r\n public addTranslationFromFloats(x: number, y: number, z: number): this {\r\n this._m[12] += x;\r\n this._m[13] += y;\r\n this._m[14] += z;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Inserts the translation vector in the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#121\r\n * @param vector3 defines the translation to insert\r\n * @returns the current updated matrix\r\n */\r\n public setTranslation(vector3: DeepImmutable<Vector3>): this {\r\n return this.setTranslationFromFloats(vector3._x, vector3._y, vector3._z);\r\n }\r\n\r\n /**\r\n * Gets the translation value of the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#122\r\n * @returns a new Vector3 as the extracted translation from the matrix\r\n */\r\n public getTranslation(): Vector3 {\r\n return new Vector3(this._m[12], this._m[13], this._m[14]);\r\n }\r\n\r\n /**\r\n * Fill a Vector3 with the extracted translation from the matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#123\r\n * @param result defines the Vector3 where to store the translation\r\n * @returns the current matrix\r\n */\r\n public getTranslationToRef<T extends Vector3>(result: T): T {\r\n result.x = this._m[12];\r\n result.y = this._m[13];\r\n result.z = this._m[14];\r\n return result;\r\n }\r\n\r\n /**\r\n * Remove rotation and scaling part from the matrix\r\n * @returns the updated matrix\r\n */\r\n public removeRotationAndScaling(): this {\r\n const m = this.m;\r\n Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, m[12], m[13], m[14], m[15], this);\r\n this._updateIdentityStatus(m[12] === 0 && m[13] === 0 && m[14] === 0 && m[15] === 1);\r\n return this;\r\n }\r\n\r\n /**\r\n * Copy the current matrix from the given one\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#21\r\n * @param other defines the source matrix\r\n * @returns the current updated matrix\r\n */\r\n public copyFrom(other: DeepImmutable<Matrix>): this {\r\n other.copyToArray(this._m);\r\n const o = other as Matrix;\r\n this.updateFlag = o.updateFlag;\r\n this._updateIdentityStatus(o._isIdentity, o._isIdentityDirty, o._isIdentity3x2, o._isIdentity3x2Dirty);\r\n return this;\r\n }\r\n\r\n /**\r\n * Populates the given array from the starting index with the current matrix values\r\n * @param array defines the target array\r\n * @param offset defines the offset in the target array where to start storing values\r\n * @returns the current matrix\r\n */\r\n public copyToArray(array: Float32Array | Array<number>, offset: number = 0): this {\r\n CopyMatrixToArray(this, array, offset);\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiply two matrices\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#15\r\n * A.multiply(B) means apply B to A so result is B x A\r\n * @param other defines the second operand\r\n * @returns a new matrix set with the multiplication result of the current Matrix and the given one\r\n */\r\n public multiply(other: DeepImmutable<Matrix>): Matrix {\r\n const result = new Matrix();\r\n this.multiplyToRef(other, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * This method performs component-by-component in-place multiplication, rather than true matrix multiplication.\r\n * Use multiply or multiplyToRef for matrix multiplication.\r\n * @param other defines the second operand\r\n * @returns the current updated matrix\r\n */\r\n public multiplyInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] *= otherM[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * This method performs a component-by-component multiplication of the current matrix with the array of transmitted numbers.\r\n * Use multiply or multiplyToRef for matrix multiplication.\r\n * @param floats defines the array of numbers to multiply the matrix by\r\n * @returns the current updated matrix\r\n */\r\n public multiplyByFloats(...floats: Tuple<number, 16>): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] *= floats[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Multiples the current matrix by the given floats and stores them in the given ref\r\n * @param args The floats and ref\r\n * @returns The updated ref\r\n */\r\n public multiplyByFloatsToRef<T extends Matrix>(...args: [...Tuple<number, 16>, T]): T {\r\n const result = args.pop() as T,\r\n m = this._m,\r\n resultM = result._m,\r\n values = args as unknown as Tuple<number, 16>;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = m[i] * values[i];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given matrix \"result\" with the multiplication result of the current Matrix and the given one\r\n * A.multiplyToRef(B, R) means apply B to A and store in R and R = B x A\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#16\r\n * @param other defines the second operand\r\n * @param result defines the matrix where to store the multiplication\r\n * @returns result input\r\n */\r\n public multiplyToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T {\r\n if (this._isIdentity) {\r\n result.copyFrom(other);\r\n return result;\r\n }\r\n if ((other as Matrix)._isIdentity) {\r\n result.copyFrom(this);\r\n return result;\r\n }\r\n\r\n this.multiplyToArray(other, result._m, 0);\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the Float32Array \"result\" from the given index \"offset\" with the multiplication of the current matrix and the given one\r\n * @param other defines the second operand\r\n * @param result defines the array where to store the multiplication\r\n * @param offset defines the offset in the target array where to start storing values\r\n * @returns the current matrix\r\n */\r\n public multiplyToArray(other: DeepImmutable<Matrix>, result: Float32Array | Array<number>, offset: number): this {\r\n MultiplyMatricesToArray(this, other, result, offset);\r\n return this;\r\n }\r\n\r\n public divide(other: DeepImmutable<Matrix>): Matrix {\r\n return this.divideToRef(other, new Matrix());\r\n }\r\n\r\n public divideToRef<T extends Matrix>(other: DeepImmutable<Matrix>, result: T): T {\r\n const m = this._m,\r\n otherM = other.m,\r\n resultM = result._m;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = m[i] / otherM[i];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n public divideInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] /= otherM[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public minimizeInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = Math.min(m[i], otherM[i]);\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public minimizeInPlaceFromFloats(...floats: Tuple<number, 16>): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = Math.min(m[i], floats[i]);\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public maximizeInPlace(other: DeepImmutable<Matrix>): this {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = Math.min(m[i], otherM[i]);\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public maximizeInPlaceFromFloats(...floats: Tuple<number, 16>): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = Math.min(m[i], floats[i]);\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public negate(): Matrix {\r\n return this.negateToRef(new Matrix());\r\n }\r\n\r\n public negateInPlace(): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] = -m[i];\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n public negateToRef<T extends Matrix>(result: T): T {\r\n const m = this._m,\r\n resultM = result._m;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = -m[i];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Check equality between this matrix and a second one\r\n * @param value defines the second matrix to compare\r\n * @returns true is the current matrix and the given one values are strictly equal\r\n */\r\n public equals(value: DeepImmutable<Matrix>): boolean {\r\n const other = value as Matrix;\r\n if (!other) {\r\n return false;\r\n }\r\n\r\n if (this._isIdentity || other._isIdentity) {\r\n if (!this._isIdentityDirty && !other._isIdentityDirty) {\r\n return this._isIdentity && other._isIdentity;\r\n }\r\n }\r\n\r\n const m = this.m;\r\n const om = other.m;\r\n return (\r\n m[0] === om[0] &&\r\n m[1] === om[1] &&\r\n m[2] === om[2] &&\r\n m[3] === om[3] &&\r\n m[4] === om[4] &&\r\n m[5] === om[5] &&\r\n m[6] === om[6] &&\r\n m[7] === om[7] &&\r\n m[8] === om[8] &&\r\n m[9] === om[9] &&\r\n m[10] === om[10] &&\r\n m[11] === om[11] &&\r\n m[12] === om[12] &&\r\n m[13] === om[13] &&\r\n m[14] === om[14] &&\r\n m[15] === om[15]\r\n );\r\n }\r\n\r\n public equalsWithEpsilon(other: DeepImmutable<Matrix>, epsilon: number = 0): boolean {\r\n const m = this._m,\r\n otherM = other.m;\r\n for (let i = 0; i < 16; i++) {\r\n if (!WithinEpsilon(m[i], otherM[i], epsilon)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n public equalsToFloats(...floats: Tuple<number, 16>): boolean {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n if (m[i] != floats[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }\r\n\r\n public floor(): Matrix {\r\n return this.floorToRef(new Matrix());\r\n }\r\n\r\n public floorToRef<T extends Matrix>(result: T): T {\r\n const m = this._m,\r\n resultM = result._m;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = Math.floor(m[i]);\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n public fract(): Matrix {\r\n return this.fractToRef(new Matrix());\r\n }\r\n\r\n public fractToRef<T extends Matrix>(result: T): T {\r\n const m = this._m,\r\n resultM = result._m;\r\n for (let i = 0; i < 16; i++) {\r\n resultM[i] = m[i] - Math.floor(m[i]);\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Clone the current matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#18\r\n * @returns a new matrix from the current matrix\r\n */\r\n public clone(): Matrix {\r\n const matrix = new Matrix();\r\n matrix.copyFrom(this);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Returns the name of the current matrix class\r\n * @returns the string \"Matrix\"\r\n */\r\n public getClassName(): string {\r\n return \"Matrix\";\r\n }\r\n\r\n /**\r\n * Gets the hash code of the current matrix\r\n * @returns the hash code\r\n */\r\n public getHashCode(): number {\r\n let hash = ExtractAsInt(this._m[0]);\r\n for (let i = 1; i < 16; i++) {\r\n hash = (hash * 397) ^ ExtractAsInt(this._m[i]);\r\n }\r\n return hash;\r\n }\r\n\r\n /**\r\n * Decomposes the current Matrix into a translation, rotation and scaling components of the provided node\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#13\r\n * @param node the node to decompose the matrix to\r\n * @returns true if operation was successful\r\n */\r\n public decomposeToTransformNode(node: TransformNode): boolean {\r\n node.rotationQuaternion = node.rotationQuaternion || new Quaternion();\r\n return this.decompose(node.scaling, node.rotationQuaternion, node.position);\r\n }\r\n\r\n /**\r\n * Decomposes the current Matrix into a translation, rotation and scaling components\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#12\r\n * @param scale defines the scale vector3 given as a reference to update\r\n * @param rotation defines the rotation quaternion given as a reference to update\r\n * @param translation defines the translation vector3 given as a reference to update\r\n * @param preserveScalingNode Use scaling sign coming from this node. Otherwise scaling sign might change.\r\n * @param useAbsoluteScaling Use scaling sign coming from this absoluteScaling when true or scaling otherwise.\r\n * @returns true if operation was successful\r\n */\r\n public decompose(scale?: Vector3, rotation?: Quaternion, translation?: Vector3, preserveScalingNode?: TransformNode, useAbsoluteScaling: boolean = true): boolean {\r\n if (this._isIdentity) {\r\n if (translation) {\r\n translation.setAll(0);\r\n }\r\n if (scale) {\r\n scale.setAll(1);\r\n }\r\n if (rotation) {\r\n rotation.copyFromFloats(0, 0, 0, 1);\r\n }\r\n return true;\r\n }\r\n\r\n const m = this._m;\r\n if (translation) {\r\n translation.copyFromFloats(m[12], m[13], m[14]);\r\n }\r\n\r\n scale = scale || MathTmp.Vector3[0];\r\n\r\n scale.x = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]);\r\n scale.y = Math.sqrt(m[4] * m[4] + m[5] * m[5] + m[6] * m[6]);\r\n scale.z = Math.sqrt(m[8] * m[8] + m[9] * m[9] + m[10] * m[10]);\r\n\r\n if (preserveScalingNode) {\r\n const signX = (useAbsoluteScaling ? preserveScalingNode.absoluteScaling.x : preserveScalingNode.scaling.x) < 0 ? -1 : 1;\r\n const signY = (useAbsoluteScaling ? preserveScalingNode.absoluteScaling.y : preserveScalingNode.scaling.y) < 0 ? -1 : 1;\r\n const signZ = (useAbsoluteScaling ? preserveScalingNode.absoluteScaling.z : preserveScalingNode.scaling.z) < 0 ? -1 : 1;\r\n\r\n scale.x *= signX;\r\n scale.y *= signY;\r\n scale.z *= signZ;\r\n } else {\r\n if (this.determinant() <= 0) {\r\n scale.y *= -1;\r\n }\r\n }\r\n\r\n if (scale._x === 0 || scale._y === 0 || scale._z === 0) {\r\n if (rotation) {\r\n rotation.copyFromFloats(0.0, 0.0, 0.0, 1.0);\r\n }\r\n return false;\r\n }\r\n\r\n if (rotation) {\r\n const sx = 1 / scale._x,\r\n sy = 1 / scale._y,\r\n sz = 1 / scale._z;\r\n Matrix.FromValuesToRef(\r\n m[0] * sx,\r\n m[1] * sx,\r\n m[2] * sx,\r\n 0.0,\r\n m[4] * sy,\r\n m[5] * sy,\r\n m[6] * sy,\r\n 0.0,\r\n m[8] * sz,\r\n m[9] * sz,\r\n m[10] * sz,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0,\r\n MathTmp.Matrix[0]\r\n );\r\n\r\n Quaternion.FromRotationMatrixToRef(MathTmp.Matrix[0], rotation);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Gets specific row of the matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\r\n * @param index defines the number of the row to get\r\n * @returns the index-th row of the current matrix as a new Vector4\r\n */\r\n public getRow(index: number): Nullable<Vector4> {\r\n if (index < 0 || index > 3) {\r\n return null;\r\n }\r\n const i = index * 4;\r\n return new Vector4(this._m[i + 0], this._m[i + 1], this._m[i + 2], this._m[i + 3]);\r\n }\r\n\r\n /**\r\n * Gets specific row of the matrix to ref\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\r\n * @param index defines the number of the row to get\r\n * @param rowVector vector to store the index-th row of the current matrix\r\n * @returns result input\r\n */\r\n public getRowToRef<T extends Vector4>(index: number, rowVector: T): T {\r\n if (index >= 0 && index <= 3) {\r\n const i = index * 4;\r\n rowVector.x = this._m[i + 0];\r\n rowVector.y = this._m[i + 1];\r\n rowVector.z = this._m[i + 2];\r\n rowVector.w = this._m[i + 3];\r\n }\r\n return rowVector;\r\n }\r\n\r\n /**\r\n * Sets the index-th row of the current matrix to the vector4 values\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\r\n * @param index defines the number of the row to set\r\n * @param row defines the target vector4\r\n * @returns the updated current matrix\r\n */\r\n public setRow(index: number, row: Vector4): this {\r\n return this.setRowFromFloats(index, row.x, row.y, row.z, row.w);\r\n }\r\n\r\n /**\r\n * Compute the transpose of the matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#40\r\n * @returns the new transposed matrix\r\n */\r\n public transpose(): Matrix {\r\n const result = new Matrix();\r\n Matrix.TransposeToRef(this, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Compute the transpose of the matrix and store it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#41\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public transposeToRef<T extends Matrix>(result: T): T {\r\n Matrix.TransposeToRef(this, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the index-th row of the current matrix with the given 4 x float values\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\r\n * @param index defines the row index\r\n * @param x defines the x component to set\r\n * @param y defines the y component to set\r\n * @param z defines the z component to set\r\n * @param w defines the w component to set\r\n * @returns the updated current matrix\r\n */\r\n public setRowFromFloats(index: number, x: number, y: number, z: number, w: number): this {\r\n if (index < 0 || index > 3) {\r\n return this;\r\n }\r\n const i = index * 4;\r\n this._m[i + 0] = x;\r\n this._m[i + 1] = y;\r\n this._m[i + 2] = z;\r\n this._m[i + 3] = w;\r\n\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Compute a new matrix set with the current matrix values multiplied by scale (float)\r\n * @param scale defines the scale factor\r\n * @returns a new matrix\r\n */\r\n public scale(scale: number): Matrix {\r\n const result = new Matrix();\r\n this.scaleToRef(scale, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Scale the current matrix values by a factor to a given result matrix\r\n * @param scale defines the scale factor\r\n * @param result defines the matrix to store the result\r\n * @returns result input\r\n */\r\n public scaleToRef<T extends Matrix>(scale: number, result: T): T {\r\n for (let index = 0; index < 16; index++) {\r\n result._m[index] = this._m[index] * scale;\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Scale the current matrix values by a factor and add the result to a given matrix\r\n * @param scale defines the scale factor\r\n * @param result defines the Matrix to store the result\r\n * @returns result input\r\n */\r\n public scaleAndAddToRef<T extends Matrix>(scale: number, result: T): T {\r\n for (let index = 0; index < 16; index++) {\r\n result._m[index] += this._m[index] * scale;\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n public scaleInPlace(scale: number): this {\r\n const m = this._m;\r\n for (let i = 0; i < 16; i++) {\r\n m[i] *= scale;\r\n }\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Writes to the given matrix a normal matrix, computed from this one (using values from identity matrix for fourth row and column).\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#17\r\n * @param ref matrix to store the result\r\n * @returns the reference matrix\r\n */\r\n public toNormalMatrix<T extends Matrix>(ref: T): T {\r\n const tmp = MathTmp.Matrix[0];\r\n this.invertToRef(tmp);\r\n tmp.transposeToRef(ref);\r\n const m = ref._m;\r\n Matrix.FromValuesToRef(m[0], m[1], m[2], 0.0, m[4], m[5], m[6], 0.0, m[8], m[9], m[10], 0.0, 0.0, 0.0, 0.0, 1.0, ref);\r\n return ref;\r\n }\r\n\r\n /**\r\n * Gets only rotation part of the current matrix\r\n * @returns a new matrix sets to the extracted rotation matrix from the current one\r\n */\r\n public getRotationMatrix(): Matrix {\r\n const result = new Matrix();\r\n this.getRotationMatrixToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Extracts the rotation matrix from the current one and sets it as the given \"result\"\r\n * @param result defines the target matrix to store data to\r\n * @returns result input\r\n */\r\n public getRotationMatrixToRef<T extends Matrix>(result: T): T {\r\n const scale = MathTmp.Vector3[0];\r\n if (!this.decompose(scale)) {\r\n Matrix.IdentityToRef(result);\r\n return result;\r\n }\r\n\r\n const m = this._m;\r\n const sx = 1 / scale._x,\r\n sy = 1 / scale._y,\r\n sz = 1 / scale._z;\r\n Matrix.FromValuesToRef(m[0] * sx, m[1] * sx, m[2] * sx, 0.0, m[4] * sy, m[5] * sy, m[6] * sy, 0.0, m[8] * sz, m[9] * sz, m[10] * sz, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Toggles model matrix from being right handed to left handed in place and vice versa\r\n * @returns the current updated matrix\r\n */\r\n public toggleModelMatrixHandInPlace(): this {\r\n const m = this._m;\r\n m[2] *= -1;\r\n m[6] *= -1;\r\n m[8] *= -1;\r\n m[9] *= -1;\r\n m[14] *= -1;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n /**\r\n * Toggles projection matrix from being right handed to left handed in place and vice versa\r\n * @returns the current updated matrix\r\n */\r\n public toggleProjectionMatrixHandInPlace(): this {\r\n const m = this._m;\r\n m[8] *= -1;\r\n m[9] *= -1;\r\n m[10] *= -1;\r\n m[11] *= -1;\r\n this.markAsUpdated();\r\n return this;\r\n }\r\n\r\n // Statics\r\n /**\r\n * Creates a matrix from an array\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#42\r\n * @param array defines the source array\r\n * @param offset defines an offset in the source array\r\n * @returns a new Matrix set from the starting index of the given array\r\n */\r\n public static FromArray(array: DeepImmutable<ArrayLike<number>>, offset: number = 0): Matrix {\r\n const result = new Matrix();\r\n Matrix.FromArrayToRef(array, offset, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Copy the content of an array into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#43\r\n * @param array defines the source array\r\n * @param offset defines an offset in the source array\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static FromArrayToRef<T extends Matrix>(array: DeepImmutable<ArrayLike<number>>, offset: number, result: T): T {\r\n for (let index = 0; index < 16; index++) {\r\n result._m[index] = array[index + offset];\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Stores an array into a matrix after having multiplied each component by a given factor\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#50\r\n * @param array defines the source array\r\n * @param offset defines the offset in the source array\r\n * @param scale defines the scaling factor\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static FromFloat32ArrayToRefScaled<T extends Matrix>(array: DeepImmutable<Float32Array | Array<number>>, offset: number, scale: number, result: T): T {\r\n result._m[0] = array[0 + offset] * scale;\r\n result._m[1] = array[1 + offset] * scale;\r\n result._m[2] = array[2 + offset] * scale;\r\n result._m[3] = array[3 + offset] * scale;\r\n result._m[4] = array[4 + offset] * scale;\r\n result._m[5] = array[5 + offset] * scale;\r\n result._m[6] = array[6 + offset] * scale;\r\n result._m[7] = array[7 + offset] * scale;\r\n result._m[8] = array[8 + offset] * scale;\r\n result._m[9] = array[9 + offset] * scale;\r\n result._m[10] = array[10 + offset] * scale;\r\n result._m[11] = array[11 + offset] * scale;\r\n result._m[12] = array[12 + offset] * scale;\r\n result._m[13] = array[13 + offset] * scale;\r\n result._m[14] = array[14 + offset] * scale;\r\n result._m[15] = array[15 + offset] * scale;\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Gets an identity matrix that must not be updated\r\n */\r\n public static get IdentityReadOnly(): DeepImmutable<Matrix> {\r\n return Matrix._IdentityReadOnly;\r\n }\r\n\r\n /**\r\n * Stores a list of values (16) inside a given matrix\r\n * @param initialM11 defines 1st value of 1st row\r\n * @param initialM12 defines 2nd value of 1st row\r\n * @param initialM13 defines 3rd value of 1st row\r\n * @param initialM14 defines 4th value of 1st row\r\n * @param initialM21 defines 1st value of 2nd row\r\n * @param initialM22 defines 2nd value of 2nd row\r\n * @param initialM23 defines 3rd value of 2nd row\r\n * @param initialM24 defines 4th value of 2nd row\r\n * @param initialM31 defines 1st value of 3rd row\r\n * @param initialM32 defines 2nd value of 3rd row\r\n * @param initialM33 defines 3rd value of 3rd row\r\n * @param initialM34 defines 4th value of 3rd row\r\n * @param initialM41 defines 1st value of 4th row\r\n * @param initialM42 defines 2nd value of 4th row\r\n * @param initialM43 defines 3rd value of 4th row\r\n * @param initialM44 defines 4th value of 4th row\r\n * @param result defines the target matrix\r\n */\r\n public static FromValuesToRef(\r\n initialM11: number,\r\n initialM12: number,\r\n initialM13: number,\r\n initialM14: number,\r\n initialM21: number,\r\n initialM22: number,\r\n initialM23: number,\r\n initialM24: number,\r\n initialM31: number,\r\n initialM32: number,\r\n initialM33: number,\r\n initialM34: number,\r\n initialM41: number,\r\n initialM42: number,\r\n initialM43: number,\r\n initialM44: number,\r\n result: Matrix\r\n ): void {\r\n const m = result._m;\r\n m[0] = initialM11;\r\n m[1] = initialM12;\r\n m[2] = initialM13;\r\n m[3] = initialM14;\r\n m[4] = initialM21;\r\n m[5] = initialM22;\r\n m[6] = initialM23;\r\n m[7] = initialM24;\r\n m[8] = initialM31;\r\n m[9] = initialM32;\r\n m[10] = initialM33;\r\n m[11] = initialM34;\r\n m[12] = initialM41;\r\n m[13] = initialM42;\r\n m[14] = initialM43;\r\n m[15] = initialM44;\r\n\r\n result.markAsUpdated();\r\n }\r\n\r\n /**\r\n * Creates new matrix from a list of values (16)\r\n * @param initialM11 defines 1st value of 1st row\r\n * @param initialM12 defines 2nd value of 1st row\r\n * @param initialM13 defines 3rd value of 1st row\r\n * @param initialM14 defines 4th value of 1st row\r\n * @param initialM21 defines 1st value of 2nd row\r\n * @param initialM22 defines 2nd value of 2nd row\r\n * @param initialM23 defines 3rd value of 2nd row\r\n * @param initialM24 defines 4th value of 2nd row\r\n * @param initialM31 defines 1st value of 3rd row\r\n * @param initialM32 defines 2nd value of 3rd row\r\n * @param initialM33 defines 3rd value of 3rd row\r\n * @param initialM34 defines 4th value of 3rd row\r\n * @param initialM41 defines 1st value of 4th row\r\n * @param initialM42 defines 2nd value of 4th row\r\n * @param initialM43 defines 3rd value of 4th row\r\n * @param initialM44 defines 4th value of 4th row\r\n * @returns the new matrix\r\n */\r\n public static FromValues(\r\n initialM11: number,\r\n initialM12: number,\r\n initialM13: number,\r\n initialM14: number,\r\n initialM21: number,\r\n initialM22: number,\r\n initialM23: number,\r\n initialM24: number,\r\n initialM31: number,\r\n initialM32: number,\r\n initialM33: number,\r\n initialM34: number,\r\n initialM41: number,\r\n initialM42: number,\r\n initialM43: number,\r\n initialM44: number\r\n ): Matrix {\r\n const result = new Matrix();\r\n const m = result._m;\r\n m[0] = initialM11;\r\n m[1] = initialM12;\r\n m[2] = initialM13;\r\n m[3] = initialM14;\r\n m[4] = initialM21;\r\n m[5] = initialM22;\r\n m[6] = initialM23;\r\n m[7] = initialM24;\r\n m[8] = initialM31;\r\n m[9] = initialM32;\r\n m[10] = initialM33;\r\n m[11] = initialM34;\r\n m[12] = initialM41;\r\n m[13] = initialM42;\r\n m[14] = initialM43;\r\n m[15] = initialM44;\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix composed by merging scale (vector3), rotation (quaternion) and translation (vector3)\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#24\r\n * @param scale defines the scale vector3\r\n * @param rotation defines the rotation quaternion\r\n * @param translation defines the translation vector3\r\n * @returns a new matrix\r\n */\r\n public static Compose(scale: DeepImmutable<Vector3>, rotation: DeepImmutable<Quaternion>, translation: DeepImmutable<Vector3>): Matrix {\r\n const result = new Matrix();\r\n Matrix.ComposeToRef(scale, rotation, translation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets a matrix to a value composed by merging scale (vector3), rotation (quaternion) and translation (vector3)\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#25\r\n * @param scale defines the scale vector3\r\n * @param rotation defines the rotation quaternion\r\n * @param translation defines the translation vector3\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static ComposeToRef<T extends Matrix>(scale: DeepImmutable<Vector3>, rotation: DeepImmutable<Quaternion>, translation: DeepImmutable<Vector3>, result: T): T {\r\n const m = result._m;\r\n const x = rotation._x,\r\n y = rotation._y,\r\n z = rotation._z,\r\n w = rotation._w;\r\n const x2 = x + x,\r\n y2 = y + y,\r\n z2 = z + z;\r\n const xx = x * x2,\r\n xy = x * y2,\r\n xz = x * z2;\r\n const yy = y * y2,\r\n yz = y * z2,\r\n zz = z * z2;\r\n const wx = w * x2,\r\n wy = w * y2,\r\n wz = w * z2;\r\n\r\n const sx = scale._x,\r\n sy = scale._y,\r\n sz = scale._z;\r\n\r\n m[0] = (1 - (yy + zz)) * sx;\r\n m[1] = (xy + wz) * sx;\r\n m[2] = (xz - wy) * sx;\r\n m[3] = 0;\r\n\r\n m[4] = (xy - wz) * sy;\r\n m[5] = (1 - (xx + zz)) * sy;\r\n m[6] = (yz + wx) * sy;\r\n m[7] = 0;\r\n\r\n m[8] = (xz + wy) * sz;\r\n m[9] = (yz - wx) * sz;\r\n m[10] = (1 - (xx + yy)) * sz;\r\n m[11] = 0;\r\n\r\n m[12] = translation._x;\r\n m[13] = translation._y;\r\n m[14] = translation._z;\r\n m[15] = 1;\r\n\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new identity matrix\r\n * @returns a new identity matrix\r\n */\r\n public static Identity(): Matrix {\r\n const identity = Matrix.FromValues(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);\r\n identity._updateIdentityStatus(true);\r\n return identity;\r\n }\r\n\r\n /**\r\n * Creates a new identity matrix and stores the result in a given matrix\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static IdentityToRef<T extends Matrix>(result: T): T {\r\n Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n result._updateIdentityStatus(true);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new zero matrix\r\n * @returns a new zero matrix\r\n */\r\n public static Zero(): Matrix {\r\n const zero = Matrix.FromValues(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);\r\n zero._updateIdentityStatus(false);\r\n return zero;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the X axis\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#97\r\n * @param angle defines the angle (in radians) to use\r\n * @returns the new matrix\r\n */\r\n public static RotationX(angle: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.RotationXToRef(angle, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix as the invert of a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#124\r\n * @param source defines the source matrix\r\n * @returns the new matrix\r\n */\r\n public static Invert(source: DeepImmutable<Matrix>): Matrix {\r\n const result = new Matrix();\r\n source.invertToRef(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the X axis and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#98\r\n * @param angle defines the angle (in radians) to use\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static RotationXToRef<T extends Matrix>(angle: number, result: T): T {\r\n const s = Math.sin(angle);\r\n const c = Math.cos(angle);\r\n Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, c, s, 0.0, 0.0, -s, c, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n\r\n result._updateIdentityStatus(c === 1 && s === 0);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the Y axis\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#99\r\n * @param angle defines the angle (in radians) to use\r\n * @returns the new matrix\r\n */\r\n public static RotationY(angle: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.RotationYToRef(angle, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the Y axis and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#100\r\n * @param angle defines the angle (in radians) to use\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static RotationYToRef<T extends Matrix>(angle: number, result: T): T {\r\n const s = Math.sin(angle);\r\n const c = Math.cos(angle);\r\n Matrix.FromValuesToRef(c, 0.0, -s, 0.0, 0.0, 1.0, 0.0, 0.0, s, 0.0, c, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n\r\n result._updateIdentityStatus(c === 1 && s === 0);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the Z axis\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#101\r\n * @param angle defines the angle (in radians) to use\r\n * @returns the new matrix\r\n */\r\n public static RotationZ(angle: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.RotationZToRef(angle, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the Z axis and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#102\r\n * @param angle defines the angle (in radians) to use\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static RotationZToRef<T extends Matrix>(angle: number, result: T): T {\r\n const s = Math.sin(angle);\r\n const c = Math.cos(angle);\r\n Matrix.FromValuesToRef(c, s, 0.0, 0.0, -s, c, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n\r\n result._updateIdentityStatus(c === 1 && s === 0);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the given axis\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#96\r\n * @param axis defines the axis to use\r\n * @param angle defines the angle (in radians) to use\r\n * @returns the new matrix\r\n */\r\n public static RotationAxis(axis: DeepImmutable<Vector3>, angle: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.RotationAxisToRef(axis, angle, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new rotation matrix for \"angle\" radians around the given axis and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#94\r\n * @param axis defines the axis to use\r\n * @param angle defines the angle (in radians) to use\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static RotationAxisToRef<T extends Matrix>(axis: DeepImmutable<Vector3>, angle: number, result: T): T {\r\n const s = Math.sin(-angle);\r\n const c = Math.cos(-angle);\r\n const c1 = 1 - c;\r\n\r\n axis = axis.normalizeToRef(MathTmp.Vector3[0]);\r\n const m = result._m;\r\n m[0] = axis._x * axis._x * c1 + c;\r\n m[1] = axis._x * axis._y * c1 - axis._z * s;\r\n m[2] = axis._x * axis._z * c1 + axis._y * s;\r\n m[3] = 0.0;\r\n\r\n m[4] = axis._y * axis._x * c1 + axis._z * s;\r\n m[5] = axis._y * axis._y * c1 + c;\r\n m[6] = axis._y * axis._z * c1 - axis._x * s;\r\n m[7] = 0.0;\r\n\r\n m[8] = axis._z * axis._x * c1 - axis._y * s;\r\n m[9] = axis._z * axis._y * c1 + axis._x * s;\r\n m[10] = axis._z * axis._z * c1 + c;\r\n m[11] = 0.0;\r\n\r\n m[12] = 0.0;\r\n m[13] = 0.0;\r\n m[14] = 0.0;\r\n m[15] = 1.0;\r\n\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Takes normalised vectors and returns a rotation matrix to align \"from\" with \"to\".\r\n * Taken from http://www.iquilezles.org/www/articles/noacos/noacos.htm\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#93\r\n * @param from defines the vector to align\r\n * @param to defines the vector to align to\r\n * @param result defines the target matrix\r\n * @param useYAxisForCoplanar defines a boolean indicating that we should favor Y axis for coplanar vectors (default is false)\r\n * @returns result input\r\n */\r\n public static RotationAlignToRef<T extends Matrix>(from: DeepImmutable<Vector3>, to: DeepImmutable<Vector3>, result: T, useYAxisForCoplanar = false): T {\r\n const c = Vector3.Dot(to, from);\r\n const m = result._m;\r\n if (c < -1 + Epsilon) {\r\n // from and to are colinear and opposite direction.\r\n // compute a PI rotation on Y axis\r\n m[0] = -1;\r\n m[1] = 0;\r\n m[2] = 0;\r\n m[3] = 0;\r\n m[4] = 0;\r\n m[5] = useYAxisForCoplanar ? 1 : -1;\r\n m[6] = 0;\r\n m[7] = 0;\r\n m[8] = 0;\r\n m[9] = 0;\r\n m[10] = useYAxisForCoplanar ? -1 : 1;\r\n m[11] = 0;\r\n } else {\r\n const v = Vector3.Cross(to, from);\r\n const k = 1 / (1 + c);\r\n\r\n m[0] = v._x * v._x * k + c;\r\n m[1] = v._y * v._x * k - v._z;\r\n m[2] = v._z * v._x * k + v._y;\r\n m[3] = 0;\r\n m[4] = v._x * v._y * k + v._z;\r\n m[5] = v._y * v._y * k + c;\r\n m[6] = v._z * v._y * k - v._x;\r\n m[7] = 0;\r\n m[8] = v._x * v._z * k - v._y;\r\n m[9] = v._y * v._z * k + v._x;\r\n m[10] = v._z * v._z * k + c;\r\n m[11] = 0;\r\n }\r\n m[12] = 0;\r\n m[13] = 0;\r\n m[14] = 0;\r\n m[15] = 1;\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a rotation matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#103\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#105\r\n * @param yaw defines the yaw angle in radians (Y axis)\r\n * @param pitch defines the pitch angle in radians (X axis)\r\n * @param roll defines the roll angle in radians (Z axis)\r\n * @returns the new rotation matrix\r\n */\r\n public static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a rotation matrix and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#104\r\n * @param yaw defines the yaw angle in radians (Y axis)\r\n * @param pitch defines the pitch angle in radians (X axis)\r\n * @param roll defines the roll angle in radians (Z axis)\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static RotationYawPitchRollToRef<T extends Matrix>(yaw: number, pitch: number, roll: number, result: T): T {\r\n Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, MathTmp.Quaternion[0]);\r\n MathTmp.Quaternion[0].toRotationMatrix(result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a scaling matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#107\r\n * @param x defines the scale factor on X axis\r\n * @param y defines the scale factor on Y axis\r\n * @param z defines the scale factor on Z axis\r\n * @returns the new matrix\r\n */\r\n public static Scaling(x: number, y: number, z: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.ScalingToRef(x, y, z, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a scaling matrix and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#108\r\n * @param x defines the scale factor on X axis\r\n * @param y defines the scale factor on Y axis\r\n * @param z defines the scale factor on Z axis\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static ScalingToRef<T extends Matrix>(x: number, y: number, z: number, result: T): T {\r\n Matrix.FromValuesToRef(x, 0.0, 0.0, 0.0, 0.0, y, 0.0, 0.0, 0.0, 0.0, z, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n\r\n result._updateIdentityStatus(x === 1 && y === 1 && z === 1);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a translation matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#109\r\n * @param x defines the translation on X axis\r\n * @param y defines the translation on Y axis\r\n * @param z defines the translationon Z axis\r\n * @returns the new matrix\r\n */\r\n public static Translation(x: number, y: number, z: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.TranslationToRef(x, y, z, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a translation matrix and stores it in a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#110\r\n * @param x defines the translation on X axis\r\n * @param y defines the translation on Y axis\r\n * @param z defines the translationon Z axis\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static TranslationToRef<T extends Matrix>(x: number, y: number, z: number, result: T): T {\r\n Matrix.FromValuesToRef(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, x, y, z, 1.0, result);\r\n result._updateIdentityStatus(x === 0 && y === 0 && z === 0);\r\n return result;\r\n }\r\n\r\n /**\r\n * Returns a new Matrix whose values are the interpolated values for \"gradient\" (float) between the ones of the matrices \"startValue\" and \"endValue\".\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#55\r\n * @param startValue defines the start value\r\n * @param endValue defines the end value\r\n * @param gradient defines the gradient factor\r\n * @returns the new matrix\r\n */\r\n public static Lerp(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.LerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Set the given matrix \"result\" as the interpolated values for \"gradient\" (float) between the ones of the matrices \"startValue\" and \"endValue\".\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#54\r\n * @param startValue defines the start value\r\n * @param endValue defines the end value\r\n * @param gradient defines the gradient factor\r\n * @param result defines the Matrix object where to store data\r\n * @returns result input\r\n */\r\n public static LerpToRef<T extends Matrix>(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result: T): T {\r\n const resultM = result._m;\r\n const startM = startValue.m;\r\n const endM = endValue.m;\r\n for (let index = 0; index < 16; index++) {\r\n resultM[index] = startM[index] * (1.0 - gradient) + endM[index] * gradient;\r\n }\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Builds a new matrix whose values are computed by:\r\n * * decomposing the \"startValue\" and \"endValue\" matrices into their respective scale, rotation and translation matrices\r\n * * interpolating for \"gradient\" (float) the values between each of these decomposed matrices between the start and the end\r\n * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#22\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#51\r\n * @param startValue defines the first matrix\r\n * @param endValue defines the second matrix\r\n * @param gradient defines the gradient between the two matrices\r\n * @returns the new matrix\r\n */\r\n public static DecomposeLerp(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number): Matrix {\r\n const result = new Matrix();\r\n Matrix.DecomposeLerpToRef(startValue, endValue, gradient, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Update a matrix to values which are computed by:\r\n * * decomposing the \"startValue\" and \"endValue\" matrices into their respective scale, rotation and translation matrices\r\n * * interpolating for \"gradient\" (float) the values between each of these decomposed matrices between the start and the end\r\n * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#23\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#53\r\n * @param startValue defines the first matrix\r\n * @param endValue defines the second matrix\r\n * @param gradient defines the gradient between the two matrices\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static DecomposeLerpToRef<T extends Matrix>(startValue: DeepImmutable<Matrix>, endValue: DeepImmutable<Matrix>, gradient: number, result: T): T {\r\n const startScale = MathTmp.Vector3[0];\r\n const startRotation = MathTmp.Quaternion[0];\r\n const startTranslation = MathTmp.Vector3[1];\r\n startValue.decompose(startScale, startRotation, startTranslation);\r\n\r\n const endScale = MathTmp.Vector3[2];\r\n const endRotation = MathTmp.Quaternion[1];\r\n const endTranslation = MathTmp.Vector3[3];\r\n endValue.decompose(endScale, endRotation, endTranslation);\r\n\r\n const resultScale = MathTmp.Vector3[4];\r\n Vector3.LerpToRef(startScale, endScale, gradient, resultScale);\r\n const resultRotation = MathTmp.Quaternion[2];\r\n Quaternion.SlerpToRef(startRotation, endRotation, gradient, resultRotation);\r\n\r\n const resultTranslation = MathTmp.Vector3[5];\r\n Vector3.LerpToRef(startTranslation, endTranslation, gradient, resultTranslation);\r\n\r\n Matrix.ComposeToRef(resultScale, resultRotation, resultTranslation, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.\r\n * This function generates a matrix suitable for a left handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#58\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#59\r\n * @param eye defines the final position of the entity\r\n * @param target defines where the entity should look at\r\n * @param up defines the up vector for the entity\r\n * @returns the new matrix\r\n */\r\n public static LookAtLH(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Matrix {\r\n const result = new Matrix();\r\n Matrix.LookAtLHToRef(eye, target, up, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given \"result\" Matrix to a matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.\r\n * This function generates a matrix suitable for a left handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#60\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#61\r\n * @param eye defines the final position of the entity\r\n * @param target defines where the entity should look at\r\n * @param up defines the up vector for the entity\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static LookAtLHToRef(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: Matrix): Matrix {\r\n const xAxis = MathTmp.Vector3[0];\r\n const yAxis = MathTmp.Vector3[1];\r\n const zAxis = MathTmp.Vector3[2];\r\n\r\n // Z axis\r\n target.subtractToRef(eye, zAxis);\r\n zAxis.normalize();\r\n\r\n // X axis\r\n Vector3.CrossToRef(up, zAxis, xAxis);\r\n\r\n const xSquareLength = xAxis.lengthSquared();\r\n if (xSquareLength === 0) {\r\n xAxis.x = 1.0;\r\n } else {\r\n xAxis.normalizeFromLength(Math.sqrt(xSquareLength));\r\n }\r\n\r\n // Y axis\r\n Vector3.CrossToRef(zAxis, xAxis, yAxis);\r\n yAxis.normalize();\r\n\r\n // Eye angles\r\n const ex = -Vector3.Dot(xAxis, eye);\r\n const ey = -Vector3.Dot(yAxis, eye);\r\n const ez = -Vector3.Dot(zAxis, eye);\r\n\r\n Matrix.FromValuesToRef(xAxis._x, yAxis._x, zAxis._x, 0.0, xAxis._y, yAxis._y, zAxis._y, 0.0, xAxis._z, yAxis._z, zAxis._z, 0.0, ex, ey, ez, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.\r\n * This function generates a matrix suitable for a right handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#62\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#63\r\n * @param eye defines the final position of the entity\r\n * @param target defines where the entity should look at\r\n * @param up defines the up vector for the entity\r\n * @returns the new matrix\r\n */\r\n public static LookAtRH(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Matrix {\r\n const result = new Matrix();\r\n Matrix.LookAtRHToRef(eye, target, up, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given \"result\" Matrix to a matrix that transforms vertices from world space to camera space. It takes three vectors as arguments that together describe the position and orientation of the camera.\r\n * This function generates a matrix suitable for a right handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#64\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#65\r\n * @param eye defines the final position of the entity\r\n * @param target defines where the entity should look at\r\n * @param up defines the up vector for the entity\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static LookAtRHToRef<T extends Matrix>(eye: DeepImmutable<Vector3>, target: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T {\r\n const xAxis = MathTmp.Vector3[0];\r\n const yAxis = MathTmp.Vector3[1];\r\n const zAxis = MathTmp.Vector3[2];\r\n\r\n // Z axis\r\n eye.subtractToRef(target, zAxis);\r\n zAxis.normalize();\r\n\r\n // X axis\r\n Vector3.CrossToRef(up, zAxis, xAxis);\r\n\r\n const xSquareLength = xAxis.lengthSquared();\r\n if (xSquareLength === 0) {\r\n xAxis.x = 1.0;\r\n } else {\r\n xAxis.normalizeFromLength(Math.sqrt(xSquareLength));\r\n }\r\n\r\n // Y axis\r\n Vector3.CrossToRef(zAxis, xAxis, yAxis);\r\n yAxis.normalize();\r\n\r\n // Eye angles\r\n const ex = -Vector3.Dot(xAxis, eye);\r\n const ey = -Vector3.Dot(yAxis, eye);\r\n const ez = -Vector3.Dot(zAxis, eye);\r\n\r\n Matrix.FromValuesToRef(xAxis._x, yAxis._x, zAxis._x, 0.0, xAxis._y, yAxis._y, zAxis._y, 0.0, xAxis._z, yAxis._z, zAxis._z, 0.0, ex, ey, ez, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)\r\n * This function generates a matrix suitable for a left handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#66\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @returns the new matrix\r\n */\r\n public static LookDirectionLH(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Matrix {\r\n const result = new Matrix();\r\n Matrix.LookDirectionLHToRef(forward, up, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given \"result\" Matrix to a matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)\r\n * This function generates a matrix suitable for a left handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#67\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static LookDirectionLHToRef<T extends Matrix>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T {\r\n const back = MathTmp.Vector3[0];\r\n back.copyFrom(forward);\r\n back.scaleInPlace(-1);\r\n const left = MathTmp.Vector3[1];\r\n Vector3.CrossToRef(up, back, left);\r\n\r\n // Generate the rotation matrix.\r\n Matrix.FromValuesToRef(left._x, left._y, left._z, 0.0, up._x, up._y, up._z, 0.0, back._x, back._y, back._z, 0.0, 0, 0, 0, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a new matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)\r\n * This function generates a matrix suitable for a right handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#68\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @returns the new matrix\r\n */\r\n public static LookDirectionRH(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>): Matrix {\r\n const result = new Matrix();\r\n Matrix.LookDirectionRHToRef(forward, up, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given \"result\" Matrix to a matrix that transforms vertices from world space to camera space. It takes two vectors as arguments that together describe the orientation of the camera. The position is assumed to be at the origin (0,0,0)\r\n * This function generates a matrix suitable for a right handed coordinate system\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#69\r\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\r\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static LookDirectionRHToRef<T extends Matrix>(forward: DeepImmutable<Vector3>, up: DeepImmutable<Vector3>, result: T): T {\r\n const right = MathTmp.Vector3[2];\r\n Vector3.CrossToRef(up, forward, right);\r\n\r\n // Generate the rotation matrix.\r\n Matrix.FromValuesToRef(right._x, right._y, right._z, 0.0, up._x, up._y, up._z, 0.0, forward._x, forward._y, forward._z, 0.0, 0, 0, 0, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Create a left-handed orthographic projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#70\r\n * @param width defines the viewport width\r\n * @param height defines the viewport height\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns a new matrix as a left-handed orthographic projection matrix\r\n */\r\n public static OrthoLH(width: number, height: number, znear: number, zfar: number, halfZRange?: boolean): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.OrthoLHToRef(width, height, znear, zfar, matrix, halfZRange);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Store a left-handed orthographic projection to a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#71\r\n * @param width defines the viewport width\r\n * @param height defines the viewport height\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param result defines the target matrix\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns result input\r\n */\r\n public static OrthoLHToRef<T extends Matrix>(width: number, height: number, znear: number, zfar: number, result: T, halfZRange?: boolean): T {\r\n const n = znear;\r\n const f = zfar;\r\n\r\n const a = 2.0 / width;\r\n const b = 2.0 / height;\r\n const c = 2.0 / (f - n);\r\n const d = -(f + n) / (f - n);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, 0.0, 0.0, d, 1.0, result);\r\n\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n\r\n result._updateIdentityStatus(a === 1 && b === 1 && c === 1 && d === 0);\r\n return result;\r\n }\r\n\r\n /**\r\n * Create a left-handed orthographic projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#72\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns a new matrix as a left-handed orthographic projection matrix\r\n */\r\n public static OrthoOffCenterLH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, halfZRange?: boolean): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, matrix, halfZRange);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Stores a left-handed orthographic projection into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#73\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param result defines the target matrix\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns result input\r\n */\r\n public static OrthoOffCenterLHToRef<T extends Matrix>(\r\n left: number,\r\n right: number,\r\n bottom: number,\r\n top: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n halfZRange?: boolean\r\n ): T {\r\n const n = znear;\r\n const f = zfar;\r\n\r\n const a = 2.0 / (right - left);\r\n const b = 2.0 / (top - bottom);\r\n const c = 2.0 / (f - n);\r\n const d = -(f + n) / (f - n);\r\n const i0 = (left + right) / (left - right);\r\n const i1 = (top + bottom) / (bottom - top);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, 0.0, 0.0, 0.0, c, 0.0, i0, i1, d, 1.0, result);\r\n\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n\r\n /**\r\n * Stores a left-handed oblique projection into a given matrix\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param length Length of the shear\r\n * @param angle Angle (along X/Y Plane) to apply shear\r\n * @param distance Distance from shear point\r\n * @param result defines the target matrix\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns result input\r\n */\r\n public static ObliqueOffCenterLHToRef<T extends Matrix>(\r\n left: number,\r\n right: number,\r\n bottom: number,\r\n top: number,\r\n znear: number,\r\n zfar: number,\r\n length: number,\r\n angle: number,\r\n distance: number,\r\n result: T,\r\n halfZRange?: boolean\r\n ): T {\r\n const a = -length * Math.cos(angle);\r\n const b = -length * Math.sin(angle);\r\n\r\n Matrix.TranslationToRef(0, 0, -distance, MathTmp.Matrix[1]);\r\n Matrix.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, a, b, 1, 0, 0, 0, 0, 1, MathTmp.Matrix[0]);\r\n MathTmp.Matrix[1].multiplyToRef(MathTmp.Matrix[0], MathTmp.Matrix[0]);\r\n Matrix.TranslationToRef(0, 0, distance, MathTmp.Matrix[1]);\r\n MathTmp.Matrix[0].multiplyToRef(MathTmp.Matrix[1], MathTmp.Matrix[0]);\r\n\r\n Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result, halfZRange);\r\n MathTmp.Matrix[0].multiplyToRef(result, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a right-handed orthographic projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#76\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns a new matrix as a right-handed orthographic projection matrix\r\n */\r\n public static OrthoOffCenterRH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, halfZRange?: boolean): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, matrix, halfZRange);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Stores a right-handed orthographic projection into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#77\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param result defines the target matrix\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns result input\r\n */\r\n public static OrthoOffCenterRHToRef<T extends Matrix>(\r\n left: number,\r\n right: number,\r\n bottom: number,\r\n top: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n halfZRange?: boolean\r\n ): T {\r\n Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result, halfZRange);\r\n result._m[10] *= -1; // No need to call markAsUpdated as previous function already called it and let _isIdentityDirty to true\r\n return result;\r\n }\r\n\r\n /**\r\n * Stores a right-handed oblique projection into a given matrix\r\n * @param left defines the viewport left coordinate\r\n * @param right defines the viewport right coordinate\r\n * @param bottom defines the viewport bottom coordinate\r\n * @param top defines the viewport top coordinate\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param length Length of the shear\r\n * @param angle Angle (along X/Y Plane) to apply shear\r\n * @param distance Distance from shear point\r\n * @param result defines the target matrix\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @returns result input\r\n */\r\n public static ObliqueOffCenterRHToRef<T extends Matrix>(\r\n left: number,\r\n right: number,\r\n bottom: number,\r\n top: number,\r\n znear: number,\r\n zfar: number,\r\n length: number,\r\n angle: number,\r\n distance: number,\r\n result: T,\r\n halfZRange?: boolean\r\n ): T {\r\n const a = length * Math.cos(angle);\r\n const b = length * Math.sin(angle);\r\n\r\n Matrix.TranslationToRef(0, 0, distance, MathTmp.Matrix[1]);\r\n Matrix.FromValuesToRef(1, 0, 0, 0, 0, 1, 0, 0, a, b, 1, 0, 0, 0, 0, 1, MathTmp.Matrix[0]);\r\n MathTmp.Matrix[1].multiplyToRef(MathTmp.Matrix[0], MathTmp.Matrix[0]);\r\n Matrix.TranslationToRef(0, 0, -distance, MathTmp.Matrix[1]);\r\n MathTmp.Matrix[0].multiplyToRef(MathTmp.Matrix[1], MathTmp.Matrix[0]);\r\n\r\n Matrix.OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, result, halfZRange);\r\n MathTmp.Matrix[0].multiplyToRef(result, result);\r\n\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a left-handed perspective projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#85\r\n * @param width defines the viewport width\r\n * @param height defines the viewport height\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @returns a new matrix as a left-handed perspective projection matrix\r\n */\r\n public static PerspectiveLH(width: number, height: number, znear: number, zfar: number, halfZRange?: boolean, projectionPlaneTilt: number = 0): Matrix {\r\n const matrix = new Matrix();\r\n\r\n const n = znear;\r\n const f = zfar;\r\n\r\n const a = (2.0 * n) / width;\r\n const b = (2.0 * n) / height;\r\n const c = (f + n) / (f - n);\r\n const d = (-2.0 * f * n) / (f - n);\r\n const rot = Math.tan(projectionPlaneTilt);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, matrix);\r\n\r\n if (halfZRange) {\r\n matrix.multiplyToRef(mtxConvertNDCToHalfZRange, matrix);\r\n }\r\n\r\n matrix._updateIdentityStatus(false);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Creates a left-handed perspective projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#78\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)\r\n * @returns a new matrix as a left-handed perspective projection matrix\r\n */\r\n public static PerspectiveFovLH(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0,\r\n reverseDepthBufferMode: boolean = false\r\n ): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.PerspectiveFovLHToRef(fov, aspect, znear, zfar, matrix, true, halfZRange, projectionPlaneTilt, reverseDepthBufferMode);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Stores a left-handed perspective projection into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#81\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\r\n * @param result defines the target matrix\r\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)\r\n * @returns result input\r\n */\r\n public static PerspectiveFovLHToRef<T extends Matrix>(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n isVerticalFovFixed = true,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0,\r\n reverseDepthBufferMode: boolean = false\r\n ): T {\r\n const n = znear;\r\n const f = zfar;\r\n\r\n const t = 1.0 / Math.tan(fov * 0.5);\r\n const a = isVerticalFovFixed ? t / aspect : t;\r\n const b = isVerticalFovFixed ? t : t * aspect;\r\n const c = reverseDepthBufferMode && n === 0 ? -1 : f !== 0 ? (f + n) / (f - n) : 1;\r\n const d = reverseDepthBufferMode && n === 0 ? 2 * f : f !== 0 ? (-2.0 * f * n) / (f - n) : -2 * n;\r\n const rot = Math.tan(projectionPlaneTilt);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, c, 1.0, 0.0, 0.0, d, 0.0, result);\r\n\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n\r\n result._updateIdentityStatus(false);\r\n return result;\r\n }\r\n\r\n /**\r\n * Stores a left-handed perspective projection into a given matrix with depth reversed\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#89\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar not used as infinity is used as far clip\r\n * @param result defines the target matrix\r\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @returns result input\r\n */\r\n public static PerspectiveFovReverseLHToRef<T extends Matrix>(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n isVerticalFovFixed = true,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0\r\n ): T {\r\n const t = 1.0 / Math.tan(fov * 0.5);\r\n const a = isVerticalFovFixed ? t / aspect : t;\r\n const b = isVerticalFovFixed ? t : t * aspect;\r\n const rot = Math.tan(projectionPlaneTilt);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, -znear, 1.0, 0.0, 0.0, 1.0, 0.0, result);\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n result._updateIdentityStatus(false);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a right-handed perspective projection matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#83\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)\r\n * @returns a new matrix as a right-handed perspective projection matrix\r\n */\r\n public static PerspectiveFovRH(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0,\r\n reverseDepthBufferMode: boolean = false\r\n ): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.PerspectiveFovRHToRef(fov, aspect, znear, zfar, matrix, true, halfZRange, projectionPlaneTilt, reverseDepthBufferMode);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Stores a right-handed perspective projection into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#84\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\r\n * @param result defines the target matrix\r\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @param reverseDepthBufferMode true to indicate that we are in a reverse depth buffer mode (meaning znear and zfar have been inverted when calling the function)\r\n * @returns result input\r\n */\r\n public static PerspectiveFovRHToRef<T extends Matrix>(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n isVerticalFovFixed = true,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0,\r\n reverseDepthBufferMode: boolean = false\r\n ): T {\r\n //alternatively this could be expressed as:\r\n // m = PerspectiveFovLHToRef\r\n // m[10] *= -1.0;\r\n // m[11] *= -1.0;\r\n\r\n const n = znear;\r\n const f = zfar;\r\n\r\n const t = 1.0 / Math.tan(fov * 0.5);\r\n const a = isVerticalFovFixed ? t / aspect : t;\r\n const b = isVerticalFovFixed ? t : t * aspect;\r\n const c = reverseDepthBufferMode && n === 0 ? 1 : f !== 0 ? -(f + n) / (f - n) : -1;\r\n const d = reverseDepthBufferMode && n === 0 ? 2 * f : f !== 0 ? (-2 * f * n) / (f - n) : -2 * n;\r\n const rot = Math.tan(projectionPlaneTilt);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, c, -1.0, 0.0, 0.0, d, 0.0, result);\r\n\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n\r\n result._updateIdentityStatus(false);\r\n return result;\r\n }\r\n\r\n /**\r\n * Stores a right-handed perspective projection into a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#90\r\n * @param fov defines the horizontal field of view\r\n * @param aspect defines the aspect ratio\r\n * @param znear defines the near clip plane\r\n * @param zfar not used as infinity is used as far clip\r\n * @param result defines the target matrix\r\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\r\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\r\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\r\n * @returns result input\r\n */\r\n public static PerspectiveFovReverseRHToRef<T extends Matrix>(\r\n fov: number,\r\n aspect: number,\r\n znear: number,\r\n zfar: number,\r\n result: T,\r\n isVerticalFovFixed = true,\r\n halfZRange?: boolean,\r\n projectionPlaneTilt: number = 0\r\n ): T {\r\n const t = 1.0 / Math.tan(fov * 0.5);\r\n const a = isVerticalFovFixed ? t / aspect : t;\r\n const b = isVerticalFovFixed ? t : t * aspect;\r\n const rot = Math.tan(projectionPlaneTilt);\r\n\r\n Matrix.FromValuesToRef(a, 0.0, 0.0, 0.0, 0.0, b, 0.0, rot, 0.0, 0.0, -znear, -1.0, 0.0, 0.0, -1.0, 0.0, result);\r\n\r\n if (halfZRange) {\r\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\r\n }\r\n\r\n result._updateIdentityStatus(false);\r\n return result;\r\n }\r\n\r\n /**\r\n * Computes a complete transformation matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#113\r\n * @param viewport defines the viewport to use\r\n * @param world defines the world matrix\r\n * @param view defines the view matrix\r\n * @param projection defines the projection matrix\r\n * @param zmin defines the near clip plane\r\n * @param zmax defines the far clip plane\r\n * @returns the transformation matrix\r\n */\r\n public static GetFinalMatrix(\r\n viewport: DeepImmutable<Viewport>,\r\n world: DeepImmutable<Matrix>,\r\n view: DeepImmutable<Matrix>,\r\n projection: DeepImmutable<Matrix>,\r\n zmin: number,\r\n zmax: number\r\n ): Matrix {\r\n const cw = viewport.width;\r\n const ch = viewport.height;\r\n const cx = viewport.x;\r\n const cy = viewport.y;\r\n\r\n const viewportMatrix = Matrix.FromValues(cw / 2.0, 0.0, 0.0, 0.0, 0.0, -ch / 2.0, 0.0, 0.0, 0.0, 0.0, zmax - zmin, 0.0, cx + cw / 2.0, ch / 2.0 + cy, zmin, 1.0);\r\n\r\n const matrix = new Matrix();\r\n world.multiplyToRef(view, matrix);\r\n matrix.multiplyToRef(projection, matrix);\r\n return matrix.multiplyToRef(viewportMatrix, matrix);\r\n }\r\n\r\n /**\r\n * Extracts a 2x2 matrix from a given matrix and store the result in a Float32Array\r\n * @param matrix defines the matrix to use\r\n * @returns a new Float32Array array with 4 elements : the 2x2 matrix extracted from the given matrix\r\n */\r\n public static GetAsMatrix2x2(matrix: DeepImmutable<Matrix>): Float32Array | Array<number> {\r\n const m = matrix.m;\r\n const arr = [m[0], m[1], m[4], m[5]];\r\n return PerformanceConfigurator.MatrixUse64Bits ? arr : new Float32Array(arr);\r\n }\r\n\r\n /**\r\n * Extracts a 3x3 matrix from a given matrix and store the result in a Float32Array\r\n * @param matrix defines the matrix to use\r\n * @returns a new Float32Array array with 9 elements : the 3x3 matrix extracted from the given matrix\r\n */\r\n public static GetAsMatrix3x3(matrix: DeepImmutable<Matrix>): Float32Array | Array<number> {\r\n const m = matrix.m;\r\n const arr = [m[0], m[1], m[2], m[4], m[5], m[6], m[8], m[9], m[10]];\r\n return PerformanceConfigurator.MatrixUse64Bits ? arr : new Float32Array(arr);\r\n }\r\n\r\n /**\r\n * Compute the transpose of a given matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#111\r\n * @param matrix defines the matrix to transpose\r\n * @returns the new matrix\r\n */\r\n public static Transpose(matrix: DeepImmutable<Matrix>): Matrix {\r\n const result = new Matrix();\r\n Matrix.TransposeToRef(matrix, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Compute the transpose of a matrix and store it in a target matrix\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#112\r\n * @param matrix defines the matrix to transpose\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static TransposeToRef<T extends Matrix>(matrix: DeepImmutable<Matrix>, result: T): T {\r\n const mm = matrix.m;\r\n const rm0 = mm[0];\r\n const rm1 = mm[4];\r\n const rm2 = mm[8];\r\n const rm3 = mm[12];\r\n\r\n const rm4 = mm[1];\r\n const rm5 = mm[5];\r\n const rm6 = mm[9];\r\n const rm7 = mm[13];\r\n\r\n const rm8 = mm[2];\r\n const rm9 = mm[6];\r\n const rm10 = mm[10];\r\n const rm11 = mm[14];\r\n\r\n const rm12 = mm[3];\r\n const rm13 = mm[7];\r\n const rm14 = mm[11];\r\n const rm15 = mm[15];\r\n\r\n const rm = result._m;\r\n rm[0] = rm0;\r\n rm[1] = rm1;\r\n rm[2] = rm2;\r\n rm[3] = rm3;\r\n rm[4] = rm4;\r\n rm[5] = rm5;\r\n rm[6] = rm6;\r\n rm[7] = rm7;\r\n rm[8] = rm8;\r\n rm[9] = rm9;\r\n rm[10] = rm10;\r\n rm[11] = rm11;\r\n rm[12] = rm12;\r\n rm[13] = rm13;\r\n rm[14] = rm14;\r\n rm[15] = rm15;\r\n result.markAsUpdated();\r\n\r\n // identity-ness does not change when transposing\r\n result._updateIdentityStatus((matrix as Matrix)._isIdentity, (matrix as Matrix)._isIdentityDirty);\r\n return result;\r\n }\r\n\r\n /**\r\n * Computes a reflection matrix from a plane\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#87\r\n * @param plane defines the reflection plane\r\n * @returns a new matrix\r\n */\r\n public static Reflection(plane: DeepImmutable<IPlaneLike>): Matrix {\r\n const matrix = new Matrix();\r\n Matrix.ReflectionToRef(plane, matrix);\r\n return matrix;\r\n }\r\n\r\n /**\r\n * Computes a reflection matrix from a plane\r\n * Example Playground - https://playground.babylonjs.com/#AV9X17#88\r\n * @param plane defines the reflection plane\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static ReflectionToRef<T extends Matrix>(plane: DeepImmutable<IPlaneLike>, result: T): T {\r\n plane.normalize();\r\n const x = plane.normal.x;\r\n const y = plane.normal.y;\r\n const z = plane.normal.z;\r\n const temp = -2 * x;\r\n const temp2 = -2 * y;\r\n const temp3 = -2 * z;\r\n Matrix.FromValuesToRef(\r\n temp * x + 1,\r\n temp2 * x,\r\n temp3 * x,\r\n 0.0,\r\n temp * y,\r\n temp2 * y + 1,\r\n temp3 * y,\r\n 0.0,\r\n temp * z,\r\n temp2 * z,\r\n temp3 * z + 1,\r\n 0.0,\r\n temp * plane.d,\r\n temp2 * plane.d,\r\n temp3 * plane.d,\r\n 1.0,\r\n result\r\n );\r\n return result;\r\n }\r\n\r\n /**\r\n * Sets the given matrix as a rotation matrix composed from the 3 left handed axes\r\n * @param xaxis defines the value of the 1st axis\r\n * @param yaxis defines the value of the 2nd axis\r\n * @param zaxis defines the value of the 3rd axis\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static FromXYZAxesToRef<T extends Matrix>(xaxis: DeepImmutable<Vector3>, yaxis: DeepImmutable<Vector3>, zaxis: DeepImmutable<Vector3>, result: T): T {\r\n Matrix.FromValuesToRef(xaxis._x, xaxis._y, xaxis._z, 0.0, yaxis._x, yaxis._y, yaxis._z, 0.0, zaxis._x, zaxis._y, zaxis._z, 0.0, 0.0, 0.0, 0.0, 1.0, result);\r\n return result;\r\n }\r\n\r\n /**\r\n * Creates a rotation matrix from a quaternion and stores it in a target matrix\r\n * @param quat defines the quaternion to use\r\n * @param result defines the target matrix\r\n * @returns result input\r\n */\r\n public static FromQuaternionToRef<T extends Matrix>(quat: DeepImmutable<Quaternion>, result: T): T {\r\n const xx = quat._x * quat._x;\r\n const yy = quat._y * quat._y;\r\n const zz = quat._z * quat._z;\r\n const xy = quat._x * quat._y;\r\n const zw = quat._z * quat._w;\r\n const zx = quat._z * quat._x;\r\n const yw = quat._y * quat._w;\r\n const yz = quat._y * quat._z;\r\n const xw = quat._x * quat._w;\r\n\r\n result._m[0] = 1.0 - 2.0 * (yy + zz);\r\n result._m[1] = 2.0 * (xy + zw);\r\n result._m[2] = 2.0 * (zx - yw);\r\n result._m[3] = 0.0;\r\n\r\n result._m[4] = 2.0 * (xy - zw);\r\n result._m[5] = 1.0 - 2.0 * (zz + xx);\r\n result._m[6] = 2.0 * (yz + xw);\r\n result._m[7] = 0.0;\r\n\r\n result._m[8] = 2.0 * (zx + yw);\r\n result._m[9] = 2.0 * (yz - xw);\r\n result._m[10] = 1.0 - 2.0 * (yy + xx);\r\n result._m[11] = 0.0;\r\n\r\n result._m[12] = 0.0;\r\n result._m[13] = 0.0;\r\n result._m[14] = 0.0;\r\n result._m[15] = 1.0;\r\n\r\n result.markAsUpdated();\r\n return result;\r\n }\r\n}\r\n\r\nObject.defineProperties(Matrix.prototype, {\r\n dimension: { value: [4, 4] },\r\n rank: { value: 2 },\r\n});\r\n\r\n/**\r\n * @internal\r\n * Same as Tmp but not exported to keep it only for math functions to avoid conflicts\r\n */\r\nclass MathTmp {\r\n // Temporary Vector3s\r\n public static Vector3 = BuildTuple(11, Vector3.Zero);\r\n\r\n // Temporary Matricies\r\n public static Matrix = BuildTuple(2, Matrix.Identity);\r\n\r\n // Temporary Quaternions\r\n public static Quaternion = BuildTuple(3, Quaternion.Zero);\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class TmpVectors {\r\n /** 3 temp Vector2 at once should be enough */\r\n public static Vector2 = BuildTuple(3, Vector2.Zero);\r\n\r\n /** 13 temp Vector3 at once should be enough */\r\n public static Vector3 = BuildTuple(13, Vector3.Zero);\r\n\r\n /** 3 temp Vector4 at once should be enough */\r\n public static Vector4 = BuildTuple(3, Vector4.Zero);\r\n\r\n /** 3 temp Quaternion at once should be enough */\r\n public static Quaternion = BuildTuple(3, Quaternion.Zero);\r\n\r\n /** 8 temp Matrices at once should be enough */\r\n public static Matrix = BuildTuple(8, Matrix.Identity);\r\n}\r\n\r\nRegisterClass(\"BABYLON.Vector2\", Vector2);\r\nRegisterClass(\"BABYLON.Vector3\", Vector3);\r\nRegisterClass(\"BABYLON.Vector4\", Vector4);\r\nRegisterClass(\"BABYLON.Matrix\", Matrix);\r\n\r\nconst mtxConvertNDCToHalfZRange = Matrix.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1);\r\n"]}