@babylonjs/core 9.8.0 → 9.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/Audio/audioSceneComponent.pure.js +17 -9
  2. package/Bones/bone.pure.js +39 -29
  3. package/Cameras/arcRotateCamera.pure.d.ts +0 -8
  4. package/Cameras/arcRotateCamera.pure.js +0 -12
  5. package/Cameras/arcRotateCamera.pure.js.map +1 -1
  6. package/Cameras/inputMapper.d.ts +29 -8
  7. package/Cameras/inputMapper.js +63 -10
  8. package/Cameras/inputMapper.js.map +1 -1
  9. package/Cameras/targetCamera.pure.js +40 -27
  10. package/Culling/Helper/transformFeedbackBoundingHelper.pure.js +17 -23
  11. package/Engines/abstractEngine.pure.js +4 -4
  12. package/Engines/abstractEngine.pure.js.map +1 -1
  13. package/Engines/thinEngine.pure.js +234 -280
  14. package/Materials/Background/backgroundMaterial.pure.js +5 -4
  15. package/Materials/Background/backgroundMaterial.pure.js.map +1 -1
  16. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.d.ts +5 -0
  17. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.js +8 -0
  18. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.js.map +1 -0
  19. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +278 -0
  20. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +718 -0
  21. package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -0
  22. package/Materials/GaussianSplatting/pure.d.ts +1 -0
  23. package/Materials/GaussianSplatting/pure.js +1 -0
  24. package/Materials/GaussianSplatting/pure.js.map +1 -1
  25. package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +10 -14
  26. package/Materials/Node/Blocks/Dual/index.d.ts +0 -14
  27. package/Materials/Node/Blocks/Dual/index.js +0 -18
  28. package/Materials/Node/Blocks/Dual/index.js.map +1 -1
  29. package/Materials/Node/Blocks/Dual/textureBlock.pure.js +660 -662
  30. package/Materials/Node/Blocks/Fragment/index.d.ts +0 -10
  31. package/Materials/Node/Blocks/Fragment/index.js +0 -13
  32. package/Materials/Node/Blocks/Fragment/index.js.map +1 -1
  33. package/Materials/Node/Blocks/GaussianSplatting/index.d.ts +12 -0
  34. package/Materials/Node/Blocks/GaussianSplatting/index.js +14 -1
  35. package/Materials/Node/Blocks/GaussianSplatting/index.js.map +1 -1
  36. package/Materials/Node/Blocks/Vertex/index.d.ts +0 -8
  37. package/Materials/Node/Blocks/Vertex/index.js +0 -10
  38. package/Materials/Node/Blocks/Vertex/index.js.map +1 -1
  39. package/Materials/PBR/openpbrMaterial.pure.js +6 -5
  40. package/Materials/PBR/openpbrMaterial.pure.js.map +1 -1
  41. package/Materials/PBR/pbrBaseMaterial.pure.js +6 -5
  42. package/Materials/PBR/pbrBaseMaterial.pure.js.map +1 -1
  43. package/Materials/Textures/index.d.ts +1 -0
  44. package/Materials/Textures/index.js +1 -0
  45. package/Materials/Textures/index.js.map +1 -1
  46. package/Materials/Textures/internalTexture.js +7 -0
  47. package/Materials/Textures/internalTexture.js.map +1 -1
  48. package/Materials/Textures/texture.pure.js +157 -255
  49. package/Materials/index.d.ts +30 -0
  50. package/Materials/index.js +31 -0
  51. package/Materials/index.js.map +1 -1
  52. package/Materials/material.pure.js +128 -69
  53. package/Materials/pure.d.ts +1 -0
  54. package/Materials/pure.js +1 -0
  55. package/Materials/pure.js.map +1 -1
  56. package/Materials/standardMaterial.pure.js +6 -5
  57. package/Materials/standardMaterial.pure.js.map +1 -1
  58. package/Maths/math.color.pure.js +55 -47
  59. package/Maths/math.vector.pure.js +118 -242
  60. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.d.ts +7 -0
  61. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.js +8 -0
  62. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.js.map +1 -0
  63. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.d.ts +147 -0
  64. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.js +257 -0
  65. package/Meshes/GaussianSplatting/gaussianSplattingDebugger.pure.js.map +1 -0
  66. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +11 -0
  67. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +31 -0
  68. package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
  69. package/Meshes/GaussianSplatting/pure.d.ts +1 -0
  70. package/Meshes/GaussianSplatting/pure.js +1 -0
  71. package/Meshes/GaussianSplatting/pure.js.map +1 -1
  72. package/Meshes/GreasedLine/greasedLineMesh.pure.js +9 -14
  73. package/Meshes/GreasedLine/greasedLineRibbonMesh.pure.js +26 -27
  74. package/Meshes/index.d.ts +1 -0
  75. package/Meshes/index.js +1 -0
  76. package/Meshes/index.js.map +1 -1
  77. package/Meshes/meshSimplification.common.d.ts +53 -0
  78. package/Meshes/meshSimplification.common.js +34 -0
  79. package/Meshes/meshSimplification.common.js.map +1 -0
  80. package/Meshes/meshSimplification.d.ts +3 -53
  81. package/Meshes/meshSimplification.js +1 -33
  82. package/Meshes/meshSimplification.js.map +1 -1
  83. package/Meshes/meshSimplificationSceneComponent.pure.js.map +1 -1
  84. package/Meshes/meshSimplificationSceneComponent.types.d.ts +2 -1
  85. package/Meshes/meshSimplificationSceneComponent.types.js.map +1 -1
  86. package/Meshes/pure.d.ts +1 -0
  87. package/Meshes/pure.js +1 -0
  88. package/Meshes/pure.js.map +1 -1
  89. package/Meshes/transformNode.pure.js +82 -44
  90. package/Misc/tools.pure.js +124 -186
  91. package/Misc/tools.pure.js.map +1 -1
  92. package/Physics/v1/physicsImpostor.pure.js +43 -37
  93. package/Shaders/ShadersInclude/gaussianSplatting.js +33 -10
  94. package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
  95. package/Shaders/gaussianSplatting.vertex.js +20 -1
  96. package/Shaders/gaussianSplatting.vertex.js.map +1 -1
  97. package/Shaders/picking.fragment.js +4 -1
  98. package/Shaders/picking.fragment.js.map +1 -1
  99. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +33 -10
  100. package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
  101. package/ShadersWGSL/gaussianSplatting.vertex.js +21 -2
  102. package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
  103. package/package.json +3 -1
@@ -22,11 +22,10 @@ export class Vector2 {
22
22
  * @param y defines the second coordinate
23
23
  */
24
24
  constructor(
25
- /** [0] defines the first coordinate */
26
- x = 0,
27
- /** [0] defines the second coordinate */
28
- y = 0
29
- ) {
25
+ /** [0] defines the first coordinate */
26
+ x = 0,
27
+ /** [0] defines the second coordinate */
28
+ y = 0) {
30
29
  this.x = x;
31
30
  this.y = y;
32
31
  }
@@ -666,14 +665,12 @@ export class Vector2 {
666
665
  static CatmullRom(value1, value2, value3, value4, amount) {
667
666
  const squared = amount * amount;
668
667
  const cubed = amount * squared;
669
- const x =
670
- 0.5 *
668
+ const x = 0.5 *
671
669
  (2.0 * value2.x +
672
670
  (-value1.x + value3.x) * amount +
673
671
  (2.0 * value1.x - 5.0 * value2.x + 4.0 * value3.x - value4.x) * squared +
674
672
  (-value1.x + 3.0 * value2.x - 3.0 * value3.x + value4.x) * cubed);
675
- const y =
676
- 0.5 *
673
+ const y = 0.5 *
677
674
  (2.0 * value2.y +
678
675
  (-value1.y + value3.y) * amount +
679
676
  (2.0 * value1.y - 5.0 * value2.y + 4.0 * value3.y - value4.y) * squared +
@@ -1269,7 +1266,8 @@ export class Vector3 {
1269
1266
  //makes angle 90 degs to current vector
1270
1267
  if (theta > Math.PI / 2) {
1271
1268
  theta -= Math.PI / 2;
1272
- } else {
1269
+ }
1270
+ else {
1273
1271
  theta += Math.PI / 2;
1274
1272
  }
1275
1273
  //Calculates resutant normal vector from spherical coordinate of perpendicular vector
@@ -1288,13 +1286,8 @@ export class Vector3 {
1288
1286
  */
1289
1287
  applyRotationQuaternionToRef(q, result) {
1290
1288
  // Derived from https://raw.org/proof/vector-rotation-using-quaternions/
1291
- const vx = this._x,
1292
- vy = this._y,
1293
- vz = this._z;
1294
- const qx = q._x,
1295
- qy = q._y,
1296
- qz = q._z,
1297
- qw = q._w;
1289
+ const vx = this._x, vy = this._y, vz = this._z;
1290
+ const qx = q._x, qy = q._y, qz = q._z, qw = q._w;
1298
1291
  // t = 2q x v
1299
1292
  const tx = 2 * (qy * vz - qz * vy);
1300
1293
  const ty = 2 * (qz * vx - qx * vz);
@@ -1367,7 +1360,8 @@ export class Vector3 {
1367
1360
  //When the ray is close to parallel to the plane return infinity vector
1368
1361
  if (Math.abs(denom) < 0.0000000001) {
1369
1362
  result.setAll(Infinity);
1370
- } else {
1363
+ }
1364
+ else {
1371
1365
  const t = -(Vector3.Dot(origin, n) + d) / denom;
1372
1366
  // P = P0 + t*V
1373
1367
  const scaledV = V.scaleInPlace(t);
@@ -1921,7 +1915,8 @@ export class Vector3 {
1921
1915
  const invSin = 1 / Math.sin(omega);
1922
1916
  scale0 = Math.sin((1 - slerp) * omega) * invSin;
1923
1917
  scale1 = Math.sin(slerp * omega) * invSin;
1924
- } else {
1918
+ }
1919
+ else {
1925
1920
  // Use linear interpolation
1926
1921
  scale0 = 1 - slerp;
1927
1922
  scale1 = slerp;
@@ -2255,20 +2250,17 @@ export class Vector3 {
2255
2250
  static CatmullRom(value1, value2, value3, value4, amount) {
2256
2251
  const squared = amount * amount;
2257
2252
  const cubed = amount * squared;
2258
- const x =
2259
- 0.5 *
2253
+ const x = 0.5 *
2260
2254
  (2.0 * value2._x +
2261
2255
  (-value1._x + value3._x) * amount +
2262
2256
  (2.0 * value1._x - 5.0 * value2._x + 4.0 * value3._x - value4._x) * squared +
2263
2257
  (-value1._x + 3.0 * value2._x - 3.0 * value3._x + value4._x) * cubed);
2264
- const y =
2265
- 0.5 *
2258
+ const y = 0.5 *
2266
2259
  (2.0 * value2._y +
2267
2260
  (-value1._y + value3._y) * amount +
2268
2261
  (2.0 * value1._y - 5.0 * value2._y + 4.0 * value3._y - value4._y) * squared +
2269
2262
  (-value1._y + 3.0 * value2._y - 3.0 * value3._y + value4._y) * cubed);
2270
- const z =
2271
- 0.5 *
2263
+ const z = 0.5 *
2272
2264
  (2.0 * value2._z +
2273
2265
  (-value1._z + value3._z) * amount +
2274
2266
  (2.0 * value1._z - 5.0 * value2._z + 4.0 * value3._z - value4._z) * squared +
@@ -2609,7 +2601,8 @@ export class Vector3 {
2609
2601
  screenSource.y = -((sourceY / viewportHeight) * 2 - 1);
2610
2602
  if (EngineStore.LastCreatedEngine?.isNDCHalfZRange) {
2611
2603
  screenSource.z = sourceZ;
2612
- } else {
2604
+ }
2605
+ else {
2613
2606
  screenSource.z = 2 * sourceZ - 1.0;
2614
2607
  }
2615
2608
  Vector3.TransformCoordinatesToRef(screenSource, matrix, result);
@@ -2755,11 +2748,13 @@ export class Vector3 {
2755
2748
  edge.copyFrom(p1p0);
2756
2749
  e0 = p0;
2757
2750
  e1 = p1;
2758
- } else if (s1 > 0 && s2 < 0) {
2751
+ }
2752
+ else if (s1 > 0 && s2 < 0) {
2759
2753
  edge.copyFrom(p2p1);
2760
2754
  e0 = p1;
2761
2755
  e1 = p2;
2762
- } else {
2756
+ }
2757
+ else {
2763
2758
  edge.copyFrom(p2p0).scaleInPlace(-1);
2764
2759
  e0 = p2;
2765
2760
  e1 = p0;
@@ -3191,13 +3186,11 @@ export class Vector4 {
3191
3186
  * @returns true if they are equal
3192
3187
  */
3193
3188
  equalsWithEpsilon(otherVector, epsilon = Epsilon) {
3194
- return (
3195
- otherVector &&
3189
+ return (otherVector &&
3196
3190
  WithinEpsilon(this._x, otherVector.x, epsilon) &&
3197
3191
  WithinEpsilon(this._y, otherVector.y, epsilon) &&
3198
3192
  WithinEpsilon(this._z, otherVector.z, epsilon) &&
3199
- WithinEpsilon(this._w, otherVector.w, epsilon)
3200
- );
3193
+ WithinEpsilon(this._w, otherVector.w, epsilon));
3201
3194
  }
3202
3195
  /**
3203
3196
  * Boolean : True if the given floats are strictly equal to the current Vector4 coordinates.
@@ -3991,13 +3984,11 @@ export class Quaternion {
3991
3984
  * @returns true if the given quaternion coordinates are close to the current ones by a distance of epsilon.
3992
3985
  */
3993
3986
  equalsWithEpsilon(otherQuaternion, epsilon = Epsilon) {
3994
- return (
3995
- otherQuaternion &&
3987
+ return (otherQuaternion &&
3996
3988
  WithinEpsilon(this._x, otherQuaternion._x, epsilon) &&
3997
3989
  WithinEpsilon(this._y, otherQuaternion._y, epsilon) &&
3998
3990
  WithinEpsilon(this._z, otherQuaternion._z, epsilon) &&
3999
- WithinEpsilon(this._w, otherQuaternion._w, epsilon)
4000
- );
3991
+ WithinEpsilon(this._w, otherQuaternion._w, epsilon));
4001
3992
  }
4002
3993
  /**
4003
3994
  * Gets a boolean if two quaternions are equals (using an epsilon value), taking care of double cover : https://www.reedbeta.com/blog/why-quaternions-double-cover/
@@ -4006,8 +3997,7 @@ export class Quaternion {
4006
3997
  * @returns true if the given quaternion coordinates are close to the current ones by a distance of epsilon.
4007
3998
  */
4008
3999
  isApprox(otherQuaternion, epsilon = Epsilon) {
4009
- return (
4010
- otherQuaternion &&
4000
+ return (otherQuaternion &&
4011
4001
  ((WithinEpsilon(this._x, otherQuaternion._x, epsilon) &&
4012
4002
  WithinEpsilon(this._y, otherQuaternion._y, epsilon) &&
4013
4003
  WithinEpsilon(this._z, otherQuaternion._z, epsilon) &&
@@ -4015,8 +4005,7 @@ export class Quaternion {
4015
4005
  (WithinEpsilon(this._x, -otherQuaternion._x, epsilon) &&
4016
4006
  WithinEpsilon(this._y, -otherQuaternion._y, epsilon) &&
4017
4007
  WithinEpsilon(this._z, -otherQuaternion._z, epsilon) &&
4018
- WithinEpsilon(this._w, -otherQuaternion._w, epsilon)))
4019
- );
4008
+ WithinEpsilon(this._w, -otherQuaternion._w, epsilon))));
4020
4009
  }
4021
4010
  /**
4022
4011
  * Clone the current quaternion
@@ -4540,12 +4529,14 @@ export class Quaternion {
4540
4529
  result._x = Math.PI / 2;
4541
4530
  result._z = 0;
4542
4531
  result._isDirty = true;
4543
- } else if (zAxisY > limit) {
4532
+ }
4533
+ else if (zAxisY > limit) {
4544
4534
  result._y = 2 * Math.atan2(qy, qw);
4545
4535
  result._x = -Math.PI / 2;
4546
4536
  result._z = 0;
4547
4537
  result._isDirty = true;
4548
- } else {
4538
+ }
4539
+ else {
4549
4540
  const sqw = qw * qw;
4550
4541
  const sqz = qz * qz;
4551
4542
  const sqx = qx * qx;
@@ -4632,7 +4623,8 @@ export class Quaternion {
4632
4623
  if (sinHalfAngle > 0) {
4633
4624
  angle = 2 * Math.atan2(sinHalfAngle, cosHalfAngle);
4634
4625
  axis.set(this._x / sinHalfAngle, this._y / sinHalfAngle, this._z / sinHalfAngle);
4635
- } else {
4626
+ }
4627
+ else {
4636
4628
  angle = 0;
4637
4629
  axis.set(1, 0, 0);
4638
4630
  }
@@ -4659,15 +4651,9 @@ export class Quaternion {
4659
4651
  */
4660
4652
  static FromRotationMatrixToRef(matrix, result) {
4661
4653
  const data = matrix.m;
4662
- const m11 = data[0],
4663
- m12 = data[4],
4664
- m13 = data[8];
4665
- const m21 = data[1],
4666
- m22 = data[5],
4667
- m23 = data[9];
4668
- const m31 = data[2],
4669
- m32 = data[6],
4670
- m33 = data[10];
4654
+ const m11 = data[0], m12 = data[4], m13 = data[8];
4655
+ const m21 = data[1], m22 = data[5], m23 = data[9];
4656
+ const m31 = data[2], m32 = data[6], m33 = data[10];
4671
4657
  const trace = m11 + m22 + m33;
4672
4658
  let s;
4673
4659
  if (trace > 0) {
@@ -4677,21 +4663,24 @@ export class Quaternion {
4677
4663
  result._y = (m13 - m31) * s;
4678
4664
  result._z = (m21 - m12) * s;
4679
4665
  result._isDirty = true;
4680
- } else if (m11 > m22 && m11 > m33) {
4666
+ }
4667
+ else if (m11 > m22 && m11 > m33) {
4681
4668
  s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);
4682
4669
  result._w = (m32 - m23) / s;
4683
4670
  result._x = 0.25 * s;
4684
4671
  result._y = (m12 + m21) / s;
4685
4672
  result._z = (m13 + m31) / s;
4686
4673
  result._isDirty = true;
4687
- } else if (m22 > m33) {
4674
+ }
4675
+ else if (m22 > m33) {
4688
4676
  s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);
4689
4677
  result._w = (m13 - m31) / s;
4690
4678
  result._x = (m12 + m21) / s;
4691
4679
  result._y = 0.25 * s;
4692
4680
  result._z = (m23 + m32) / s;
4693
4681
  result._isDirty = true;
4694
- } else {
4682
+ }
4683
+ else {
4695
4684
  s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);
4696
4685
  result._w = (m21 - m12) / s;
4697
4686
  result._x = (m13 + m31) / s;
@@ -4912,10 +4901,12 @@ export class Quaternion {
4912
4901
  if (r < epsilon) {
4913
4902
  if (Math.abs(vecFrom.x) > Math.abs(vecFrom.z)) {
4914
4903
  result.set(-vecFrom.y, vecFrom.x, 0, 0);
4915
- } else {
4904
+ }
4905
+ else {
4916
4906
  result.set(0, -vecFrom.z, vecFrom.y, 0);
4917
4907
  }
4918
- } else {
4908
+ }
4909
+ else {
4919
4910
  Vector3.CrossToRef(vecFrom, vecTo, TmpVectors.Vector3[0]);
4920
4911
  result.set(TmpVectors.Vector3[0].x, TmpVectors.Vector3[0].y, TmpVectors.Vector3[0].z, r);
4921
4912
  }
@@ -5115,7 +5106,8 @@ export class Quaternion {
5115
5106
  if (num4 > 0.999999) {
5116
5107
  num3 = 1 - amount;
5117
5108
  num2 = flag ? -amount : amount;
5118
- } else {
5109
+ }
5110
+ else {
5119
5111
  const num5 = Math.acos(num4);
5120
5112
  const num6 = 1.0 / Math.sin(num5);
5121
5113
  num3 = Math.sin((1.0 - amount) * num5) * num6;
@@ -5400,21 +5392,21 @@ export class Matrix {
5400
5392
  const m = this._m;
5401
5393
  this._isIdentity =
5402
5394
  m[0] === 1.0 &&
5403
- m[1] === 0.0 &&
5404
- m[2] === 0.0 &&
5405
- m[3] === 0.0 &&
5406
- m[4] === 0.0 &&
5407
- m[5] === 1.0 &&
5408
- m[6] === 0.0 &&
5409
- m[7] === 0.0 &&
5410
- m[8] === 0.0 &&
5411
- m[9] === 0.0 &&
5412
- m[10] === 1.0 &&
5413
- m[11] === 0.0 &&
5414
- m[12] === 0.0 &&
5415
- m[13] === 0.0 &&
5416
- m[14] === 0.0 &&
5417
- m[15] === 1.0;
5395
+ m[1] === 0.0 &&
5396
+ m[2] === 0.0 &&
5397
+ m[3] === 0.0 &&
5398
+ m[4] === 0.0 &&
5399
+ m[5] === 1.0 &&
5400
+ m[6] === 0.0 &&
5401
+ m[7] === 0.0 &&
5402
+ m[8] === 0.0 &&
5403
+ m[9] === 0.0 &&
5404
+ m[10] === 1.0 &&
5405
+ m[11] === 0.0 &&
5406
+ m[12] === 0.0 &&
5407
+ m[13] === 0.0 &&
5408
+ m[14] === 0.0 &&
5409
+ m[15] === 1.0;
5418
5410
  }
5419
5411
  return this._isIdentity;
5420
5412
  }
@@ -5427,8 +5419,8 @@ export class Matrix {
5427
5419
  this._isIdentity3x2Dirty = false;
5428
5420
  if (this._m[0] !== 1.0 || this._m[5] !== 1.0 || this._m[15] !== 1.0) {
5429
5421
  this._isIdentity3x2 = false;
5430
- } else if (
5431
- this._m[1] !== 0.0 ||
5422
+ }
5423
+ else if (this._m[1] !== 0.0 ||
5432
5424
  this._m[2] !== 0.0 ||
5433
5425
  this._m[3] !== 0.0 ||
5434
5426
  this._m[4] !== 0.0 ||
@@ -5440,10 +5432,10 @@ export class Matrix {
5440
5432
  this._m[11] !== 0.0 ||
5441
5433
  this._m[12] !== 0.0 ||
5442
5434
  this._m[13] !== 0.0 ||
5443
- this._m[14] !== 0.0
5444
- ) {
5435
+ this._m[14] !== 0.0) {
5445
5436
  this._isIdentity3x2 = false;
5446
- } else {
5437
+ }
5438
+ else {
5447
5439
  this._isIdentity3x2 = true;
5448
5440
  }
5449
5441
  }
@@ -5459,22 +5451,10 @@ export class Matrix {
5459
5451
  return 1;
5460
5452
  }
5461
5453
  const m = this._m;
5462
- const m00 = m[0],
5463
- m01 = m[1],
5464
- m02 = m[2],
5465
- m03 = m[3];
5466
- const m10 = m[4],
5467
- m11 = m[5],
5468
- m12 = m[6],
5469
- m13 = m[7];
5470
- const m20 = m[8],
5471
- m21 = m[9],
5472
- m22 = m[10],
5473
- m23 = m[11];
5474
- const m30 = m[12],
5475
- m31 = m[13],
5476
- m32 = m[14],
5477
- m33 = m[15];
5454
+ const m00 = m[0], m01 = m[1], m02 = m[2], m03 = m[3];
5455
+ const m10 = m[4], m11 = m[5], m12 = m[6], m13 = m[7];
5456
+ const m20 = m[8], m21 = m[9], m22 = m[10], m23 = m[11];
5457
+ const m30 = m[12], m31 = m[13], m32 = m[14], m33 = m[15];
5478
5458
  // https://en.wikipedia.org/wiki/Laplace_expansion
5479
5459
  // to compute the deterrminant of a 4x4 Matrix we compute the cofactors of any row or column,
5480
5460
  // then we multiply each Cofactor by its corresponding matrix value and sum them all to get the determinant
@@ -5634,8 +5614,7 @@ export class Matrix {
5634
5614
  return this;
5635
5615
  }
5636
5616
  addInPlace(other) {
5637
- const m = this._m,
5638
- otherM = other.m;
5617
+ const m = this._m, otherM = other.m;
5639
5618
  for (let i = 0; i < 16; i++) {
5640
5619
  m[i] += otherM[i];
5641
5620
  }
@@ -5651,8 +5630,7 @@ export class Matrix {
5651
5630
  return this;
5652
5631
  }
5653
5632
  subtract(other) {
5654
- const m = this._m,
5655
- otherM = other.m;
5633
+ const m = this._m, otherM = other.m;
5656
5634
  for (let i = 0; i < 16; i++) {
5657
5635
  m[i] -= otherM[i];
5658
5636
  }
@@ -5660,9 +5638,7 @@ export class Matrix {
5660
5638
  return this;
5661
5639
  }
5662
5640
  subtractToRef(other, result) {
5663
- const m = this._m,
5664
- otherM = other.m,
5665
- resultM = result._m;
5641
+ const m = this._m, otherM = other.m, resultM = result._m;
5666
5642
  for (let i = 0; i < 16; i++) {
5667
5643
  resultM[i] = m[i] - otherM[i];
5668
5644
  }
@@ -5670,8 +5646,7 @@ export class Matrix {
5670
5646
  return result;
5671
5647
  }
5672
5648
  subtractInPlace(other) {
5673
- const m = this._m,
5674
- otherM = other.m;
5649
+ const m = this._m, otherM = other.m;
5675
5650
  for (let i = 0; i < 16; i++) {
5676
5651
  m[i] -= otherM[i];
5677
5652
  }
@@ -5682,10 +5657,7 @@ export class Matrix {
5682
5657
  return this.subtractFromFloatsToRef(...floats, new Matrix());
5683
5658
  }
5684
5659
  subtractFromFloatsToRef(...args) {
5685
- const result = args.pop(),
5686
- m = this._m,
5687
- resultM = result._m,
5688
- values = args;
5660
+ const result = args.pop(), m = this._m, resultM = result._m, values = args;
5689
5661
  for (let i = 0; i < 16; i++) {
5690
5662
  resultM[i] = m[i] - values[i];
5691
5663
  }
@@ -5705,7 +5677,8 @@ export class Matrix {
5705
5677
  }
5706
5678
  if (InvertMatrixToArray(this, other.asArray())) {
5707
5679
  other.markAsUpdated();
5708
- } else {
5680
+ }
5681
+ else {
5709
5682
  other.copyFrom(this);
5710
5683
  }
5711
5684
  return other;
@@ -5845,8 +5818,7 @@ export class Matrix {
5845
5818
  * @returns the current updated matrix
5846
5819
  */
5847
5820
  multiplyInPlace(other) {
5848
- const m = this._m,
5849
- otherM = other.m;
5821
+ const m = this._m, otherM = other.m;
5850
5822
  for (let i = 0; i < 16; i++) {
5851
5823
  m[i] *= otherM[i];
5852
5824
  }
@@ -5873,10 +5845,7 @@ export class Matrix {
5873
5845
  * @returns The updated ref
5874
5846
  */
5875
5847
  multiplyByFloatsToRef(...args) {
5876
- const result = args.pop(),
5877
- m = this._m,
5878
- resultM = result._m,
5879
- values = args;
5848
+ const result = args.pop(), m = this._m, resultM = result._m, values = args;
5880
5849
  for (let i = 0; i < 16; i++) {
5881
5850
  resultM[i] = m[i] * values[i];
5882
5851
  }
@@ -5919,9 +5888,7 @@ export class Matrix {
5919
5888
  return this.divideToRef(other, new Matrix());
5920
5889
  }
5921
5890
  divideToRef(other, result) {
5922
- const m = this._m,
5923
- otherM = other.m,
5924
- resultM = result._m;
5891
+ const m = this._m, otherM = other.m, resultM = result._m;
5925
5892
  for (let i = 0; i < 16; i++) {
5926
5893
  resultM[i] = m[i] / otherM[i];
5927
5894
  }
@@ -5929,8 +5896,7 @@ export class Matrix {
5929
5896
  return result;
5930
5897
  }
5931
5898
  divideInPlace(other) {
5932
- const m = this._m,
5933
- otherM = other.m;
5899
+ const m = this._m, otherM = other.m;
5934
5900
  for (let i = 0; i < 16; i++) {
5935
5901
  m[i] /= otherM[i];
5936
5902
  }
@@ -5938,8 +5904,7 @@ export class Matrix {
5938
5904
  return this;
5939
5905
  }
5940
5906
  minimizeInPlace(other) {
5941
- const m = this._m,
5942
- otherM = other.m;
5907
+ const m = this._m, otherM = other.m;
5943
5908
  for (let i = 0; i < 16; i++) {
5944
5909
  m[i] = Math.min(m[i], otherM[i]);
5945
5910
  }
@@ -5955,8 +5920,7 @@ export class Matrix {
5955
5920
  return this;
5956
5921
  }
5957
5922
  maximizeInPlace(other) {
5958
- const m = this._m,
5959
- otherM = other.m;
5923
+ const m = this._m, otherM = other.m;
5960
5924
  for (let i = 0; i < 16; i++) {
5961
5925
  m[i] = Math.min(m[i], otherM[i]);
5962
5926
  }
@@ -5983,8 +5947,7 @@ export class Matrix {
5983
5947
  return this;
5984
5948
  }
5985
5949
  negateToRef(result) {
5986
- const m = this._m,
5987
- resultM = result._m;
5950
+ const m = this._m, resultM = result._m;
5988
5951
  for (let i = 0; i < 16; i++) {
5989
5952
  resultM[i] = -m[i];
5990
5953
  }
@@ -6008,8 +5971,7 @@ export class Matrix {
6008
5971
  }
6009
5972
  const m = this.m;
6010
5973
  const om = other.m;
6011
- return (
6012
- m[0] === om[0] &&
5974
+ return (m[0] === om[0] &&
6013
5975
  m[1] === om[1] &&
6014
5976
  m[2] === om[2] &&
6015
5977
  m[3] === om[3] &&
@@ -6024,12 +5986,10 @@ export class Matrix {
6024
5986
  m[12] === om[12] &&
6025
5987
  m[13] === om[13] &&
6026
5988
  m[14] === om[14] &&
6027
- m[15] === om[15]
6028
- );
5989
+ m[15] === om[15]);
6029
5990
  }
6030
5991
  equalsWithEpsilon(other, epsilon = 0) {
6031
- const m = this._m,
6032
- otherM = other.m;
5992
+ const m = this._m, otherM = other.m;
6033
5993
  for (let i = 0; i < 16; i++) {
6034
5994
  if (!WithinEpsilon(m[i], otherM[i], epsilon)) {
6035
5995
  return false;
@@ -6050,8 +6010,7 @@ export class Matrix {
6050
6010
  return this.floorToRef(new Matrix());
6051
6011
  }
6052
6012
  floorToRef(result) {
6053
- const m = this._m,
6054
- resultM = result._m;
6013
+ const m = this._m, resultM = result._m;
6055
6014
  for (let i = 0; i < 16; i++) {
6056
6015
  resultM[i] = Math.floor(m[i]);
6057
6016
  }
@@ -6062,8 +6021,7 @@ export class Matrix {
6062
6021
  return this.fractToRef(new Matrix());
6063
6022
  }
6064
6023
  fractToRef(result) {
6065
- const m = this._m,
6066
- resultM = result._m;
6024
+ const m = this._m, resultM = result._m;
6067
6025
  for (let i = 0; i < 16; i++) {
6068
6026
  resultM[i] = m[i] - Math.floor(m[i]);
6069
6027
  }
@@ -6146,7 +6104,8 @@ export class Matrix {
6146
6104
  scale.x *= signX;
6147
6105
  scale.y *= signY;
6148
6106
  scale.z *= signZ;
6149
- } else {
6107
+ }
6108
+ else {
6150
6109
  if (this.determinant() <= 0) {
6151
6110
  scale.y *= -1;
6152
6111
  }
@@ -6158,28 +6117,8 @@ export class Matrix {
6158
6117
  return false;
6159
6118
  }
6160
6119
  if (rotation) {
6161
- const sx = 1 / scale._x,
6162
- sy = 1 / scale._y,
6163
- sz = 1 / scale._z;
6164
- Matrix.FromValuesToRef(
6165
- m[0] * sx,
6166
- m[1] * sx,
6167
- m[2] * sx,
6168
- 0.0,
6169
- m[4] * sy,
6170
- m[5] * sy,
6171
- m[6] * sy,
6172
- 0.0,
6173
- m[8] * sz,
6174
- m[9] * sz,
6175
- m[10] * sz,
6176
- 0.0,
6177
- 0.0,
6178
- 0.0,
6179
- 0.0,
6180
- 1.0,
6181
- MathTmp.Matrix[0]
6182
- );
6120
+ const sx = 1 / scale._x, sy = 1 / scale._y, sz = 1 / scale._z;
6121
+ 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]);
6183
6122
  Quaternion.FromRotationMatrixToRef(MathTmp.Matrix[0], rotation);
6184
6123
  }
6185
6124
  return true;
@@ -6345,9 +6284,7 @@ export class Matrix {
6345
6284
  return result;
6346
6285
  }
6347
6286
  const m = this._m;
6348
- const sx = 1 / scale._x,
6349
- sy = 1 / scale._y,
6350
- sz = 1 / scale._z;
6287
+ const sx = 1 / scale._x, sy = 1 / scale._y, sz = 1 / scale._z;
6351
6288
  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);
6352
6289
  return result;
6353
6290
  }
@@ -6461,25 +6398,7 @@ export class Matrix {
6461
6398
  * @param initialM44 defines 4th value of 4th row
6462
6399
  * @param result defines the target matrix
6463
6400
  */
6464
- static FromValuesToRef(
6465
- initialM11,
6466
- initialM12,
6467
- initialM13,
6468
- initialM14,
6469
- initialM21,
6470
- initialM22,
6471
- initialM23,
6472
- initialM24,
6473
- initialM31,
6474
- initialM32,
6475
- initialM33,
6476
- initialM34,
6477
- initialM41,
6478
- initialM42,
6479
- initialM43,
6480
- initialM44,
6481
- result
6482
- ) {
6401
+ static FromValuesToRef(initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44, result) {
6483
6402
  const m = result._m;
6484
6403
  m[0] = initialM11;
6485
6404
  m[1] = initialM12;
@@ -6519,24 +6438,7 @@ export class Matrix {
6519
6438
  * @param initialM44 defines 4th value of 4th row
6520
6439
  * @returns the new matrix
6521
6440
  */
6522
- static FromValues(
6523
- initialM11,
6524
- initialM12,
6525
- initialM13,
6526
- initialM14,
6527
- initialM21,
6528
- initialM22,
6529
- initialM23,
6530
- initialM24,
6531
- initialM31,
6532
- initialM32,
6533
- initialM33,
6534
- initialM34,
6535
- initialM41,
6536
- initialM42,
6537
- initialM43,
6538
- initialM44
6539
- ) {
6441
+ static FromValues(initialM11, initialM12, initialM13, initialM14, initialM21, initialM22, initialM23, initialM24, initialM31, initialM32, initialM33, initialM34, initialM41, initialM42, initialM43, initialM44) {
6540
6442
  const result = new Matrix();
6541
6443
  const m = result._m;
6542
6444
  m[0] = initialM11;
@@ -6582,25 +6484,12 @@ export class Matrix {
6582
6484
  */
6583
6485
  static ComposeToRef(scale, rotation, translation, result) {
6584
6486
  const m = result._m;
6585
- const x = rotation._x,
6586
- y = rotation._y,
6587
- z = rotation._z,
6588
- w = rotation._w;
6589
- const x2 = x + x,
6590
- y2 = y + y,
6591
- z2 = z + z;
6592
- const xx = x * x2,
6593
- xy = x * y2,
6594
- xz = x * z2;
6595
- const yy = y * y2,
6596
- yz = y * z2,
6597
- zz = z * z2;
6598
- const wx = w * x2,
6599
- wy = w * y2,
6600
- wz = w * z2;
6601
- const sx = scale._x,
6602
- sy = scale._y,
6603
- sz = scale._z;
6487
+ const x = rotation._x, y = rotation._y, z = rotation._z, w = rotation._w;
6488
+ const x2 = x + x, y2 = y + y, z2 = z + z;
6489
+ const xx = x * x2, xy = x * y2, xz = x * z2;
6490
+ const yy = y * y2, yz = y * z2, zz = z * z2;
6491
+ const wx = w * x2, wy = w * y2, wz = w * z2;
6492
+ const sx = scale._x, sy = scale._y, sz = scale._z;
6604
6493
  m[0] = (1 - (yy + zz)) * sx;
6605
6494
  m[1] = (xy + wz) * sx;
6606
6495
  m[2] = (xz - wy) * sx;
@@ -6807,7 +6696,8 @@ export class Matrix {
6807
6696
  m[9] = 0;
6808
6697
  m[10] = useYAxisForCoplanar ? -1 : 1;
6809
6698
  m[11] = 0;
6810
- } else {
6699
+ }
6700
+ else {
6811
6701
  const v = Vector3.Cross(to, from);
6812
6702
  const k = 1 / (1 + c);
6813
6703
  m[0] = v._x * v._x * k + c;
@@ -7030,7 +6920,8 @@ export class Matrix {
7030
6920
  const xSquareLength = xAxis.lengthSquared();
7031
6921
  if (xSquareLength === 0) {
7032
6922
  xAxis.x = 1.0;
7033
- } else {
6923
+ }
6924
+ else {
7034
6925
  xAxis.normalizeFromLength(Math.sqrt(xSquareLength));
7035
6926
  }
7036
6927
  // Y axis
@@ -7081,7 +6972,8 @@ export class Matrix {
7081
6972
  const xSquareLength = xAxis.lengthSquared();
7082
6973
  if (xSquareLength === 0) {
7083
6974
  xAxis.x = 1.0;
7084
- } else {
6975
+ }
6976
+ else {
7085
6977
  xAxis.normalizeFromLength(Math.sqrt(xSquareLength));
7086
6978
  }
7087
6979
  // Y axis
@@ -7631,25 +7523,7 @@ export class Matrix {
7631
7523
  const temp = -2 * x;
7632
7524
  const temp2 = -2 * y;
7633
7525
  const temp3 = -2 * z;
7634
- Matrix.FromValuesToRef(
7635
- temp * x + 1,
7636
- temp2 * x,
7637
- temp3 * x,
7638
- 0.0,
7639
- temp * y,
7640
- temp2 * y + 1,
7641
- temp3 * y,
7642
- 0.0,
7643
- temp * z,
7644
- temp2 * z,
7645
- temp3 * z + 1,
7646
- 0.0,
7647
- temp * plane.d,
7648
- temp2 * plane.d,
7649
- temp3 * plane.d,
7650
- 1.0,
7651
- result
7652
- );
7526
+ 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);
7653
7527
  return result;
7654
7528
  }
7655
7529
  /**
@@ -7705,7 +7579,8 @@ Matrix._IdentityReadOnly = /*#__PURE__*/ Matrix.Identity();
7705
7579
  * @internal
7706
7580
  * Same as Tmp but not exported to keep it only for math functions to avoid conflicts
7707
7581
  */
7708
- class MathTmp {}
7582
+ class MathTmp {
7583
+ }
7709
7584
  // Temporary Vector3s
7710
7585
  MathTmp.Vector3 = /*#__PURE__*/ BuildTuple(11, Vector3.Zero);
7711
7586
  // Temporary Matricies
@@ -7715,7 +7590,8 @@ MathTmp.Quaternion = /*#__PURE__*/ BuildTuple(3, Quaternion.Zero);
7715
7590
  /**
7716
7591
  * @internal
7717
7592
  */
7718
- export class TmpVectors {}
7593
+ export class TmpVectors {
7594
+ }
7719
7595
  /** 3 temp Vector2 at once should be enough */
7720
7596
  TmpVectors.Vector2 = /*#__PURE__*/ BuildTuple(3, Vector2.Zero);
7721
7597
  /** 13 temp Vector3 at once should be enough */
@@ -7762,4 +7638,4 @@ export function RegisterMathVector() {
7762
7638
  RegisterClass("BABYLON.Vector4", Vector4);
7763
7639
  RegisterClass("BABYLON.Matrix", Matrix);
7764
7640
  }
7765
- //# sourceMappingURL=math.vector.pure.js.map
7641
+ //# sourceMappingURL=math.vector.pure.js.map