@babylonjs/core 8.8.5 → 8.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/Animations/animatable.core.js +2 -2
  2. package/Animations/animatable.core.js.map +1 -1
  3. package/AudioV2/abstractAudio/abstractSound.d.ts +0 -7
  4. package/AudioV2/abstractAudio/abstractSound.js.map +1 -1
  5. package/AudioV2/abstractAudio/abstractSoundSource.d.ts +6 -3
  6. package/AudioV2/abstractAudio/abstractSoundSource.js +1 -2
  7. package/AudioV2/abstractAudio/abstractSoundSource.js.map +1 -1
  8. package/AudioV2/webAudio/webAudioEngine.js +4 -1
  9. package/AudioV2/webAudio/webAudioEngine.js.map +1 -1
  10. package/AudioV2/webAudio/webAudioSoundSource.js +1 -1
  11. package/AudioV2/webAudio/webAudioSoundSource.js.map +1 -1
  12. package/AudioV2/webAudio/webAudioStaticSound.js +1 -1
  13. package/AudioV2/webAudio/webAudioStaticSound.js.map +1 -1
  14. package/AudioV2/webAudio/webAudioStreamingSound.js +1 -1
  15. package/AudioV2/webAudio/webAudioStreamingSound.js.map +1 -1
  16. package/Cameras/targetCamera.d.ts +0 -4
  17. package/Cameras/targetCamera.js +0 -28
  18. package/Cameras/targetCamera.js.map +1 -1
  19. package/Collisions/gpuPicker.d.ts +3 -0
  20. package/Collisions/gpuPicker.js +26 -2
  21. package/Collisions/gpuPicker.js.map +1 -1
  22. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js +22 -15
  23. package/Engines/AbstractEngine/abstractEngine.cubeTexture.js.map +1 -1
  24. package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.d.ts +1 -0
  25. package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js +8 -0
  26. package/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js.map +1 -1
  27. package/Engines/WebGPU/webgpuBufferManager.js +5 -2
  28. package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
  29. package/Engines/abstractEngine.js +2 -2
  30. package/Engines/abstractEngine.js.map +1 -1
  31. package/Engines/constants.d.ts +5 -0
  32. package/Engines/constants.js +5 -0
  33. package/Engines/constants.js.map +1 -1
  34. package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js +1 -1
  35. package/FlowGraph/Blocks/Data/flowGraphDataSwitchBlock.js.map +1 -1
  36. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.d.ts +2 -1
  37. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js +5 -4
  38. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.js.map +1 -1
  39. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.d.ts +3 -1
  40. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js +26 -4
  41. package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphSetDelayBlock.js.map +1 -1
  42. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.d.ts +3 -0
  43. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js +13 -0
  44. package/FrameGraph/Node/Blocks/Rendering/csmShadowGeneratorBlock.js.map +1 -1
  45. package/FrameGraph/Node/nodeRenderGraph.d.ts +1 -1
  46. package/FrameGraph/Node/nodeRenderGraph.js +1 -1
  47. package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
  48. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.d.ts +7 -0
  49. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js +17 -0
  50. package/FrameGraph/Tasks/Rendering/csmShadowGeneratorTask.js.map +1 -1
  51. package/FrameGraph/frameGraph.d.ts +2 -0
  52. package/FrameGraph/frameGraph.js +2 -0
  53. package/FrameGraph/frameGraph.js.map +1 -1
  54. package/Gizmos/planeRotationGizmo.js +1 -1
  55. package/Gizmos/planeRotationGizmo.js.map +1 -1
  56. package/Helpers/environmentHelper.js +3 -3
  57. package/Helpers/environmentHelper.js.map +1 -1
  58. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +1 -0
  59. package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
  60. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +4 -1
  61. package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
  62. package/Materials/PBR/pbrBRDFConfiguration.d.ts +30 -0
  63. package/Materials/PBR/pbrBRDFConfiguration.js +45 -0
  64. package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
  65. package/Materials/PBR/pbrBaseMaterial.d.ts +0 -10
  66. package/Materials/PBR/pbrBaseMaterial.js +0 -13
  67. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  68. package/Materials/PBR/pbrMaterial.d.ts +0 -16
  69. package/Materials/PBR/pbrMaterial.decalMap.js +0 -5
  70. package/Materials/PBR/pbrMaterial.decalMap.js.map +1 -1
  71. package/Materials/PBR/pbrMaterial.js +1 -30
  72. package/Materials/PBR/pbrMaterial.js.map +1 -1
  73. package/Materials/Textures/renderTargetTexture.d.ts +4 -4
  74. package/Materials/Textures/renderTargetTexture.js +3 -1
  75. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  76. package/Materials/effectRenderer.d.ts +1 -0
  77. package/Materials/effectRenderer.js +3 -1
  78. package/Materials/effectRenderer.js.map +1 -1
  79. package/Materials/shaderMaterial.d.ts +7 -8
  80. package/Materials/shaderMaterial.js +21 -15
  81. package/Materials/shaderMaterial.js.map +1 -1
  82. package/Materials/standardMaterial.decalMap.js +0 -5
  83. package/Materials/standardMaterial.decalMap.js.map +1 -1
  84. package/Materials/standardMaterial.js +1 -1
  85. package/Materials/standardMaterial.js.map +1 -1
  86. package/Maths/ThinMaths/thinMath.matrix.functions.d.ts +11 -11
  87. package/Maths/ThinMaths/thinMath.matrix.functions.js.map +1 -1
  88. package/Maths/math.like.d.ts +2 -2
  89. package/Maths/math.like.js.map +1 -1
  90. package/Maths/math.vector.d.ts +23 -17
  91. package/Maths/math.vector.js +144 -115
  92. package/Maths/math.vector.js.map +1 -1
  93. package/Meshes/Node/nodeGeometry.d.ts +1 -1
  94. package/Meshes/Node/nodeGeometry.js +1 -1
  95. package/Meshes/Node/nodeGeometry.js.map +1 -1
  96. package/Meshes/csg2.js +1 -1
  97. package/Meshes/csg2.js.map +1 -1
  98. package/Meshes/instancedMesh.js +12 -2
  99. package/Meshes/instancedMesh.js.map +1 -1
  100. package/Meshes/mesh.d.ts +2 -2
  101. package/Meshes/mesh.js.map +1 -1
  102. package/Misc/minMaxReducer.js +5 -0
  103. package/Misc/minMaxReducer.js.map +1 -1
  104. package/Offline/database.d.ts +1 -1
  105. package/Offline/database.js +5 -5
  106. package/Offline/database.js.map +1 -1
  107. package/Rendering/depthPeelingRenderer.d.ts +1 -1
  108. package/Rendering/depthPeelingRenderer.js +1 -1
  109. package/Rendering/depthPeelingRenderer.js.map +1 -1
  110. package/Rendering/edgesRenderer.d.ts +1 -1
  111. package/Rendering/edgesRenderer.js +2 -2
  112. package/Rendering/edgesRenderer.js.map +1 -1
  113. package/Rendering/fluidRenderer/fluidRenderer.d.ts +1 -1
  114. package/Rendering/fluidRenderer/fluidRenderer.js +1 -1
  115. package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
  116. package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +1 -1
  117. package/Rendering/fluidRenderer/fluidRenderingObject.js +1 -1
  118. package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
  119. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.d.ts +1 -1
  120. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js +1 -1
  121. package/Rendering/fluidRenderer/fluidRenderingObjectCustomParticles.js.map +1 -1
  122. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +1 -1
  123. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +1 -1
  124. package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
  125. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.d.ts +2 -2
  126. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +2 -2
  127. package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
  128. package/Rendering/prePassEffectConfiguration.d.ts +5 -0
  129. package/Rendering/prePassEffectConfiguration.js.map +1 -1
  130. package/Rendering/prePassRenderer.js +3 -0
  131. package/Rendering/prePassRenderer.js.map +1 -1
  132. package/Rendering/subSurfaceConfiguration.d.ts +6 -1
  133. package/Rendering/subSurfaceConfiguration.js +6 -1
  134. package/Rendering/subSurfaceConfiguration.js.map +1 -1
  135. package/Shaders/ShadersInclude/hdrFilteringFunctions.js +15 -14
  136. package/Shaders/ShadersInclude/hdrFilteringFunctions.js.map +1 -1
  137. package/Shaders/ShadersInclude/pbrBRDFFunctions.js +3 -0
  138. package/Shaders/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
  139. package/Shaders/ShadersInclude/pbrBlockReflection.js +1 -1
  140. package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
  141. package/Shaders/ShadersInclude/pbrBlockReflectivity.js +2 -2
  142. package/Shaders/ShadersInclude/pbrBlockReflectivity.js.map +1 -1
  143. package/Shaders/ShadersInclude/pbrBlockSubSurface.js +4 -4
  144. package/Shaders/ShadersInclude/pbrBlockSubSurface.js.map +1 -1
  145. package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js +6 -2
  146. package/Shaders/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  147. package/Shaders/pbr.fragment.js +6 -2
  148. package/Shaders/pbr.fragment.js.map +1 -1
  149. package/Shaders/pbr.vertex.d.ts +1 -0
  150. package/Shaders/pbr.vertex.js +12 -4
  151. package/Shaders/pbr.vertex.js.map +1 -1
  152. package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js +3 -0
  153. package/ShadersWGSL/ShadersInclude/pbrBRDFFunctions.js.map +1 -1
  154. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +1 -1
  155. package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
  156. package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js +2 -2
  157. package/ShadersWGSL/ShadersInclude/pbrBlockReflectivity.js.map +1 -1
  158. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js +7 -2
  159. package/ShadersWGSL/ShadersInclude/pbrDirectLightingFunctions.js.map +1 -1
  160. package/ShadersWGSL/pbr.fragment.js +2 -1
  161. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  162. package/ShadersWGSL/pbr.vertex.d.ts +1 -0
  163. package/ShadersWGSL/pbr.vertex.js +5 -2
  164. package/ShadersWGSL/pbr.vertex.js.map +1 -1
  165. package/assetContainer.js +13 -13
  166. package/assetContainer.js.map +1 -1
  167. package/package.json +1 -1
  168. package/scene.d.ts +4 -0
  169. package/scene.js +21 -15
  170. package/scene.js.map +1 -1
  171. package/sceneComponent.d.ts +1 -1
  172. package/sceneComponent.js.map +1 -1
@@ -1258,8 +1258,8 @@ export class Vector3 {
1258
1258
  * so saves on memory rather than importing whole Spherical Class
1259
1259
  */
1260
1260
  const radius = this.length();
1261
- let theta = Math.acos(this.y / radius);
1262
- const phi = Math.atan2(this.z, this.x);
1261
+ let theta = Math.acos(this._y / radius);
1262
+ const phi = Math.atan2(this._z, this._x);
1263
1263
  //makes angle 90 degs to current vector
1264
1264
  if (theta > Math.PI / 2) {
1265
1265
  theta -= Math.PI / 2;
@@ -1591,7 +1591,7 @@ export class Vector3 {
1591
1591
  * @returns a new Vector3
1592
1592
  */
1593
1593
  floor() {
1594
- return new Vector3(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z));
1594
+ return new Vector3(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));
1595
1595
  }
1596
1596
  /**
1597
1597
  * Gets the current Vector3's fractional values and stores them in result
@@ -1599,9 +1599,9 @@ export class Vector3 {
1599
1599
  * @returns the result vector
1600
1600
  */
1601
1601
  fractToRef(result) {
1602
- result._x = this.x - Math.floor(this._x);
1603
- result._y = this.y - Math.floor(this._y);
1604
- result._z = this.z - Math.floor(this._z);
1602
+ result._x = this._x - Math.floor(this._x);
1603
+ result._y = this._y - Math.floor(this._y);
1604
+ result._z = this._z - Math.floor(this._z);
1605
1605
  result._isDirty = true;
1606
1606
  return result;
1607
1607
  }
@@ -1611,7 +1611,7 @@ export class Vector3 {
1611
1611
  * @returns a new Vector3
1612
1612
  */
1613
1613
  fract() {
1614
- return new Vector3(this.x - Math.floor(this._x), this.y - Math.floor(this._y), this.z - Math.floor(this._z));
1614
+ return new Vector3(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z));
1615
1615
  }
1616
1616
  // Properties
1617
1617
  /**
@@ -2887,6 +2887,41 @@ Object.defineProperties(Vector3.prototype, {
2887
2887
  * Vector4 class created for EulerAngle class conversion to Quaternion
2888
2888
  */
2889
2889
  export class Vector4 {
2890
+ // ---------------------------------
2891
+ // Getters / setters (same pattern as Vector3)
2892
+ // ---------------------------------
2893
+ /** Gets or sets the x coordinate */
2894
+ get x() {
2895
+ return this._x;
2896
+ }
2897
+ set x(value) {
2898
+ this._x = value;
2899
+ this._isDirty = true;
2900
+ }
2901
+ /** Gets or sets the y coordinate */
2902
+ get y() {
2903
+ return this._y;
2904
+ }
2905
+ set y(value) {
2906
+ this._y = value;
2907
+ this._isDirty = true;
2908
+ }
2909
+ /** Gets or sets the z coordinate */
2910
+ get z() {
2911
+ return this._z;
2912
+ }
2913
+ set z(value) {
2914
+ this._z = value;
2915
+ this._isDirty = true;
2916
+ }
2917
+ /** Gets or sets the w coordinate */
2918
+ get w() {
2919
+ return this._w;
2920
+ }
2921
+ set w(value) {
2922
+ this._w = value;
2923
+ this._isDirty = true;
2924
+ }
2890
2925
  /**
2891
2926
  * Creates a Vector4 object from the given floats.
2892
2927
  * @param x x value of the vector
@@ -2894,26 +2929,20 @@ export class Vector4 {
2894
2929
  * @param z z value of the vector
2895
2930
  * @param w w value of the vector
2896
2931
  */
2897
- constructor(
2898
- /** [0] x value of the vector */
2899
- x = 0,
2900
- /** [0] y value of the vector */
2901
- y = 0,
2902
- /** [0] z value of the vector */
2903
- z = 0,
2904
- /** [0] w value of the vector */
2905
- w = 0) {
2906
- this.x = x;
2907
- this.y = y;
2908
- this.z = z;
2909
- this.w = w;
2932
+ constructor(x = 0, y = 0, z = 0, w = 0) {
2933
+ /** @internal */
2934
+ this._isDirty = true;
2935
+ this._x = x;
2936
+ this._y = y;
2937
+ this._z = z;
2938
+ this._w = w;
2910
2939
  }
2911
2940
  /**
2912
2941
  * Returns the string with the Vector4 coordinates.
2913
2942
  * @returns a string containing all the vector values
2914
2943
  */
2915
2944
  toString() {
2916
- return `{X: ${this.x} Y: ${this.y} Z: ${this.z} W: ${this.w}}`;
2945
+ return `{X: ${this._x} Y: ${this._y} Z: ${this._z} W: ${this._w}}`;
2917
2946
  }
2918
2947
  /**
2919
2948
  * Returns the string "Vector4".
@@ -2927,10 +2956,10 @@ export class Vector4 {
2927
2956
  * @returns a unique hash code
2928
2957
  */
2929
2958
  getHashCode() {
2930
- const x = ExtractAsInt(this.x);
2931
- const y = ExtractAsInt(this.y);
2932
- const z = ExtractAsInt(this.z);
2933
- const w = ExtractAsInt(this.w);
2959
+ const x = ExtractAsInt(this._x);
2960
+ const y = ExtractAsInt(this._y);
2961
+ const z = ExtractAsInt(this._z);
2962
+ const w = ExtractAsInt(this._w);
2934
2963
  let hash = x;
2935
2964
  hash = (hash * 397) ^ y;
2936
2965
  hash = (hash * 397) ^ z;
@@ -2943,7 +2972,7 @@ export class Vector4 {
2943
2972
  * @returns the resulting array
2944
2973
  */
2945
2974
  asArray() {
2946
- return [this.x, this.y, this.z, this.w];
2975
+ return [this._x, this._y, this._z, this._w];
2947
2976
  }
2948
2977
  /**
2949
2978
  * Populates the given array from the given index with the Vector4 coordinates.
@@ -2955,10 +2984,10 @@ export class Vector4 {
2955
2984
  if (index === undefined) {
2956
2985
  index = 0;
2957
2986
  }
2958
- array[index] = this.x;
2959
- array[index + 1] = this.y;
2960
- array[index + 2] = this.z;
2961
- array[index + 3] = this.w;
2987
+ array[index] = this._x;
2988
+ array[index + 1] = this._y;
2989
+ array[index + 2] = this._z;
2990
+ array[index + 3] = this._w;
2962
2991
  return this;
2963
2992
  }
2964
2993
  /**
@@ -2977,10 +3006,10 @@ export class Vector4 {
2977
3006
  * @returns the updated Vector4.
2978
3007
  */
2979
3008
  addInPlace(otherVector) {
2980
- this.x += otherVector.x;
2981
- this.y += otherVector.y;
2982
- this.z += otherVector.z;
2983
- this.w += otherVector.w;
3009
+ this.x += otherVector._x;
3010
+ this.y += otherVector._y;
3011
+ this.z += otherVector._z;
3012
+ this.w += otherVector._w;
2984
3013
  return this;
2985
3014
  }
2986
3015
  /**
@@ -3004,7 +3033,7 @@ export class Vector4 {
3004
3033
  * @returns the resulting vector
3005
3034
  */
3006
3035
  add(otherVector) {
3007
- return new Vector4(this.x + otherVector.x, this.y + otherVector.y, this.z + otherVector.z, this.w + otherVector.w);
3036
+ return new Vector4(this._x + otherVector.x, this._y + otherVector.y, this._z + otherVector.z, this._w + otherVector.w);
3008
3037
  }
3009
3038
  /**
3010
3039
  * Updates the given vector "result" with the result of the addition of the current Vector4 and the given one.
@@ -3013,10 +3042,10 @@ export class Vector4 {
3013
3042
  * @returns result input
3014
3043
  */
3015
3044
  addToRef(otherVector, result) {
3016
- result.x = this.x + otherVector.x;
3017
- result.y = this.y + otherVector.y;
3018
- result.z = this.z + otherVector.z;
3019
- result.w = this.w + otherVector.w;
3045
+ result.x = this._x + otherVector.x;
3046
+ result.y = this._y + otherVector.y;
3047
+ result.z = this._z + otherVector.z;
3048
+ result.w = this._w + otherVector.w;
3020
3049
  return result;
3021
3050
  }
3022
3051
  /**
@@ -3037,7 +3066,7 @@ export class Vector4 {
3037
3066
  * @returns the new vector with the result
3038
3067
  */
3039
3068
  subtract(otherVector) {
3040
- return new Vector4(this.x - otherVector.x, this.y - otherVector.y, this.z - otherVector.z, this.w - otherVector.w);
3069
+ return new Vector4(this._x - otherVector.x, this._y - otherVector.y, this._z - otherVector.z, this._w - otherVector.w);
3041
3070
  }
3042
3071
  /**
3043
3072
  * Sets the given vector "result" with the result of the subtraction of the given vector from the current Vector4.
@@ -3046,10 +3075,10 @@ export class Vector4 {
3046
3075
  * @returns result input
3047
3076
  */
3048
3077
  subtractToRef(otherVector, result) {
3049
- result.x = this.x - otherVector.x;
3050
- result.y = this.y - otherVector.y;
3051
- result.z = this.z - otherVector.z;
3052
- result.w = this.w - otherVector.w;
3078
+ result.x = this._x - otherVector.x;
3079
+ result.y = this._y - otherVector.y;
3080
+ result.z = this._z - otherVector.z;
3081
+ result.w = this._w - otherVector.w;
3053
3082
  return result;
3054
3083
  }
3055
3084
  /**
@@ -3061,7 +3090,7 @@ export class Vector4 {
3061
3090
  * @returns new vector containing the result
3062
3091
  */
3063
3092
  subtractFromFloats(x, y, z, w) {
3064
- return new Vector4(this.x - x, this.y - y, this.z - z, this.w - w);
3093
+ return new Vector4(this._x - x, this._y - y, this._z - z, this._w - w);
3065
3094
  }
3066
3095
  /**
3067
3096
  * Sets the given vector "result" set with the result of the subtraction of the given floats from the current Vector4 coordinates.
@@ -3073,10 +3102,10 @@ export class Vector4 {
3073
3102
  * @returns result input
3074
3103
  */
3075
3104
  subtractFromFloatsToRef(x, y, z, w, result) {
3076
- result.x = this.x - x;
3077
- result.y = this.y - y;
3078
- result.z = this.z - z;
3079
- result.w = this.w - w;
3105
+ result.x = this._x - x;
3106
+ result.y = this._y - y;
3107
+ result.z = this._z - z;
3108
+ result.w = this._w - w;
3080
3109
  return result;
3081
3110
  }
3082
3111
  /**
@@ -3084,7 +3113,7 @@ export class Vector4 {
3084
3113
  * @returns a new vector with the negated values
3085
3114
  */
3086
3115
  negate() {
3087
- return new Vector4(-this.x, -this.y, -this.z, -this.w);
3116
+ return new Vector4(-this._x, -this._y, -this._z, -this._w);
3088
3117
  }
3089
3118
  /**
3090
3119
  * Negate this vector in place
@@ -3103,10 +3132,10 @@ export class Vector4 {
3103
3132
  * @returns the result
3104
3133
  */
3105
3134
  negateToRef(result) {
3106
- result.x = -this.x;
3107
- result.y = -this.y;
3108
- result.z = -this.z;
3109
- result.w = -this.w;
3135
+ result.x = -this._x;
3136
+ result.y = -this._y;
3137
+ result.z = -this._z;
3138
+ result.w = -this._w;
3110
3139
  return result;
3111
3140
  }
3112
3141
  /**
@@ -3127,7 +3156,7 @@ export class Vector4 {
3127
3156
  * @returns a new vector with the result
3128
3157
  */
3129
3158
  scale(scale) {
3130
- return new Vector4(this.x * scale, this.y * scale, this.z * scale, this.w * scale);
3159
+ return new Vector4(this._x * scale, this._y * scale, this._z * scale, this._w * scale);
3131
3160
  }
3132
3161
  /**
3133
3162
  * Sets the given vector "result" with the current Vector4 coordinates multiplied by scale (float).
@@ -3136,10 +3165,10 @@ export class Vector4 {
3136
3165
  * @returns result input
3137
3166
  */
3138
3167
  scaleToRef(scale, result) {
3139
- result.x = this.x * scale;
3140
- result.y = this.y * scale;
3141
- result.z = this.z * scale;
3142
- result.w = this.w * scale;
3168
+ result.x = this._x * scale;
3169
+ result.y = this._y * scale;
3170
+ result.z = this._z * scale;
3171
+ result.w = this._w * scale;
3143
3172
  return result;
3144
3173
  }
3145
3174
  /**
@@ -3149,10 +3178,10 @@ export class Vector4 {
3149
3178
  * @returns result input
3150
3179
  */
3151
3180
  scaleAndAddToRef(scale, result) {
3152
- result.x += this.x * scale;
3153
- result.y += this.y * scale;
3154
- result.z += this.z * scale;
3155
- result.w += this.w * scale;
3181
+ result.x += this._x * scale;
3182
+ result.y += this._y * scale;
3183
+ result.z += this._z * scale;
3184
+ result.w += this._w * scale;
3156
3185
  return result;
3157
3186
  }
3158
3187
  /**
@@ -3161,7 +3190,7 @@ export class Vector4 {
3161
3190
  * @returns true if they are equal
3162
3191
  */
3163
3192
  equals(otherVector) {
3164
- return otherVector && this.x === otherVector.x && this.y === otherVector.y && this.z === otherVector.z && this.w === otherVector.w;
3193
+ return otherVector && this._x === otherVector.x && this._y === otherVector.y && this._z === otherVector.z && this._w === otherVector.w;
3165
3194
  }
3166
3195
  /**
3167
3196
  * Boolean : True if the current Vector4 coordinates are each beneath the distance "epsilon" from the given vector ones.
@@ -3171,10 +3200,10 @@ export class Vector4 {
3171
3200
  */
3172
3201
  equalsWithEpsilon(otherVector, epsilon = Epsilon) {
3173
3202
  return (otherVector &&
3174
- WithinEpsilon(this.x, otherVector.x, epsilon) &&
3175
- WithinEpsilon(this.y, otherVector.y, epsilon) &&
3176
- WithinEpsilon(this.z, otherVector.z, epsilon) &&
3177
- WithinEpsilon(this.w, otherVector.w, epsilon));
3203
+ WithinEpsilon(this._x, otherVector.x, epsilon) &&
3204
+ WithinEpsilon(this._y, otherVector.y, epsilon) &&
3205
+ WithinEpsilon(this._z, otherVector.z, epsilon) &&
3206
+ WithinEpsilon(this._w, otherVector.w, epsilon));
3178
3207
  }
3179
3208
  /**
3180
3209
  * Boolean : True if the given floats are strictly equal to the current Vector4 coordinates.
@@ -3185,7 +3214,7 @@ export class Vector4 {
3185
3214
  * @returns true if equal
3186
3215
  */
3187
3216
  equalsToFloats(x, y, z, w) {
3188
- return this.x === x && this.y === y && this.z === z && this.w === w;
3217
+ return this._x === x && this._y === y && this._z === z && this._w === w;
3189
3218
  }
3190
3219
  /**
3191
3220
  * Multiplies in place the current Vector4 by the given one.
@@ -3205,7 +3234,7 @@ export class Vector4 {
3205
3234
  * @returns resulting new vector
3206
3235
  */
3207
3236
  multiply(otherVector) {
3208
- return new Vector4(this.x * otherVector.x, this.y * otherVector.y, this.z * otherVector.z, this.w * otherVector.w);
3237
+ return new Vector4(this._x * otherVector.x, this._y * otherVector.y, this._z * otherVector.z, this._w * otherVector.w);
3209
3238
  }
3210
3239
  /**
3211
3240
  * Updates the given vector "result" with the multiplication result of the current Vector4 and the given one.
@@ -3214,10 +3243,10 @@ export class Vector4 {
3214
3243
  * @returns result input
3215
3244
  */
3216
3245
  multiplyToRef(otherVector, result) {
3217
- result.x = this.x * otherVector.x;
3218
- result.y = this.y * otherVector.y;
3219
- result.z = this.z * otherVector.z;
3220
- result.w = this.w * otherVector.w;
3246
+ result.x = this._x * otherVector.x;
3247
+ result.y = this._y * otherVector.y;
3248
+ result.z = this._z * otherVector.z;
3249
+ result.w = this._w * otherVector.w;
3221
3250
  return result;
3222
3251
  }
3223
3252
  /**
@@ -3229,7 +3258,7 @@ export class Vector4 {
3229
3258
  * @returns resulting new vector
3230
3259
  */
3231
3260
  multiplyByFloats(x, y, z, w) {
3232
- return new Vector4(this.x * x, this.y * y, this.z * z, this.w * w);
3261
+ return new Vector4(this._x * x, this._y * y, this._z * z, this._w * w);
3233
3262
  }
3234
3263
  /**
3235
3264
  * Returns a new Vector4 set with the division result of the current Vector4 by the given one.
@@ -3237,7 +3266,7 @@ export class Vector4 {
3237
3266
  * @returns resulting new vector
3238
3267
  */
3239
3268
  divide(otherVector) {
3240
- return new Vector4(this.x / otherVector.x, this.y / otherVector.y, this.z / otherVector.z, this.w / otherVector.w);
3269
+ return new Vector4(this._x / otherVector.x, this._y / otherVector.y, this._z / otherVector.z, this._w / otherVector.w);
3241
3270
  }
3242
3271
  /**
3243
3272
  * Updates the given vector "result" with the division result of the current Vector4 by the given one.
@@ -3246,10 +3275,10 @@ export class Vector4 {
3246
3275
  * @returns result input
3247
3276
  */
3248
3277
  divideToRef(otherVector, result) {
3249
- result.x = this.x / otherVector.x;
3250
- result.y = this.y / otherVector.y;
3251
- result.z = this.z / otherVector.z;
3252
- result.w = this.w / otherVector.w;
3278
+ result.x = this._x / otherVector.x;
3279
+ result.y = this._y / otherVector.y;
3280
+ result.z = this._z / otherVector.z;
3281
+ result.w = this._w / otherVector.w;
3253
3282
  return result;
3254
3283
  }
3255
3284
  /**
@@ -3266,16 +3295,16 @@ export class Vector4 {
3266
3295
  * @returns the current updated Vector4
3267
3296
  */
3268
3297
  minimizeInPlace(other) {
3269
- if (other.x < this.x) {
3298
+ if (other.x < this._x) {
3270
3299
  this.x = other.x;
3271
3300
  }
3272
- if (other.y < this.y) {
3301
+ if (other.y < this._y) {
3273
3302
  this.y = other.y;
3274
3303
  }
3275
- if (other.z < this.z) {
3304
+ if (other.z < this._z) {
3276
3305
  this.z = other.z;
3277
3306
  }
3278
- if (other.w < this.w) {
3307
+ if (other.w < this._w) {
3279
3308
  this.w = other.w;
3280
3309
  }
3281
3310
  return this;
@@ -3286,16 +3315,16 @@ export class Vector4 {
3286
3315
  * @returns the current updated Vector4
3287
3316
  */
3288
3317
  maximizeInPlace(other) {
3289
- if (other.x > this.x) {
3318
+ if (other.x > this._x) {
3290
3319
  this.x = other.x;
3291
3320
  }
3292
- if (other.y > this.y) {
3321
+ if (other.y > this._y) {
3293
3322
  this.y = other.y;
3294
3323
  }
3295
- if (other.z > this.z) {
3324
+ if (other.z > this._z) {
3296
3325
  this.z = other.z;
3297
3326
  }
3298
- if (other.w > this.w) {
3327
+ if (other.w > this._w) {
3299
3328
  this.w = other.w;
3300
3329
  }
3301
3330
  return this;
@@ -3309,10 +3338,10 @@ export class Vector4 {
3309
3338
  * @returns the current updated Vector4
3310
3339
  */
3311
3340
  minimizeInPlaceFromFloats(x, y, z, w) {
3312
- this.x = Math.min(x, this.x);
3313
- this.y = Math.min(y, this.y);
3314
- this.z = Math.min(z, this.z);
3315
- this.w = Math.min(w, this.w);
3341
+ this.x = Math.min(x, this._x);
3342
+ this.y = Math.min(y, this._y);
3343
+ this.z = Math.min(z, this._z);
3344
+ this.w = Math.min(w, this._w);
3316
3345
  return this;
3317
3346
  }
3318
3347
  /**
@@ -3324,10 +3353,10 @@ export class Vector4 {
3324
3353
  * @returns the current updated Vector4
3325
3354
  */
3326
3355
  maximizeInPlaceFromFloats(x, y, z, w) {
3327
- this.x = Math.max(x, this.x);
3328
- this.y = Math.max(y, this.y);
3329
- this.z = Math.max(z, this.z);
3330
- this.w = Math.max(w, this.w);
3356
+ this.x = Math.max(x, this._x);
3357
+ this.y = Math.max(y, this._y);
3358
+ this.z = Math.max(z, this._z);
3359
+ this.w = Math.max(w, this._w);
3331
3360
  return this;
3332
3361
  }
3333
3362
  /**
@@ -3336,10 +3365,10 @@ export class Vector4 {
3336
3365
  * @returns the result vector
3337
3366
  */
3338
3367
  floorToRef(result) {
3339
- result.x = Math.floor(this.x);
3340
- result.y = Math.floor(this.y);
3341
- result.z = Math.floor(this.z);
3342
- result.w = Math.floor(this.w);
3368
+ result.x = Math.floor(this._x);
3369
+ result.y = Math.floor(this._y);
3370
+ result.z = Math.floor(this._z);
3371
+ result.w = Math.floor(this._w);
3343
3372
  return result;
3344
3373
  }
3345
3374
  /**
@@ -3347,7 +3376,7 @@ export class Vector4 {
3347
3376
  * @returns a new Vector4
3348
3377
  */
3349
3378
  floor() {
3350
- return new Vector4(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w));
3379
+ return new Vector4(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z), Math.floor(this._w));
3351
3380
  }
3352
3381
  /**
3353
3382
  * Gets the current Vector4's fractional values and stores them in result
@@ -3355,10 +3384,10 @@ export class Vector4 {
3355
3384
  * @returns the result vector
3356
3385
  */
3357
3386
  fractToRef(result) {
3358
- result.x = this.x - Math.floor(this.x);
3359
- result.y = this.y - Math.floor(this.y);
3360
- result.z = this.z - Math.floor(this.z);
3361
- result.w = this.w - Math.floor(this.w);
3387
+ result.x = this._x - Math.floor(this._x);
3388
+ result.y = this._y - Math.floor(this._y);
3389
+ result.z = this._z - Math.floor(this._z);
3390
+ result.w = this._w - Math.floor(this._w);
3362
3391
  return result;
3363
3392
  }
3364
3393
  /**
@@ -3366,7 +3395,7 @@ export class Vector4 {
3366
3395
  * @returns a new Vector4
3367
3396
  */
3368
3397
  fract() {
3369
- return new Vector4(this.x - Math.floor(this.x), this.y - Math.floor(this.y), this.z - Math.floor(this.z), this.w - Math.floor(this.w));
3398
+ return new Vector4(this._x - Math.floor(this._x), this._y - Math.floor(this._y), this._z - Math.floor(this._z), this._w - Math.floor(this._w));
3370
3399
  }
3371
3400
  // Properties
3372
3401
  /**
@@ -3374,14 +3403,14 @@ export class Vector4 {
3374
3403
  * @returns the length
3375
3404
  */
3376
3405
  length() {
3377
- return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);
3406
+ return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);
3378
3407
  }
3379
3408
  /**
3380
3409
  * Returns the Vector4 squared length (float).
3381
3410
  * @returns the length squared
3382
3411
  */
3383
3412
  lengthSquared() {
3384
- return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;
3413
+ return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;
3385
3414
  }
3386
3415
  // Methods
3387
3416
  /**
@@ -3418,10 +3447,10 @@ export class Vector4 {
3418
3447
  normalizeToRef(reference) {
3419
3448
  const len = this.length();
3420
3449
  if (len === 0 || len === 1.0) {
3421
- reference.x = this.x;
3422
- reference.y = this.y;
3423
- reference.z = this.z;
3424
- reference.w = this.w;
3450
+ reference.x = this._x;
3451
+ reference.y = this._y;
3452
+ reference.z = this._z;
3453
+ reference.w = this._w;
3425
3454
  return reference;
3426
3455
  }
3427
3456
  return this.scaleToRef(1.0 / len, reference);
@@ -3431,14 +3460,14 @@ export class Vector4 {
3431
3460
  * @returns this converted to a new vector3
3432
3461
  */
3433
3462
  toVector3() {
3434
- return new Vector3(this.x, this.y, this.z);
3463
+ return new Vector3(this._x, this._y, this._z);
3435
3464
  }
3436
3465
  /**
3437
3466
  * Returns a new Vector4 copied from the current one.
3438
3467
  * @returns the new cloned vector
3439
3468
  */
3440
3469
  clone() {
3441
- return new Vector4(this.x, this.y, this.z, this.w);
3470
+ return new Vector4(this._x, this._y, this._z, this._w);
3442
3471
  }
3443
3472
  /**
3444
3473
  * Updates the current Vector4 with the given one coordinates.
@@ -3493,7 +3522,7 @@ export class Vector4 {
3493
3522
  * @returns the dot product
3494
3523
  */
3495
3524
  dot(otherVector) {
3496
- return this.x * otherVector.x + this.y * otherVector.y + this.z * otherVector.z + this.w * otherVector.w;
3525
+ return this._x * otherVector.x + this._y * otherVector.y + this._z * otherVector.z + this._w * otherVector.w;
3497
3526
  }
3498
3527
  // Statics
3499
3528
  /**