-
Notifications
You must be signed in to change notification settings - Fork 0
/
088d5a4e-4f2cb64570bdf3425971.js.map
1 lines (1 loc) · 361 KB
/
088d5a4e-4f2cb64570bdf3425971.js.map
1
{"version":3,"file":"088d5a4e-4f2cb64570bdf3425971.js","mappings":"kUAQA,MAAMA,EAAiBC,GACZC,SAASD,EAAME,WAAWC,QAAQ,MAAO,KAM7C,MAAMC,EAMTC,YAEAC,EAAI,EAEJC,EAAI,GACAC,KAAKF,EAAIA,EACTE,KAAKD,EAAIA,CACb,CAKAL,WACI,MAAO,OAAOM,KAAKF,QAAQE,KAAKD,IACpC,CAKAE,eACI,MAAO,SACX,CAKAC,cAGI,IAAIC,EAFMZ,EAAcS,KAAKF,GAI7B,OADAK,EAAe,IAAPA,EAFEZ,EAAcS,KAAKD,GAGtBI,CACX,CASAC,QAAQC,EAAOC,EAAQ,GAGnB,OAFAD,EAAMC,GAASN,KAAKF,EACpBO,EAAMC,EAAQ,GAAKN,KAAKD,EACjBC,IACX,CAQAO,UAAUF,EAAOC,EAAQ,GAErB,OADAV,EAAQY,eAAeH,EAAOC,EAAON,MAC9BA,IACX,CAMAS,UACI,MAAMC,EAAS,IAAIC,MAEnB,OADAX,KAAKI,QAAQM,EAAQ,GACdA,CACX,CAOAE,SAASC,GAGL,OAFAb,KAAKF,EAAIe,EAAOf,EAChBE,KAAKD,EAAIc,EAAOd,EACTC,IACX,CAQAc,eAAehB,EAAGC,GAGd,OAFAC,KAAKF,EAAIA,EACTE,KAAKD,EAAIA,EACFC,IACX,CAQAe,IAAIjB,EAAGC,GACH,OAAOC,KAAKc,eAAehB,EAAGC,EAClC,CAOAiB,IAAIC,GACA,OAAO,IAAIjB,KAAKH,YAAYG,KAAKF,EAAImB,EAAYnB,EAAGE,KAAKD,EAAIkB,EAAYlB,EAC7E,CAQAmB,SAASD,EAAaP,GAGlB,OAFAA,EAAOZ,EAAIE,KAAKF,EAAImB,EAAYnB,EAChCY,EAAOX,EAAIC,KAAKD,EAAIkB,EAAYl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B,WAAW,GAAIviB,EAAQD,MACvD2F,EAAWwH,QAAU,IAAWqV,WAAW,EAAGrV,EAAQnN,MACtD2F,EAAWnF,WAAa,IAAWgiB,WAAW,EAAGhiB,EAAWR,MAC5D2F,EAAWzB,OAAS,IAAWse,WAAW,EAAGte,EAAOuN,WACpD,OAAc,kBAAmBvY,IACjC,OAAc,kBAAmB+G,IACjC,OAAc,kBAAmBkN,IACjC,OAAc,iBAAkBjJ,GAChC,MAAMwb,EAA4Bxb,EAAO4Y,WAAW,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,GAAK,EAAG,EAAG,EAAG,GAAK,E","sources":["webpack://code-cave/./node_modules/@babylonjs/core/Maths/math.vector.js"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport { Scalar } from \"./math.scalar.js\";\nimport { Epsilon } from \"./math.constants.js\";\nimport { ArrayTools } from \"../Misc/arrayTools.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { PerformanceConfigurator } from \"../Engines/performanceConfigurator.js\";\nimport { EngineStore } from \"../Engines/engineStore.js\";\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst _ExtractAsInt = (value) => {\n return parseInt(value.toString().replace(/\\W/g, \"\"));\n};\n/**\n * Class representing a vector containing 2 coordinates\n * Example Playground - Overview - https://playground.babylonjs.com/#QYBWV4#9\n */\nexport class Vector2 {\n /**\n * Creates a new Vector2 from the given x and y coordinates\n * @param x defines the first coordinate\n * @param y defines the second coordinate\n */\n constructor(\n /** defines the first coordinate */\n x = 0, \n /** defines the second coordinate */\n y = 0) {\n this.x = x;\n this.y = y;\n }\n /**\n * Gets a string with the Vector2 coordinates\n * @returns a string with the Vector2 coordinates\n */\n toString() {\n return `{X: ${this.x} Y: ${this.y}}`;\n }\n /**\n * Gets class name\n * @returns the string \"Vector2\"\n */\n getClassName() {\n return \"Vector2\";\n }\n /**\n * Gets current vector hash code\n * @returns the Vector2 hash code as a number\n */\n getHashCode() {\n const x = _ExtractAsInt(this.x);\n const y = _ExtractAsInt(this.y);\n let hash = x;\n hash = (hash * 397) ^ y;\n return hash;\n }\n // Operators\n /**\n * Sets the Vector2 coordinates in the given array or Float32Array from the given index.\n * Example Playground https://playground.babylonjs.com/#QYBWV4#15\n * @param array defines the source array\n * @param index defines the offset in source array\n * @returns the current Vector2\n */\n toArray(array, index = 0) {\n array[index] = this.x;\n array[index + 1] = this.y;\n return this;\n }\n /**\n * Update the current vector from an array\n * Example Playground https://playground.babylonjs.com/#QYBWV4#39\n * @param array defines the destination array\n * @param index defines the offset in the destination array\n * @returns the current Vector2\n */\n fromArray(array, index = 0) {\n Vector2.FromArrayToRef(array, index, this);\n return this;\n }\n /**\n * Copy the current vector to an array\n * Example Playground https://playground.babylonjs.com/#QYBWV4#40\n * @returns a new array with 2 elements: the Vector2 coordinates.\n */\n asArray() {\n const result = new Array();\n this.toArray(result, 0);\n return result;\n }\n /**\n * Sets the Vector2 coordinates with the given Vector2 coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#24\n * @param source defines the source Vector2\n * @returns the current updated Vector2\n */\n copyFrom(source) {\n this.x = source.x;\n this.y = source.y;\n return this;\n }\n /**\n * Sets the Vector2 coordinates with the given floats\n * Example Playground https://playground.babylonjs.com/#QYBWV4#25\n * @param x defines the first coordinate\n * @param y defines the second coordinate\n * @returns the current updated Vector2\n */\n copyFromFloats(x, y) {\n this.x = x;\n this.y = y;\n return this;\n }\n /**\n * Sets the Vector2 coordinates with the given floats\n * Example Playground https://playground.babylonjs.com/#QYBWV4#62\n * @param x defines the first coordinate\n * @param y defines the second coordinate\n * @returns the current updated Vector2\n */\n set(x, y) {\n return this.copyFromFloats(x, y);\n }\n /**\n * Add another vector with the current one\n * Example Playground https://playground.babylonjs.com/#QYBWV4#11\n * @param otherVector defines the other vector\n * @returns a new Vector2 set with the addition of the current Vector2 and the given one coordinates\n */\n add(otherVector) {\n return new this.constructor(this.x + otherVector.x, this.y + otherVector.y);\n }\n /**\n * Sets the \"result\" coordinates with the addition of the current Vector2 and the given one coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#12\n * @param otherVector defines the other vector\n * @param result defines the target vector\n * @returns result input\n */\n addToRef(otherVector, result) {\n result.x = this.x + otherVector.x;\n result.y = this.y + otherVector.y;\n return result;\n }\n /**\n * Set the Vector2 coordinates by adding the given Vector2 coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#13\n * @param otherVector defines the other vector\n * @returns the current updated Vector2\n */\n addInPlace(otherVector) {\n this.x += otherVector.x;\n this.y += otherVector.y;\n return this;\n }\n /**\n * Gets a new Vector2 by adding the current Vector2 coordinates to the given Vector3 x, y coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#14\n * @param otherVector defines the other vector\n * @returns a new Vector2\n */\n addVector3(otherVector) {\n return new this.constructor(this.x + otherVector.x, this.y + otherVector.y);\n }\n /**\n * Gets a new Vector2 set with the subtracted coordinates of the given one from the current Vector2\n * Example Playground https://playground.babylonjs.com/#QYBWV4#61\n * @param otherVector defines the other vector\n * @returns a new Vector2\n */\n subtract(otherVector) {\n return new this.constructor(this.x - otherVector.x, this.y - otherVector.y);\n }\n /**\n * Sets the \"result\" coordinates with the subtraction of the given one from the current Vector2 coordinates.\n * Example Playground https://playground.babylonjs.com/#QYBWV4#63\n * @param otherVector defines the other vector\n * @param result defines the target vector\n * @returns result input\n */\n subtractToRef(otherVector, result) {\n result.x = this.x - otherVector.x;\n result.y = this.y - otherVector.y;\n return result;\n }\n /**\n * Sets the current Vector2 coordinates by subtracting from it the given one coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#88\n * @param otherVector defines the other vector\n * @returns the current updated Vector2\n */\n subtractInPlace(otherVector) {\n this.x -= otherVector.x;\n this.y -= otherVector.y;\n return this;\n }\n /**\n * Multiplies in place the current Vector2 coordinates by the given ones\n * Example Playground https://playground.babylonjs.com/#QYBWV4#43\n * @param otherVector defines the other vector\n * @returns the current updated Vector2\n */\n multiplyInPlace(otherVector) {\n this.x *= otherVector.x;\n this.y *= otherVector.y;\n return this;\n }\n /**\n * Returns a new Vector2 set with the multiplication of the current Vector2 and the given one coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#42\n * @param otherVector defines the other vector\n * @returns a new Vector2\n */\n multiply(otherVector) {\n return new this.constructor(this.x * otherVector.x, this.y * otherVector.y);\n }\n /**\n * Sets \"result\" coordinates with the multiplication of the current Vector2 and the given one coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#44\n * @param otherVector defines the other vector\n * @param result defines the target vector\n * @returns result input\n */\n multiplyToRef(otherVector, result) {\n result.x = this.x * otherVector.x;\n result.y = this.y * otherVector.y;\n return result;\n }\n /**\n * Gets a new Vector2 set with the Vector2 coordinates multiplied by the given floats\n * Example Playground https://playground.babylonjs.com/#QYBWV4#89\n * @param x defines the first coordinate\n * @param y defines the second coordinate\n * @returns a new Vector2\n */\n multiplyByFloats(x, y) {\n return new this.constructor(this.x * x, this.y * y);\n }\n /**\n * Returns a new Vector2 set with the Vector2 coordinates divided by the given one coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#27\n * @param otherVector defines the other vector\n * @returns a new Vector2\n */\n divide(otherVector) {\n return new this.constructor(this.x / otherVector.x, this.y / otherVector.y);\n }\n /**\n * Sets the \"result\" coordinates with the Vector2 divided by the given one coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#30\n * @param otherVector defines the other vector\n * @param result defines the target vector\n * @returns result input\n */\n divideToRef(otherVector, result) {\n result.x = this.x / otherVector.x;\n result.y = this.y / otherVector.y;\n return result;\n }\n /**\n * Divides the current Vector2 coordinates by the given ones\n * Example Playground https://playground.babylonjs.com/#QYBWV4#28\n * @param otherVector defines the other vector\n * @returns the current updated Vector2\n */\n divideInPlace(otherVector) {\n return this.divideToRef(otherVector, this);\n }\n /**\n * Gets a new Vector2 with current Vector2 negated coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#22\n * @returns a new Vector2\n */\n negate() {\n return new this.constructor(-this.x, -this.y);\n }\n /**\n * Negate this vector in place\n * Example Playground https://playground.babylonjs.com/#QYBWV4#23\n * @returns this\n */\n negateInPlace() {\n this.x *= -1;\n this.y *= -1;\n return this;\n }\n /**\n * Negate the current Vector2 and stores the result in the given vector \"result\" coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#41\n * @param result defines the Vector3 object where to store the result\n * @returns the result\n */\n negateToRef(result) {\n return result.copyFromFloats(this.x * -1, this.y * -1);\n }\n /**\n * Multiply the Vector2 coordinates by\n * Example Playground https://playground.babylonjs.com/#QYBWV4#59\n * @param scale defines the scaling factor\n * @returns the current updated Vector2\n */\n scaleInPlace(scale) {\n this.x *= scale;\n this.y *= scale;\n return this;\n }\n /**\n * Returns a new Vector2 scaled by \"scale\" from the current Vector2\n * Example Playground https://playground.babylonjs.com/#QYBWV4#52\n * @param scale defines the scaling factor\n * @returns a new Vector2\n */\n scale(scale) {\n const result = new this.constructor(0, 0);\n this.scaleToRef(scale, result);\n return result;\n }\n /**\n * Scale the current Vector2 values by a factor to a given Vector2\n * Example Playground https://playground.babylonjs.com/#QYBWV4#57\n * @param scale defines the scale factor\n * @param result defines the Vector2 object where to store the result\n * @returns result input\n */\n scaleToRef(scale, result) {\n result.x = this.x * scale;\n result.y = this.y * scale;\n return result;\n }\n /**\n * Scale the current Vector2 values by a factor and add the result to a given Vector2\n * Example Playground https://playground.babylonjs.com/#QYBWV4#58\n * @param scale defines the scale factor\n * @param result defines the Vector2 object where to store the result\n * @returns result input\n */\n scaleAndAddToRef(scale, result) {\n result.x += this.x * scale;\n result.y += this.y * scale;\n return result;\n }\n /**\n * Gets a boolean if two vectors are equals\n * Example Playground https://playground.babylonjs.com/#QYBWV4#31\n * @param otherVector defines the other vector\n * @returns true if the given vector coordinates strictly equal the current Vector2 ones\n */\n equals(otherVector) {\n return otherVector && this.x === otherVector.x && this.y === otherVector.y;\n }\n /**\n * Gets a boolean if two vectors are equals (using an epsilon value)\n * Example Playground https://playground.babylonjs.com/#QYBWV4#32\n * @param otherVector defines the other vector\n * @param epsilon defines the minimal distance to consider equality\n * @returns true if the given vector coordinates are close to the current ones by a distance of epsilon.\n */\n equalsWithEpsilon(otherVector, epsilon = Epsilon) {\n return otherVector && Scalar.WithinEpsilon(this.x, otherVector.x, epsilon) && Scalar.WithinEpsilon(this.y, otherVector.y, epsilon);\n }\n /**\n * Gets a new Vector2 from current Vector2 floored values\n * Example Playground https://playground.babylonjs.com/#QYBWV4#35\n * eg (1.2, 2.31) returns (1, 2)\n * @returns a new Vector2\n */\n floor() {\n return new this.constructor(Math.floor(this.x), Math.floor(this.y));\n }\n /**\n * Gets a new Vector2 from current Vector2 fractional values\n * Example Playground https://playground.babylonjs.com/#QYBWV4#34\n * eg (1.2, 2.31) returns (0.2, 0.31)\n * @returns a new Vector2\n */\n fract() {\n return new this.constructor(this.x - Math.floor(this.x), this.y - Math.floor(this.y));\n }\n /**\n * Rotate the current vector into a given result vector\n * Example Playground https://playground.babylonjs.com/#QYBWV4#49\n * @param angle defines the rotation angle\n * @param result defines the result vector where to store the rotated vector\n * @returns result input\n */\n rotateToRef(angle, result) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const x = cos * this.x - sin * this.y;\n const y = sin * this.x + cos * this.y;\n result.x = x;\n result.y = y;\n return result;\n }\n // Properties\n /**\n * Gets the length of the vector\n * @returns the vector length (float)\n */\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y);\n }\n /**\n * Gets the vector squared length\n * @returns the vector squared length (float)\n */\n lengthSquared() {\n return this.x * this.x + this.y * this.y;\n }\n // Methods\n /**\n * Normalize the vector\n * Example Playground https://playground.babylonjs.com/#QYBWV4#48\n * @returns the current updated Vector2\n */\n normalize() {\n Vector2.NormalizeToRef(this, this);\n return this;\n }\n /**\n * Gets a new Vector2 copied from the Vector2\n * Example Playground https://playground.babylonjs.com/#QYBWV4#20\n * @returns a new Vector2\n */\n clone() {\n return new this.constructor(this.x, this.y);\n }\n // Statics\n /**\n * Gets a new Vector2(0, 0)\n * @returns a new Vector2\n */\n static Zero() {\n return new Vector2(0, 0);\n }\n /**\n * Gets a new Vector2(1, 1)\n * @returns a new Vector2\n */\n static One() {\n return new Vector2(1, 1);\n }\n /**\n * Returns a new Vector2 with random values between min and max\n * @param min the minimum random value\n * @param max the maximum random value\n * @returns a Vector2 with random values between min and max\n */\n static Random(min = 0, max = 1) {\n return new Vector2(Scalar.RandomRange(min, max), Scalar.RandomRange(min, max));\n }\n /**\n * Gets a zero Vector2 that must not be updated\n */\n static get ZeroReadOnly() {\n return Vector2._ZeroReadOnly;\n }\n /**\n * Gets a new Vector2 set from the given index element of the given array\n * Example Playground https://playground.babylonjs.com/#QYBWV4#79\n * @param array defines the data source\n * @param offset defines the offset in the data source\n * @returns a new Vector2\n */\n static FromArray(array, offset = 0) {\n return new Vector2(array[offset], array[offset + 1]);\n }\n /**\n * Sets \"result\" from the given index element of the given array\n * Example Playground https://playground.babylonjs.com/#QYBWV4#80\n * @param array defines the data source\n * @param offset defines the offset in the data source\n * @param result defines the target vector\n * @returns result input\n */\n static FromArrayToRef(array, offset, result) {\n result.x = array[offset];\n result.y = array[offset + 1];\n return result;\n }\n /**\n * Gets a new Vector2 located for \"amount\" (float) on the CatmullRom spline defined by the given four Vector2\n * Example Playground https://playground.babylonjs.com/#QYBWV4#65\n * @param value1 defines 1st point of control\n * @param value2 defines 2nd point of control\n * @param value3 defines 3rd point of control\n * @param value4 defines 4th point of control\n * @param amount defines the interpolation factor\n * @returns a new Vector2\n */\n static CatmullRom(value1, value2, value3, value4, amount) {\n const squared = amount * amount;\n const cubed = amount * squared;\n const x = 0.5 *\n (2.0 * value2.x +\n (-value1.x + value3.x) * amount +\n (2.0 * value1.x - 5.0 * value2.x + 4.0 * value3.x - value4.x) * squared +\n (-value1.x + 3.0 * value2.x - 3.0 * value3.x + value4.x) * cubed);\n const y = 0.5 *\n (2.0 * value2.y +\n (-value1.y + value3.y) * amount +\n (2.0 * value1.y - 5.0 * value2.y + 4.0 * value3.y - value4.y) * squared +\n (-value1.y + 3.0 * value2.y - 3.0 * value3.y + value4.y) * cubed);\n return new value1.constructor(x, y);\n }\n /**\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\".\n * If a coordinate of \"value\" is lower than \"min\" coordinates, the returned Vector2 is given this \"min\" coordinate.\n * If a coordinate of \"value\" is greater than \"max\" coordinates, the returned Vector2 is given this \"max\" coordinate\n * Example Playground https://playground.babylonjs.com/#QYBWV4#76\n * @param value defines the value to clamp\n * @param min defines the lower limit\n * @param max defines the upper limit\n * @returns a new Vector2\n */\n static Clamp(value, min, max) {\n let x = value.x;\n x = x > max.x ? max.x : x;\n x = x < min.x ? min.x : x;\n let y = value.y;\n y = y > max.y ? max.y : y;\n y = y < min.y ? min.y : y;\n return new value.constructor(x, y);\n }\n /**\n * Returns a new Vector2 located for \"amount\" (float) on the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\"\n * Example Playground https://playground.babylonjs.com/#QYBWV4#81\n * @param value1 defines the 1st control point\n * @param tangent1 defines the outgoing tangent\n * @param value2 defines the 2nd control point\n * @param tangent2 defines the incoming tangent\n * @param amount defines the interpolation factor\n * @returns a new Vector2\n */\n static Hermite(value1, tangent1, value2, tangent2, amount) {\n const squared = amount * amount;\n const cubed = amount * squared;\n const part1 = 2.0 * cubed - 3.0 * squared + 1.0;\n const part2 = -2.0 * cubed + 3.0 * squared;\n const part3 = cubed - 2.0 * squared + amount;\n const part4 = cubed - squared;\n const x = value1.x * part1 + value2.x * part2 + tangent1.x * part3 + tangent2.x * part4;\n const y = value1.y * part1 + value2.y * part2 + tangent1.y * part3 + tangent2.y * part4;\n return new value1.constructor(x, y);\n }\n /**\n * Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\n * Example Playground https://playground.babylonjs.com/#QYBWV4#82\n * @param value1 defines the first control point\n * @param tangent1 defines the first tangent\n * @param value2 defines the second control point\n * @param tangent2 defines the second tangent\n * @param time define where the derivative must be done\n * @returns 1st derivative\n */\n static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {\n const result = new value1.constructor();\n this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result);\n return result;\n }\n /**\n * Returns a new Vector2 which is the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\n * Example Playground https://playground.babylonjs.com/#QYBWV4#83\n * @param value1 defines the first control point\n * @param tangent1 defines the first tangent\n * @param value2 defines the second control point\n * @param tangent2 defines the second tangent\n * @param time define where the derivative must be done\n * @param result define where the derivative will be stored\n * @returns result input\n */\n static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {\n const t2 = time * time;\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;\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;\n return result;\n }\n /**\n * Returns a new Vector2 located for \"amount\" (float) on the linear interpolation between the vector \"start\" adn the vector \"end\".\n * Example Playground https://playground.babylonjs.com/#QYBWV4#84\n * @param start defines the start vector\n * @param end defines the end vector\n * @param amount defines the interpolation factor\n * @returns a new Vector2\n */\n static Lerp(start, end, amount) {\n const x = start.x + (end.x - start.x) * amount;\n const y = start.y + (end.y - start.y) * amount;\n return new start.constructor(x, y);\n }\n /**\n * Gets the dot product of the vector \"left\" and the vector \"right\"\n * Example Playground https://playground.babylonjs.com/#QYBWV4#90\n * @param left defines first vector\n * @param right defines second vector\n * @returns the dot product (float)\n */\n static Dot(left, right) {\n return left.x * right.x + left.y * right.y;\n }\n /**\n * Returns a new Vector2 equal to the normalized given vector\n * Example Playground https://playground.babylonjs.com/#QYBWV4#46\n * @param vector defines the vector to normalize\n * @returns a new Vector2\n */\n static Normalize(vector) {\n const newVector = new vector.constructor();\n this.NormalizeToRef(vector, newVector);\n return newVector;\n }\n /**\n * Normalize a given vector into a second one\n * Example Playground https://playground.babylonjs.com/#QYBWV4#50\n * @param vector defines the vector to normalize\n * @param result defines the vector where to store the result\n * @returns result input\n */\n static NormalizeToRef(vector, result) {\n const len = vector.length();\n if (len === 0) {\n return result;\n }\n result.x = vector.x / len;\n result.y = vector.y / len;\n return result;\n }\n /**\n * Gets a new Vector2 set with the minimal coordinate values from the \"left\" and \"right\" vectors\n * Example Playground https://playground.babylonjs.com/#QYBWV4#86\n * @param left defines 1st vector\n * @param right defines 2nd vector\n * @returns a new Vector2\n */\n static Minimize(left, right) {\n const x = left.x < right.x ? left.x : right.x;\n const y = left.y < right.y ? left.y : right.y;\n return new left.constructor(x, y);\n }\n /**\n * Gets a new Vector2 set with the maximal coordinate values from the \"left\" and \"right\" vectors\n * Example Playground https://playground.babylonjs.com/#QYBWV4#86\n * @param left defines 1st vector\n * @param right defines 2nd vector\n * @returns a new Vector2\n */\n static Maximize(left, right) {\n const x = left.x > right.x ? left.x : right.x;\n const y = left.y > right.y ? left.y : right.y;\n return new left.constructor(x, y);\n }\n /**\n * Gets a new Vector2 set with the transformed coordinates of the given vector by the given transformation matrix\n * Example Playground https://playground.babylonjs.com/#QYBWV4#17\n * @param vector defines the vector to transform\n * @param transformation defines the matrix to apply\n * @returns a new Vector2\n */\n static Transform(vector, transformation) {\n const result = new vector.constructor();\n Vector2.TransformToRef(vector, transformation, result);\n return result;\n }\n /**\n * Transforms the given vector coordinates by the given transformation matrix and stores the result in the vector \"result\" coordinates\n * Example Playground https://playground.babylonjs.com/#QYBWV4#19\n * @param vector defines the vector to transform\n * @param transformation defines the matrix to apply\n * @param result defines the target vector\n * @returns result input\n */\n static TransformToRef(vector, transformation, result) {\n const m = transformation.m;\n const x = vector.x * m[0] + vector.y * m[4] + m[12];\n const y = vector.x * m[1] + vector.y * m[5] + m[13];\n result.x = x;\n result.y = y;\n return result;\n }\n /**\n * Determines if a given vector is included in a triangle\n * Example Playground https://playground.babylonjs.com/#QYBWV4#87\n * @param p defines the vector to test\n * @param p0 defines 1st triangle point\n * @param p1 defines 2nd triangle point\n * @param p2 defines 3rd triangle point\n * @returns true if the point \"p\" is in the triangle defined by the vectors \"p0\", \"p1\", \"p2\"\n */\n static PointInTriangle(p, p0, p1, p2) {\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);\n const sign = a < 0 ? -1 : 1;\n const s = (p0.y * p2.x - p0.x * p2.y + (p2.y - p0.y) * p.x + (p0.x - p2.x) * p.y) * sign;\n const t = (p0.x * p1.y - p0.y * p1.x + (p0.y - p1.y) * p.x + (p1.x - p0.x) * p.y) * sign;\n return s > 0 && t > 0 && s + t < 2 * a * sign;\n }\n /**\n * Gets the distance between the vectors \"value1\" and \"value2\"\n * Example Playground https://playground.babylonjs.com/#QYBWV4#71\n * @param value1 defines first vector\n * @param value2 defines second vector\n * @returns the distance between vectors\n */\n static Distance(value1, value2) {\n return Math.sqrt(Vector2.DistanceSquared(value1, value2));\n }\n /**\n * Returns the squared distance between the vectors \"value1\" and \"value2\"\n * Example Playground https://playground.babylonjs.com/#QYBWV4#72\n * @param value1 defines first vector\n * @param value2 defines second vector\n * @returns the squared distance between vectors\n */\n static DistanceSquared(value1, value2) {\n const x = value1.x - value2.x;\n const y = value1.y - value2.y;\n return x * x + y * y;\n }\n /**\n * Gets a new Vector2 located at the center of the vectors \"value1\" and \"value2\"\n * Example Playground https://playground.babylonjs.com/#QYBWV4#86\n * Example Playground https://playground.babylonjs.com/#QYBWV4#66\n * @param value1 defines first vector\n * @param value2 defines second vector\n * @returns a new Vector2\n */\n static Center(value1, value2) {\n const result = new value1.constructor();\n return Vector2.CenterToRef(value1, value2, result);\n }\n /**\n * Gets the center of the vectors \"value1\" and \"value2\" and stores the result in the vector \"ref\"\n * Example Playground https://playground.babylonjs.com/#QYBWV4#66\n * @param value1 defines first vector\n * @param value2 defines second vector\n * @param ref defines third vector\n * @returns ref\n */\n static CenterToRef(value1, value2, ref) {\n return ref.copyFromFloats((value1.x + value2.x) / 2, (value1.y + value2.y) / 2);\n }\n /**\n * Gets the shortest distance (float) between the point \"p\" and the segment defined by the two points \"segA\" and \"segB\".\n * Example Playground https://playground.babylonjs.com/#QYBWV4#77\n * @param p defines the middle point\n * @param segA defines one point of the segment\n * @param segB defines the other point of the segment\n * @returns the shortest distance\n */\n static DistanceOfPointFromSegment(p, segA, segB) {\n const l2 = Vector2.DistanceSquared(segA, segB);\n if (l2 === 0.0) {\n return Vector2.Distance(p, segA);\n }\n const v = segB.subtract(segA);\n const t = Math.max(0, Math.min(1, Vector2.Dot(p.subtract(segA), v) / l2));\n const proj = segA.add(v.multiplyByFloats(t, t));\n return Vector2.Distance(p, proj);\n }\n}\nVector2._ZeroReadOnly = Vector2.Zero();\n/**\n * Class used to store (x,y,z) vector representation\n * A Vector3 is the main object used in 3D geometry\n * It can represent either the coordinates of a point the space, either a direction\n * Reminder: js uses a left handed forward facing system\n * Example Playground - Overview - https://playground.babylonjs.com/#R1F8YU\n */\nexport class Vector3 {\n /** Gets or sets the x coordinate */\n get x() {\n return this._x;\n }\n set x(value) {\n this._x = value;\n this._isDirty = true;\n }\n /** Gets or sets the y coordinate */\n get y() {\n return this._y;\n }\n set y(value) {\n this._y = value;\n this._isDirty = true;\n }\n /** Gets or sets the z coordinate */\n get z() {\n return this._z;\n }\n set z(value) {\n this._z = value;\n this._isDirty = true;\n }\n /**\n * Creates a new Vector3 object from the given x, y, z (floats) coordinates.\n * @param x defines the first coordinates (on X axis)\n * @param y defines the second coordinates (on Y axis)\n * @param z defines the third coordinates (on Z axis)\n */\n constructor(x = 0, y = 0, z = 0) {\n /** @internal */\n this._isDirty = true;\n this._x = x;\n this._y = y;\n this._z = z;\n }\n /**\n * Creates a string representation of the Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#67\n * @returns a string with the Vector3 coordinates.\n */\n toString() {\n return `{X: ${this._x} Y: ${this._y} Z: ${this._z}}`;\n }\n /**\n * Gets the class name\n * @returns the string \"Vector3\"\n */\n getClassName() {\n return \"Vector3\";\n }\n /**\n * Creates the Vector3 hash code\n * @returns a number which tends to be unique between Vector3 instances\n */\n getHashCode() {\n const x = _ExtractAsInt(this._x);\n const y = _ExtractAsInt(this._y);\n const z = _ExtractAsInt(this._z);\n let hash = x;\n hash = (hash * 397) ^ y;\n hash = (hash * 397) ^ z;\n return hash;\n }\n // Operators\n /**\n * Creates an array containing three elements : the coordinates of the Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#10\n * @returns a new array of numbers\n */\n asArray() {\n const result = [];\n this.toArray(result, 0);\n return result;\n }\n /**\n * Populates the given array or Float32Array from the given index with the successive coordinates of the Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#65\n * @param array defines the destination array\n * @param index defines the offset in the destination array\n * @returns the current Vector3\n */\n toArray(array, index = 0) {\n array[index] = this._x;\n array[index + 1] = this._y;\n array[index + 2] = this._z;\n return this;\n }\n /**\n * Update the current vector from an array\n * Example Playground https://playground.babylonjs.com/#R1F8YU#24\n * @param array defines the destination array\n * @param index defines the offset in the destination array\n * @returns the current Vector3\n */\n fromArray(array, index = 0) {\n Vector3.FromArrayToRef(array, index, this);\n return this;\n }\n /**\n * Converts the current Vector3 into a quaternion (considering that the Vector3 contains Euler angles representation of a rotation)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#66\n * @returns a new Quaternion object, computed from the Vector3 coordinates\n */\n toQuaternion() {\n return Quaternion.RotationYawPitchRoll(this._y, this._x, this._z);\n }\n /**\n * Adds the given vector to the current Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#4\n * @param otherVector defines the second operand\n * @returns the current updated Vector3\n */\n addInPlace(otherVector) {\n return this.addInPlaceFromFloats(otherVector._x, otherVector._y, otherVector._z);\n }\n /**\n * Adds the given coordinates to the current Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#5\n * @param x defines the x coordinate of the operand\n * @param y defines the y coordinate of the operand\n * @param z defines the z coordinate of the operand\n * @returns the current updated Vector3\n */\n addInPlaceFromFloats(x, y, z) {\n this._x += x;\n this._y += y;\n this._z += z;\n this._isDirty = true;\n return this;\n }\n /**\n * Gets a new Vector3, result of the addition the current Vector3 and the given vector\n * Example Playground https://playground.babylonjs.com/#R1F8YU#3\n * @param otherVector defines the second operand\n * @returns the resulting Vector3\n */\n add(otherVector) {\n return new this.constructor(this._x + otherVector._x, this._y + otherVector._y, this._z + otherVector._z);\n }\n /**\n * Adds the current Vector3 to the given one and stores the result in the vector \"result\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#6\n * @param otherVector defines the second operand\n * @param result defines the Vector3 object where to store the result\n * @returns the result\n */\n addToRef(otherVector, result) {\n return result.copyFromFloats(this._x + otherVector._x, this._y + otherVector._y, this._z + otherVector._z);\n }\n /**\n * Subtract the given vector from the current Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#61\n * @param otherVector defines the second operand\n * @returns the current updated Vector3\n */\n subtractInPlace(otherVector) {\n this._x -= otherVector._x;\n this._y -= otherVector._y;\n this._z -= otherVector._z;\n this._isDirty = true;\n return this;\n }\n /**\n * Returns a new Vector3, result of the subtraction of the given vector from the current Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#60\n * @param otherVector defines the second operand\n * @returns the resulting Vector3\n */\n subtract(otherVector) {\n return new this.constructor(this._x - otherVector._x, this._y - otherVector._y, this._z - otherVector._z);\n }\n /**\n * Subtracts the given vector from the current Vector3 and stores the result in the vector \"result\".\n * Example Playground https://playground.babylonjs.com/#R1F8YU#63\n * @param otherVector defines the second operand\n * @param result defines the Vector3 object where to store the result\n * @returns the result\n */\n subtractToRef(otherVector, result) {\n return this.subtractFromFloatsToRef(otherVector._x, otherVector._y, otherVector._z, result);\n }\n /**\n * Returns a new Vector3 set with the subtraction of the given floats from the current Vector3 coordinates\n * Example Playground https://playground.babylonjs.com/#R1F8YU#62\n * @param x defines the x coordinate of the operand\n * @param y defines the y coordinate of the operand\n * @param z defines the z coordinate of the operand\n * @returns the resulting Vector3\n */\n subtractFromFloats(x, y, z) {\n return new this.constructor(this._x - x, this._y - y, this._z - z);\n }\n /**\n * Subtracts the given floats from the current Vector3 coordinates and set the given vector \"result\" with this result\n * Example Playground https://playground.babylonjs.com/#R1F8YU#64\n * @param x defines the x coordinate of the operand\n * @param y defines the y coordinate of the operand\n * @param z defines the z coordinate of the operand\n * @param result defines the Vector3 object where to store the result\n * @returns the result\n */\n subtractFromFloatsToRef(x, y, z, result) {\n return result.copyFromFloats(this._x - x, this._y - y, this._z - z);\n }\n /**\n * Gets a new Vector3 set with the current Vector3 negated coordinates\n * Example Playground https://playground.babylonjs.com/#R1F8YU#35\n * @returns a new Vector3\n */\n negate() {\n return new this.constructor(-this._x, -this._y, -this._z);\n }\n /**\n * Negate this vector in place\n * Example Playground https://playground.babylonjs.com/#R1F8YU#36\n * @returns this\n */\n negateInPlace() {\n this._x *= -1;\n this._y *= -1;\n this._z *= -1;\n this._isDirty = true;\n return this;\n }\n /**\n * Negate the current Vector3 and stores the result in the given vector \"result\" coordinates\n * Example Playground https://playground.babylonjs.com/#R1F8YU#37\n * @param result defines the Vector3 object where to store the result\n * @returns the result\n */\n negateToRef(result) {\n return result.copyFromFloats(this._x * -1, this._y * -1, this._z * -1);\n }\n /**\n * Multiplies the Vector3 coordinates by the float \"scale\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#56\n * @param scale defines the multiplier factor\n * @returns the current updated Vector3\n */\n scaleInPlace(scale) {\n this._x *= scale;\n this._y *= scale;\n this._z *= scale;\n this._isDirty = true;\n return this;\n }\n /**\n * Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float \"scale\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#53\n * @param scale defines the multiplier factor\n * @returns a new Vector3\n */\n scale(scale) {\n return new this.constructor(this._x * scale, this._y * scale, this._z * scale);\n }\n /**\n * Multiplies the current Vector3 coordinates by the float \"scale\" and stores the result in the given vector \"result\" coordinates\n * Example Playground https://playground.babylonjs.com/#R1F8YU#57\n * @param scale defines the multiplier factor\n * @param result defines the Vector3 object where to store the result\n * @returns the result\n */\n scaleToRef(scale, result) {\n return result.copyFromFloats(this._x * scale, this._y * scale, this._z * scale);\n }\n /**\n * Creates a vector normal (perpendicular) to the current Vector3 and stores the result in the given vector\n * Out of the infinite possibilities the normal chosen is the one formed by rotating the current vector\n * 90 degrees about an axis which lies perpendicular to the current vector\n * and its projection on the xz plane. In the case of a current vector in the xz plane\n * the normal is calculated to be along the y axis.\n * Example Playground https://playground.babylonjs.com/#R1F8YU#230\n * Example Playground https://playground.babylonjs.com/#R1F8YU#231\n * @param result defines the Vector3 object where to store the resultant normal\n * returns the result\n */\n getNormalToRef(result) {\n /**\n * Calculates the spherical coordinates of the current vector\n * so saves on memory rather than importing whole Spherical Class\n */\n const radius = this.length();\n let theta = Math.acos(this.y / radius);\n const phi = Math.atan2(this.z, this.x);\n //makes angle 90 degs to current vector\n if (theta > Math.PI / 2) {\n theta -= Math.PI / 2;\n }\n else {\n theta += Math.PI / 2;\n }\n //Calculates resutant normal vector from spherical coordinate of perpendicular vector\n const x = radius * Math.sin(theta) * Math.cos(phi);\n const y = radius * Math.cos(theta);\n const z = radius * Math.sin(theta) * Math.sin(phi);\n result.set(x, y, z);\n return result;\n }\n /**\n * Rotates the vector using the given unit quaternion and stores the new vector in result\n * Example Playground https://playground.babylonjs.com/#R1F8YU#9\n * @param q the unit quaternion representing the rotation\n * @param result the output vector\n * @returns the result\n */\n applyRotationQuaternionToRef(q, result) {\n const ix = q._w * this._x + q._y * this._z - q._z * this._y;\n const iy = q._w * this._y + q._z * this._x - q._x * this._z;\n const iz = q._w * this._z + q._x * this._y - q._y * this._x;\n const iw = -q._x * this._x - q._y * this._y - q._z * this._z;\n result._x = ix * q._w + iw * -q._x + iy * -q._z - iz * -q._y;\n result._y = iy * q._w + iw * -q._y + iz * -q._x - ix * -q._z;\n result._z = iz * q._w + iw * -q._z + ix * -q._y - iy * -q._x;\n result._isDirty = true;\n return result;\n }\n /**\n * Rotates the vector in place using the given unit quaternion\n * Example Playground https://playground.babylonjs.com/#R1F8YU#8\n * @param q the unit quaternion representing the rotation\n * @returns the current updated Vector3\n */\n applyRotationQuaternionInPlace(q) {\n return this.applyRotationQuaternionToRef(q, this);\n }\n /**\n * Rotates the vector using the given unit quaternion and returns the new vector\n * Example Playground https://playground.babylonjs.com/#R1F8YU#7\n * @param q the unit quaternion representing the rotation\n * @returns a new Vector3\n */\n applyRotationQuaternion(q) {\n return this.applyRotationQuaternionToRef(q, new this.constructor());\n }\n /**\n * Scale the current Vector3 values by a factor and add the result to a given Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#55\n * @param scale defines the scale factor\n * @param result defines the Vector3 object where to store the result\n * @returns result input\n */\n scaleAndAddToRef(scale, result) {\n return result.addInPlaceFromFloats(this._x * scale, this._y * scale, this._z * scale);\n }\n /**\n * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.\n * Example Playground https://playground.babylonjs.com/#R1F8YU#48\n * @param plane defines the plane to project to\n * @param origin defines the origin of the projection ray\n * @returns the projected vector3\n */\n projectOnPlane(plane, origin) {\n const result = new this.constructor();\n this.projectOnPlaneToRef(plane, origin, result);\n return result;\n }\n /**\n * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.\n * Example Playground https://playground.babylonjs.com/#R1F8YU#49\n * @param plane defines the plane to project to\n * @param origin defines the origin of the projection ray\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n projectOnPlaneToRef(plane, origin, result) {\n const n = plane.normal;\n const d = plane.d;\n const V = MathTmp.Vector3[0];\n // ray direction\n this.subtractToRef(origin, V);\n V.normalize();\n const denom = Vector3.Dot(V, n);\n //When the ray is close to parallel to the plane return infinity vector\n if (Math.abs(denom) < Math.pow(10, -10)) {\n result.setAll(Infinity);\n }\n else {\n const t = -(Vector3.Dot(origin, n) + d) / denom;\n // P = P0 + t*V\n const scaledV = V.scaleInPlace(t);\n origin.addToRef(scaledV, result);\n }\n return result;\n }\n /**\n * Returns true if the current Vector3 and the given vector coordinates are strictly equal\n * Example Playground https://playground.babylonjs.com/#R1F8YU#19\n * @param otherVector defines the second operand\n * @returns true if both vectors are equals\n */\n equals(otherVector) {\n return otherVector && this._x === otherVector._x && this._y === otherVector._y && this._z === otherVector._z;\n }\n /**\n * Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon\n * Example Playground https://playground.babylonjs.com/#R1F8YU#21\n * @param otherVector defines the second operand\n * @param epsilon defines the minimal distance to define values as equals\n * @returns true if both vectors are distant less than epsilon\n */\n equalsWithEpsilon(otherVector, epsilon = Epsilon) {\n return (otherVector &&\n Scalar.WithinEpsilon(this._x, otherVector._x, epsilon) &&\n Scalar.WithinEpsilon(this._y, otherVector._y, epsilon) &&\n Scalar.WithinEpsilon(this._z, otherVector._z, epsilon));\n }\n /**\n * Returns true if the current Vector3 coordinates equals the given floats\n * Example Playground https://playground.babylonjs.com/#R1F8YU#20\n * @param x defines the x coordinate of the operand\n * @param y defines the y coordinate of the operand\n * @param z defines the z coordinate of the operand\n * @returns true if both vectors are equal\n */\n equalsToFloats(x, y, z) {\n return this._x === x && this._y === y && this._z === z;\n }\n /**\n * Multiplies the current Vector3 coordinates by the given ones\n * Example Playground https://playground.babylonjs.com/#R1F8YU#32\n * @param otherVector defines the second operand\n * @returns the current updated Vector3\n */\n multiplyInPlace(otherVector) {\n this._x *= otherVector._x;\n this._y *= otherVector._y;\n this._z *= otherVector._z;\n this._isDirty = true;\n return this;\n }\n /**\n * Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector\n * Example Playground https://playground.babylonjs.com/#R1F8YU#31\n * @param otherVector defines the second operand\n * @returns the new Vector3\n */\n multiply(otherVector) {\n return this.multiplyByFloats(otherVector._x, otherVector._y, otherVector._z);\n }\n /**\n * Multiplies the current Vector3 by the given one and stores the result in the given vector \"result\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#33\n * @param otherVector defines the second operand\n * @param result defines the Vector3 object where to store the result\n * @returns the result\n */\n multiplyToRef(otherVector, result) {\n return result.copyFromFloats(this._x * otherVector._x, this._y * otherVector._y, this._z * otherVector._z);\n }\n /**\n * Returns a new Vector3 set with the result of the multiplication of the current Vector3 coordinates by the given floats\n * Example Playground https://playground.babylonjs.com/#R1F8YU#34\n * @param x defines the x coordinate of the operand\n * @param y defines the y coordinate of the operand\n * @param z defines the z coordinate of the operand\n * @returns the new Vector3\n */\n multiplyByFloats(x, y, z) {\n return new this.constructor(this._x * x, this._y * y, this._z * z);\n }\n /**\n * Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones\n * Example Playground https://playground.babylonjs.com/#R1F8YU#16\n * @param otherVector defines the second operand\n * @returns the new Vector3\n */\n divide(otherVector) {\n return new this.constructor(this._x / otherVector._x, this._y / otherVector._y, this._z / otherVector._z);\n }\n /**\n * Divides the current Vector3 coordinates by the given ones and stores the result in the given vector \"result\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#18\n * @param otherVector defines the second operand\n * @param result defines the Vector3 object where to store the result\n * @returns the result\n */\n divideToRef(otherVector, result) {\n return result.copyFromFloats(this._x / otherVector._x, this._y / otherVector._y, this._z / otherVector._z);\n }\n /**\n * Divides the current Vector3 coordinates by the given ones.\n * Example Playground https://playground.babylonjs.com/#R1F8YU#17\n * @param otherVector defines the second operand\n * @returns the current updated Vector3\n */\n divideInPlace(otherVector) {\n return this.divideToRef(otherVector, this);\n }\n /**\n * Updates the current Vector3 with the minimal coordinate values between its and the given vector ones\n * Example Playground https://playground.babylonjs.com/#R1F8YU#29\n * @param other defines the second operand\n * @returns the current updated Vector3\n */\n minimizeInPlace(other) {\n return this.minimizeInPlaceFromFloats(other._x, other._y, other._z);\n }\n /**\n * Updates the current Vector3 with the maximal coordinate values between its and the given vector ones.\n * Example Playground https://playground.babylonjs.com/#R1F8YU#27\n * @param other defines the second operand\n * @returns the current updated Vector3\n */\n maximizeInPlace(other) {\n return this.maximizeInPlaceFromFloats(other._x, other._y, other._z);\n }\n /**\n * Updates the current Vector3 with the minimal coordinate values between its and the given coordinates\n * Example Playground https://playground.babylonjs.com/#R1F8YU#30\n * @param x defines the x coordinate of the operand\n * @param y defines the y coordinate of the operand\n * @param z defines the z coordinate of the operand\n * @returns the current updated Vector3\n */\n minimizeInPlaceFromFloats(x, y, z) {\n if (x < this._x) {\n this.x = x;\n }\n if (y < this._y) {\n this.y = y;\n }\n if (z < this._z) {\n this.z = z;\n }\n return this;\n }\n /**\n * Updates the current Vector3 with the maximal coordinate values between its and the given coordinates.\n * Example Playground https://playground.babylonjs.com/#R1F8YU#28\n * @param x defines the x coordinate of the operand\n * @param y defines the y coordinate of the operand\n * @param z defines the z coordinate of the operand\n * @returns the current updated Vector3\n */\n maximizeInPlaceFromFloats(x, y, z) {\n if (x > this._x) {\n this.x = x;\n }\n if (y > this._y) {\n this.y = y;\n }\n if (z > this._z) {\n this.z = z;\n }\n return this;\n }\n /**\n * Due to float precision, scale of a mesh could be uniform but float values are off by a small fraction\n * Check if is non uniform within a certain amount of decimal places to account for this\n * @param epsilon the amount the values can differ\n * @returns if the the vector is non uniform to a certain number of decimal places\n */\n isNonUniformWithinEpsilon(epsilon) {\n const absX = Math.abs(this._x);\n const absY = Math.abs(this._y);\n if (!Scalar.WithinEpsilon(absX, absY, epsilon)) {\n return true;\n }\n const absZ = Math.abs(this._z);\n if (!Scalar.WithinEpsilon(absX, absZ, epsilon)) {\n return true;\n }\n if (!Scalar.WithinEpsilon(absY, absZ, epsilon)) {\n return true;\n }\n return false;\n }\n /**\n * Gets a boolean indicating that the vector is non uniform meaning x, y or z are not all the same\n */\n get isNonUniform() {\n const absX = Math.abs(this._x);\n const absY = Math.abs(this._y);\n if (absX !== absY) {\n return true;\n }\n const absZ = Math.abs(this._z);\n if (absX !== absZ) {\n return true;\n }\n return false;\n }\n /**\n * Gets a new Vector3 from current Vector3 floored values\n * Example Playground https://playground.babylonjs.com/#R1F8YU#22\n * @returns a new Vector3\n */\n floor() {\n return new this.constructor(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));\n }\n /**\n * Gets a new Vector3 from current Vector3 fractional values\n * Example Playground https://playground.babylonjs.com/#R1F8YU#23\n * @returns a new Vector3\n */\n fract() {\n return new this.constructor(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z));\n }\n // Properties\n /**\n * Gets the length of the Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#25\n * @returns the length of the Vector3\n */\n length() {\n return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z);\n }\n /**\n * Gets the squared length of the Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#26\n * @returns squared length of the Vector3\n */\n lengthSquared() {\n return this._x * this._x + this._y * this._y + this._z * this._z;\n }\n /**\n * Gets a boolean indicating if the vector contains a zero in one of its components\n * Example Playground https://playground.babylonjs.com/#R1F8YU#1\n */\n get hasAZeroComponent() {\n return this._x * this._y * this._z === 0;\n }\n /**\n * Normalize the current Vector3.\n * Please note that this is an in place operation.\n * Example Playground https://playground.babylonjs.com/#R1F8YU#122\n * @returns the current updated Vector3\n */\n normalize() {\n return this.normalizeFromLength(this.length());\n }\n /**\n * Reorders the x y z properties of the vector in place\n * Example Playground https://playground.babylonjs.com/#R1F8YU#44\n * @param order new ordering of the properties (eg. for vector 1,2,3 with \"ZYX\" will produce 3,2,1)\n * @returns the current updated vector\n */\n reorderInPlace(order) {\n order = order.toLowerCase();\n if (order === \"xyz\") {\n return this;\n }\n MathTmp.Vector3[0].copyFrom(this);\n [\"x\", \"y\", \"z\"].forEach((val, i) => {\n this[val] = MathTmp.Vector3[0][order[i]];\n });\n return this;\n }\n /**\n * Rotates the vector around 0,0,0 by a quaternion\n * Example Playground https://playground.babylonjs.com/#R1F8YU#47\n * @param quaternion the rotation quaternion\n * @param result vector to store the result\n * @returns the resulting vector\n */\n rotateByQuaternionToRef(quaternion, result) {\n quaternion.toRotationMatrix(MathTmp.Matrix[0]);\n Vector3.TransformCoordinatesToRef(this, MathTmp.Matrix[0], result);\n return result;\n }\n /**\n * Rotates a vector around a given point\n * Example Playground https://playground.babylonjs.com/#R1F8YU#46\n * @param quaternion the rotation quaternion\n * @param point the point to rotate around\n * @param result vector to store the result\n * @returns the resulting vector\n */\n rotateByQuaternionAroundPointToRef(quaternion, point, result) {\n this.subtractToRef(point, MathTmp.Vector3[0]);\n MathTmp.Vector3[0].rotateByQuaternionToRef(quaternion, MathTmp.Vector3[0]);\n point.addToRef(MathTmp.Vector3[0], result);\n return result;\n }\n /**\n * Returns a new Vector3 as the cross product of the current vector and the \"other\" one\n * The cross product is then orthogonal to both current and \"other\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#14\n * @param other defines the right operand\n * @returns the cross product\n */\n cross(other) {\n const result = new this.constructor();\n return Vector3.CrossToRef(this, other, result);\n }\n /**\n * Normalize the current Vector3 with the given input length.\n * Please note that this is an in place operation.\n * Example Playground https://playground.babylonjs.com/#R1F8YU#123\n * @param len the length of the vector\n * @returns the current updated Vector3\n */\n normalizeFromLength(len) {\n if (len === 0 || len === 1.0) {\n return this;\n }\n return this.scaleInPlace(1.0 / len);\n }\n /**\n * Normalize the current Vector3 to a new vector\n * Example Playground https://playground.babylonjs.com/#R1F8YU#124\n * @returns the new Vector3\n */\n normalizeToNew() {\n const normalized = new this.constructor(0, 0, 0);\n this.normalizeToRef(normalized);\n return normalized;\n }\n /**\n * Normalize the current Vector3 to the reference\n * Example Playground https://playground.babylonjs.com/#R1F8YU#125\n * @param reference define the Vector3 to update\n * @returns the updated Vector3\n */\n normalizeToRef(reference) {\n const len = this.length();\n if (len === 0 || len === 1.0) {\n return reference.copyFromFloats(this._x, this._y, this._z);\n }\n return this.scaleToRef(1.0 / len, reference);\n }\n /**\n * Creates a new Vector3 copied from the current Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#11\n * @returns the new Vector3\n */\n clone() {\n return new this.constructor(this._x, this._y, this._z);\n }\n /**\n * Copies the given vector coordinates to the current Vector3 ones\n * Example Playground https://playground.babylonjs.com/#R1F8YU#12\n * @param source defines the source Vector3\n * @returns the current updated Vector3\n */\n copyFrom(source) {\n return this.copyFromFloats(source._x, source._y, source._z);\n }\n /**\n * Copies the given floats to the current Vector3 coordinates\n * Example Playground https://playground.babylonjs.com/#R1F8YU#13\n * @param x defines the x coordinate of the operand\n * @param y defines the y coordinate of the operand\n * @param z defines the z coordinate of the operand\n * @returns the current updated Vector3\n */\n copyFromFloats(x, y, z) {\n this._x = x;\n this._y = y;\n this._z = z;\n this._isDirty = true;\n return this;\n }\n /**\n * Copies the given floats to the current Vector3 coordinates\n * Example Playground https://playground.babylonjs.com/#R1F8YU#58\n * @param x defines the x coordinate of the operand\n * @param y defines the y coordinate of the operand\n * @param z defines the z coordinate of the operand\n * @returns the current updated Vector3\n */\n set(x, y, z) {\n return this.copyFromFloats(x, y, z);\n }\n /**\n * Copies the given float to the current Vector3 coordinates\n * Example Playground https://playground.babylonjs.com/#R1F8YU#59\n * @param v defines the x, y and z coordinates of the operand\n * @returns the current updated Vector3\n */\n setAll(v) {\n this._x = this._y = this._z = v;\n this._isDirty = true;\n return this;\n }\n // Statics\n /**\n * Get the clip factor between two vectors\n * Example Playground https://playground.babylonjs.com/#R1F8YU#126\n * @param vector0 defines the first operand\n * @param vector1 defines the second operand\n * @param axis defines the axis to use\n * @param size defines the size along the axis\n * @returns the clip factor\n */\n static GetClipFactor(vector0, vector1, axis, size) {\n const d0 = Vector3.Dot(vector0, axis) - size;\n const d1 = Vector3.Dot(vector1, axis) - size;\n const s = d0 / (d0 - d1);\n return s;\n }\n /**\n * Get angle between two vectors\n * Example Playground https://playground.babylonjs.com/#R1F8YU#86\n * @param vector0 the starting point\n * @param vector1 the ending point\n * @param normal direction of the normal\n * @returns the angle between vector0 and vector1\n */\n static GetAngleBetweenVectors(vector0, vector1, normal) {\n const v0 = vector0.normalizeToRef(MathTmp.Vector3[1]);\n const v1 = vector1.normalizeToRef(MathTmp.Vector3[2]);\n let dot = Vector3.Dot(v0, v1);\n // Vectors are normalized so dot will be in [-1, 1] (aside precision issues enough to break the result which explains the below clamp)\n dot = Scalar.Clamp(dot, -1, 1);\n const angle = Math.acos(dot);\n const n = MathTmp.Vector3[3];\n Vector3.CrossToRef(v0, v1, n);\n if (Vector3.Dot(n, normal) > 0) {\n return isNaN(angle) ? 0 : angle;\n }\n return isNaN(angle) ? -Math.PI : -Math.acos(dot);\n }\n /**\n * Get angle between two vectors projected on a plane\n * Example Playground https://playground.babylonjs.com/#R1F8YU#87\n * Expectation compute time: 0.01 ms (median) and 0.02 ms (percentile 95%)\n * @param vector0 angle between vector0 and vector1\n * @param vector1 angle between vector0 and vector1\n * @param normal Normal of the projection plane\n * @returns the angle in radians (float) between vector0 and vector1 projected on the plane with the specified normal\n */\n static GetAngleBetweenVectorsOnPlane(vector0, vector1, normal) {\n MathTmp.Vector3[0].copyFrom(vector0);\n const v0 = MathTmp.Vector3[0];\n MathTmp.Vector3[1].copyFrom(vector1);\n const v1 = MathTmp.Vector3[1];\n MathTmp.Vector3[2].copyFrom(normal);\n const vNormal = MathTmp.Vector3[2];\n const right = MathTmp.Vector3[3];\n const forward = MathTmp.Vector3[4];\n v0.normalize();\n v1.normalize();\n vNormal.normalize();\n Vector3.CrossToRef(vNormal, v0, right);\n Vector3.CrossToRef(right, vNormal, forward);\n const angle = Math.atan2(Vector3.Dot(v1, right), Vector3.Dot(v1, forward));\n return Scalar.NormalizeRadians(angle);\n }\n /**\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\n * Example PG https://playground.babylonjs.com/#R1F8YU#189\n * @param start the starting point\n * @param target the target point\n * @param ref the vector3 to store the result\n * @returns ref in the form (pitch, yaw, 0)\n */\n static PitchYawRollToMoveBetweenPointsToRef(start, target, ref) {\n const diff = TmpVectors.Vector3[0];\n target.subtractToRef(start, diff);\n ref._y = Math.atan2(diff.x, diff.z) || 0;\n ref._x = Math.atan2(Math.sqrt(diff.x ** 2 + diff.z ** 2), diff.y) || 0;\n ref._z = 0;\n ref._isDirty = true;\n return ref;\n }\n /**\n * Gets the rotation that aligns the roll axis (Y) to the line joining the start point to the target point\n * Example PG https://playground.babylonjs.com/#R1F8YU#188\n * @param start the starting point\n * @param target the target point\n * @returns the rotation in the form (pitch, yaw, 0)\n */\n static PitchYawRollToMoveBetweenPoints(start, target) {\n const ref = Vector3.Zero();\n return Vector3.PitchYawRollToMoveBetweenPointsToRef(start, target, ref);\n }\n /**\n * Slerp between two vectors. See also `SmoothToRef`\n * Slerp is a spherical linear interpolation\n * giving a slow in and out effect\n * Example Playground 1 https://playground.babylonjs.com/#R1F8YU#108\n * Example Playground 2 https://playground.babylonjs.com/#R1F8YU#109\n * @param vector0 Start vector\n * @param vector1 End vector\n * @param slerp amount (will be clamped between 0 and 1)\n * @param result The slerped vector\n */\n static SlerpToRef(vector0, vector1, slerp, result) {\n slerp = Scalar.Clamp(slerp, 0, 1);\n const vector0Dir = MathTmp.Vector3[0];\n const vector1Dir = MathTmp.Vector3[1];\n vector0Dir.copyFrom(vector0);\n const vector0Length = vector0Dir.length();\n vector0Dir.normalizeFromLength(vector0Length);\n vector1Dir.copyFrom(vector1);\n const vector1Length = vector1Dir.length();\n vector1Dir.normalizeFromLength(vector1Length);\n const dot = Vector3.Dot(vector0Dir, vector1Dir);\n let scale0;\n let scale1;\n if (dot < 1 - Epsilon) {\n const omega = Math.acos(dot);\n const invSin = 1 / Math.sin(omega);\n scale0 = Math.sin((1 - slerp) * omega) * invSin;\n scale1 = Math.sin(slerp * omega) * invSin;\n }\n else {\n // Use linear interpolation\n scale0 = 1 - slerp;\n scale1 = slerp;\n }\n vector0Dir.scaleInPlace(scale0);\n vector1Dir.scaleInPlace(scale1);\n result.copyFrom(vector0Dir).addInPlace(vector1Dir);\n result.scaleInPlace(Scalar.Lerp(vector0Length, vector1Length, slerp));\n return result;\n }\n /**\n * Smooth interpolation between two vectors using Slerp\n * Example Playground https://playground.babylonjs.com/#R1F8YU#110\n * @param source source vector\n * @param goal goal vector\n * @param deltaTime current interpolation frame\n * @param lerpTime total interpolation time\n * @param result the smoothed vector\n */\n static SmoothToRef(source, goal, deltaTime, lerpTime, result) {\n Vector3.SlerpToRef(source, goal, lerpTime === 0 ? 1 : deltaTime / lerpTime, result);\n return result;\n }\n /**\n * Returns a new Vector3 set from the index \"offset\" of the given array\n * Example Playground https://playground.babylonjs.com/#R1F8YU#83\n * @param array defines the source array\n * @param offset defines the offset in the source array\n * @returns the new Vector3\n */\n static FromArray(array, offset = 0) {\n return new Vector3(array[offset], array[offset + 1], array[offset + 2]);\n }\n /**\n * Returns a new Vector3 set from the index \"offset\" of the given Float32Array\n * @param array defines the source array\n * @param offset defines the offset in the source array\n * @returns the new Vector3\n * @deprecated Please use FromArray instead.\n */\n static FromFloatArray(array, offset) {\n return Vector3.FromArray(array, offset);\n }\n /**\n * Sets the given vector \"result\" with the element values from the index \"offset\" of the given array\n * Example Playground https://playground.babylonjs.com/#R1F8YU#84\n * @param array defines the source array\n * @param offset defines the offset in the source array\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n static FromArrayToRef(array, offset, result) {\n result._x = array[offset];\n result._y = array[offset + 1];\n result._z = array[offset + 2];\n result._isDirty = true;\n return result;\n }\n /**\n * Sets the given vector \"result\" with the element values from the index \"offset\" of the given Float32Array\n * @param array defines the source array\n * @param offset defines the offset in the source array\n * @param result defines the Vector3 where to store the result\n * @deprecated Please use FromArrayToRef instead.\n */\n static FromFloatArrayToRef(array, offset, result) {\n return Vector3.FromArrayToRef(array, offset, result);\n }\n /**\n * Sets the given vector \"result\" with the given floats.\n * Example Playground https://playground.babylonjs.com/#R1F8YU#85\n * @param x defines the x coordinate of the source\n * @param y defines the y coordinate of the source\n * @param z defines the z coordinate of the source\n * @param result defines the Vector3 where to store the result\n */\n static FromFloatsToRef(x, y, z, result) {\n result.copyFromFloats(x, y, z);\n return result;\n }\n /**\n * Returns a new Vector3 set to (0.0, 0.0, 0.0)\n * @returns a new empty Vector3\n */\n static Zero() {\n return new Vector3(0.0, 0.0, 0.0);\n }\n /**\n * Returns a new Vector3 set to (1.0, 1.0, 1.0)\n * @returns a new Vector3\n */\n static One() {\n return new Vector3(1.0, 1.0, 1.0);\n }\n /**\n * Returns a new Vector3 set to (0.0, 1.0, 0.0)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\n * @returns a new up Vector3\n */\n static Up() {\n return new Vector3(0.0, 1.0, 0.0);\n }\n /**\n * Gets an up Vector3 that must not be updated\n */\n static get UpReadOnly() {\n return Vector3._UpReadOnly;\n }\n /**\n * Gets a down Vector3 that must not be updated\n */\n static get DownReadOnly() {\n return Vector3._DownReadOnly;\n }\n /**\n * Gets a right Vector3 that must not be updated\n */\n static get RightReadOnly() {\n return Vector3._RightReadOnly;\n }\n /**\n * Gets a left Vector3 that must not be updated\n */\n static get LeftReadOnly() {\n return Vector3._LeftReadOnly;\n }\n /**\n * Gets a forward Vector3 that must not be updated\n */\n static get LeftHandedForwardReadOnly() {\n return Vector3._LeftHandedForwardReadOnly;\n }\n /**\n * Gets a forward Vector3 that must not be updated\n */\n static get RightHandedForwardReadOnly() {\n return Vector3._RightHandedForwardReadOnly;\n }\n /**\n * Gets a backward Vector3 that must not be updated\n */\n static get LeftHandedBackwardReadOnly() {\n return Vector3._LeftHandedBackwardReadOnly;\n }\n /**\n * Gets a backward Vector3 that must not be updated\n */\n static get RightHandedBackwardReadOnly() {\n return Vector3._RightHandedBackwardReadOnly;\n }\n /**\n * Gets a zero Vector3 that must not be updated\n */\n static get ZeroReadOnly() {\n return Vector3._ZeroReadOnly;\n }\n /**\n * Gets a one Vector3 that must not be updated\n */\n static get OneReadOnly() {\n return Vector3._OneReadOnly;\n }\n /**\n * Returns a new Vector3 set to (0.0, -1.0, 0.0)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\n * @returns a new down Vector3\n */\n static Down() {\n return new Vector3(0.0, -1.0, 0.0);\n }\n /**\n * Returns a new Vector3 set to (0.0, 0.0, 1.0)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\n * @param rightHandedSystem is the scene right-handed (negative z)\n * @returns a new forward Vector3\n */\n static Forward(rightHandedSystem = false) {\n return new Vector3(0.0, 0.0, rightHandedSystem ? -1.0 : 1.0);\n }\n /**\n * Returns a new Vector3 set to (0.0, 0.0, -1.0)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\n * @param rightHandedSystem is the scene right-handed (negative-z)\n * @returns a new Backward Vector3\n */\n static Backward(rightHandedSystem = false) {\n return new Vector3(0.0, 0.0, rightHandedSystem ? 1.0 : -1.0);\n }\n /**\n * Returns a new Vector3 set to (1.0, 0.0, 0.0)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\n * @returns a new right Vector3\n */\n static Right() {\n return new Vector3(1.0, 0.0, 0.0);\n }\n /**\n * Returns a new Vector3 set to (-1.0, 0.0, 0.0)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#71\n * @returns a new left Vector3\n */\n static Left() {\n return new Vector3(-1.0, 0.0, 0.0);\n }\n /**\n * Returns a new Vector3 with random values between min and max\n * @param min the minimum random value\n * @param max the maximum random value\n * @returns a Vector3 with random values between min and max\n */\n static Random(min = 0, max = 1) {\n return new Vector3(Scalar.RandomRange(min, max), Scalar.RandomRange(min, max), Scalar.RandomRange(min, max));\n }\n /**\n * Returns a new Vector3 set with the result of the transformation by the given matrix of the given vector.\n * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#111\n * @param vector defines the Vector3 to transform\n * @param transformation defines the transformation matrix\n * @returns the transformed Vector3\n */\n static TransformCoordinates(vector, transformation) {\n const result = Vector3.Zero();\n Vector3.TransformCoordinatesToRef(vector, transformation, result);\n return result;\n }\n /**\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given vector\n * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#113\n * @param vector defines the Vector3 to transform\n * @param transformation defines the transformation matrix\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n static TransformCoordinatesToRef(vector, transformation, result) {\n Vector3.TransformCoordinatesFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);\n return result;\n }\n /**\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)\n * This method computes transformed coordinates only, not transformed direction vectors\n * Example Playground https://playground.babylonjs.com/#R1F8YU#115\n * @param x define the x coordinate of the source vector\n * @param y define the y coordinate of the source vector\n * @param z define the z coordinate of the source vector\n * @param transformation defines the transformation matrix\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n static TransformCoordinatesFromFloatsToRef(x, y, z, transformation, result) {\n const m = transformation.m;\n const rx = x * m[0] + y * m[4] + z * m[8] + m[12];\n const ry = x * m[1] + y * m[5] + z * m[9] + m[13];\n const rz = x * m[2] + y * m[6] + z * m[10] + m[14];\n const rw = 1 / (x * m[3] + y * m[7] + z * m[11] + m[15]);\n result._x = rx * rw;\n result._y = ry * rw;\n result._z = rz * rw;\n result._isDirty = true;\n return result;\n }\n /**\n * Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector\n * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#112\n * @param vector defines the Vector3 to transform\n * @param transformation defines the transformation matrix\n * @returns the new Vector3\n */\n static TransformNormal(vector, transformation) {\n const result = Vector3.Zero();\n Vector3.TransformNormalToRef(vector, transformation, result);\n return result;\n }\n /**\n * Sets the given vector \"result\" with the result of the normal transformation by the given matrix of the given vector\n * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#114\n * @param vector defines the Vector3 to transform\n * @param transformation defines the transformation matrix\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n static TransformNormalToRef(vector, transformation, result) {\n this.TransformNormalFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);\n return result;\n }\n /**\n * Sets the given vector \"result\" with the result of the normal transformation by the given matrix of the given floats (x, y, z)\n * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)\n * Example Playground https://playground.babylonjs.com/#R1F8YU#116\n * @param x define the x coordinate of the source vector\n * @param y define the y coordinate of the source vector\n * @param z define the z coordinate of the source vector\n * @param transformation defines the transformation matrix\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n static TransformNormalFromFloatsToRef(x, y, z, transformation, result) {\n const m = transformation.m;\n result._x = x * m[0] + y * m[4] + z * m[8];\n result._y = x * m[1] + y * m[5] + z * m[9];\n result._z = x * m[2] + y * m[6] + z * m[10];\n result._isDirty = true;\n return result;\n }\n /**\n * Returns a new Vector3 located for \"amount\" on the CatmullRom interpolation spline defined by the vectors \"value1\", \"value2\", \"value3\", \"value4\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#69\n * @param value1 defines the first control point\n * @param value2 defines the second control point\n * @param value3 defines the third control point\n * @param value4 defines the fourth control point\n * @param amount defines the amount on the spline to use\n * @returns the new Vector3\n */\n static CatmullRom(value1, value2, value3, value4, amount) {\n const squared = amount * amount;\n const cubed = amount * squared;\n const x = 0.5 *\n (2.0 * value2._x +\n (-value1._x + value3._x) * amount +\n (2.0 * value1._x - 5.0 * value2._x + 4.0 * value3._x - value4._x) * squared +\n (-value1._x + 3.0 * value2._x - 3.0 * value3._x + value4._x) * cubed);\n const y = 0.5 *\n (2.0 * value2._y +\n (-value1._y + value3._y) * amount +\n (2.0 * value1._y - 5.0 * value2._y + 4.0 * value3._y - value4._y) * squared +\n (-value1._y + 3.0 * value2._y - 3.0 * value3._y + value4._y) * cubed);\n const z = 0.5 *\n (2.0 * value2._z +\n (-value1._z + value3._z) * amount +\n (2.0 * value1._z - 5.0 * value2._z + 4.0 * value3._z - value4._z) * squared +\n (-value1._z + 3.0 * value2._z - 3.0 * value3._z + value4._z) * cubed);\n return new value1.constructor(x, y, z);\n }\n /**\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\"\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\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\n * Example Playground https://playground.babylonjs.com/#R1F8YU#76\n * @param value defines the current value\n * @param min defines the lower range value\n * @param max defines the upper range value\n * @returns the new Vector3\n */\n static Clamp(value, min, max) {\n const result = new value.constructor();\n Vector3.ClampToRef(value, min, max, result);\n return result;\n }\n /**\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\"\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\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\n * Example Playground https://playground.babylonjs.com/#R1F8YU#77\n * @param value defines the current value\n * @param min defines the lower range value\n * @param max defines the upper range value\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n static ClampToRef(value, min, max, result) {\n let x = value._x;\n x = x > max._x ? max._x : x;\n x = x < min._x ? min._x : x;\n let y = value._y;\n y = y > max._y ? max._y : y;\n y = y < min._y ? min._y : y;\n let z = value._z;\n z = z > max._z ? max._z : z;\n z = z < min._z ? min._z : z;\n result.copyFromFloats(x, y, z);\n return result;\n }\n /**\n * Checks if a given vector is inside a specific range\n * Example Playground https://playground.babylonjs.com/#R1F8YU#75\n * @param v defines the vector to test\n * @param min defines the minimum range\n * @param max defines the maximum range\n */\n static CheckExtends(v, min, max) {\n min.minimizeInPlace(v);\n max.maximizeInPlace(v);\n }\n /**\n * Returns a new Vector3 located for \"amount\" (float) on the Hermite interpolation spline defined by the vectors \"value1\", \"tangent1\", \"value2\", \"tangent2\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#89\n * @param value1 defines the first control point\n * @param tangent1 defines the first tangent vector\n * @param value2 defines the second control point\n * @param tangent2 defines the second tangent vector\n * @param amount defines the amount on the interpolation spline (between 0 and 1)\n * @returns the new Vector3\n */\n static Hermite(value1, tangent1, value2, tangent2, amount) {\n const squared = amount * amount;\n const cubed = amount * squared;\n const part1 = 2.0 * cubed - 3.0 * squared + 1.0;\n const part2 = -2.0 * cubed + 3.0 * squared;\n const part3 = cubed - 2.0 * squared + amount;\n const part4 = cubed - squared;\n const x = value1._x * part1 + value2._x * part2 + tangent1._x * part3 + tangent2._x * part4;\n const y = value1._y * part1 + value2._y * part2 + tangent1._y * part3 + tangent2._y * part4;\n const z = value1._z * part1 + value2._z * part2 + tangent1._z * part3 + tangent2._z * part4;\n return new value1.constructor(x, y, z);\n }\n /**\n * Returns a new Vector3 which is the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\n * Example Playground https://playground.babylonjs.com/#R1F8YU#90\n * @param value1 defines the first control point\n * @param tangent1 defines the first tangent\n * @param value2 defines the second control point\n * @param tangent2 defines the second tangent\n * @param time define where the derivative must be done\n * @returns 1st derivative\n */\n static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {\n const result = new value1.constructor();\n this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result);\n return result;\n }\n /**\n * Update a Vector3 with the 1st derivative of the Hermite spline defined by the vectors \"value1\", \"value2\", \"tangent1\", \"tangent2\".\n * Example Playground https://playground.babylonjs.com/#R1F8YU#91\n * @param value1 defines the first control point\n * @param tangent1 defines the first tangent\n * @param value2 defines the second control point\n * @param tangent2 defines the second tangent\n * @param time define where the derivative must be done\n * @param result define where to store the derivative\n * @returns result input\n */\n static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {\n const t2 = time * time;\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;\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;\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;\n result._isDirty = true;\n return result;\n }\n /**\n * Returns a new Vector3 located for \"amount\" (float) on the linear interpolation between the vectors \"start\" and \"end\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#95\n * @param start defines the start value\n * @param end defines the end value\n * @param amount max defines amount between both (between 0 and 1)\n * @returns the new Vector3\n */\n static Lerp(start, end, amount) {\n const result = new start.constructor(0, 0, 0);\n Vector3.LerpToRef(start, end, amount, result);\n return result;\n }\n /**\n * Sets the given vector \"result\" with the result of the linear interpolation from the vector \"start\" for \"amount\" to the vector \"end\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#93\n * @param start defines the start value\n * @param end defines the end value\n * @param amount max defines amount between both (between 0 and 1)\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n static LerpToRef(start, end, amount, result) {\n result._x = start._x + (end._x - start._x) * amount;\n result._y = start._y + (end._y - start._y) * amount;\n result._z = start._z + (end._z - start._z) * amount;\n result._isDirty = true;\n return result;\n }\n /**\n * Returns the dot product (float) between the vectors \"left\" and \"right\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#82\n * @param left defines the left operand\n * @param right defines the right operand\n * @returns the dot product\n */\n static Dot(left, right) {\n return left._x * right._x + left._y * right._y + left._z * right._z;\n }\n /**\n * Returns a new Vector3 as the cross product of the vectors \"left\" and \"right\"\n * The cross product is then orthogonal to both \"left\" and \"right\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#15\n * @param left defines the left operand\n * @param right defines the right operand\n * @returns the cross product\n */\n static Cross(left, right) {\n const result = new left.constructor();\n Vector3.CrossToRef(left, right, result);\n return result;\n }\n /**\n * Sets the given vector \"result\" with the cross product of \"left\" and \"right\"\n * The cross product is then orthogonal to both \"left\" and \"right\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#78\n * @param left defines the left operand\n * @param right defines the right operand\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n static CrossToRef(left, right, result) {\n const x = left._y * right._z - left._z * right._y;\n const y = left._z * right._x - left._x * right._z;\n const z = left._x * right._y - left._y * right._x;\n result.copyFromFloats(x, y, z);\n return result;\n }\n /**\n * Returns a new Vector3 as the normalization of the given vector\n * Example Playground https://playground.babylonjs.com/#R1F8YU#98\n * @param vector defines the Vector3 to normalize\n * @returns the new Vector3\n */\n static Normalize(vector) {\n const result = Vector3.Zero();\n Vector3.NormalizeToRef(vector, result);\n return result;\n }\n /**\n * Sets the given vector \"result\" with the normalization of the given first vector\n * Example Playground https://playground.babylonjs.com/#R1F8YU#98\n * @param vector defines the Vector3 to normalize\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n static NormalizeToRef(vector, result) {\n vector.normalizeToRef(result);\n return result;\n }\n /**\n * Project a Vector3 onto screen space\n * Example Playground https://playground.babylonjs.com/#R1F8YU#101\n * @param vector defines the Vector3 to project\n * @param world defines the world matrix to use\n * @param transform defines the transform (view x projection) matrix to use\n * @param viewport defines the screen viewport to use\n * @returns the new Vector3\n */\n static Project(vector, world, transform, viewport) {\n const result = new vector.constructor();\n Vector3.ProjectToRef(vector, world, transform, viewport, result);\n return result;\n }\n /**\n * Project a Vector3 onto screen space to reference\n * Example Playground https://playground.babylonjs.com/#R1F8YU#102\n * @param vector defines the Vector3 to project\n * @param world defines the world matrix to use\n * @param transform defines the transform (view x projection) matrix to use\n * @param viewport defines the screen viewport to use\n * @param result the vector in which the screen space will be stored\n * @returns result input\n */\n static ProjectToRef(vector, world, transform, viewport, result) {\n const cw = viewport.width;\n const ch = viewport.height;\n const cx = viewport.x;\n const cy = viewport.y;\n const viewportMatrix = MathTmp.Matrix[1];\n Matrix.FromValuesToRef(cw / 2.0, 0, 0, 0, 0, -ch / 2.0, 0, 0, 0, 0, 0.5, 0, cx + cw / 2.0, ch / 2.0 + cy, 0.5, 1, viewportMatrix);\n const matrix = MathTmp.Matrix[0];\n world.multiplyToRef(transform, matrix);\n matrix.multiplyToRef(viewportMatrix, matrix);\n Vector3.TransformCoordinatesToRef(vector, matrix, result);\n return result;\n }\n /**\n * Reflects a vector off the plane defined by a normalized normal\n * @param inDirection defines the vector direction\n * @param normal defines the normal - Must be normalized\n * @returns the resulting vector\n */\n static Reflect(inDirection, normal) {\n return this.ReflectToRef(inDirection, normal, new Vector3());\n }\n /**\n * Reflects a vector off the plane defined by a normalized normal to reference\n * @param inDirection defines the vector direction\n * @param normal defines the normal - Must be normalized\n * @param result defines the Vector3 where to store the result\n * @returns the resulting vector\n */\n static ReflectToRef(inDirection, normal, ref) {\n const tmp = TmpVectors.Vector3[0];\n tmp.copyFrom(normal).scaleInPlace(2 * Vector3.Dot(inDirection, normal));\n return ref.copyFrom(inDirection).subtractInPlace(tmp);\n }\n /**\n * @internal\n */\n static _UnprojectFromInvertedMatrixToRef(source, matrix, result) {\n Vector3.TransformCoordinatesToRef(source, matrix, result);\n const m = matrix.m;\n const num = source._x * m[3] + source._y * m[7] + source._z * m[11] + m[15];\n if (Scalar.WithinEpsilon(num, 1.0)) {\n result.scaleInPlace(1.0 / num);\n }\n return result;\n }\n /**\n * Unproject from screen space to object space\n * Example Playground https://playground.babylonjs.com/#R1F8YU#121\n * @param source defines the screen space Vector3 to use\n * @param viewportWidth defines the current width of the viewport\n * @param viewportHeight defines the current height of the viewport\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\n * @param transform defines the transform (view x projection) matrix to use\n * @returns the new Vector3\n */\n static UnprojectFromTransform(source, viewportWidth, viewportHeight, world, transform) {\n return this.Unproject(source, viewportWidth, viewportHeight, world, transform, Matrix.IdentityReadOnly);\n }\n /**\n * Unproject from screen space to object space\n * Example Playground https://playground.babylonjs.com/#R1F8YU#117\n * @param source defines the screen space Vector3 to use\n * @param viewportWidth defines the current width of the viewport\n * @param viewportHeight defines the current height of the viewport\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\n * @param view defines the view matrix to use\n * @param projection defines the projection matrix to use\n * @returns the new Vector3\n */\n static Unproject(source, viewportWidth, viewportHeight, world, view, projection) {\n const result = new source.constructor();\n Vector3.UnprojectToRef(source, viewportWidth, viewportHeight, world, view, projection, result);\n return result;\n }\n /**\n * Unproject from screen space to object space\n * Example Playground https://playground.babylonjs.com/#R1F8YU#119\n * @param source defines the screen space Vector3 to use\n * @param viewportWidth defines the current width of the viewport\n * @param viewportHeight defines the current height of the viewport\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\n * @param view defines the view matrix to use\n * @param projection defines the projection matrix to use\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n static UnprojectToRef(source, viewportWidth, viewportHeight, world, view, projection, result) {\n Vector3.UnprojectFloatsToRef(source._x, source._y, source._z, viewportWidth, viewportHeight, world, view, projection, result);\n return result;\n }\n /**\n * Unproject from screen space to object space\n * Example Playground https://playground.babylonjs.com/#R1F8YU#120\n * @param sourceX defines the screen space x coordinate to use\n * @param sourceY defines the screen space y coordinate to use\n * @param sourceZ defines the screen space z coordinate to use\n * @param viewportWidth defines the current width of the viewport\n * @param viewportHeight defines the current height of the viewport\n * @param world defines the world matrix to use (can be set to Identity to go to world space)\n * @param view defines the view matrix to use\n * @param projection defines the projection matrix to use\n * @param result defines the Vector3 where to store the result\n * @returns result input\n */\n static UnprojectFloatsToRef(sourceX, sourceY, sourceZ, viewportWidth, viewportHeight, world, view, projection, result) {\n var _a;\n const matrix = MathTmp.Matrix[0];\n world.multiplyToRef(view, matrix);\n matrix.multiplyToRef(projection, matrix);\n matrix.invert();\n const screenSource = MathTmp.Vector3[0];\n screenSource.x = (sourceX / viewportWidth) * 2 - 1;\n screenSource.y = -((sourceY / viewportHeight) * 2 - 1);\n if ((_a = EngineStore.LastCreatedEngine) === null || _a === void 0 ? void 0 : _a.isNDCHalfZRange) {\n screenSource.z = sourceZ;\n }\n else {\n screenSource.z = 2 * sourceZ - 1.0;\n }\n Vector3._UnprojectFromInvertedMatrixToRef(screenSource, matrix, result);\n return result;\n }\n /**\n * Gets the minimal coordinate values between two Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#97\n * @param left defines the first operand\n * @param right defines the second operand\n * @returns the new Vector3\n */\n static Minimize(left, right) {\n const min = new left.constructor();\n min.copyFrom(left);\n min.minimizeInPlace(right);\n return min;\n }\n /**\n * Gets the maximal coordinate values between two Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#96\n * @param left defines the first operand\n * @param right defines the second operand\n * @returns the new Vector3\n */\n static Maximize(left, right) {\n const max = new left.constructor();\n max.copyFrom(left);\n max.maximizeInPlace(right);\n return max;\n }\n /**\n * Returns the distance between the vectors \"value1\" and \"value2\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#81\n * @param value1 defines the first operand\n * @param value2 defines the second operand\n * @returns the distance\n */\n static Distance(value1, value2) {\n return Math.sqrt(Vector3.DistanceSquared(value1, value2));\n }\n /**\n * Returns the squared distance between the vectors \"value1\" and \"value2\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#80\n * @param value1 defines the first operand\n * @param value2 defines the second operand\n * @returns the squared distance\n */\n static DistanceSquared(value1, value2) {\n const x = value1._x - value2._x;\n const y = value1._y - value2._y;\n const z = value1._z - value2._z;\n return x * x + y * y + z * z;\n }\n /**\n * Projects \"vector\" on the triangle determined by its extremities \"p0\", \"p1\" and \"p2\", stores the result in \"ref\"\n * and returns the distance to the projected point.\n * Example Playground https://playground.babylonjs.com/#R1F8YU#104\n * From http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.104.4264&rep=rep1&type=pdf\n *\n * @param vector the vector to get distance from\n * @param p0 extremity of the triangle\n * @param p1 extremity of the triangle\n * @param p2 extremity of the triangle\n * @param ref variable to store the result to\n * @returns The distance between \"ref\" and \"vector\"\n */\n static ProjectOnTriangleToRef(vector, p0, p1, p2, ref) {\n const p1p0 = MathTmp.Vector3[0];\n const p2p0 = MathTmp.Vector3[1];\n const p2p1 = MathTmp.Vector3[2];\n const normal = MathTmp.Vector3[3];\n const vectorp0 = MathTmp.Vector3[4];\n // Triangle vectors\n p1.subtractToRef(p0, p1p0);\n p2.subtractToRef(p0, p2p0);\n p2.subtractToRef(p1, p2p1);\n const p1p0L = p1p0.length();\n const p2p0L = p2p0.length();\n const p2p1L = p2p1.length();\n if (p1p0L < Epsilon || p2p0L < Epsilon || p2p1L < Epsilon) {\n // This is a degenerate triangle. As we assume this is part of a non-degenerate mesh,\n // we will find a better intersection later.\n // Let's just return one of the extremities\n ref.copyFrom(p0);\n return Vector3.Distance(vector, p0);\n }\n // Compute normal and vector to p0\n vector.subtractToRef(p0, vectorp0);\n Vector3.CrossToRef(p1p0, p2p0, normal);\n const nl = normal.length();\n if (nl < Epsilon) {\n // Extremities are aligned, we are back on the case of a degenerate triangle\n ref.copyFrom(p0);\n return Vector3.Distance(vector, p0);\n }\n normal.normalizeFromLength(nl);\n let l = vectorp0.length();\n if (l < Epsilon) {\n // Vector is p0\n ref.copyFrom(p0);\n return 0;\n }\n vectorp0.normalizeFromLength(l);\n // Project to \"proj\" that lies on the triangle plane\n const cosA = Vector3.Dot(normal, vectorp0);\n const projVector = MathTmp.Vector3[5];\n const proj = MathTmp.Vector3[6];\n projVector.copyFrom(normal).scaleInPlace(-l * cosA);\n proj.copyFrom(vector).addInPlace(projVector);\n // Compute barycentric coordinates (v0, v1 and v2 are axis from barycenter to extremities)\n const v0 = MathTmp.Vector3[4];\n const v1 = MathTmp.Vector3[5];\n const v2 = MathTmp.Vector3[7];\n const tmp = MathTmp.Vector3[8];\n v0.copyFrom(p1p0).scaleInPlace(1 / p1p0L);\n tmp.copyFrom(p2p0).scaleInPlace(1 / p2p0L);\n v0.addInPlace(tmp).scaleInPlace(-1);\n v1.copyFrom(p1p0).scaleInPlace(-1 / p1p0L);\n tmp.copyFrom(p2p1).scaleInPlace(1 / p2p1L);\n v1.addInPlace(tmp).scaleInPlace(-1);\n v2.copyFrom(p2p1).scaleInPlace(-1 / p2p1L);\n tmp.copyFrom(p2p0).scaleInPlace(-1 / p2p0L);\n v2.addInPlace(tmp).scaleInPlace(-1);\n // Determines which edge of the triangle is closest to \"proj\"\n const projP = MathTmp.Vector3[9];\n let dot;\n projP.copyFrom(proj).subtractInPlace(p0);\n Vector3.CrossToRef(v0, projP, tmp);\n dot = Vector3.Dot(tmp, normal);\n const s0 = dot;\n projP.copyFrom(proj).subtractInPlace(p1);\n Vector3.CrossToRef(v1, projP, tmp);\n dot = Vector3.Dot(tmp, normal);\n const s1 = dot;\n projP.copyFrom(proj).subtractInPlace(p2);\n Vector3.CrossToRef(v2, projP, tmp);\n dot = Vector3.Dot(tmp, normal);\n const s2 = dot;\n const edge = MathTmp.Vector3[10];\n let e0, e1;\n if (s0 > 0 && s1 < 0) {\n edge.copyFrom(p1p0);\n e0 = p0;\n e1 = p1;\n }\n else if (s1 > 0 && s2 < 0) {\n edge.copyFrom(p2p1);\n e0 = p1;\n e1 = p2;\n }\n else {\n edge.copyFrom(p2p0).scaleInPlace(-1);\n e0 = p2;\n e1 = p0;\n }\n // Determines if \"proj\" lies inside the triangle\n const tmp2 = MathTmp.Vector3[9];\n const tmp3 = MathTmp.Vector3[4];\n e0.subtractToRef(proj, tmp);\n e1.subtractToRef(proj, tmp2);\n Vector3.CrossToRef(tmp, tmp2, tmp3);\n const isOutside = Vector3.Dot(tmp3, normal) < 0;\n // If inside, we already found the projected point, \"proj\"\n if (!isOutside) {\n ref.copyFrom(proj);\n return Math.abs(l * cosA);\n }\n // If outside, we find \"triProj\", the closest point from \"proj\" on the closest edge\n const r = MathTmp.Vector3[5];\n Vector3.CrossToRef(edge, tmp3, r);\n r.normalize();\n const e0proj = MathTmp.Vector3[9];\n e0proj.copyFrom(e0).subtractInPlace(proj);\n const e0projL = e0proj.length();\n if (e0projL < Epsilon) {\n // Proj is e0\n ref.copyFrom(e0);\n return Vector3.Distance(vector, e0);\n }\n e0proj.normalizeFromLength(e0projL);\n const cosG = Vector3.Dot(r, e0proj);\n const triProj = MathTmp.Vector3[7];\n triProj.copyFrom(proj).addInPlace(r.scaleInPlace(e0projL * cosG));\n // Now we clamp \"triProj\" so it lies between e0 and e1\n tmp.copyFrom(triProj).subtractInPlace(e0);\n l = edge.length();\n edge.normalizeFromLength(l);\n let t = Vector3.Dot(tmp, edge) / Math.max(l, Epsilon);\n t = Scalar.Clamp(t, 0, 1);\n triProj.copyFrom(e0).addInPlace(edge.scaleInPlace(t * l));\n ref.copyFrom(triProj);\n return Vector3.Distance(vector, triProj);\n }\n /**\n * Returns a new Vector3 located at the center between \"value1\" and \"value2\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#72\n * @param value1 defines the first operand\n * @param value2 defines the second operand\n * @returns the new Vector3\n */\n static Center(value1, value2) {\n return Vector3.CenterToRef(value1, value2, Vector3.Zero());\n }\n /**\n * Gets the center of the vectors \"value1\" and \"value2\" and stores the result in the vector \"ref\"\n * Example Playground https://playground.babylonjs.com/#R1F8YU#73\n * @param value1 defines first vector\n * @param value2 defines second vector\n * @param ref defines third vector\n * @returns ref\n */\n static CenterToRef(value1, value2, ref) {\n return ref.copyFromFloats((value1._x + value2._x) / 2, (value1._y + value2._y) / 2, (value1._z + value2._z) / 2);\n }\n /**\n * Given three orthogonal normalized left-handed oriented Vector3 axis in space (target system),\n * RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply\n * to something in order to rotate it from its local system to the given target system\n * Note: axis1, axis2 and axis3 are normalized during this operation\n * Example Playground https://playground.babylonjs.com/#R1F8YU#106\n * @param axis1 defines the first axis\n * @param axis2 defines the second axis\n * @param axis3 defines the third axis\n * @returns a new Vector3\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/target_align\n */\n static RotationFromAxis(axis1, axis2, axis3) {\n const rotation = new axis1.constructor();\n Vector3.RotationFromAxisToRef(axis1, axis2, axis3, rotation);\n return rotation;\n }\n /**\n * The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3\n * Example Playground https://playground.babylonjs.com/#R1F8YU#107\n * @param axis1 defines the first axis\n * @param axis2 defines the second axis\n * @param axis3 defines the third axis\n * @param ref defines the Vector3 where to store the result\n * @returns result input\n */\n static RotationFromAxisToRef(axis1, axis2, axis3, ref) {\n const quat = MathTmp.Quaternion[0];\n Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat);\n quat.toEulerAnglesToRef(ref);\n return ref;\n }\n}\nVector3._UpReadOnly = Vector3.Up();\nVector3._DownReadOnly = Vector3.Down();\nVector3._LeftHandedForwardReadOnly = Vector3.Forward(false);\nVector3._RightHandedForwardReadOnly = Vector3.Forward(true);\nVector3._LeftHandedBackwardReadOnly = Vector3.Backward(false);\nVector3._RightHandedBackwardReadOnly = Vector3.Backward(true);\nVector3._RightReadOnly = Vector3.Right();\nVector3._LeftReadOnly = Vector3.Left();\nVector3._ZeroReadOnly = Vector3.Zero();\nVector3._OneReadOnly = Vector3.One();\n/**\n * Vector4 class created for EulerAngle class conversion to Quaternion\n */\nexport class Vector4 {\n /**\n * Creates a Vector4 object from the given floats.\n * @param x x value of the vector\n * @param y y value of the vector\n * @param z z value of the vector\n * @param w w value of the vector\n */\n constructor(\n /** x value of the vector */\n x = 0, \n /** y value of the vector */\n y = 0, \n /** z value of the vector */\n z = 0, \n /** w value of the vector */\n w = 0) {\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n }\n /**\n * Returns the string with the Vector4 coordinates.\n * @returns a string containing all the vector values\n */\n toString() {\n return `{X: ${this.x} Y: ${this.y} Z: ${this.z} W: ${this.w}}`;\n }\n /**\n * Returns the string \"Vector4\".\n * @returns \"Vector4\"\n */\n getClassName() {\n return \"Vector4\";\n }\n /**\n * Returns the Vector4 hash code.\n * @returns a unique hash code\n */\n getHashCode() {\n const x = _ExtractAsInt(this.x);\n const y = _ExtractAsInt(this.y);\n const z = _ExtractAsInt(this.z);\n const w = _ExtractAsInt(this.w);\n let hash = x;\n hash = (hash * 397) ^ y;\n hash = (hash * 397) ^ z;\n hash = (hash * 397) ^ w;\n return hash;\n }\n // Operators\n /**\n * Returns a new array populated with 4 elements : the Vector4 coordinates.\n * @returns the resulting array\n */\n asArray() {\n const result = new Array();\n this.toArray(result, 0);\n return result;\n }\n /**\n * Populates the given array from the given index with the Vector4 coordinates.\n * @param array array to populate\n * @param index index of the array to start at (default: 0)\n * @returns the Vector4.\n */\n toArray(array, index) {\n if (index === undefined) {\n index = 0;\n }\n array[index] = this.x;\n array[index + 1] = this.y;\n array[index + 2] = this.z;\n array[index + 3] = this.w;\n return this;\n }\n /**\n * Update the current vector from an array\n * @param array defines the destination array\n * @param index defines the offset in the destination array\n * @returns the current Vector3\n */\n fromArray(array, index = 0) {\n Vector4.FromArrayToRef(array, index, this);\n return this;\n }\n /**\n * Adds the given vector to the current Vector4.\n * @param otherVector the vector to add\n * @returns the updated Vector4.\n */\n addInPlace(otherVector) {\n this.x += otherVector.x;\n this.y += otherVector.y;\n this.z += otherVector.z;\n this.w += otherVector.w;\n return this;\n }\n /**\n * Returns a new Vector4 as the result of the addition of the current Vector4 and the given one.\n * @param otherVector the vector to add\n * @returns the resulting vector\n */\n add(otherVector) {\n return new this.constructor(this.x + otherVector.x, this.y + otherVector.y, this.z + otherVector.z, this.w + otherVector.w);\n }\n /**\n * Updates the given vector \"result\" with the result of the addition of the current Vector4 and the given one.\n * @param otherVector the vector to add\n * @param result the vector to store the result\n * @returns result input\n */\n addToRef(otherVector, result) {\n result.x = this.x + otherVector.x;\n result.y = this.y + otherVector.y;\n result.z = this.z + otherVector.z;\n result.w = this.w + otherVector.w;\n return result;\n }\n /**\n * Subtract in place the given vector from the current Vector4.\n * @param otherVector the vector to subtract\n * @returns the updated Vector4.\n */\n subtractInPlace(otherVector) {\n this.x -= otherVector.x;\n this.y -= otherVector.y;\n this.z -= otherVector.z;\n this.w -= otherVector.w;\n return this;\n }\n /**\n * Returns a new Vector4 with the result of the subtraction of the given vector from the current Vector4.\n * @param otherVector the vector to add\n * @returns the new vector with the result\n */\n subtract(otherVector) {\n return new this.constructor(this.x - otherVector.x, this.y - otherVector.y, this.z - otherVector.z, this.w - otherVector.w);\n }\n /**\n * Sets the given vector \"result\" with the result of the subtraction of the given vector from the current Vector4.\n * @param otherVector the vector to subtract\n * @param result the vector to store the result\n * @returns result input\n */\n subtractToRef(otherVector, result) {\n result.x = this.x - otherVector.x;\n result.y = this.y - otherVector.y;\n result.z = this.z - otherVector.z;\n result.w = this.w - otherVector.w;\n return result;\n }\n /**\n * Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates.\n */\n /**\n * Returns a new Vector4 set with the result of the subtraction of the given floats from the current Vector4 coordinates.\n * @param x value to subtract\n * @param y value to subtract\n * @param z value to subtract\n * @param w value to subtract\n * @returns new vector containing the result\n */\n subtractFromFloats(x, y, z, w) {\n return new this.constructor(this.x - x, this.y - y, this.z - z, this.w - w);\n }\n /**\n * Sets the given vector \"result\" set with the result of the subtraction of the given floats from the current Vector4 coordinates.\n * @param x value to subtract\n * @param y value to subtract\n * @param z value to subtract\n * @param w value to subtract\n * @param result the vector to store the result in\n * @returns result input\n */\n subtractFromFloatsToRef(x, y, z, w, result) {\n result.x = this.x - x;\n result.y = this.y - y;\n result.z = this.z - z;\n result.w = this.w - w;\n return result;\n }\n /**\n * Returns a new Vector4 set with the current Vector4 negated coordinates.\n * @returns a new vector with the negated values\n */\n negate() {\n return new this.constructor(-this.x, -this.y, -this.z, -this.w);\n }\n /**\n * Negate this vector in place\n * @returns this\n */\n negateInPlace() {\n this.x *= -1;\n this.y *= -1;\n this.z *= -1;\n this.w *= -1;\n return this;\n }\n /**\n * Negate the current Vector4 and stores the result in the given vector \"result\" coordinates\n * @param result defines the Vector3 object where to store the result\n * @returns the result\n */\n negateToRef(result) {\n return result.copyFromFloats(this.x * -1, this.y * -1, this.z * -1, this.w * -1);\n }\n /**\n * Multiplies the current Vector4 coordinates by scale (float).\n * @param scale the number to scale with\n * @returns the updated Vector4.\n */\n scaleInPlace(scale) {\n this.x *= scale;\n this.y *= scale;\n this.z *= scale;\n this.w *= scale;\n return this;\n }\n /**\n * Returns a new Vector4 set with the current Vector4 coordinates multiplied by scale (float).\n * @param scale the number to scale with\n * @returns a new vector with the result\n */\n scale(scale) {\n return new this.constructor(this.x * scale, this.y * scale, this.z * scale, this.w * scale);\n }\n /**\n * Sets the given vector \"result\" with the current Vector4 coordinates multiplied by scale (float).\n * @param scale the number to scale with\n * @param result a vector to store the result in\n * @returns result input\n */\n scaleToRef(scale, result) {\n result.x = this.x * scale;\n result.y = this.y * scale;\n result.z = this.z * scale;\n result.w = this.w * scale;\n return result;\n }\n /**\n * Scale the current Vector4 values by a factor and add the result to a given Vector4\n * @param scale defines the scale factor\n * @param result defines the Vector4 object where to store the result\n * @returns result input\n */\n scaleAndAddToRef(scale, result) {\n result.x += this.x * scale;\n result.y += this.y * scale;\n result.z += this.z * scale;\n result.w += this.w * scale;\n return result;\n }\n /**\n * Boolean : True if the current Vector4 coordinates are stricly equal to the given ones.\n * @param otherVector the vector to compare against\n * @returns true if they are equal\n */\n equals(otherVector) {\n return otherVector && this.x === otherVector.x && this.y === otherVector.y && this.z === otherVector.z && this.w === otherVector.w;\n }\n /**\n * Boolean : True if the current Vector4 coordinates are each beneath the distance \"epsilon\" from the given vector ones.\n * @param otherVector vector to compare against\n * @param epsilon (Default: very small number)\n * @returns true if they are equal\n */\n equalsWithEpsilon(otherVector, epsilon = Epsilon) {\n return (otherVector &&\n Scalar.WithinEpsilon(this.x, otherVector.x, epsilon) &&\n Scalar.WithinEpsilon(this.y, otherVector.y, epsilon) &&\n Scalar.WithinEpsilon(this.z, otherVector.z, epsilon) &&\n Scalar.WithinEpsilon(this.w, otherVector.w, epsilon));\n }\n /**\n * Boolean : True if the given floats are strictly equal to the current Vector4 coordinates.\n * @param x x value to compare against\n * @param y y value to compare against\n * @param z z value to compare against\n * @param w w value to compare against\n * @returns true if equal\n */\n equalsToFloats(x, y, z, w) {\n return this.x === x && this.y === y && this.z === z && this.w === w;\n }\n /**\n * Multiplies in place the current Vector4 by the given one.\n * @param otherVector vector to multiple with\n * @returns the updated Vector4.\n */\n multiplyInPlace(otherVector) {\n this.x *= otherVector.x;\n this.y *= otherVector.y;\n this.z *= otherVector.z;\n this.w *= otherVector.w;\n return this;\n }\n /**\n * Returns a new Vector4 set with the multiplication result of the current Vector4 and the given one.\n * @param otherVector vector to multiple with\n * @returns resulting new vector\n */\n multiply(otherVector) {\n return new this.constructor(this.x * otherVector.x, this.y * otherVector.y, this.z * otherVector.z, this.w * otherVector.w);\n }\n /**\n * Updates the given vector \"result\" with the multiplication result of the current Vector4 and the given one.\n * @param otherVector vector to multiple with\n * @param result vector to store the result\n * @returns result input\n */\n multiplyToRef(otherVector, result) {\n result.x = this.x * otherVector.x;\n result.y = this.y * otherVector.y;\n result.z = this.z * otherVector.z;\n result.w = this.w * otherVector.w;\n return result;\n }\n /**\n * Returns a new Vector4 set with the multiplication result of the given floats and the current Vector4 coordinates.\n * @param x x value multiply with\n * @param y y value multiply with\n * @param z z value multiply with\n * @param w w value multiply with\n * @returns resulting new vector\n */\n multiplyByFloats(x, y, z, w) {\n return new this.constructor(this.x * x, this.y * y, this.z * z, this.w * w);\n }\n /**\n * Returns a new Vector4 set with the division result of the current Vector4 by the given one.\n * @param otherVector vector to devide with\n * @returns resulting new vector\n */\n divide(otherVector) {\n return new this.constructor(this.x / otherVector.x, this.y / otherVector.y, this.z / otherVector.z, this.w / otherVector.w);\n }\n /**\n * Updates the given vector \"result\" with the division result of the current Vector4 by the given one.\n * @param otherVector vector to devide with\n * @param result vector to store the result\n * @returns result input\n */\n divideToRef(otherVector, result) {\n result.x = this.x / otherVector.x;\n result.y = this.y / otherVector.y;\n result.z = this.z / otherVector.z;\n result.w = this.w / otherVector.w;\n return result;\n }\n /**\n * Divides the current Vector3 coordinates by the given ones.\n * @param otherVector vector to devide with\n * @returns the updated Vector3.\n */\n divideInPlace(otherVector) {\n return this.divideToRef(otherVector, this);\n }\n /**\n * Updates the Vector4 coordinates with the minimum values between its own and the given vector ones\n * @param other defines the second operand\n * @returns the current updated Vector4\n */\n minimizeInPlace(other) {\n if (other.x < this.x) {\n this.x = other.x;\n }\n if (other.y < this.y) {\n this.y = other.y;\n }\n if (other.z < this.z) {\n this.z = other.z;\n }\n if (other.w < this.w) {\n this.w = other.w;\n }\n return this;\n }\n /**\n * Updates the Vector4 coordinates with the maximum values between its own and the given vector ones\n * @param other defines the second operand\n * @returns the current updated Vector4\n */\n maximizeInPlace(other) {\n if (other.x > this.x) {\n this.x = other.x;\n }\n if (other.y > this.y) {\n this.y = other.y;\n }\n if (other.z > this.z) {\n this.z = other.z;\n }\n if (other.w > this.w) {\n this.w = other.w;\n }\n return this;\n }\n /**\n * Gets a new Vector4 from current Vector4 floored values\n * @returns a new Vector4\n */\n floor() {\n return new this.constructor(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w));\n }\n /**\n * Gets a new Vector4 from current Vector4 fractional values\n * @returns a new Vector4\n */\n fract() {\n return new this.constructor(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z), this.w - Math.floor(this.w));\n }\n // Properties\n /**\n * Returns the Vector4 length (float).\n * @returns the length\n */\n length() {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n }\n /**\n * Returns the Vector4 squared length (float).\n * @returns the length squared\n */\n lengthSquared() {\n return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n }\n // Methods\n /**\n * Normalizes in place the Vector4.\n * @returns the updated Vector4.\n */\n normalize() {\n const len = this.length();\n if (len === 0) {\n return this;\n }\n return this.scaleInPlace(1.0 / len);\n }\n /**\n * Returns a new Vector3 from the Vector4 (x, y, z) coordinates.\n * @returns this converted to a new vector3\n */\n toVector3() {\n return new Vector3(this.x, this.y, this.z);\n }\n /**\n * Returns a new Vector4 copied from the current one.\n * @returns the new cloned vector\n */\n clone() {\n return new this.constructor(this.x, this.y, this.z, this.w);\n }\n /**\n * Updates the current Vector4 with the given one coordinates.\n * @param source the source vector to copy from\n * @returns the updated Vector4.\n */\n copyFrom(source) {\n this.x = source.x;\n this.y = source.y;\n this.z = source.z;\n this.w = source.w;\n return this;\n }\n /**\n * Updates the current Vector4 coordinates with the given floats.\n * @param x float to copy from\n * @param y float to copy from\n * @param z float to copy from\n * @param w float to copy from\n * @returns the updated Vector4.\n */\n copyFromFloats(x, y, z, w) {\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n return this;\n }\n /**\n * Updates the current Vector4 coordinates with the given floats.\n * @param x float to set from\n * @param y float to set from\n * @param z float to set from\n * @param w float to set from\n * @returns the updated Vector4.\n */\n set(x, y, z, w) {\n return this.copyFromFloats(x, y, z, w);\n }\n /**\n * Copies the given float to the current Vector3 coordinates\n * @param v defines the x, y, z and w coordinates of the operand\n * @returns the current updated Vector3\n */\n setAll(v) {\n this.x = this.y = this.z = this.w = v;\n return this;\n }\n // Statics\n /**\n * Returns a new Vector4 set from the starting index of the given array.\n * @param array the array to pull values from\n * @param offset the offset into the array to start at\n * @returns the new vector\n */\n static FromArray(array, offset) {\n if (!offset) {\n offset = 0;\n }\n return new Vector4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);\n }\n /**\n * Updates the given vector \"result\" from the starting index of the given array.\n * @param array the array to pull values from\n * @param offset the offset into the array to start at\n * @param result the vector to store the result in\n * @returns result input\n */\n static FromArrayToRef(array, offset, result) {\n result.x = array[offset];\n result.y = array[offset + 1];\n result.z = array[offset + 2];\n result.w = array[offset + 3];\n return result;\n }\n /**\n * Updates the given vector \"result\" from the starting index of the given Float32Array.\n * @param array the array to pull values from\n * @param offset the offset into the array to start at\n * @param result the vector to store the result in\n * @returns result input\n */\n static FromFloatArrayToRef(array, offset, result) {\n Vector4.FromArrayToRef(array, offset, result);\n return result;\n }\n /**\n * Updates the given vector \"result\" coordinates from the given floats.\n * @param x float to set from\n * @param y float to set from\n * @param z float to set from\n * @param w float to set from\n * @param result the vector to the floats in\n * @returns result input\n */\n static FromFloatsToRef(x, y, z, w, result) {\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = w;\n return result;\n }\n /**\n * Returns a new Vector4 set to (0.0, 0.0, 0.0, 0.0)\n * @returns the new vector\n */\n static Zero() {\n return new Vector4(0.0, 0.0, 0.0, 0.0);\n }\n /**\n * Returns a new Vector4 set to (1.0, 1.0, 1.0, 1.0)\n * @returns the new vector\n */\n static One() {\n return new Vector4(1.0, 1.0, 1.0, 1.0);\n }\n /**\n * Returns a new Vector4 with random values between min and max\n * @param min the minimum random value\n * @param max the maximum random value\n * @returns a Vector4 with random values between min and max\n */\n static Random(min = 0, max = 1) {\n return new Vector4(Scalar.RandomRange(min, max), Scalar.RandomRange(min, max), Scalar.RandomRange(min, max), Scalar.RandomRange(min, max));\n }\n /**\n * Gets a zero Vector4 that must not be updated\n */\n static get ZeroReadOnly() {\n return Vector4._ZeroReadOnly;\n }\n /**\n * Returns a new normalized Vector4 from the given one.\n * @param vector the vector to normalize\n * @returns the vector\n */\n static Normalize(vector) {\n const result = Vector4.Zero();\n Vector4.NormalizeToRef(vector, result);\n return result;\n }\n /**\n * Updates the given vector \"result\" from the normalization of the given one.\n * @param vector the vector to normalize\n * @param result the vector to store the result in\n * @returns result input\n */\n static NormalizeToRef(vector, result) {\n result.copyFrom(vector);\n result.normalize();\n return result;\n }\n /**\n * Returns a vector with the minimum values from the left and right vectors\n * @param left left vector to minimize\n * @param right right vector to minimize\n * @returns a new vector with the minimum of the left and right vector values\n */\n static Minimize(left, right) {\n const min = new left.constructor();\n min.copyFrom(left);\n min.minimizeInPlace(right);\n return min;\n }\n /**\n * Returns a vector with the maximum values from the left and right vectors\n * @param left left vector to maximize\n * @param right right vector to maximize\n * @returns a new vector with the maximum of the left and right vector values\n */\n static Maximize(left, right) {\n const max = new left.constructor();\n max.copyFrom(left);\n max.maximizeInPlace(right);\n return max;\n }\n /**\n * Returns the distance (float) between the vectors \"value1\" and \"value2\".\n * @param value1 value to calulate the distance between\n * @param value2 value to calulate the distance between\n * @returns the distance between the two vectors\n */\n static Distance(value1, value2) {\n return Math.sqrt(Vector4.DistanceSquared(value1, value2));\n }\n /**\n * Returns the squared distance (float) between the vectors \"value1\" and \"value2\".\n * @param value1 value to calulate the distance between\n * @param value2 value to calulate the distance between\n * @returns the distance between the two vectors squared\n */\n static DistanceSquared(value1, value2) {\n const x = value1.x - value2.x;\n const y = value1.y - value2.y;\n const z = value1.z - value2.z;\n const w = value1.w - value2.w;\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Returns a new Vector4 located at the center between the vectors \"value1\" and \"value2\".\n * @param value1 value to calulate the center between\n * @param value2 value to calulate the center between\n * @returns the center between the two vectors\n */\n static Center(value1, value2) {\n return Vector4.CenterToRef(value1, value2, Vector4.Zero());\n }\n /**\n * Gets the center of the vectors \"value1\" and \"value2\" and stores the result in the vector \"ref\"\n * @param value1 defines first vector\n * @param value2 defines second vector\n * @param ref defines third vector\n * @returns ref\n */\n static CenterToRef(value1, value2, ref) {\n return ref.copyFromFloats((value1.x + value2.x) / 2, (value1.y + value2.y) / 2, (value1.z + value2.z) / 2, (value1.w + value2.w) / 2);\n }\n /**\n * Returns a new Vector4 set with the result of the transformation by the given matrix of the given vector.\n * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\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\n * @param vector defines the Vector3 to transform\n * @param transformation defines the transformation matrix\n * @returns the transformed Vector4\n */\n static TransformCoordinates(vector, transformation) {\n const result = Vector4.Zero();\n Vector4.TransformCoordinatesToRef(vector, transformation, result);\n return result;\n }\n /**\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given vector\n * This method computes tranformed coordinates only, not transformed direction vectors (ie. it takes translation in account)\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\n * @param vector defines the Vector3 to transform\n * @param transformation defines the transformation matrix\n * @param result defines the Vector4 where to store the result\n * @returns result input\n */\n static TransformCoordinatesToRef(vector, transformation, result) {\n Vector4.TransformCoordinatesFromFloatsToRef(vector._x, vector._y, vector._z, transformation, result);\n return result;\n }\n /**\n * Sets the given vector \"result\" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)\n * This method computes tranformed coordinates only, not transformed direction vectors\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\n * @param x define the x coordinate of the source vector\n * @param y define the y coordinate of the source vector\n * @param z define the z coordinate of the source vector\n * @param transformation defines the transformation matrix\n * @param result defines the Vector4 where to store the result\n * @returns result input\n */\n static TransformCoordinatesFromFloatsToRef(x, y, z, transformation, result) {\n const m = transformation.m;\n const rx = x * m[0] + y * m[4] + z * m[8] + m[12];\n const ry = x * m[1] + y * m[5] + z * m[9] + m[13];\n const rz = x * m[2] + y * m[6] + z * m[10] + m[14];\n const rw = x * m[3] + y * m[7] + z * m[11] + m[15];\n result.x = rx;\n result.y = ry;\n result.z = rz;\n result.w = rw;\n return result;\n }\n /**\n * Returns a new Vector4 set with the result of the normal transformation by the given matrix of the given vector.\n * This methods computes transformed normalized direction vectors only.\n * @param vector the vector to transform\n * @param transformation the transformation matrix to apply\n * @returns the new vector\n */\n static TransformNormal(vector, transformation) {\n const result = new vector.constructor();\n Vector4.TransformNormalToRef(vector, transformation, result);\n return result;\n }\n /**\n * Sets the given vector \"result\" with the result of the normal transformation by the given matrix of the given vector.\n * This methods computes transformed normalized direction vectors only.\n * @param vector the vector to transform\n * @param transformation the transformation matrix to apply\n * @param result the vector to store the result in\n * @returns result input\n */\n static TransformNormalToRef(vector, transformation, result) {\n const m = transformation.m;\n const x = vector.x * m[0] + vector.y * m[4] + vector.z * m[8];\n const y = vector.x * m[1] + vector.y * m[5] + vector.z * m[9];\n const z = vector.x * m[2] + vector.y * m[6] + vector.z * m[10];\n result.x = x;\n result.y = y;\n result.z = z;\n result.w = vector.w;\n return result;\n }\n /**\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).\n * This methods computes transformed normalized direction vectors only.\n * @param x value to transform\n * @param y value to transform\n * @param z value to transform\n * @param w value to transform\n * @param transformation the transformation matrix to apply\n * @param result the vector to store the results in\n * @returns result input\n */\n static TransformNormalFromFloatsToRef(x, y, z, w, transformation, result) {\n const m = transformation.m;\n result.x = x * m[0] + y * m[4] + z * m[8];\n result.y = x * m[1] + y * m[5] + z * m[9];\n result.z = x * m[2] + y * m[6] + z * m[10];\n result.w = w;\n return result;\n }\n /**\n * Creates a new Vector4 from a Vector3\n * @param source defines the source data\n * @param w defines the 4th component (default is 0)\n * @returns a new Vector4\n */\n static FromVector3(source, w = 0) {\n return new Vector4(source._x, source._y, source._z, w);\n }\n}\nVector4._ZeroReadOnly = Vector4.Zero();\n/**\n * Class used to store quaternion data\n * Example Playground - Overview - https://playground.babylonjs.com/#L49EJ7#100\n * @see https://en.wikipedia.org/wiki/Quaternion\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms\n */\nexport class Quaternion {\n /** Gets or sets the x coordinate */\n get x() {\n return this._x;\n }\n set x(value) {\n this._x = value;\n this._isDirty = true;\n }\n /** Gets or sets the y coordinate */\n get y() {\n return this._y;\n }\n set y(value) {\n this._y = value;\n this._isDirty = true;\n }\n /** Gets or sets the z coordinate */\n get z() {\n return this._z;\n }\n set z(value) {\n this._z = value;\n this._isDirty = true;\n }\n /** Gets or sets the w coordinate */\n get w() {\n return this._w;\n }\n set w(value) {\n this._w = value;\n this._isDirty = true;\n }\n /**\n * Creates a new Quaternion from the given floats\n * @param x defines the first component (0 by default)\n * @param y defines the second component (0 by default)\n * @param z defines the third component (0 by default)\n * @param w defines the fourth component (1.0 by default)\n */\n constructor(x = 0.0, y = 0.0, z = 0.0, w = 1.0) {\n /** @internal */\n this._isDirty = true;\n this._x = x;\n this._y = y;\n this._z = z;\n this._w = w;\n }\n /**\n * Gets a string representation for the current quaternion\n * @returns a string with the Quaternion coordinates\n */\n toString() {\n return `{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`;\n }\n /**\n * Gets the class name of the quaternion\n * @returns the string \"Quaternion\"\n */\n getClassName() {\n return \"Quaternion\";\n }\n /**\n * Gets a hash code for this quaternion\n * @returns the quaternion hash code\n */\n getHashCode() {\n const x = _ExtractAsInt(this._x);\n const y = _ExtractAsInt(this._y);\n const z = _ExtractAsInt(this._z);\n const w = _ExtractAsInt(this._w);\n let hash = x;\n hash = (hash * 397) ^ y;\n hash = (hash * 397) ^ z;\n hash = (hash * 397) ^ w;\n return hash;\n }\n /**\n * Copy the quaternion to an array\n * Example Playground https://playground.babylonjs.com/#L49EJ7#13\n * @returns a new array populated with 4 elements from the quaternion coordinates\n */\n asArray() {\n return [this._x, this._y, this._z, this._w];\n }\n /**\n * Stores from the starting index in the given array the Quaternion successive values\n * Example Playground https://playground.babylonjs.com/#L49EJ7#59\n * @param array defines the array where to store the x,y,z,w components\n * @param index defines an optional index in the target array to define where to start storing values\n * @returns the current Quaternion object\n */\n toArray(array, index = 0) {\n array[index] = this._x;\n array[index + 1] = this._y;\n array[index + 2] = this._z;\n array[index + 3] = this._w;\n return this;\n }\n /**\n * Check if two quaternions are equals\n * Example Playground https://playground.babylonjs.com/#L49EJ7#38\n * @param otherQuaternion defines the second operand\n * @returns true if the current quaternion and the given one coordinates are strictly equals\n */\n equals(otherQuaternion) {\n return otherQuaternion && this._x === otherQuaternion._x && this._y === otherQuaternion._y && this._z === otherQuaternion._z && this._w === otherQuaternion._w;\n }\n /**\n * Gets a boolean if two quaternions are equals (using an epsilon value)\n * Example Playground https://playground.babylonjs.com/#L49EJ7#37\n * @param otherQuaternion defines the other quaternion\n * @param epsilon defines the minimal distance to consider equality\n * @returns true if the given quaternion coordinates are close to the current ones by a distance of epsilon.\n */\n equalsWithEpsilon(otherQuaternion, epsilon = Epsilon) {\n return (otherQuaternion &&\n Scalar.WithinEpsilon(this._x, otherQuaternion._x, epsilon) &&\n Scalar.WithinEpsilon(this._y, otherQuaternion._y, epsilon) &&\n Scalar.WithinEpsilon(this._z, otherQuaternion._z, epsilon) &&\n Scalar.WithinEpsilon(this._w, otherQuaternion._w, epsilon));\n }\n /**\n * Clone the current quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#12\n * @returns a new quaternion copied from the current one\n */\n clone() {\n return new this.constructor(this._x, this._y, this._z, this._w);\n }\n /**\n * Copy a quaternion to the current one\n * Example Playground https://playground.babylonjs.com/#L49EJ7#86\n * @param other defines the other quaternion\n * @returns the updated current quaternion\n */\n copyFrom(other) {\n this._x = other._x;\n this._y = other._y;\n this._z = other._z;\n this._w = other._w;\n this._isDirty = true;\n return this;\n }\n /**\n * Updates the current quaternion with the given float coordinates\n * Example Playground https://playground.babylonjs.com/#L49EJ7#87\n * @param x defines the x coordinate\n * @param y defines the y coordinate\n * @param z defines the z coordinate\n * @param w defines the w coordinate\n * @returns the updated current quaternion\n */\n copyFromFloats(x, y, z, w) {\n this._x = x;\n this._y = y;\n this._z = z;\n this._w = w;\n this._isDirty = true;\n return this;\n }\n /**\n * Updates the current quaternion from the given float coordinates\n * Example Playground https://playground.babylonjs.com/#L49EJ7#56\n * @param x defines the x coordinate\n * @param y defines the y coordinate\n * @param z defines the z coordinate\n * @param w defines the w coordinate\n * @returns the updated current quaternion\n */\n set(x, y, z, w) {\n return this.copyFromFloats(x, y, z, w);\n }\n /**\n * Adds two quaternions\n * Example Playground https://playground.babylonjs.com/#L49EJ7#10\n * @param other defines the second operand\n * @returns a new quaternion as the addition result of the given one and the current quaternion\n */\n add(other) {\n return new this.constructor(this._x + other._x, this._y + other._y, this._z + other._z, this._w + other._w);\n }\n /**\n * Add a quaternion to the current one\n * Example Playground https://playground.babylonjs.com/#L49EJ7#11\n * @param other defines the quaternion to add\n * @returns the current quaternion\n */\n addInPlace(other) {\n this._x += other._x;\n this._y += other._y;\n this._z += other._z;\n this._w += other._w;\n this._isDirty = true;\n return this;\n }\n /**\n * Subtract two quaternions\n * Example Playground https://playground.babylonjs.com/#L49EJ7#57\n * @param other defines the second operand\n * @returns a new quaternion as the subtraction result of the given one from the current one\n */\n subtract(other) {\n return new this.constructor(this._x - other._x, this._y - other._y, this._z - other._z, this._w - other._w);\n }\n /**\n * Subtract a quaternion to the current one\n * Example Playground https://playground.babylonjs.com/#L49EJ7#58\n * @param other defines the quaternion to subtract\n * @returns the current quaternion\n */\n subtractInPlace(other) {\n this._x -= other._x;\n this._y -= other._y;\n this._z -= other._z;\n this._w -= other._w;\n this._isDirty = true;\n return this;\n }\n /**\n * Multiplies the current quaternion by a scale factor\n * Example Playground https://playground.babylonjs.com/#L49EJ7#88\n * @param value defines the scale factor\n * @returns a new quaternion set by multiplying the current quaternion coordinates by the float \"scale\"\n */\n scale(value) {\n return new this.constructor(this._x * value, this._y * value, this._z * value, this._w * value);\n }\n /**\n * Scale the current quaternion values by a factor and stores the result to a given quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#89\n * @param scale defines the scale factor\n * @param result defines the Quaternion object where to store the result\n * @returns result input\n */\n scaleToRef(scale, result) {\n result._x = this._x * scale;\n result._y = this._y * scale;\n result._z = this._z * scale;\n result._w = this._w * scale;\n result._isDirty = true;\n return result;\n }\n /**\n * Multiplies in place the current quaternion by a scale factor\n * Example Playground https://playground.babylonjs.com/#L49EJ7#90\n * @param value defines the scale factor\n * @returns the current modified quaternion\n */\n scaleInPlace(value) {\n this._x *= value;\n this._y *= value;\n this._z *= value;\n this._w *= value;\n this._isDirty = true;\n return this;\n }\n /**\n * Scale the current quaternion values by a factor and add the result to a given quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#91\n * @param scale defines the scale factor\n * @param result defines the Quaternion object where to store the result\n * @returns result input\n */\n scaleAndAddToRef(scale, result) {\n result._x += this._x * scale;\n result._y += this._y * scale;\n result._z += this._z * scale;\n result._w += this._w * scale;\n result._isDirty = true;\n return result;\n }\n /**\n * Multiplies two quaternions\n * Example Playground https://playground.babylonjs.com/#L49EJ7#43\n * @param q1 defines the second operand\n * @returns a new quaternion set as the multiplication result of the current one with the given one \"q1\"\n */\n multiply(q1) {\n const result = new this.constructor(0, 0, 0, 1.0);\n this.multiplyToRef(q1, result);\n return result;\n }\n /**\n * Sets the given \"result\" as the the multiplication result of the current one with the given one \"q1\"\n * Example Playground https://playground.babylonjs.com/#L49EJ7#45\n * @param q1 defines the second operand\n * @param result defines the target quaternion\n * @returns the current quaternion\n */\n multiplyToRef(q1, result) {\n const x = this._x * q1._w + this._y * q1._z - this._z * q1._y + this._w * q1._x;\n const y = -this._x * q1._z + this._y * q1._w + this._z * q1._x + this._w * q1._y;\n const z = this._x * q1._y - this._y * q1._x + this._z * q1._w + this._w * q1._z;\n const w = -this._x * q1._x - this._y * q1._y - this._z * q1._z + this._w * q1._w;\n result.copyFromFloats(x, y, z, w);\n return result;\n }\n /**\n * Updates the current quaternion with the multiplication of itself with the given one \"q1\"\n * Example Playground https://playground.babylonjs.com/#L49EJ7#46\n * @param q1 defines the second operand\n * @returns the currentupdated quaternion\n */\n multiplyInPlace(q1) {\n this.multiplyToRef(q1, this);\n return this;\n }\n /**\n * Conjugates the current quaternion and stores the result in the given quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#81\n * @param ref defines the target quaternion\n * @returns result input\n */\n conjugateToRef(ref) {\n ref.copyFromFloats(-this._x, -this._y, -this._z, this._w);\n return ref;\n }\n /**\n * Conjugates in place the current quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#82\n * @returns the current updated quaternion\n */\n conjugateInPlace() {\n this._x *= -1;\n this._y *= -1;\n this._z *= -1;\n this._isDirty = true;\n return this;\n }\n /**\n * Conjugates (1-q) the current quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#83\n * @returns a new quaternion\n */\n conjugate() {\n return new this.constructor(-this._x, -this._y, -this._z, this._w);\n }\n /**\n * Returns the inverse of the current quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#84\n * @returns a new quaternion\n */\n invert() {\n const conjugate = this.conjugate();\n const lengthSquared = this.lengthSquared();\n if (lengthSquared == 0 || lengthSquared == 1) {\n return conjugate;\n }\n conjugate.scaleInPlace(1 / lengthSquared);\n return conjugate;\n }\n /**\n * Invert in place the current quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#85\n * @returns this quaternion\n */\n invertInPlace() {\n this.conjugateInPlace();\n const lengthSquared = this.lengthSquared();\n if (lengthSquared == 0 || lengthSquared == 1) {\n return this;\n }\n this.scaleInPlace(1 / lengthSquared);\n return this;\n }\n /**\n * Gets squared length of current quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#29\n * @returns the quaternion length (float)\n */\n lengthSquared() {\n return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n }\n /**\n * Gets length of current quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#28\n * @returns the quaternion length (float)\n */\n length() {\n return Math.sqrt(this.lengthSquared());\n }\n /**\n * Normalize in place the current quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#54\n * @returns the current updated quaternion\n */\n normalize() {\n const len = this.length();\n if (len === 0) {\n return this;\n }\n const inv = 1.0 / len;\n this.scaleInPlace(inv);\n return this;\n }\n /**\n * Normalize a copy of the current quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#55\n * @returns the normalized quaternion\n */\n normalizeToNew() {\n const len = this.length();\n if (len === 0) {\n return this.clone();\n }\n const inv = 1.0 / len;\n return this.scale(inv);\n }\n /**\n * Returns a new Vector3 set with the Euler angles translated from the current quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#32\n * @returns a new Vector3 containing the Euler angles\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions\n */\n toEulerAngles() {\n const result = Vector3.Zero();\n this.toEulerAnglesToRef(result);\n return result;\n }\n /**\n * Sets the given vector3 \"result\" with the Euler angles translated from the current quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#31\n * @param result defines the vector which will be filled with the Euler angles\n * @returns result input\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/center_origin/rotation_conventions\n */\n toEulerAnglesToRef(result) {\n const qz = this._z;\n const qx = this._x;\n const qy = this._y;\n const qw = this._w;\n const zAxisY = qy * qz - qx * qw;\n const limit = 0.4999999;\n if (zAxisY < -limit) {\n result._y = 2 * Math.atan2(qy, qw);\n result._x = Math.PI / 2;\n result._z = 0;\n result._isDirty = true;\n }\n else if (zAxisY > limit) {\n result._y = 2 * Math.atan2(qy, qw);\n result._x = -Math.PI / 2;\n result._z = 0;\n result._isDirty = true;\n }\n else {\n const sqw = qw * qw;\n const sqz = qz * qz;\n const sqx = qx * qx;\n const sqy = qy * qy;\n result._z = Math.atan2(2.0 * (qx * qy + qz * qw), -sqz - sqx + sqy + sqw);\n result._x = Math.asin(-2.0 * zAxisY);\n result._y = Math.atan2(2.0 * (qz * qx + qy * qw), sqz - sqx - sqy + sqw);\n result._isDirty = true;\n }\n return result;\n }\n /**\n * Updates the given rotation matrix with the current quaternion values\n * Example Playground https://playground.babylonjs.com/#L49EJ7#67\n * @param result defines the target matrix\n * @returns the current unchanged quaternion\n */\n toRotationMatrix(result) {\n Matrix.FromQuaternionToRef(this, result);\n return result;\n }\n /**\n * Updates the current quaternion from the given rotation matrix values\n * Example Playground https://playground.babylonjs.com/#L49EJ7#41\n * @param matrix defines the source matrix\n * @returns the current updated quaternion\n */\n fromRotationMatrix(matrix) {\n Quaternion.FromRotationMatrixToRef(matrix, this);\n return this;\n }\n // Statics\n /**\n * Creates a new quaternion from a rotation matrix\n * Example Playground https://playground.babylonjs.com/#L49EJ7#101\n * @param matrix defines the source matrix\n * @returns a new quaternion created from the given rotation matrix values\n */\n static FromRotationMatrix(matrix) {\n const result = new Quaternion();\n Quaternion.FromRotationMatrixToRef(matrix, result);\n return result;\n }\n /**\n * Updates the given quaternion with the given rotation matrix values\n * Example Playground https://playground.babylonjs.com/#L49EJ7#102\n * @param matrix defines the source matrix\n * @param result defines the target quaternion\n * @returns result input\n */\n static FromRotationMatrixToRef(matrix, result) {\n const data = matrix.m;\n const m11 = data[0], m12 = data[4], m13 = data[8];\n const m21 = data[1], m22 = data[5], m23 = data[9];\n const m31 = data[2], m32 = data[6], m33 = data[10];\n const trace = m11 + m22 + m33;\n let s;\n if (trace > 0) {\n s = 0.5 / Math.sqrt(trace + 1.0);\n result._w = 0.25 / s;\n result._x = (m32 - m23) * s;\n result._y = (m13 - m31) * s;\n result._z = (m21 - m12) * s;\n result._isDirty = true;\n }\n else if (m11 > m22 && m11 > m33) {\n s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n result._w = (m32 - m23) / s;\n result._x = 0.25 * s;\n result._y = (m12 + m21) / s;\n result._z = (m13 + m31) / s;\n result._isDirty = true;\n }\n else if (m22 > m33) {\n s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n result._w = (m13 - m31) / s;\n result._x = (m12 + m21) / s;\n result._y = 0.25 * s;\n result._z = (m23 + m32) / s;\n result._isDirty = true;\n }\n else {\n s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n result._w = (m21 - m12) / s;\n result._x = (m13 + m31) / s;\n result._y = (m23 + m32) / s;\n result._z = 0.25 * s;\n result._isDirty = true;\n }\n return result;\n }\n /**\n * Returns the dot product (float) between the quaternions \"left\" and \"right\"\n * Example Playground https://playground.babylonjs.com/#L49EJ7#61\n * @param left defines the left operand\n * @param right defines the right operand\n * @returns the dot product\n */\n static Dot(left, right) {\n return left._x * right._x + left._y * right._y + left._z * right._z + left._w * right._w;\n }\n /**\n * Checks if the orientations of two rotation quaternions are close to each other\n * Example Playground https://playground.babylonjs.com/#L49EJ7#60\n * @param quat0 defines the first quaternion to check\n * @param quat1 defines the second quaternion to check\n * @param epsilon defines closeness, 0 same orientation, 1 PI apart, default 0.1\n * @returns true if the two quaternions are close to each other within epsilon\n */\n static AreClose(quat0, quat1, epsilon = 0.1) {\n const dot = Quaternion.Dot(quat0, quat1);\n return 1 - dot * dot <= epsilon;\n }\n /**\n * Smooth interpolation between two quaternions using Slerp\n * Example Playground https://playground.babylonjs.com/#L49EJ7#93\n * @param source source quaternion\n * @param goal goal quaternion\n * @param deltaTime current interpolation frame\n * @param lerpTime total interpolation time\n * @param result the smoothed quaternion\n */\n static SmoothToRef(source, goal, deltaTime, lerpTime, result) {\n let slerp = lerpTime === 0 ? 1 : deltaTime / lerpTime;\n slerp = Scalar.Clamp(slerp, 0, 1);\n Quaternion.SlerpToRef(source, goal, slerp, result);\n return result;\n }\n /**\n * Creates an empty quaternion\n * @returns a new quaternion set to (0.0, 0.0, 0.0)\n */\n static Zero() {\n return new Quaternion(0.0, 0.0, 0.0, 0.0);\n }\n /**\n * Inverse a given quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#103\n * @param q defines the source quaternion\n * @returns a new quaternion as the inverted current quaternion\n */\n static Inverse(q) {\n return new q.constructor(-q._x, -q._y, -q._z, q._w);\n }\n /**\n * Inverse a given quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#104\n * @param q defines the source quaternion\n * @param result the quaternion the result will be stored in\n * @returns the result quaternion\n */\n static InverseToRef(q, result) {\n result.set(-q._x, -q._y, -q._z, q._w);\n return result;\n }\n /**\n * Creates an identity quaternion\n * @returns the identity quaternion\n */\n static Identity() {\n return new Quaternion(0.0, 0.0, 0.0, 1.0);\n }\n /**\n * Gets a boolean indicating if the given quaternion is identity\n * @param quaternion defines the quaternion to check\n * @returns true if the quaternion is identity\n */\n static IsIdentity(quaternion) {\n return quaternion && quaternion._x === 0 && quaternion._y === 0 && quaternion._z === 0 && quaternion._w === 1;\n }\n /**\n * Creates a quaternion from a rotation around an axis\n * Example Playground https://playground.babylonjs.com/#L49EJ7#72\n * @param axis defines the axis to use\n * @param angle defines the angle to use\n * @returns a new quaternion created from the given axis (Vector3) and angle in radians (float)\n */\n static RotationAxis(axis, angle) {\n return Quaternion.RotationAxisToRef(axis, angle, new Quaternion());\n }\n /**\n * Creates a rotation around an axis and stores it into the given quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#73\n * @param axis defines the axis to use\n * @param angle defines the angle to use\n * @param result defines the target quaternion\n * @returns the target quaternion\n */\n static RotationAxisToRef(axis, angle, result) {\n const sin = Math.sin(angle / 2);\n axis.normalize();\n result._w = Math.cos(angle / 2);\n result._x = axis._x * sin;\n result._y = axis._y * sin;\n result._z = axis._z * sin;\n result._isDirty = true;\n return result;\n }\n /**\n * Creates a new quaternion from data stored into an array\n * Example Playground https://playground.babylonjs.com/#L49EJ7#63\n * @param array defines the data source\n * @param offset defines the offset in the source array where the data starts\n * @returns a new quaternion\n */\n static FromArray(array, offset) {\n if (!offset) {\n offset = 0;\n }\n return new Quaternion(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);\n }\n /**\n * Updates the given quaternion \"result\" from the starting index of the given array.\n * Example Playground https://playground.babylonjs.com/#L49EJ7#64\n * @param array the array to pull values from\n * @param offset the offset into the array to start at\n * @param result the quaternion to store the result in\n * @returns result input\n */\n static FromArrayToRef(array, offset, result) {\n result._x = array[offset];\n result._y = array[offset + 1];\n result._z = array[offset + 2];\n result._w = array[offset + 3];\n result._isDirty = true;\n return result;\n }\n /**\n * Create a quaternion from Euler rotation angles\n * Example Playground https://playground.babylonjs.com/#L49EJ7#33\n * @param x Pitch\n * @param y Yaw\n * @param z Roll\n * @returns the new Quaternion\n */\n static FromEulerAngles(x, y, z) {\n const q = new Quaternion();\n Quaternion.RotationYawPitchRollToRef(y, x, z, q);\n return q;\n }\n /**\n * Updates a quaternion from Euler rotation angles\n * Example Playground https://playground.babylonjs.com/#L49EJ7#34\n * @param x Pitch\n * @param y Yaw\n * @param z Roll\n * @param result the quaternion to store the result\n * @returns the updated quaternion\n */\n static FromEulerAnglesToRef(x, y, z, result) {\n Quaternion.RotationYawPitchRollToRef(y, x, z, result);\n return result;\n }\n /**\n * Create a quaternion from Euler rotation vector\n * Example Playground https://playground.babylonjs.com/#L49EJ7#35\n * @param vec the Euler vector (x Pitch, y Yaw, z Roll)\n * @returns the new Quaternion\n */\n static FromEulerVector(vec) {\n const q = new Quaternion();\n Quaternion.RotationYawPitchRollToRef(vec._y, vec._x, vec._z, q);\n return q;\n }\n /**\n * Updates a quaternion from Euler rotation vector\n * Example Playground https://playground.babylonjs.com/#L49EJ7#36\n * @param vec the Euler vector (x Pitch, y Yaw, z Roll)\n * @param result the quaternion to store the result\n * @returns the updated quaternion\n */\n static FromEulerVectorToRef(vec, result) {\n Quaternion.RotationYawPitchRollToRef(vec._y, vec._x, vec._z, result);\n return result;\n }\n /**\n * Updates a quaternion so that it rotates vector vecFrom to vector vecTo\n * Example Playground - https://playground.babylonjs.com/#L49EJ7#70\n * @param vecFrom defines the direction vector from which to rotate\n * @param vecTo defines the direction vector to which to rotate\n * @param result the quaternion to store the result\n * @param epsilon defines the minimal dot value to define vecs as opposite. Default: `BABYLON.Epsilon`\n * @returns the updated quaternion\n */\n static FromUnitVectorsToRef(vecFrom, vecTo, result, epsilon = Epsilon) {\n const r = Vector3.Dot(vecFrom, vecTo) + 1;\n if (r < epsilon) {\n if (Math.abs(vecFrom.x) > Math.abs(vecFrom.z)) {\n result.set(-vecFrom.y, vecFrom.x, 0, 0);\n }\n else {\n result.set(0, -vecFrom.z, vecFrom.y, 0);\n }\n }\n else {\n Vector3.CrossToRef(vecFrom, vecTo, TmpVectors.Vector3[0]);\n result.set(TmpVectors.Vector3[0].x, TmpVectors.Vector3[0].y, TmpVectors.Vector3[0].z, r);\n }\n return result.normalize();\n }\n /**\n * Creates a new quaternion from the given Euler float angles (y, x, z)\n * Example Playground https://playground.babylonjs.com/#L49EJ7#77\n * @param yaw defines the rotation around Y axis\n * @param pitch defines the rotation around X axis\n * @param roll defines the rotation around Z axis\n * @returns the new quaternion\n */\n static RotationYawPitchRoll(yaw, pitch, roll) {\n const q = new Quaternion();\n Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, q);\n return q;\n }\n /**\n * Creates a new rotation from the given Euler float angles (y, x, z) and stores it in the target quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#78\n * @param yaw defines the rotation around Y axis\n * @param pitch defines the rotation around X axis\n * @param roll defines the rotation around Z axis\n * @param result defines the target quaternion\n * @returns result input\n */\n static RotationYawPitchRollToRef(yaw, pitch, roll, result) {\n // Produces a quaternion from Euler angles in the z-y-x orientation (Tait-Bryan angles)\n const halfRoll = roll * 0.5;\n const halfPitch = pitch * 0.5;\n const halfYaw = yaw * 0.5;\n const sinRoll = Math.sin(halfRoll);\n const cosRoll = Math.cos(halfRoll);\n const sinPitch = Math.sin(halfPitch);\n const cosPitch = Math.cos(halfPitch);\n const sinYaw = Math.sin(halfYaw);\n const cosYaw = Math.cos(halfYaw);\n result._x = cosYaw * sinPitch * cosRoll + sinYaw * cosPitch * sinRoll;\n result._y = sinYaw * cosPitch * cosRoll - cosYaw * sinPitch * sinRoll;\n result._z = cosYaw * cosPitch * sinRoll - sinYaw * sinPitch * cosRoll;\n result._w = cosYaw * cosPitch * cosRoll + sinYaw * sinPitch * sinRoll;\n result._isDirty = true;\n return result;\n }\n /**\n * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation\n * Example Playground https://playground.babylonjs.com/#L49EJ7#68\n * @param alpha defines the rotation around first axis\n * @param beta defines the rotation around second axis\n * @param gamma defines the rotation around third axis\n * @returns the new quaternion\n */\n static RotationAlphaBetaGamma(alpha, beta, gamma) {\n const result = new Quaternion();\n Quaternion.RotationAlphaBetaGammaToRef(alpha, beta, gamma, result);\n return result;\n }\n /**\n * Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation and stores it in the target quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#69\n * @param alpha defines the rotation around first axis\n * @param beta defines the rotation around second axis\n * @param gamma defines the rotation around third axis\n * @param result defines the target quaternion\n * @returns result input\n */\n static RotationAlphaBetaGammaToRef(alpha, beta, gamma, result) {\n // Produces a quaternion from Euler angles in the z-x-z orientation\n const halfGammaPlusAlpha = (gamma + alpha) * 0.5;\n const halfGammaMinusAlpha = (gamma - alpha) * 0.5;\n const halfBeta = beta * 0.5;\n result._x = Math.cos(halfGammaMinusAlpha) * Math.sin(halfBeta);\n result._y = Math.sin(halfGammaMinusAlpha) * Math.sin(halfBeta);\n result._z = Math.sin(halfGammaPlusAlpha) * Math.cos(halfBeta);\n result._w = Math.cos(halfGammaPlusAlpha) * Math.cos(halfBeta);\n result._isDirty = true;\n return result;\n }\n /**\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)\n * Example Playground https://playground.babylonjs.com/#L49EJ7#75\n * @param axis1 defines the first axis\n * @param axis2 defines the second axis\n * @param axis3 defines the third axis\n * @returns the new quaternion\n */\n static RotationQuaternionFromAxis(axis1, axis2, axis3) {\n const quat = new Quaternion(0.0, 0.0, 0.0, 0.0);\n Quaternion.RotationQuaternionFromAxisToRef(axis1, axis2, axis3, quat);\n return quat;\n }\n /**\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\n * Example Playground https://playground.babylonjs.com/#L49EJ7#76\n * @param axis1 defines the first axis\n * @param axis2 defines the second axis\n * @param axis3 defines the third axis\n * @param ref defines the target quaternion\n * @returns result input\n */\n static RotationQuaternionFromAxisToRef(axis1, axis2, axis3, ref) {\n const rotMat = MathTmp.Matrix[0];\n Matrix.FromXYZAxesToRef(axis1.normalize(), axis2.normalize(), axis3.normalize(), rotMat);\n Quaternion.FromRotationMatrixToRef(rotMat, ref);\n return ref;\n }\n /**\n * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like \"up\".\n * This function works in left handed mode\n * Example Playground https://playground.babylonjs.com/#L49EJ7#96\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\n * @returns A new quaternion oriented toward the specified forward and up.\n */\n static FromLookDirectionLH(forward, up) {\n const quat = new Quaternion();\n Quaternion.FromLookDirectionLHToRef(forward, up, quat);\n return quat;\n }\n /**\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.\n * This function works in left handed mode\n * Example Playground https://playground.babylonjs.com/#L49EJ7#97\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\n * @param ref defines the target quaternion.\n * @returns result input\n */\n static FromLookDirectionLHToRef(forward, up, ref) {\n const rotMat = MathTmp.Matrix[0];\n Matrix.LookDirectionLHToRef(forward, up, rotMat);\n Quaternion.FromRotationMatrixToRef(rotMat, ref);\n return ref;\n }\n /**\n * Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like \"up\".\n * This function works in right handed mode\n * Example Playground https://playground.babylonjs.com/#L49EJ7#98\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\n * @returns A new quaternion oriented toward the specified forward and up.\n */\n static FromLookDirectionRH(forward, up) {\n const quat = new Quaternion();\n Quaternion.FromLookDirectionRHToRef(forward, up, quat);\n return quat;\n }\n /**\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.\n * This function works in right handed mode\n * Example Playground https://playground.babylonjs.com/#L49EJ7#105\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\n * @param ref defines the target quaternion.\n * @returns result input\n */\n static FromLookDirectionRHToRef(forward, up, ref) {\n const rotMat = MathTmp.Matrix[0];\n Matrix.LookDirectionRHToRef(forward, up, rotMat);\n return Quaternion.FromRotationMatrixToRef(rotMat, ref);\n }\n /**\n * Interpolates between two quaternions\n * Example Playground https://playground.babylonjs.com/#L49EJ7#79\n * @param left defines first quaternion\n * @param right defines second quaternion\n * @param amount defines the gradient to use\n * @returns the new interpolated quaternion\n */\n static Slerp(left, right, amount) {\n const result = Quaternion.Identity();\n Quaternion.SlerpToRef(left, right, amount, result);\n return result;\n }\n /**\n * Interpolates between two quaternions and stores it into a target quaternion\n * Example Playground https://playground.babylonjs.com/#L49EJ7#92\n * @param left defines first quaternion\n * @param right defines second quaternion\n * @param amount defines the gradient to use\n * @param result defines the target quaternion\n * @returns result input\n */\n static SlerpToRef(left, right, amount, result) {\n let num2;\n let num3;\n let num4 = left._x * right._x + left._y * right._y + left._z * right._z + left._w * right._w;\n let flag = false;\n if (num4 < 0) {\n flag = true;\n num4 = -num4;\n }\n if (num4 > 0.999999) {\n num3 = 1 - amount;\n num2 = flag ? -amount : amount;\n }\n else {\n const num5 = Math.acos(num4);\n const num6 = 1.0 / Math.sin(num5);\n num3 = Math.sin((1.0 - amount) * num5) * num6;\n num2 = flag ? -Math.sin(amount * num5) * num6 : Math.sin(amount * num5) * num6;\n }\n result._x = num3 * left._x + num2 * right._x;\n result._y = num3 * left._y + num2 * right._y;\n result._z = num3 * left._z + num2 * right._z;\n result._w = num3 * left._w + num2 * right._w;\n result._isDirty = true;\n return result;\n }\n /**\n * Interpolate between two quaternions using Hermite interpolation\n * Example Playground https://playground.babylonjs.com/#L49EJ7#47\n * @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/drawCurves#hermite-quaternion-spline\n * @param value1 defines first quaternion\n * @param tangent1 defines the incoming tangent\n * @param value2 defines second quaternion\n * @param tangent2 defines the outgoing tangent\n * @param amount defines the target quaternion\n * @returns the new interpolated quaternion\n */\n static Hermite(value1, tangent1, value2, tangent2, amount) {\n const squared = amount * amount;\n const cubed = amount * squared;\n const part1 = 2.0 * cubed - 3.0 * squared + 1.0;\n const part2 = -2.0 * cubed + 3.0 * squared;\n const part3 = cubed - 2.0 * squared + amount;\n const part4 = cubed - squared;\n const x = value1._x * part1 + value2._x * part2 + tangent1._x * part3 + tangent2._x * part4;\n const y = value1._y * part1 + value2._y * part2 + tangent1._y * part3 + tangent2._y * part4;\n const z = value1._z * part1 + value2._z * part2 + tangent1._z * part3 + tangent2._z * part4;\n const w = value1._w * part1 + value2._w * part2 + tangent1._w * part3 + tangent2._w * part4;\n return new value1.constructor(x, y, z, w);\n }\n /**\n * Returns a new Quaternion which is the 1st derivative of the Hermite spline defined by the quaternions \"value1\", \"value2\", \"tangent1\", \"tangent2\".\n * Example Playground https://playground.babylonjs.com/#L49EJ7#48\n * @param value1 defines the first control point\n * @param tangent1 defines the first tangent\n * @param value2 defines the second control point\n * @param tangent2 defines the second tangent\n * @param time define where the derivative must be done\n * @returns 1st derivative\n */\n static Hermite1stDerivative(value1, tangent1, value2, tangent2, time) {\n const result = new value1.constructor();\n this.Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result);\n return result;\n }\n /**\n * Update a Quaternion with the 1st derivative of the Hermite spline defined by the quaternions \"value1\", \"value2\", \"tangent1\", \"tangent2\".\n * Example Playground https://playground.babylonjs.com/#L49EJ7#49\n * @param value1 defines the first control point\n * @param tangent1 defines the first tangent\n * @param value2 defines the second control point\n * @param tangent2 defines the second tangent\n * @param time define where the derivative must be done\n * @param result define where to store the derivative\n * @returns result input\n */\n static Hermite1stDerivativeToRef(value1, tangent1, value2, tangent2, time, result) {\n const t2 = time * time;\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;\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;\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;\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;\n result._isDirty = true;\n return result;\n }\n}\n/**\n * Class used to store matrix data (4x4)\n * Note on matrix definitions in Babylon.js for setting values directly\n * rather than using one of the methods available.\n * Matrix size is given by rows x columns.\n * A Vector3 is a 1 X 3 matrix [x, y, z].\n *\n * In Babylon.js multiplying a 1 x 3 matrix by a 4 x 4 matrix\n * is done using BABYLON.Vector4.TransformCoordinates(Vector3, Matrix).\n * and extending the passed Vector3 to a Vector4, V = [x, y, z, 1].\n * Let M be a matrix with elements m(row, column), so that\n * m(2, 3) is the element in row 2 column 3 of M.\n *\n * Multiplication is of the form VM and has the resulting Vector4\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)].\n * On the web you will find many examples that use the opposite convention of MV,\n * in which case to make use of the examples you will need to transpose the matrix.\n *\n * Example Playground - Overview Linear Algebra - https://playground.babylonjs.com/#AV9X17\n * Example Playground - Overview Transformation - https://playground.babylonjs.com/#AV9X17#1\n * Example Playground - Overview Projection - https://playground.babylonjs.com/#AV9X17#2\n */\nexport class Matrix {\n /**\n * Gets the precision of matrix computations\n */\n static get Use64Bits() {\n return PerformanceConfigurator.MatrixUse64Bits;\n }\n /**\n * Gets the internal data of the matrix\n */\n get m() {\n return this._m;\n }\n /**\n * Update the updateFlag to indicate that the matrix has been updated\n */\n markAsUpdated() {\n this.updateFlag = Matrix._UpdateFlagSeed++;\n this._isIdentity = false;\n this._isIdentity3x2 = false;\n this._isIdentityDirty = true;\n this._isIdentity3x2Dirty = true;\n }\n _updateIdentityStatus(isIdentity, isIdentityDirty = false, isIdentity3x2 = false, isIdentity3x2Dirty = true) {\n this._isIdentity = isIdentity;\n this._isIdentity3x2 = isIdentity || isIdentity3x2;\n this._isIdentityDirty = this._isIdentity ? false : isIdentityDirty;\n this._isIdentity3x2Dirty = this._isIdentity3x2 ? false : isIdentity3x2Dirty;\n }\n /**\n * Creates an empty matrix (filled with zeros)\n */\n constructor() {\n this._isIdentity = false;\n this._isIdentityDirty = true;\n this._isIdentity3x2 = true;\n this._isIdentity3x2Dirty = true;\n /**\n * Gets the update flag of the matrix which is an unique number for the matrix.\n * It will be incremented every time the matrix data change.\n * You can use it to speed the comparison between two versions of the same matrix.\n */\n this.updateFlag = -1;\n if (PerformanceConfigurator.MatrixTrackPrecisionChange) {\n PerformanceConfigurator.MatrixTrackedMatrices.push(this);\n }\n this._m = new PerformanceConfigurator.MatrixCurrentType(16);\n this.markAsUpdated();\n }\n // Properties\n /**\n * Check if the current matrix is identity\n * @returns true is the matrix is the identity matrix\n */\n isIdentity() {\n if (this._isIdentityDirty) {\n this._isIdentityDirty = false;\n const m = this._m;\n this._isIdentity =\n m[0] === 1.0 &&\n m[1] === 0.0 &&\n m[2] === 0.0 &&\n m[3] === 0.0 &&\n m[4] === 0.0 &&\n m[5] === 1.0 &&\n m[6] === 0.0 &&\n m[7] === 0.0 &&\n m[8] === 0.0 &&\n m[9] === 0.0 &&\n m[10] === 1.0 &&\n m[11] === 0.0 &&\n m[12] === 0.0 &&\n m[13] === 0.0 &&\n m[14] === 0.0 &&\n m[15] === 1.0;\n }\n return this._isIdentity;\n }\n /**\n * Check if the current matrix is identity as a texture matrix (3x2 store in 4x4)\n * @returns true is the matrix is the identity matrix\n */\n isIdentityAs3x2() {\n if (this._isIdentity3x2Dirty) {\n this._isIdentity3x2Dirty = false;\n if (this._m[0] !== 1.0 || this._m[5] !== 1.0 || this._m[15] !== 1.0) {\n this._isIdentity3x2 = false;\n }\n else if (this._m[1] !== 0.0 ||\n this._m[2] !== 0.0 ||\n this._m[3] !== 0.0 ||\n this._m[4] !== 0.0 ||\n this._m[6] !== 0.0 ||\n this._m[7] !== 0.0 ||\n this._m[8] !== 0.0 ||\n this._m[9] !== 0.0 ||\n this._m[10] !== 0.0 ||\n this._m[11] !== 0.0 ||\n this._m[12] !== 0.0 ||\n this._m[13] !== 0.0 ||\n this._m[14] !== 0.0) {\n this._isIdentity3x2 = false;\n }\n else {\n this._isIdentity3x2 = true;\n }\n }\n return this._isIdentity3x2;\n }\n /**\n * Gets the determinant of the matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#34\n * @returns the matrix determinant\n */\n determinant() {\n if (this._isIdentity === true) {\n return 1;\n }\n const m = this._m;\n const m00 = m[0], m01 = m[1], m02 = m[2], m03 = m[3];\n const m10 = m[4], m11 = m[5], m12 = m[6], m13 = m[7];\n const m20 = m[8], m21 = m[9], m22 = m[10], m23 = m[11];\n const m30 = m[12], m31 = m[13], m32 = m[14], m33 = m[15];\n // https://en.wikipedia.org/wiki/Laplace_expansion\n // to compute the deterrminant of a 4x4 Matrix we compute the cofactors of any row or column,\n // then we multiply each Cofactor by its corresponding matrix value and sum them all to get the determinant\n // Cofactor(i, j) = sign(i,j) * det(Minor(i, j))\n // where\n // - sign(i,j) = (i+j) % 2 === 0 ? 1 : -1\n // - Minor(i, j) is the 3x3 matrix we get by removing row i and column j from current Matrix\n //\n // Here we do that for the 1st row.\n const det_22_33 = m22 * m33 - m32 * m23;\n const det_21_33 = m21 * m33 - m31 * m23;\n const det_21_32 = m21 * m32 - m31 * m22;\n const det_20_33 = m20 * m33 - m30 * m23;\n const det_20_32 = m20 * m32 - m22 * m30;\n const det_20_31 = m20 * m31 - m30 * m21;\n const cofact_00 = +(m11 * det_22_33 - m12 * det_21_33 + m13 * det_21_32);\n const cofact_01 = -(m10 * det_22_33 - m12 * det_20_33 + m13 * det_20_32);\n const cofact_02 = +(m10 * det_21_33 - m11 * det_20_33 + m13 * det_20_31);\n const cofact_03 = -(m10 * det_21_32 - m11 * det_20_32 + m12 * det_20_31);\n return m00 * cofact_00 + m01 * cofact_01 + m02 * cofact_02 + m03 * cofact_03;\n }\n // Methods\n /**\n * Returns the matrix as a Float32Array or Array<number>\n * Example Playground - https://playground.babylonjs.com/#AV9X17#49\n * @returns the matrix underlying array\n */\n toArray() {\n return this._m;\n }\n /**\n * Returns the matrix as a Float32Array or Array<number>\n * Example Playground - https://playground.babylonjs.com/#AV9X17#114\n * @returns the matrix underlying array.\n */\n asArray() {\n return this._m;\n }\n /**\n * Inverts the current matrix in place\n * Example Playground - https://playground.babylonjs.com/#AV9X17#118\n * @returns the current inverted matrix\n */\n invert() {\n this.invertToRef(this);\n return this;\n }\n /**\n * Sets all the matrix elements to zero\n * @returns the current matrix\n */\n reset() {\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);\n this._updateIdentityStatus(false);\n return this;\n }\n /**\n * Adds the current matrix with a second one\n * Example Playground - https://playground.babylonjs.com/#AV9X17#44\n * @param other defines the matrix to add\n * @returns a new matrix as the addition of the current matrix and the given one\n */\n add(other) {\n const result = new this.constructor();\n this.addToRef(other, result);\n return result;\n }\n /**\n * Sets the given matrix \"result\" to the addition of the current matrix and the given one\n * Example Playground - https://playground.babylonjs.com/#AV9X17#45\n * @param other defines the matrix to add\n * @param result defines the target matrix\n * @returns result input\n */\n addToRef(other, result) {\n const m = this._m;\n const resultM = result._m;\n const otherM = other.m;\n for (let index = 0; index < 16; index++) {\n resultM[index] = m[index] + otherM[index];\n }\n result.markAsUpdated();\n return result;\n }\n /**\n * Adds in place the given matrix to the current matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#46\n * @param other defines the second operand\n * @returns the current updated matrix\n */\n addToSelf(other) {\n const m = this._m;\n const otherM = other.m;\n for (let index = 0; index < 16; index++) {\n m[index] += otherM[index];\n }\n this.markAsUpdated();\n return this;\n }\n /**\n * Sets the given matrix to the current inverted Matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#119\n * @param other defines the target matrix\n * @returns result input\n */\n invertToRef(other) {\n if (this._isIdentity === true) {\n Matrix.IdentityToRef(other);\n return other;\n }\n // the inverse of a Matrix is the transpose of cofactor matrix divided by the determinant\n const m = this._m;\n const m00 = m[0], m01 = m[1], m02 = m[2], m03 = m[3];\n const m10 = m[4], m11 = m[5], m12 = m[6], m13 = m[7];\n const m20 = m[8], m21 = m[9], m22 = m[10], m23 = m[11];\n const m30 = m[12], m31 = m[13], m32 = m[14], m33 = m[15];\n const det_22_33 = m22 * m33 - m32 * m23;\n const det_21_33 = m21 * m33 - m31 * m23;\n const det_21_32 = m21 * m32 - m31 * m22;\n const det_20_33 = m20 * m33 - m30 * m23;\n const det_20_32 = m20 * m32 - m22 * m30;\n const det_20_31 = m20 * m31 - m30 * m21;\n const cofact_00 = +(m11 * det_22_33 - m12 * det_21_33 + m13 * det_21_32);\n const cofact_01 = -(m10 * det_22_33 - m12 * det_20_33 + m13 * det_20_32);\n const cofact_02 = +(m10 * det_21_33 - m11 * det_20_33 + m13 * det_20_31);\n const cofact_03 = -(m10 * det_21_32 - m11 * det_20_32 + m12 * det_20_31);\n const det = m00 * cofact_00 + m01 * cofact_01 + m02 * cofact_02 + m03 * cofact_03;\n if (det === 0) {\n // not invertible\n other.copyFrom(this);\n return other;\n }\n const detInv = 1 / det;\n const det_12_33 = m12 * m33 - m32 * m13;\n const det_11_33 = m11 * m33 - m31 * m13;\n const det_11_32 = m11 * m32 - m31 * m12;\n const det_10_33 = m10 * m33 - m30 * m13;\n const det_10_32 = m10 * m32 - m30 * m12;\n const det_10_31 = m10 * m31 - m30 * m11;\n const det_12_23 = m12 * m23 - m22 * m13;\n const det_11_23 = m11 * m23 - m21 * m13;\n const det_11_22 = m11 * m22 - m21 * m12;\n const det_10_23 = m10 * m23 - m20 * m13;\n const det_10_22 = m10 * m22 - m20 * m12;\n const det_10_21 = m10 * m21 - m20 * m11;\n const cofact_10 = -(m01 * det_22_33 - m02 * det_21_33 + m03 * det_21_32);\n const cofact_11 = +(m00 * det_22_33 - m02 * det_20_33 + m03 * det_20_32);\n const cofact_12 = -(m00 * det_21_33 - m01 * det_20_33 + m03 * det_20_31);\n const cofact_13 = +(m00 * det_21_32 - m01 * det_20_32 + m02 * det_20_31);\n const cofact_20 = +(m01 * det_12_33 - m02 * det_11_33 + m03 * det_11_32);\n const cofact_21 = -(m00 * det_12_33 - m02 * det_10_33 + m03 * det_10_32);\n const cofact_22 = +(m00 * det_11_33 - m01 * det_10_33 + m03 * det_10_31);\n const cofact_23 = -(m00 * det_11_32 - m01 * det_10_32 + m02 * det_10_31);\n const cofact_30 = -(m01 * det_12_23 - m02 * det_11_23 + m03 * det_11_22);\n const cofact_31 = +(m00 * det_12_23 - m02 * det_10_23 + m03 * det_10_22);\n const cofact_32 = -(m00 * det_11_23 - m01 * det_10_23 + m03 * det_10_21);\n const cofact_33 = +(m00 * det_11_22 - m01 * det_10_22 + m02 * det_10_21);\n Matrix.FromValuesToRef(cofact_00 * detInv, cofact_10 * detInv, cofact_20 * detInv, cofact_30 * detInv, cofact_01 * detInv, cofact_11 * detInv, cofact_21 * detInv, cofact_31 * detInv, cofact_02 * detInv, cofact_12 * detInv, cofact_22 * detInv, cofact_32 * detInv, cofact_03 * detInv, cofact_13 * detInv, cofact_23 * detInv, cofact_33 * detInv, other);\n return other;\n }\n /**\n * add a value at the specified position in the current Matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#47\n * @param index the index of the value within the matrix. between 0 and 15.\n * @param value the value to be added\n * @returns the current updated matrix\n */\n addAtIndex(index, value) {\n this._m[index] += value;\n this.markAsUpdated();\n return this;\n }\n /**\n * mutiply the specified position in the current Matrix by a value\n * @param index the index of the value within the matrix. between 0 and 15.\n * @param value the value to be added\n * @returns the current updated matrix\n */\n multiplyAtIndex(index, value) {\n this._m[index] *= value;\n this.markAsUpdated();\n return this;\n }\n /**\n * Inserts the translation vector (using 3 floats) in the current matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#120\n * @param x defines the 1st component of the translation\n * @param y defines the 2nd component of the translation\n * @param z defines the 3rd component of the translation\n * @returns the current updated matrix\n */\n setTranslationFromFloats(x, y, z) {\n this._m[12] = x;\n this._m[13] = y;\n this._m[14] = z;\n this.markAsUpdated();\n return this;\n }\n /**\n * Adds the translation vector (using 3 floats) in the current matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#20\n * Example Playground - https://playground.babylonjs.com/#AV9X17#48\n * @param x defines the 1st component of the translation\n * @param y defines the 2nd component of the translation\n * @param z defines the 3rd component of the translation\n * @returns the current updated matrix\n */\n addTranslationFromFloats(x, y, z) {\n this._m[12] += x;\n this._m[13] += y;\n this._m[14] += z;\n this.markAsUpdated();\n return this;\n }\n /**\n * Inserts the translation vector in the current matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#121\n * @param vector3 defines the translation to insert\n * @returns the current updated matrix\n */\n setTranslation(vector3) {\n return this.setTranslationFromFloats(vector3._x, vector3._y, vector3._z);\n }\n /**\n * Gets the translation value of the current matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#122\n * @returns a new Vector3 as the extracted translation from the matrix\n */\n getTranslation() {\n return new Vector3(this._m[12], this._m[13], this._m[14]);\n }\n /**\n * Fill a Vector3 with the extracted translation from the matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#123\n * @param result defines the Vector3 where to store the translation\n * @returns the current matrix\n */\n getTranslationToRef(result) {\n result.x = this._m[12];\n result.y = this._m[13];\n result.z = this._m[14];\n return result;\n }\n /**\n * Remove rotation and scaling part from the matrix\n * @returns the updated matrix\n */\n removeRotationAndScaling() {\n const m = this.m;\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);\n this._updateIdentityStatus(m[12] === 0 && m[13] === 0 && m[14] === 0 && m[15] === 1);\n return this;\n }\n /**\n * Multiply two matrices\n * Example Playground - https://playground.babylonjs.com/#AV9X17#15\n * A.multiply(B) means apply B to A so result is B x A\n * @param other defines the second operand\n * @returns a new matrix set with the multiplication result of the current Matrix and the given one\n */\n multiply(other) {\n const result = new this.constructor();\n this.multiplyToRef(other, result);\n return result;\n }\n /**\n * Copy the current matrix from the given one\n * Example Playground - https://playground.babylonjs.com/#AV9X17#21\n * @param other defines the source matrix\n * @returns the current updated matrix\n */\n copyFrom(other) {\n other.copyToArray(this._m);\n const o = other;\n this.updateFlag = o.updateFlag;\n this._updateIdentityStatus(o._isIdentity, o._isIdentityDirty, o._isIdentity3x2, o._isIdentity3x2Dirty);\n return this;\n }\n /**\n * Populates the given array from the starting index with the current matrix values\n * @param array defines the target array\n * @param offset defines the offset in the target array where to start storing values\n * @returns the current matrix\n */\n copyToArray(array, offset = 0) {\n const source = this._m;\n array[offset] = source[0];\n array[offset + 1] = source[1];\n array[offset + 2] = source[2];\n array[offset + 3] = source[3];\n array[offset + 4] = source[4];\n array[offset + 5] = source[5];\n array[offset + 6] = source[6];\n array[offset + 7] = source[7];\n array[offset + 8] = source[8];\n array[offset + 9] = source[9];\n array[offset + 10] = source[10];\n array[offset + 11] = source[11];\n array[offset + 12] = source[12];\n array[offset + 13] = source[13];\n array[offset + 14] = source[14];\n array[offset + 15] = source[15];\n return this;\n }\n /**\n * Sets the given matrix \"result\" with the multiplication result of the current Matrix and the given one\n * A.multiplyToRef(B, R) means apply B to A and store in R and R = B x A\n * Example Playground - https://playground.babylonjs.com/#AV9X17#16\n * @param other defines the second operand\n * @param result defines the matrix where to store the multiplication\n * @returns result input\n */\n multiplyToRef(other, result) {\n if (this._isIdentity) {\n result.copyFrom(other);\n return result;\n }\n if (other._isIdentity) {\n result.copyFrom(this);\n return result;\n }\n this.multiplyToArray(other, result._m, 0);\n result.markAsUpdated();\n return result;\n }\n /**\n * Sets the Float32Array \"result\" from the given index \"offset\" with the multiplication of the current matrix and the given one\n * @param other defines the second operand\n * @param result defines the array where to store the multiplication\n * @param offset defines the offset in the target array where to start storing values\n * @returns the current matrix\n */\n multiplyToArray(other, result, offset) {\n const m = this._m;\n const otherM = other.m;\n const tm0 = m[0], tm1 = m[1], tm2 = m[2], tm3 = m[3];\n const tm4 = m[4], tm5 = m[5], tm6 = m[6], tm7 = m[7];\n const tm8 = m[8], tm9 = m[9], tm10 = m[10], tm11 = m[11];\n const tm12 = m[12], tm13 = m[13], tm14 = m[14], tm15 = m[15];\n const om0 = otherM[0], om1 = otherM[1], om2 = otherM[2], om3 = otherM[3];\n const om4 = otherM[4], om5 = otherM[5], om6 = otherM[6], om7 = otherM[7];\n const om8 = otherM[8], om9 = otherM[9], om10 = otherM[10], om11 = otherM[11];\n const om12 = otherM[12], om13 = otherM[13], om14 = otherM[14], om15 = otherM[15];\n result[offset] = tm0 * om0 + tm1 * om4 + tm2 * om8 + tm3 * om12;\n result[offset + 1] = tm0 * om1 + tm1 * om5 + tm2 * om9 + tm3 * om13;\n result[offset + 2] = tm0 * om2 + tm1 * om6 + tm2 * om10 + tm3 * om14;\n result[offset + 3] = tm0 * om3 + tm1 * om7 + tm2 * om11 + tm3 * om15;\n result[offset + 4] = tm4 * om0 + tm5 * om4 + tm6 * om8 + tm7 * om12;\n result[offset + 5] = tm4 * om1 + tm5 * om5 + tm6 * om9 + tm7 * om13;\n result[offset + 6] = tm4 * om2 + tm5 * om6 + tm6 * om10 + tm7 * om14;\n result[offset + 7] = tm4 * om3 + tm5 * om7 + tm6 * om11 + tm7 * om15;\n result[offset + 8] = tm8 * om0 + tm9 * om4 + tm10 * om8 + tm11 * om12;\n result[offset + 9] = tm8 * om1 + tm9 * om5 + tm10 * om9 + tm11 * om13;\n result[offset + 10] = tm8 * om2 + tm9 * om6 + tm10 * om10 + tm11 * om14;\n result[offset + 11] = tm8 * om3 + tm9 * om7 + tm10 * om11 + tm11 * om15;\n result[offset + 12] = tm12 * om0 + tm13 * om4 + tm14 * om8 + tm15 * om12;\n result[offset + 13] = tm12 * om1 + tm13 * om5 + tm14 * om9 + tm15 * om13;\n result[offset + 14] = tm12 * om2 + tm13 * om6 + tm14 * om10 + tm15 * om14;\n result[offset + 15] = tm12 * om3 + tm13 * om7 + tm14 * om11 + tm15 * om15;\n return this;\n }\n /**\n * Check equality between this matrix and a second one\n * @param value defines the second matrix to compare\n * @returns true is the current matrix and the given one values are strictly equal\n */\n equals(value) {\n const other = value;\n if (!other) {\n return false;\n }\n if (this._isIdentity || other._isIdentity) {\n if (!this._isIdentityDirty && !other._isIdentityDirty) {\n return this._isIdentity && other._isIdentity;\n }\n }\n const m = this.m;\n const om = other.m;\n return (m[0] === om[0] &&\n m[1] === om[1] &&\n m[2] === om[2] &&\n m[3] === om[3] &&\n m[4] === om[4] &&\n m[5] === om[5] &&\n m[6] === om[6] &&\n m[7] === om[7] &&\n m[8] === om[8] &&\n m[9] === om[9] &&\n m[10] === om[10] &&\n m[11] === om[11] &&\n m[12] === om[12] &&\n m[13] === om[13] &&\n m[14] === om[14] &&\n m[15] === om[15]);\n }\n /**\n * Clone the current matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#18\n * @returns a new matrix from the current matrix\n */\n clone() {\n const matrix = new this.constructor();\n matrix.copyFrom(this);\n return matrix;\n }\n /**\n * Returns the name of the current matrix class\n * @returns the string \"Matrix\"\n */\n getClassName() {\n return \"Matrix\";\n }\n /**\n * Gets the hash code of the current matrix\n * @returns the hash code\n */\n getHashCode() {\n let hash = _ExtractAsInt(this._m[0]);\n for (let i = 1; i < 16; i++) {\n hash = (hash * 397) ^ _ExtractAsInt(this._m[i]);\n }\n return hash;\n }\n /**\n * Decomposes the current Matrix into a translation, rotation and scaling components of the provided node\n * Example Playground - https://playground.babylonjs.com/#AV9X17#13\n * @param node the node to decompose the matrix to\n * @returns true if operation was successful\n */\n decomposeToTransformNode(node) {\n node.rotationQuaternion = node.rotationQuaternion || new Quaternion();\n return this.decompose(node.scaling, node.rotationQuaternion, node.position);\n }\n /**\n * Decomposes the current Matrix into a translation, rotation and scaling components\n * Example Playground - https://playground.babylonjs.com/#AV9X17#12\n * @param scale defines the scale vector3 given as a reference to update\n * @param rotation defines the rotation quaternion given as a reference to update\n * @param translation defines the translation vector3 given as a reference to update\n * @param preserveScalingNode Use scaling sign coming from this node. Otherwise scaling sign might change.\n * @returns true if operation was successful\n */\n decompose(scale, rotation, translation, preserveScalingNode) {\n if (this._isIdentity) {\n if (translation) {\n translation.setAll(0);\n }\n if (scale) {\n scale.setAll(1);\n }\n if (rotation) {\n rotation.copyFromFloats(0, 0, 0, 1);\n }\n return true;\n }\n const m = this._m;\n if (translation) {\n translation.copyFromFloats(m[12], m[13], m[14]);\n }\n scale = scale || MathTmp.Vector3[0];\n scale.x = Math.sqrt(m[0] * m[0] + m[1] * m[1] + m[2] * m[2]);\n scale.y = Math.sqrt(m[4] * m[4] + m[5] * m[5] + m[6] * m[6]);\n scale.z = Math.sqrt(m[8] * m[8] + m[9] * m[9] + m[10] * m[10]);\n if (preserveScalingNode) {\n const signX = preserveScalingNode.scaling.x < 0 ? -1 : 1;\n const signY = preserveScalingNode.scaling.y < 0 ? -1 : 1;\n const signZ = preserveScalingNode.scaling.z < 0 ? -1 : 1;\n scale.x *= signX;\n scale.y *= signY;\n scale.z *= signZ;\n }\n else {\n if (this.determinant() <= 0) {\n scale.y *= -1;\n }\n }\n if (scale._x === 0 || scale._y === 0 || scale._z === 0) {\n if (rotation) {\n rotation.copyFromFloats(0.0, 0.0, 0.0, 1.0);\n }\n return false;\n }\n if (rotation) {\n const sx = 1 / scale._x, sy = 1 / scale._y, sz = 1 / scale._z;\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, MathTmp.Matrix[0]);\n Quaternion.FromRotationMatrixToRef(MathTmp.Matrix[0], rotation);\n }\n return true;\n }\n /**\n * Gets specific row of the matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\n * @param index defines the number of the row to get\n * @returns the index-th row of the current matrix as a new Vector4\n */\n getRow(index) {\n if (index < 0 || index > 3) {\n return null;\n }\n const i = index * 4;\n return new Vector4(this._m[i + 0], this._m[i + 1], this._m[i + 2], this._m[i + 3]);\n }\n /**\n * Gets specific row of the matrix to ref\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\n * @param index defines the number of the row to get\n * @param rowVector vector to store the index-th row of the current matrix\n * @returns result input\n */\n getRowToRef(index, rowVector) {\n if (index >= 0 && index < 3) {\n const i = index * 4;\n rowVector.x = this._m[i + 0];\n rowVector.y = this._m[i + 1];\n rowVector.z = this._m[i + 2];\n rowVector.w = this._m[i + 3];\n }\n return rowVector;\n }\n /**\n * Sets the index-th row of the current matrix to the vector4 values\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\n * @param index defines the number of the row to set\n * @param row defines the target vector4\n * @returns the updated current matrix\n */\n setRow(index, row) {\n return this.setRowFromFloats(index, row.x, row.y, row.z, row.w);\n }\n /**\n * Compute the transpose of the matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#40\n * @returns the new transposed matrix\n */\n transpose() {\n const result = new this.constructor();\n Matrix.TransposeToRef(this, result);\n return result;\n }\n /**\n * Compute the transpose of the matrix and store it in a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#41\n * @param result defines the target matrix\n * @returns result input\n */\n transposeToRef(result) {\n Matrix.TransposeToRef(this, result);\n return result;\n }\n /**\n * Sets the index-th row of the current matrix with the given 4 x float values\n * Example Playground - https://playground.babylonjs.com/#AV9X17#36\n * @param index defines the row index\n * @param x defines the x component to set\n * @param y defines the y component to set\n * @param z defines the z component to set\n * @param w defines the w component to set\n * @returns the updated current matrix\n */\n setRowFromFloats(index, x, y, z, w) {\n if (index < 0 || index > 3) {\n return this;\n }\n const i = index * 4;\n this._m[i + 0] = x;\n this._m[i + 1] = y;\n this._m[i + 2] = z;\n this._m[i + 3] = w;\n this.markAsUpdated();\n return this;\n }\n /**\n * Compute a new matrix set with the current matrix values multiplied by scale (float)\n * @param scale defines the scale factor\n * @returns a new matrix\n */\n scale(scale) {\n const result = new this.constructor();\n this.scaleToRef(scale, result);\n return result;\n }\n /**\n * Scale the current matrix values by a factor to a given result matrix\n * @param scale defines the scale factor\n * @param result defines the matrix to store the result\n * @returns result input\n */\n scaleToRef(scale, result) {\n for (let index = 0; index < 16; index++) {\n result._m[index] = this._m[index] * scale;\n }\n result.markAsUpdated();\n return result;\n }\n /**\n * Scale the current matrix values by a factor and add the result to a given matrix\n * @param scale defines the scale factor\n * @param result defines the Matrix to store the result\n * @returns result input\n */\n scaleAndAddToRef(scale, result) {\n for (let index = 0; index < 16; index++) {\n result._m[index] += this._m[index] * scale;\n }\n result.markAsUpdated();\n return result;\n }\n /**\n * Writes to the given matrix a normal matrix, computed from this one (using values from identity matrix for fourth row and column).\n * Example Playground - https://playground.babylonjs.com/#AV9X17#17\n * @param ref matrix to store the result\n */\n toNormalMatrix(ref) {\n const tmp = MathTmp.Matrix[0];\n this.invertToRef(tmp);\n tmp.transposeToRef(ref);\n const m = ref._m;\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);\n return ref;\n }\n /**\n * Gets only rotation part of the current matrix\n * @returns a new matrix sets to the extracted rotation matrix from the current one\n */\n getRotationMatrix() {\n const result = new this.constructor();\n this.getRotationMatrixToRef(result);\n return result;\n }\n /**\n * Extracts the rotation matrix from the current one and sets it as the given \"result\"\n * @param result defines the target matrix to store data to\n * @returns result input\n */\n getRotationMatrixToRef(result) {\n const scale = MathTmp.Vector3[0];\n if (!this.decompose(scale)) {\n Matrix.IdentityToRef(result);\n return result;\n }\n const m = this._m;\n const sx = 1 / scale._x, sy = 1 / scale._y, sz = 1 / scale._z;\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);\n return result;\n }\n /**\n * Toggles model matrix from being right handed to left handed in place and vice versa\n */\n toggleModelMatrixHandInPlace() {\n const m = this._m;\n m[2] *= -1;\n m[6] *= -1;\n m[8] *= -1;\n m[9] *= -1;\n m[14] *= -1;\n this.markAsUpdated();\n return this;\n }\n /**\n * Toggles projection matrix from being right handed to left handed in place and vice versa\n */\n toggleProjectionMatrixHandInPlace() {\n const m = this._m;\n m[8] *= -1;\n m[9] *= -1;\n m[10] *= -1;\n m[11] *= -1;\n this.markAsUpdated();\n return this;\n }\n // Statics\n /**\n * Creates a matrix from an array\n * Example Playground - https://playground.babylonjs.com/#AV9X17#42\n * @param array defines the source array\n * @param offset defines an offset in the source array\n * @returns a new Matrix set from the starting index of the given array\n */\n static FromArray(array, offset = 0) {\n const result = new Matrix();\n Matrix.FromArrayToRef(array, offset, result);\n return result;\n }\n /**\n * Copy the content of an array into a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#43\n * @param array defines the source array\n * @param offset defines an offset in the source array\n * @param result defines the target matrix\n * @returns result input\n */\n static FromArrayToRef(array, offset, result) {\n for (let index = 0; index < 16; index++) {\n result._m[index] = array[index + offset];\n }\n result.markAsUpdated();\n return result;\n }\n /**\n * Stores an array into a matrix after having multiplied each component by a given factor\n * Example Playground - https://playground.babylonjs.com/#AV9X17#50\n * @param array defines the source array\n * @param offset defines the offset in the source array\n * @param scale defines the scaling factor\n * @param result defines the target matrix\n * @returns result input\n */\n static FromFloat32ArrayToRefScaled(array, offset, scale, result) {\n for (let index = 0; index < 16; index++) {\n result._m[index] = array[index + offset] * scale;\n }\n result.markAsUpdated();\n return result;\n }\n /**\n * Gets an identity matrix that must not be updated\n */\n static get IdentityReadOnly() {\n return Matrix._IdentityReadOnly;\n }\n /**\n * Stores a list of values (16) inside a given matrix\n * @param initialM11 defines 1st value of 1st row\n * @param initialM12 defines 2nd value of 1st row\n * @param initialM13 defines 3rd value of 1st row\n * @param initialM14 defines 4th value of 1st row\n * @param initialM21 defines 1st value of 2nd row\n * @param initialM22 defines 2nd value of 2nd row\n * @param initialM23 defines 3rd value of 2nd row\n * @param initialM24 defines 4th value of 2nd row\n * @param initialM31 defines 1st value of 3rd row\n * @param initialM32 defines 2nd value of 3rd row\n * @param initialM33 defines 3rd value of 3rd row\n * @param initialM34 defines 4th value of 3rd row\n * @param initialM41 defines 1st value of 4th row\n * @param initialM42 defines 2nd value of 4th row\n * @param initialM43 defines 3rd value of 4th row\n * @param initialM44 defines 4th value of 4th row\n * @param result defines the target matrix\n * @returns result input\n */\n static FromValuesToRef(initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44, result) {\n const m = result._m;\n m[0] = initialM11;\n m[1] = initialM12;\n m[2] = initialM13;\n m[3] = initialM14;\n m[4] = initialM21;\n m[5] = initialM22;\n m[6] = initialM23;\n m[7] = initialM24;\n m[8] = initialM31;\n m[9] = initialM32;\n m[10] = initialM33;\n m[11] = initialM34;\n m[12] = initialM41;\n m[13] = initialM42;\n m[14] = initialM43;\n m[15] = initialM44;\n result.markAsUpdated();\n }\n /**\n * Creates new matrix from a list of values (16)\n * @param initialM11 defines 1st value of 1st row\n * @param initialM12 defines 2nd value of 1st row\n * @param initialM13 defines 3rd value of 1st row\n * @param initialM14 defines 4th value of 1st row\n * @param initialM21 defines 1st value of 2nd row\n * @param initialM22 defines 2nd value of 2nd row\n * @param initialM23 defines 3rd value of 2nd row\n * @param initialM24 defines 4th value of 2nd row\n * @param initialM31 defines 1st value of 3rd row\n * @param initialM32 defines 2nd value of 3rd row\n * @param initialM33 defines 3rd value of 3rd row\n * @param initialM34 defines 4th value of 3rd row\n * @param initialM41 defines 1st value of 4th row\n * @param initialM42 defines 2nd value of 4th row\n * @param initialM43 defines 3rd value of 4th row\n * @param initialM44 defines 4th value of 4th row\n * @returns the new matrix\n */\n static FromValues(initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44) {\n const result = new Matrix();\n const m = result._m;\n m[0] = initialM11;\n m[1] = initialM12;\n m[2] = initialM13;\n m[3] = initialM14;\n m[4] = initialM21;\n m[5] = initialM22;\n m[6] = initialM23;\n m[7] = initialM24;\n m[8] = initialM31;\n m[9] = initialM32;\n m[10] = initialM33;\n m[11] = initialM34;\n m[12] = initialM41;\n m[13] = initialM42;\n m[14] = initialM43;\n m[15] = initialM44;\n result.markAsUpdated();\n return result;\n }\n /**\n * Creates a new matrix composed by merging scale (vector3), rotation (quaternion) and translation (vector3)\n * Example Playground - https://playground.babylonjs.com/#AV9X17#24\n * @param scale defines the scale vector3\n * @param rotation defines the rotation quaternion\n * @param translation defines the translation vector3\n * @returns a new matrix\n */\n static Compose(scale, rotation, translation) {\n const result = new Matrix();\n Matrix.ComposeToRef(scale, rotation, translation, result);\n return result;\n }\n /**\n * Sets a matrix to a value composed by merging scale (vector3), rotation (quaternion) and translation (vector3)\n * Example Playground - https://playground.babylonjs.com/#AV9X17#25\n * @param scale defines the scale vector3\n * @param rotation defines the rotation quaternion\n * @param translation defines the translation vector3\n * @param result defines the target matrix\n * @returns result input\n */\n static ComposeToRef(scale, rotation, translation, result) {\n const m = result._m;\n const x = rotation._x, y = rotation._y, z = rotation._z, w = rotation._w;\n const x2 = x + x, y2 = y + y, z2 = z + z;\n const xx = x * x2, xy = x * y2, xz = x * z2;\n const yy = y * y2, yz = y * z2, zz = z * z2;\n const wx = w * x2, wy = w * y2, wz = w * z2;\n const sx = scale._x, sy = scale._y, sz = scale._z;\n m[0] = (1 - (yy + zz)) * sx;\n m[1] = (xy + wz) * sx;\n m[2] = (xz - wy) * sx;\n m[3] = 0;\n m[4] = (xy - wz) * sy;\n m[5] = (1 - (xx + zz)) * sy;\n m[6] = (yz + wx) * sy;\n m[7] = 0;\n m[8] = (xz + wy) * sz;\n m[9] = (yz - wx) * sz;\n m[10] = (1 - (xx + yy)) * sz;\n m[11] = 0;\n m[12] = translation._x;\n m[13] = translation._y;\n m[14] = translation._z;\n m[15] = 1;\n result.markAsUpdated();\n return result;\n }\n /**\n * Creates a new identity matrix\n * @returns a new identity matrix\n */\n static Identity() {\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);\n identity._updateIdentityStatus(true);\n return identity;\n }\n /**\n * Creates a new identity matrix and stores the result in a given matrix\n * @param result defines the target matrix\n * @returns result input\n */\n static IdentityToRef(result) {\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);\n result._updateIdentityStatus(true);\n return result;\n }\n /**\n * Creates a new zero matrix\n * @returns a new zero matrix\n */\n static Zero() {\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);\n zero._updateIdentityStatus(false);\n return zero;\n }\n /**\n * Creates a new rotation matrix for \"angle\" radians around the X axis\n * Example Playground - https://playground.babylonjs.com/#AV9X17#97\n * @param angle defines the angle (in radians) to use\n * @returns the new matrix\n */\n static RotationX(angle) {\n const result = new Matrix();\n Matrix.RotationXToRef(angle, result);\n return result;\n }\n /**\n * Creates a new matrix as the invert of a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#124\n * @param source defines the source matrix\n * @returns the new matrix\n */\n static Invert(source) {\n const result = new source.constructor();\n source.invertToRef(result);\n return result;\n }\n /**\n * Creates a new rotation matrix for \"angle\" radians around the X axis and stores it in a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#98\n * @param angle defines the angle (in radians) to use\n * @param result defines the target matrix\n * @returns result input\n */\n static RotationXToRef(angle, result) {\n const s = Math.sin(angle);\n const c = Math.cos(angle);\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);\n result._updateIdentityStatus(c === 1 && s === 0);\n return result;\n }\n /**\n * Creates a new rotation matrix for \"angle\" radians around the Y axis\n * Example Playground - https://playground.babylonjs.com/#AV9X17#99\n * @param angle defines the angle (in radians) to use\n * @returns the new matrix\n */\n static RotationY(angle) {\n const result = new Matrix();\n Matrix.RotationYToRef(angle, result);\n return result;\n }\n /**\n * Creates a new rotation matrix for \"angle\" radians around the Y axis and stores it in a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#100\n * @param angle defines the angle (in radians) to use\n * @param result defines the target matrix\n * @returns result input\n */\n static RotationYToRef(angle, result) {\n const s = Math.sin(angle);\n const c = Math.cos(angle);\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);\n result._updateIdentityStatus(c === 1 && s === 0);\n return result;\n }\n /**\n * Creates a new rotation matrix for \"angle\" radians around the Z axis\n * Example Playground - https://playground.babylonjs.com/#AV9X17#101\n * @param angle defines the angle (in radians) to use\n * @returns the new matrix\n */\n static RotationZ(angle) {\n const result = new Matrix();\n Matrix.RotationZToRef(angle, result);\n return result;\n }\n /**\n * Creates a new rotation matrix for \"angle\" radians around the Z axis and stores it in a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#102\n * @param angle defines the angle (in radians) to use\n * @param result defines the target matrix\n * @returns result input\n */\n static RotationZToRef(angle, result) {\n const s = Math.sin(angle);\n const c = Math.cos(angle);\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);\n result._updateIdentityStatus(c === 1 && s === 0);\n return result;\n }\n /**\n * Creates a new rotation matrix for \"angle\" radians around the given axis\n * Example Playground - https://playground.babylonjs.com/#AV9X17#96\n * @param axis defines the axis to use\n * @param angle defines the angle (in radians) to use\n * @returns the new matrix\n */\n static RotationAxis(axis, angle) {\n const result = new Matrix();\n Matrix.RotationAxisToRef(axis, angle, result);\n return result;\n }\n /**\n * Creates a new rotation matrix for \"angle\" radians around the given axis and stores it in a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#94\n * @param axis defines the axis to use\n * @param angle defines the angle (in radians) to use\n * @param result defines the target matrix\n * @returns result input\n */\n static RotationAxisToRef(axis, angle, result) {\n const s = Math.sin(-angle);\n const c = Math.cos(-angle);\n const c1 = 1 - c;\n axis.normalize();\n const m = result._m;\n m[0] = axis._x * axis._x * c1 + c;\n m[1] = axis._x * axis._y * c1 - axis._z * s;\n m[2] = axis._x * axis._z * c1 + axis._y * s;\n m[3] = 0.0;\n m[4] = axis._y * axis._x * c1 + axis._z * s;\n m[5] = axis._y * axis._y * c1 + c;\n m[6] = axis._y * axis._z * c1 - axis._x * s;\n m[7] = 0.0;\n m[8] = axis._z * axis._x * c1 - axis._y * s;\n m[9] = axis._z * axis._y * c1 + axis._x * s;\n m[10] = axis._z * axis._z * c1 + c;\n m[11] = 0.0;\n m[12] = 0.0;\n m[13] = 0.0;\n m[14] = 0.0;\n m[15] = 1.0;\n result.markAsUpdated();\n return result;\n }\n /**\n * Takes normalised vectors and returns a rotation matrix to align \"from\" with \"to\".\n * Taken from http://www.iquilezles.org/www/articles/noacos/noacos.htm\n * Example Playground - https://playground.babylonjs.com/#AV9X17#93\n * @param from defines the vector to align\n * @param to defines the vector to align to\n * @param result defines the target matrix\n * @returns result input\n */\n static RotationAlignToRef(from, to, result) {\n const c = Vector3.Dot(to, from);\n const m = result._m;\n if (c < -1 + Epsilon) {\n // from and to are colinear and opposite direction.\n // compute a PI rotation on Z axis\n m[0] = -1;\n m[1] = 0;\n m[2] = 0;\n m[3] = 0;\n m[4] = 0;\n m[5] = -1;\n m[6] = 0;\n m[7] = 0;\n m[8] = 0;\n m[9] = 0;\n m[10] = 1;\n m[11] = 0;\n }\n else {\n const v = Vector3.Cross(to, from);\n const k = 1 / (1 + c);\n m[0] = v._x * v._x * k + c;\n m[1] = v._y * v._x * k - v._z;\n m[2] = v._z * v._x * k + v._y;\n m[3] = 0;\n m[4] = v._x * v._y * k + v._z;\n m[5] = v._y * v._y * k + c;\n m[6] = v._z * v._y * k - v._x;\n m[7] = 0;\n m[8] = v._x * v._z * k - v._y;\n m[9] = v._y * v._z * k + v._x;\n m[10] = v._z * v._z * k + c;\n m[11] = 0;\n }\n m[12] = 0;\n m[13] = 0;\n m[14] = 0;\n m[15] = 1;\n result.markAsUpdated();\n return result;\n }\n /**\n * Creates a rotation matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#103\n * Example Playground - https://playground.babylonjs.com/#AV9X17#105\n * @param yaw defines the yaw angle in radians (Y axis)\n * @param pitch defines the pitch angle in radians (X axis)\n * @param roll defines the roll angle in radians (Z axis)\n * @returns the new rotation matrix\n */\n static RotationYawPitchRoll(yaw, pitch, roll) {\n const result = new Matrix();\n Matrix.RotationYawPitchRollToRef(yaw, pitch, roll, result);\n return result;\n }\n /**\n * Creates a rotation matrix and stores it in a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#104\n * @param yaw defines the yaw angle in radians (Y axis)\n * @param pitch defines the pitch angle in radians (X axis)\n * @param roll defines the roll angle in radians (Z axis)\n * @param result defines the target matrix\n * @returns result input\n */\n static RotationYawPitchRollToRef(yaw, pitch, roll, result) {\n Quaternion.RotationYawPitchRollToRef(yaw, pitch, roll, MathTmp.Quaternion[0]);\n MathTmp.Quaternion[0].toRotationMatrix(result);\n return result;\n }\n /**\n * Creates a scaling matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#107\n * @param x defines the scale factor on X axis\n * @param y defines the scale factor on Y axis\n * @param z defines the scale factor on Z axis\n * @returns the new matrix\n */\n static Scaling(x, y, z) {\n const result = new Matrix();\n Matrix.ScalingToRef(x, y, z, result);\n return result;\n }\n /**\n * Creates a scaling matrix and stores it in a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#108\n * @param x defines the scale factor on X axis\n * @param y defines the scale factor on Y axis\n * @param z defines the scale factor on Z axis\n * @param result defines the target matrix\n * @returns result input\n */\n static ScalingToRef(x, y, z, result) {\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);\n result._updateIdentityStatus(x === 1 && y === 1 && z === 1);\n return result;\n }\n /**\n * Creates a translation matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#109\n * @param x defines the translation on X axis\n * @param y defines the translation on Y axis\n * @param z defines the translationon Z axis\n * @returns the new matrix\n */\n static Translation(x, y, z) {\n const result = new Matrix();\n Matrix.TranslationToRef(x, y, z, result);\n return result;\n }\n /**\n * Creates a translation matrix and stores it in a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#110\n * @param x defines the translation on X axis\n * @param y defines the translation on Y axis\n * @param z defines the translationon Z axis\n * @param result defines the target matrix\n * @returns result input\n */\n static TranslationToRef(x, y, z, result) {\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);\n result._updateIdentityStatus(x === 0 && y === 0 && z === 0);\n return result;\n }\n /**\n * Returns a new Matrix whose values are the interpolated values for \"gradient\" (float) between the ones of the matrices \"startValue\" and \"endValue\".\n * Example Playground - https://playground.babylonjs.com/#AV9X17#55\n * @param startValue defines the start value\n * @param endValue defines the end value\n * @param gradient defines the gradient factor\n * @returns the new matrix\n */\n static Lerp(startValue, endValue, gradient) {\n const result = new startValue.constructor();\n Matrix.LerpToRef(startValue, endValue, gradient, result);\n return result;\n }\n /**\n * Set the given matrix \"result\" as the interpolated values for \"gradient\" (float) between the ones of the matrices \"startValue\" and \"endValue\".\n * Example Playground - https://playground.babylonjs.com/#AV9X17#54\n * @param startValue defines the start value\n * @param endValue defines the end value\n * @param gradient defines the gradient factor\n * @param result defines the Matrix object where to store data\n * @returns result input\n */\n static LerpToRef(startValue, endValue, gradient, result) {\n const resultM = result._m;\n const startM = startValue.m;\n const endM = endValue.m;\n for (let index = 0; index < 16; index++) {\n resultM[index] = startM[index] * (1.0 - gradient) + endM[index] * gradient;\n }\n result.markAsUpdated();\n return result;\n }\n /**\n * Builds a new matrix whose values are computed by:\n * * decomposing the the \"startValue\" and \"endValue\" matrices into their respective scale, rotation and translation matrices\n * * interpolating for \"gradient\" (float) the values between each of these decomposed matrices between the start and the end\n * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices\n * Example Playground - https://playground.babylonjs.com/#AV9X17#22\n * Example Playground - https://playground.babylonjs.com/#AV9X17#51\n * @param startValue defines the first matrix\n * @param endValue defines the second matrix\n * @param gradient defines the gradient between the two matrices\n * @returns the new matrix\n */\n static DecomposeLerp(startValue, endValue, gradient) {\n const result = new startValue.constructor();\n Matrix.DecomposeLerpToRef(startValue, endValue, gradient, result);\n return result;\n }\n /**\n * Update a matrix to values which are computed by:\n * * decomposing the the \"startValue\" and \"endValue\" matrices into their respective scale, rotation and translation matrices\n * * interpolating for \"gradient\" (float) the values between each of these decomposed matrices between the start and the end\n * * recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices\n * Example Playground - https://playground.babylonjs.com/#AV9X17#23\n * Example Playground - https://playground.babylonjs.com/#AV9X17#53\n * @param startValue defines the first matrix\n * @param endValue defines the second matrix\n * @param gradient defines the gradient between the two matrices\n * @param result defines the target matrix\n * @returns result input\n */\n static DecomposeLerpToRef(startValue, endValue, gradient, result) {\n const startScale = MathTmp.Vector3[0];\n const startRotation = MathTmp.Quaternion[0];\n const startTranslation = MathTmp.Vector3[1];\n startValue.decompose(startScale, startRotation, startTranslation);\n const endScale = MathTmp.Vector3[2];\n const endRotation = MathTmp.Quaternion[1];\n const endTranslation = MathTmp.Vector3[3];\n endValue.decompose(endScale, endRotation, endTranslation);\n const resultScale = MathTmp.Vector3[4];\n Vector3.LerpToRef(startScale, endScale, gradient, resultScale);\n const resultRotation = MathTmp.Quaternion[2];\n Quaternion.SlerpToRef(startRotation, endRotation, gradient, resultRotation);\n const resultTranslation = MathTmp.Vector3[5];\n Vector3.LerpToRef(startTranslation, endTranslation, gradient, resultTranslation);\n Matrix.ComposeToRef(resultScale, resultRotation, resultTranslation, result);\n return result;\n }\n /**\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.\n * This function generates a matrix suitable for a left handed coordinate system\n * Example Playground - https://playground.babylonjs.com/#AV9X17#58\n * Example Playground - https://playground.babylonjs.com/#AV9X17#59\n * @param eye defines the final position of the entity\n * @param target defines where the entity should look at\n * @param up defines the up vector for the entity\n * @returns the new matrix\n */\n static LookAtLH(eye, target, up) {\n const result = new Matrix();\n Matrix.LookAtLHToRef(eye, target, up, result);\n return result;\n }\n /**\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.\n * This function generates a matrix suitable for a left handed coordinate system\n * Example Playground - https://playground.babylonjs.com/#AV9X17#60\n * Example Playground - https://playground.babylonjs.com/#AV9X17#61\n * @param eye defines the final position of the entity\n * @param target defines where the entity should look at\n * @param up defines the up vector for the entity\n * @param result defines the target matrix\n * @returns result input\n */\n static LookAtLHToRef(eye, target, up, result) {\n const xAxis = MathTmp.Vector3[0];\n const yAxis = MathTmp.Vector3[1];\n const zAxis = MathTmp.Vector3[2];\n // Z axis\n target.subtractToRef(eye, zAxis);\n zAxis.normalize();\n // X axis\n Vector3.CrossToRef(up, zAxis, xAxis);\n const xSquareLength = xAxis.lengthSquared();\n if (xSquareLength === 0) {\n xAxis.x = 1.0;\n }\n else {\n xAxis.normalizeFromLength(Math.sqrt(xSquareLength));\n }\n // Y axis\n Vector3.CrossToRef(zAxis, xAxis, yAxis);\n yAxis.normalize();\n // Eye angles\n const ex = -Vector3.Dot(xAxis, eye);\n const ey = -Vector3.Dot(yAxis, eye);\n const ez = -Vector3.Dot(zAxis, eye);\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);\n }\n /**\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.\n * This function generates a matrix suitable for a right handed coordinate system\n * Example Playground - https://playground.babylonjs.com/#AV9X17#62\n * Example Playground - https://playground.babylonjs.com/#AV9X17#63\n * @param eye defines the final position of the entity\n * @param target defines where the entity should look at\n * @param up defines the up vector for the entity\n * @returns the new matrix\n */\n static LookAtRH(eye, target, up) {\n const result = new Matrix();\n Matrix.LookAtRHToRef(eye, target, up, result);\n return result;\n }\n /**\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.\n * This function generates a matrix suitable for a right handed coordinate system\n * Example Playground - https://playground.babylonjs.com/#AV9X17#64\n * Example Playground - https://playground.babylonjs.com/#AV9X17#65\n * @param eye defines the final position of the entity\n * @param target defines where the entity should look at\n * @param up defines the up vector for the entity\n * @param result defines the target matrix\n * @returns result input\n */\n static LookAtRHToRef(eye, target, up, result) {\n const xAxis = MathTmp.Vector3[0];\n const yAxis = MathTmp.Vector3[1];\n const zAxis = MathTmp.Vector3[2];\n // Z axis\n eye.subtractToRef(target, zAxis);\n zAxis.normalize();\n // X axis\n Vector3.CrossToRef(up, zAxis, xAxis);\n const xSquareLength = xAxis.lengthSquared();\n if (xSquareLength === 0) {\n xAxis.x = 1.0;\n }\n else {\n xAxis.normalizeFromLength(Math.sqrt(xSquareLength));\n }\n // Y axis\n Vector3.CrossToRef(zAxis, xAxis, yAxis);\n yAxis.normalize();\n // Eye angles\n const ex = -Vector3.Dot(xAxis, eye);\n const ey = -Vector3.Dot(yAxis, eye);\n const ez = -Vector3.Dot(zAxis, eye);\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);\n return result;\n }\n /**\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)\n * This function generates a matrix suitable for a left handed coordinate system\n * Example Playground - https://playground.babylonjs.com/#AV9X17#66\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\n * @returns the new matrix\n */\n static LookDirectionLH(forward, up) {\n const result = new Matrix();\n Matrix.LookDirectionLHToRef(forward, up, result);\n return result;\n }\n /**\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)\n * This function generates a matrix suitable for a left handed coordinate system\n * Example Playground - https://playground.babylonjs.com/#AV9X17#67\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\n * @param result defines the target matrix\n * @returns result input\n */\n static LookDirectionLHToRef(forward, up, result) {\n const back = MathTmp.Vector3[0];\n back.copyFrom(forward);\n back.scaleInPlace(-1);\n const left = MathTmp.Vector3[1];\n Vector3.CrossToRef(up, back, left);\n // Generate the rotation matrix.\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);\n return result;\n }\n /**\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)\n * This function generates a matrix suitable for a right handed coordinate system\n * Example Playground - https://playground.babylonjs.com/#AV9X17#68\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\n * @returns the new matrix\n */\n static LookDirectionRH(forward, up) {\n const result = new Matrix();\n Matrix.LookDirectionRHToRef(forward, up, result);\n return result;\n }\n /**\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)\n * This function generates a matrix suitable for a right handed coordinate system\n * Example Playground - https://playground.babylonjs.com/#AV9X17#69\n * @param forward defines the forward direction - Must be normalized and orthogonal to up.\n * @param up defines the up vector for the entity - Must be normalized and orthogonal to forward.\n * @param result defines the target matrix\n * @returns result input\n */\n static LookDirectionRHToRef(forward, up, result) {\n const right = MathTmp.Vector3[2];\n Vector3.CrossToRef(up, forward, right);\n // Generate the rotation matrix.\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);\n return result;\n }\n /**\n * Create a left-handed orthographic projection matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#70\n * @param width defines the viewport width\n * @param height defines the viewport height\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @returns a new matrix as a left-handed orthographic projection matrix\n */\n static OrthoLH(width, height, znear, zfar, halfZRange) {\n const matrix = new Matrix();\n Matrix.OrthoLHToRef(width, height, znear, zfar, matrix, halfZRange);\n return matrix;\n }\n /**\n * Store a left-handed orthographic projection to a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#71\n * @param width defines the viewport width\n * @param height defines the viewport height\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane\n * @param result defines the target matrix\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @returns result input\n */\n static OrthoLHToRef(width, height, znear, zfar, result, halfZRange) {\n const n = znear;\n const f = zfar;\n const a = 2.0 / width;\n const b = 2.0 / height;\n const c = 2.0 / (f - n);\n const d = -(f + n) / (f - n);\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);\n if (halfZRange) {\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\n }\n result._updateIdentityStatus(a === 1 && b === 1 && c === 1 && d === 0);\n return result;\n }\n /**\n * Create a left-handed orthographic projection matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#72\n * @param left defines the viewport left coordinate\n * @param right defines the viewport right coordinate\n * @param bottom defines the viewport bottom coordinate\n * @param top defines the viewport top coordinate\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @returns a new matrix as a left-handed orthographic projection matrix\n */\n static OrthoOffCenterLH(left, right, bottom, top, znear, zfar, halfZRange) {\n const matrix = new Matrix();\n Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, matrix, halfZRange);\n return matrix;\n }\n /**\n * Stores a left-handed orthographic projection into a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#73\n * @param left defines the viewport left coordinate\n * @param right defines the viewport right coordinate\n * @param bottom defines the viewport bottom coordinate\n * @param top defines the viewport top coordinate\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane\n * @param result defines the target matrix\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @returns result input\n */\n static OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result, halfZRange) {\n const n = znear;\n const f = zfar;\n const a = 2.0 / (right - left);\n const b = 2.0 / (top - bottom);\n const c = 2.0 / (f - n);\n const d = -(f + n) / (f - n);\n const i0 = (left + right) / (left - right);\n const i1 = (top + bottom) / (bottom - top);\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);\n if (halfZRange) {\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\n }\n result.markAsUpdated();\n return result;\n }\n /**\n * Creates a right-handed orthographic projection matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#76\n * @param left defines the viewport left coordinate\n * @param right defines the viewport right coordinate\n * @param bottom defines the viewport bottom coordinate\n * @param top defines the viewport top coordinate\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @returns a new matrix as a right-handed orthographic projection matrix\n */\n static OrthoOffCenterRH(left, right, bottom, top, znear, zfar, halfZRange) {\n const matrix = new Matrix();\n Matrix.OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, matrix, halfZRange);\n return matrix;\n }\n /**\n * Stores a right-handed orthographic projection into a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#77\n * @param left defines the viewport left coordinate\n * @param right defines the viewport right coordinate\n * @param bottom defines the viewport bottom coordinate\n * @param top defines the viewport top coordinate\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane\n * @param result defines the target matrix\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @returns result input\n */\n static OrthoOffCenterRHToRef(left, right, bottom, top, znear, zfar, result, halfZRange) {\n Matrix.OrthoOffCenterLHToRef(left, right, bottom, top, znear, zfar, result, halfZRange);\n result._m[10] *= -1; // No need to call markAsUpdated as previous function already called it and let _isIdentityDirty to true\n return result;\n }\n /**\n * Creates a left-handed perspective projection matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#85\n * @param width defines the viewport width\n * @param height defines the viewport height\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\n * @returns a new matrix as a left-handed perspective projection matrix\n */\n static PerspectiveLH(width, height, znear, zfar, halfZRange, projectionPlaneTilt = 0) {\n const matrix = new Matrix();\n const n = znear;\n const f = zfar;\n const a = (2.0 * n) / width;\n const b = (2.0 * n) / height;\n const c = (f + n) / (f - n);\n const d = (-2.0 * f * n) / (f - n);\n const rot = Math.tan(projectionPlaneTilt);\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);\n if (halfZRange) {\n matrix.multiplyToRef(mtxConvertNDCToHalfZRange, matrix);\n }\n matrix._updateIdentityStatus(false);\n return matrix;\n }\n /**\n * Creates a left-handed perspective projection matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#78\n * @param fov defines the horizontal field of view\n * @param aspect defines the aspect ratio\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\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)\n * @returns a new matrix as a left-handed perspective projection matrix\n */\n static PerspectiveFovLH(fov, aspect, znear, zfar, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = false) {\n const matrix = new Matrix();\n Matrix.PerspectiveFovLHToRef(fov, aspect, znear, zfar, matrix, true, halfZRange, projectionPlaneTilt, reverseDepthBufferMode);\n return matrix;\n }\n /**\n * Stores a left-handed perspective projection into a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#81\n * @param fov defines the horizontal field of view\n * @param aspect defines the aspect ratio\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\n * @param result defines the target matrix\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\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)\n * @returns result input\n */\n static PerspectiveFovLHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = true, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = false) {\n const n = znear;\n const f = zfar;\n const t = 1.0 / Math.tan(fov * 0.5);\n const a = isVerticalFovFixed ? t / aspect : t;\n const b = isVerticalFovFixed ? t : t * aspect;\n const c = reverseDepthBufferMode && n === 0 ? -1 : f !== 0 ? (f + n) / (f - n) : 1;\n const d = reverseDepthBufferMode && n === 0 ? 2 * f : f !== 0 ? (-2.0 * f * n) / (f - n) : -2 * n;\n const rot = Math.tan(projectionPlaneTilt);\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);\n if (halfZRange) {\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\n }\n result._updateIdentityStatus(false);\n return result;\n }\n /**\n * Stores a left-handed perspective projection into a given matrix with depth reversed\n * Example Playground - https://playground.babylonjs.com/#AV9X17#89\n * @param fov defines the horizontal field of view\n * @param aspect defines the aspect ratio\n * @param znear defines the near clip plane\n * @param zfar not used as infinity is used as far clip\n * @param result defines the target matrix\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\n * @returns result input\n */\n static PerspectiveFovReverseLHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = true, halfZRange, projectionPlaneTilt = 0) {\n const t = 1.0 / Math.tan(fov * 0.5);\n const a = isVerticalFovFixed ? t / aspect : t;\n const b = isVerticalFovFixed ? t : t * aspect;\n const rot = Math.tan(projectionPlaneTilt);\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);\n if (halfZRange) {\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\n }\n result._updateIdentityStatus(false);\n return result;\n }\n /**\n * Creates a right-handed perspective projection matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#83\n * @param fov defines the horizontal field of view\n * @param aspect defines the aspect ratio\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\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)\n * @returns a new matrix as a right-handed perspective projection matrix\n */\n static PerspectiveFovRH(fov, aspect, znear, zfar, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = false) {\n const matrix = new Matrix();\n Matrix.PerspectiveFovRHToRef(fov, aspect, znear, zfar, matrix, true, halfZRange, projectionPlaneTilt, reverseDepthBufferMode);\n return matrix;\n }\n /**\n * Stores a right-handed perspective projection into a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#84\n * @param fov defines the horizontal field of view\n * @param aspect defines the aspect ratio\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane. If 0, assume we are in \"infinite zfar\" mode\n * @param result defines the target matrix\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\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)\n * @returns result input\n */\n static PerspectiveFovRHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = true, halfZRange, projectionPlaneTilt = 0, reverseDepthBufferMode = false) {\n //alternatively this could be expressed as:\n // m = PerspectiveFovLHToRef\n // m[10] *= -1.0;\n // m[11] *= -1.0;\n const n = znear;\n const f = zfar;\n const t = 1.0 / Math.tan(fov * 0.5);\n const a = isVerticalFovFixed ? t / aspect : t;\n const b = isVerticalFovFixed ? t : t * aspect;\n const c = reverseDepthBufferMode && n === 0 ? 1 : f !== 0 ? -(f + n) / (f - n) : -1;\n const d = reverseDepthBufferMode && n === 0 ? 2 * f : f !== 0 ? (-2 * f * n) / (f - n) : -2 * n;\n const rot = Math.tan(projectionPlaneTilt);\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);\n if (halfZRange) {\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\n }\n result._updateIdentityStatus(false);\n return result;\n }\n /**\n * Stores a right-handed perspective projection into a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#90\n * @param fov defines the horizontal field of view\n * @param aspect defines the aspect ratio\n * @param znear defines the near clip plane\n * @param zfar not used as infinity is used as far clip\n * @param result defines the target matrix\n * @param isVerticalFovFixed defines it the fov is vertically fixed (default) or horizontally\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\n * @returns result input\n */\n static PerspectiveFovReverseRHToRef(fov, aspect, znear, zfar, result, isVerticalFovFixed = true, halfZRange, projectionPlaneTilt = 0) {\n const t = 1.0 / Math.tan(fov * 0.5);\n const a = isVerticalFovFixed ? t / aspect : t;\n const b = isVerticalFovFixed ? t : t * aspect;\n const rot = Math.tan(projectionPlaneTilt);\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);\n if (halfZRange) {\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\n }\n result._updateIdentityStatus(false);\n return result;\n }\n /**\n * Stores a perspective projection for WebVR info a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#92\n * @param fov defines the field of view\n * @param fov.upDegrees\n * @param fov.downDegrees\n * @param fov.leftDegrees\n * @param fov.rightDegrees\n * @param znear defines the near clip plane\n * @param zfar defines the far clip plane\n * @param result defines the target matrix\n * @param rightHanded defines if the matrix must be in right-handed mode (false by default)\n * @param halfZRange true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)\n * @param projectionPlaneTilt optional tilt angle of the projection plane around the X axis (horizontal)\n * @returns result input\n */\n static PerspectiveFovWebVRToRef(fov, znear, zfar, result, rightHanded = false, halfZRange, projectionPlaneTilt = 0) {\n const rightHandedFactor = rightHanded ? -1 : 1;\n const upTan = Math.tan((fov.upDegrees * Math.PI) / 180.0);\n const downTan = Math.tan((fov.downDegrees * Math.PI) / 180.0);\n const leftTan = Math.tan((fov.leftDegrees * Math.PI) / 180.0);\n const rightTan = Math.tan((fov.rightDegrees * Math.PI) / 180.0);\n const xScale = 2.0 / (leftTan + rightTan);\n const yScale = 2.0 / (upTan + downTan);\n const rot = Math.tan(projectionPlaneTilt);\n const m = result._m;\n m[0] = xScale;\n m[1] = m[2] = m[3] = m[4] = 0.0;\n m[5] = yScale;\n m[6] = 0.0;\n m[7] = rot;\n m[8] = (leftTan - rightTan) * xScale * 0.5;\n m[9] = -((upTan - downTan) * yScale * 0.5);\n m[10] = -zfar / (znear - zfar);\n m[11] = 1.0 * rightHandedFactor;\n m[12] = m[13] = m[15] = 0.0;\n m[14] = -(2.0 * zfar * znear) / (zfar - znear);\n if (halfZRange) {\n result.multiplyToRef(mtxConvertNDCToHalfZRange, result);\n }\n result.markAsUpdated();\n return result;\n }\n /**\n * Computes a complete transformation matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#113\n * @param viewport defines the viewport to use\n * @param world defines the world matrix\n * @param view defines the view matrix\n * @param projection defines the projection matrix\n * @param zmin defines the near clip plane\n * @param zmax defines the far clip plane\n * @returns the transformation matrix\n */\n static GetFinalMatrix(viewport, world, view, projection, zmin, zmax) {\n const cw = viewport.width;\n const ch = viewport.height;\n const cx = viewport.x;\n const cy = viewport.y;\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);\n const matrix = new world.constructor();\n world.multiplyToRef(view, matrix);\n matrix.multiplyToRef(projection, matrix);\n return matrix.multiplyToRef(viewportMatrix, matrix);\n }\n /**\n * Extracts a 2x2 matrix from a given matrix and store the result in a Float32Array\n * @param matrix defines the matrix to use\n * @returns a new Float32Array array with 4 elements : the 2x2 matrix extracted from the given matrix\n */\n static GetAsMatrix2x2(matrix) {\n const m = matrix.m;\n const arr = [m[0], m[1], m[4], m[5]];\n return PerformanceConfigurator.MatrixUse64Bits ? arr : new Float32Array(arr);\n }\n /**\n * Extracts a 3x3 matrix from a given matrix and store the result in a Float32Array\n * @param matrix defines the matrix to use\n * @returns a new Float32Array array with 9 elements : the 3x3 matrix extracted from the given matrix\n */\n static GetAsMatrix3x3(matrix) {\n const m = matrix.m;\n const arr = [m[0], m[1], m[2], m[4], m[5], m[6], m[8], m[9], m[10]];\n return PerformanceConfigurator.MatrixUse64Bits ? arr : new Float32Array(arr);\n }\n /**\n * Compute the transpose of a given matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#111\n * @param matrix defines the matrix to transpose\n * @returns the new matrix\n */\n static Transpose(matrix) {\n const result = new matrix.constructor();\n Matrix.TransposeToRef(matrix, result);\n return result;\n }\n /**\n * Compute the transpose of a matrix and store it in a target matrix\n * Example Playground - https://playground.babylonjs.com/#AV9X17#112\n * @param matrix defines the matrix to transpose\n * @param result defines the target matrix\n * @returns result input\n */\n static TransposeToRef(matrix, result) {\n const rm = result._m;\n const mm = matrix.m;\n rm[0] = mm[0];\n rm[1] = mm[4];\n rm[2] = mm[8];\n rm[3] = mm[12];\n rm[4] = mm[1];\n rm[5] = mm[5];\n rm[6] = mm[9];\n rm[7] = mm[13];\n rm[8] = mm[2];\n rm[9] = mm[6];\n rm[10] = mm[10];\n rm[11] = mm[14];\n rm[12] = mm[3];\n rm[13] = mm[7];\n rm[14] = mm[11];\n rm[15] = mm[15];\n result.markAsUpdated();\n // identity-ness does not change when transposing\n result._updateIdentityStatus(matrix._isIdentity, matrix._isIdentityDirty);\n return result;\n }\n /**\n * Computes a reflection matrix from a plane\n * Example Playground - https://playground.babylonjs.com/#AV9X17#87\n * @param plane defines the reflection plane\n * @returns a new matrix\n */\n static Reflection(plane) {\n const matrix = new Matrix();\n Matrix.ReflectionToRef(plane, matrix);\n return matrix;\n }\n /**\n * Computes a reflection matrix from a plane\n * Example Playground - https://playground.babylonjs.com/#AV9X17#88\n * @param plane defines the reflection plane\n * @param result defines the target matrix\n * @returns result input\n */\n static ReflectionToRef(plane, result) {\n plane.normalize();\n const x = plane.normal.x;\n const y = plane.normal.y;\n const z = plane.normal.z;\n const temp = -2 * x;\n const temp2 = -2 * y;\n const temp3 = -2 * z;\n Matrix.FromValuesToRef(temp * x + 1, temp2 * x, temp3 * x, 0.0, temp * y, temp2 * y + 1, temp3 * y, 0.0, temp * z, temp2 * z, temp3 * z + 1, 0.0, temp * plane.d, temp2 * plane.d, temp3 * plane.d, 1.0, result);\n return result;\n }\n /**\n * Sets the given matrix as a rotation matrix composed from the 3 left handed axes\n * @param xaxis defines the value of the 1st axis\n * @param yaxis defines the value of the 2nd axis\n * @param zaxis defines the value of the 3rd axis\n * @param result defines the target matrix\n * @returns result input\n */\n static FromXYZAxesToRef(xaxis, yaxis, zaxis, result) {\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);\n return result;\n }\n /**\n * Creates a rotation matrix from a quaternion and stores it in a target matrix\n * @param quat defines the quaternion to use\n * @param result defines the target matrix\n * @returns result input\n */\n static FromQuaternionToRef(quat, result) {\n const xx = quat._x * quat._x;\n const yy = quat._y * quat._y;\n const zz = quat._z * quat._z;\n const xy = quat._x * quat._y;\n const zw = quat._z * quat._w;\n const zx = quat._z * quat._x;\n const yw = quat._y * quat._w;\n const yz = quat._y * quat._z;\n const xw = quat._x * quat._w;\n result._m[0] = 1.0 - 2.0 * (yy + zz);\n result._m[1] = 2.0 * (xy + zw);\n result._m[2] = 2.0 * (zx - yw);\n result._m[3] = 0.0;\n result._m[4] = 2.0 * (xy - zw);\n result._m[5] = 1.0 - 2.0 * (zz + xx);\n result._m[6] = 2.0 * (yz + xw);\n result._m[7] = 0.0;\n result._m[8] = 2.0 * (zx + yw);\n result._m[9] = 2.0 * (yz - xw);\n result._m[10] = 1.0 - 2.0 * (yy + xx);\n result._m[11] = 0.0;\n result._m[12] = 0.0;\n result._m[13] = 0.0;\n result._m[14] = 0.0;\n result._m[15] = 1.0;\n result.markAsUpdated();\n return result;\n }\n}\nMatrix._UpdateFlagSeed = 0;\nMatrix._IdentityReadOnly = Matrix.Identity();\n/**\n * @internal\n * Same as Tmp but not exported to keep it only for math functions to avoid conflicts\n */\nclass MathTmp {\n}\nMathTmp.Vector3 = ArrayTools.BuildTuple(11, Vector3.Zero);\nMathTmp.Matrix = ArrayTools.BuildTuple(2, Matrix.Identity);\nMathTmp.Quaternion = ArrayTools.BuildTuple(3, Quaternion.Zero);\n/**\n * @internal\n */\nexport class TmpVectors {\n}\nTmpVectors.Vector2 = ArrayTools.BuildTuple(3, Vector2.Zero); // 3 temp Vector2 at once should be enough\nTmpVectors.Vector3 = ArrayTools.BuildTuple(13, Vector3.Zero); // 13 temp Vector3 at once should be enough\nTmpVectors.Vector4 = ArrayTools.BuildTuple(3, Vector4.Zero); // 3 temp Vector4 at once should be enough\nTmpVectors.Quaternion = ArrayTools.BuildTuple(2, Quaternion.Zero); // 2 temp Quaternion at once should be enough\nTmpVectors.Matrix = ArrayTools.BuildTuple(8, Matrix.Identity); // 8 temp Matrices at once should be enough\nRegisterClass(\"BABYLON.Vector2\", Vector2);\nRegisterClass(\"BABYLON.Vector3\", Vector3);\nRegisterClass(\"BABYLON.Vector4\", Vector4);\nRegisterClass(\"BABYLON.Matrix\", Matrix);\nconst mtxConvertNDCToHalfZRange = Matrix.FromValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1);\n//# sourceMappingURL=math.vector.js.map"],"names":["_ExtractAsInt","value","parseInt","toString","replace","Vector2","constructor","x","y","this","getClassName","getHashCode","hash","toArray","array","index","fromArray","FromArrayToRef","asArray","result","Array","copyFrom","source","copyFromFloats","set","add","otherVector","addToRef","addInPlace","addVector3","subtract","subtractToRef","subtractInPlace","multiplyInPlace","multiply","multiplyToRef","multiplyByFloats","divide","divideToRef","divideInPlace","negate","negateInPlace","negateToRef","scaleInPlace","scale","scaleToRef","scaleAndAddToRef","equals","equalsWithEpsilon","epsilon","WithinEpsilon","floor","Math","fract","rotateToRef","angle","cos","sin","length","sqrt","lengthSquared","normalize","NormalizeToRef","clone","static","min","max","RandomRange","ZeroReadOnly","_ZeroReadOnly","offset","value1","value2","value3","value4","amount","squared","cubed","tangent1","tangent2","part1","part2","part3","part4","time","Hermite1stDerivativeToRef","t2","start","end","left","right","vector","newVector","len","transformation","TransformToRef","m","p","p0","p1","p2","a","sign","s","t","DistanceSquared","CenterToRef","ref","segA","segB","l2","Distance","v","Dot","proj","Zero","Vector3","_x","_isDirty","_y","z","_z","toQuaternion","Quaternion","RotationYawPitchRoll","addInPlaceFromFloats","subtractFromFloatsToRef","subtractFromFloats","getNormalToRef","radius","theta","acos","phi","atan2","PI","applyRotationQuaternionToRef","q","ix","_w","iy","iz","iw","applyRotationQuaternionInPlace","applyRotationQuaternion","projectOnPlane","plane","origin","projectOnPlaneToRef","n","normal","d","V","MathTmp","denom","abs","pow","setAll","Infinity","scaledV","equalsToFloats","minimizeInPlace","other","minimizeInPlaceFromFloats","maximizeInPlace","maximizeInPlaceFromFloats","isNonUniformWithinEpsilon","absX","absY","absZ","isNonUniform","hasAZeroComponent","normalizeFromLength","reorderInPlace","order","toLowerCase","forEach","val","i","rotateByQuaternionToRef","quaternion","toRotationMatrix","Matrix","TransformCoordinatesToRef","rotateByQuaternionAroundPointToRef","point","cross","CrossToRef","normalizeToNew","normalized","normalizeToRef","reference","vector0","vector1","axis","size","d0","v0","v1","dot","Clamp","isNaN","vNormal","forward","NormalizeRadians","target","diff","TmpVectors","PitchYawRollToMoveBetweenPointsToRef","slerp","vector0Dir","vector1Dir","vector0Length","vector1Length","scale0","scale1","omega","invSin","Lerp","goal","deltaTime","lerpTime","SlerpToRef","FromArray","UpReadOnly","_UpReadOnly","DownReadOnly","_DownReadOnly","RightReadOnly","_RightReadOnly","LeftReadOnly","_LeftReadOnly","LeftHandedForwardReadOnly","_LeftHandedForwardReadOnly","RightHandedForwardReadOnly","_RightHandedForwardReadOnly","LeftHandedBackwardReadOnly","_LeftHandedBackwardReadOnly","RightHandedBackwardReadOnly","_RightHandedBackwardReadOnly","OneReadOnly","_OneReadOnly","rightHandedSystem","TransformCoordinatesFromFloatsToRef","rx","ry","rz","rw","TransformNormalToRef","TransformNormalFromFloatsToRef","ClampToRef","LerpToRef","world","transform","viewport","ProjectToRef","cw","width","ch","height","cx","cy","viewportMatrix","FromValuesToRef","matrix","inDirection","ReflectToRef","tmp","num","viewportWidth","viewportHeight","Unproject","IdentityReadOnly","view","projection","UnprojectToRef","UnprojectFloatsToRef","sourceX","sourceY","sourceZ","_a","invert","screenSource","LastCreatedEngine","isNDCHalfZRange","_UnprojectFromInvertedMatrixToRef","p1p0","p2p0","p2p1","vectorp0","p1p0L","p2p0L","p2p1L","nl","l","cosA","projVector","v2","projP","s0","s1","s2","edge","e0","e1","tmp2","tmp3","r","e0proj","e0projL","cosG","triProj","axis1","axis2","axis3","rotation","RotationFromAxisToRef","quat","RotationQuaternionFromAxisToRef","toEulerAnglesToRef","Up","Down","Forward","Backward","Right","Left","One","Vector4","w","undefined","toVector3","otherQuaternion","q1","conjugateToRef","conjugateInPlace","conjugate","invertInPlace","inv","toEulerAngles","qz","qx","qy","qw","zAxisY","limit","sqw","sqz","sqx","sqy","asin","FromQuaternionToRef","fromRotationMatrix","FromRotationMatrixToRef","data","m11","m12","m13","m21","m22","m23","m31","m32","m33","trace","quat0","quat1","RotationAxisToRef","RotationYawPitchRollToRef","vec","vecFrom","vecTo","yaw","pitch","roll","halfRoll","halfPitch","halfYaw","sinRoll","cosRoll","sinPitch","cosPitch","sinYaw","cosYaw","alpha","beta","gamma","RotationAlphaBetaGammaToRef","halfGammaPlusAlpha","halfGammaMinusAlpha","halfBeta","rotMat","FromXYZAxesToRef","up","FromLookDirectionLHToRef","LookDirectionLHToRef","FromLookDirectionRHToRef","LookDirectionRHToRef","Identity","num2","num3","num4","flag","num5","num6","Use64Bits","MatrixUse64Bits","_m","markAsUpdated","updateFlag","_UpdateFlagSeed","_isIdentity","_isIdentity3x2","_isIdentityDirty","_isIdentity3x2Dirty","_updateIdentityStatus","isIdentity","isIdentityDirty","isIdentity3x2","isIdentity3x2Dirty","MatrixTrackPrecisionChange","MatrixTrackedMatrices","push","MatrixCurrentType","isIdentityAs3x2","determinant","m00","m01","m02","m03","m10","m20","m30","det_22_33","det_21_33","det_21_32","det_20_33","det_20_32","det_20_31","invertToRef","reset","resultM","otherM","addToSelf","IdentityToRef","cofact_00","cofact_01","cofact_02","cofact_03","det","detInv","det_12_33","det_11_33","det_11_32","det_10_33","det_10_32","det_10_31","det_12_23","det_11_23","det_11_22","det_10_23","det_10_22","det_10_21","cofact_10","cofact_11","cofact_12","cofact_13","cofact_20","cofact_21","cofact_22","cofact_23","cofact_30","cofact_31","cofact_32","cofact_33","addAtIndex","multiplyAtIndex","setTranslationFromFloats","addTranslationFromFloats","setTranslation","vector3","getTranslation","getTranslationToRef","removeRotationAndScaling","copyToArray","o","multiplyToArray","tm0","tm1","tm2","tm3","tm4","tm5","tm6","tm7","tm8","tm9","tm10","tm11","tm12","tm13","tm14","tm15","om0","om1","om2","om3","om4","om5","om6","om7","om8","om9","om10","om11","om12","om13","om14","om15","om","decomposeToTransformNode","node","rotationQuaternion","decompose","scaling","position","translation","preserveScalingNode","signX","signY","signZ","sx","sy","sz","getRow","getRowToRef","rowVector","setRow","row","setRowFromFloats","transpose","TransposeToRef","transposeToRef","toNormalMatrix","getRotationMatrix","getRotationMatrixToRef","toggleModelMatrixHandInPlace","toggleProjectionMatrixHandInPlace","_IdentityReadOnly","initialM11","initialM12","initialM13","initialM14","initialM21","initialM22","initialM23","initialM24","initialM31","initialM32","initialM33","initialM34","initialM41","initialM42","initialM43","initialM44","ComposeToRef","x2","y2","z2","xx","xy","xz","yy","yz","zz","wx","wy","wz","identity","FromValues","zero","RotationXToRef","c","RotationYToRef","RotationZToRef","c1","from","to","Cross","k","ScalingToRef","TranslationToRef","startValue","endValue","gradient","startM","endM","DecomposeLerpToRef","startScale","startRotation","startTranslation","endScale","endRotation","endTranslation","resultScale","resultRotation","resultTranslation","eye","LookAtLHToRef","xAxis","yAxis","zAxis","xSquareLength","ex","ey","ez","LookAtRHToRef","back","znear","zfar","halfZRange","OrthoLHToRef","b","mtxConvertNDCToHalfZRange","bottom","top","OrthoOffCenterLHToRef","i0","i1","OrthoOffCenterRHToRef","projectionPlaneTilt","rot","tan","fov","aspect","reverseDepthBufferMode","PerspectiveFovLHToRef","isVerticalFovFixed","f","PerspectiveFovRHToRef","rightHanded","rightHandedFactor","upTan","upDegrees","downTan","downDegrees","leftTan","leftDegrees","rightTan","rightDegrees","xScale","yScale","zmin","zmax","arr","Float32Array","rm","mm","ReflectionToRef","temp","temp2","temp3","xaxis","yaxis","zaxis","zw","zx","yw","xw","BuildTuple"],"sourceRoot":""}