@babylonjs/core 5.18.0 → 5.21.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 (128) hide show
  1. package/Debug/debugLayer.d.ts +36 -0
  2. package/Debug/debugLayer.js.map +1 -1
  3. package/DeviceInput/InputDevices/deviceSource.d.ts +1 -1
  4. package/DeviceInput/InputDevices/deviceSource.js.map +1 -1
  5. package/DeviceInput/InputDevices/deviceSourceManager.d.ts +1 -1
  6. package/DeviceInput/InputDevices/deviceSourceManager.js +1 -1
  7. package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
  8. package/DeviceInput/{Helpers/eventFactory.d.ts → eventFactory.d.ts} +4 -4
  9. package/DeviceInput/{Helpers/eventFactory.js → eventFactory.js} +2 -2
  10. package/DeviceInput/eventFactory.js.map +1 -0
  11. package/DeviceInput/{InputDevices/inputInterfaces.d.ts → inputInterfaces.d.ts} +2 -2
  12. package/DeviceInput/{InputDevices/inputInterfaces.js → inputInterfaces.js} +0 -0
  13. package/DeviceInput/inputInterfaces.js.map +1 -0
  14. package/DeviceInput/{InputDevices/internalDeviceSourceManager.d.ts → internalDeviceSourceManager.d.ts} +7 -7
  15. package/DeviceInput/{InputDevices/internalDeviceSourceManager.js → internalDeviceSourceManager.js} +2 -2
  16. package/DeviceInput/internalDeviceSourceManager.js.map +1 -0
  17. package/DeviceInput/{InputDevices/nativeDeviceInputSystem.d.ts → nativeDeviceInputSystem.d.ts} +2 -2
  18. package/DeviceInput/{InputDevices/nativeDeviceInputSystem.js → nativeDeviceInputSystem.js} +2 -2
  19. package/DeviceInput/nativeDeviceInputSystem.js.map +1 -0
  20. package/DeviceInput/{InputDevices/webDeviceInputSystem.d.ts → webDeviceInputSystem.d.ts} +3 -3
  21. package/DeviceInput/{InputDevices/webDeviceInputSystem.js → webDeviceInputSystem.js} +4 -4
  22. package/DeviceInput/webDeviceInputSystem.js.map +1 -0
  23. package/Engines/Extensions/engine.query.js +5 -1
  24. package/Engines/Extensions/engine.query.js.map +1 -1
  25. package/Engines/Extensions/engine.transformFeedback.js +5 -1
  26. package/Engines/Extensions/engine.transformFeedback.js.map +1 -1
  27. package/Engines/Native/nativeInterfaces.d.ts +1 -1
  28. package/Engines/Native/nativeInterfaces.js.map +1 -1
  29. package/Engines/engine.d.ts +21 -242
  30. package/Engines/thinEngine.d.ts +1 -1
  31. package/Engines/thinEngine.js +7 -3
  32. package/Engines/thinEngine.js.map +1 -1
  33. package/Gizmos/axisDragGizmo.d.ts +20 -1
  34. package/Gizmos/axisDragGizmo.js.map +1 -1
  35. package/Gizmos/axisScaleGizmo.d.ts +26 -1
  36. package/Gizmos/axisScaleGizmo.js.map +1 -1
  37. package/Gizmos/boundingBoxGizmo.d.ts +71 -1
  38. package/Gizmos/boundingBoxGizmo.js.map +1 -1
  39. package/Gizmos/cameraGizmo.d.ts +15 -1
  40. package/Gizmos/cameraGizmo.js.map +1 -1
  41. package/Gizmos/gizmoManager.d.ts +8 -8
  42. package/Gizmos/gizmoManager.js.map +1 -1
  43. package/Gizmos/lightGizmo.d.ts +13 -1
  44. package/Gizmos/lightGizmo.js.map +1 -1
  45. package/Gizmos/planeDragGizmo.d.ts +20 -1
  46. package/Gizmos/planeDragGizmo.js.map +1 -1
  47. package/Gizmos/planeRotationGizmo.d.ts +22 -1
  48. package/Gizmos/planeRotationGizmo.js.map +1 -1
  49. package/Gizmos/positionGizmo.d.ts +44 -10
  50. package/Gizmos/positionGizmo.js.map +1 -1
  51. package/Gizmos/rotationGizmo.d.ts +29 -6
  52. package/Gizmos/rotationGizmo.js.map +1 -1
  53. package/Gizmos/scaleGizmo.d.ts +34 -6
  54. package/Gizmos/scaleGizmo.js.map +1 -1
  55. package/Loading/Plugins/babylonFileLoader.js +16 -4
  56. package/Loading/Plugins/babylonFileLoader.js.map +1 -1
  57. package/Materials/Background/backgroundMaterial.js +1 -0
  58. package/Materials/Background/backgroundMaterial.js.map +1 -1
  59. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.d.ts +39 -0
  60. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +97 -0
  61. package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -0
  62. package/Materials/Node/Blocks/Fragment/index.d.ts +1 -0
  63. package/Materials/Node/Blocks/Fragment/index.js +1 -0
  64. package/Materials/Node/Blocks/Fragment/index.js.map +1 -1
  65. package/Materials/PBR/pbrBaseMaterial.js +10 -0
  66. package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
  67. package/Materials/Textures/Procedurals/proceduralTexture.js +5 -1
  68. package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
  69. package/Materials/Textures/renderTargetTexture.js +3 -0
  70. package/Materials/Textures/renderTargetTexture.js.map +1 -1
  71. package/Materials/Textures/texture.js +9 -5
  72. package/Materials/Textures/texture.js.map +1 -1
  73. package/Materials/index.d.ts +1 -0
  74. package/Materials/index.js +1 -0
  75. package/Materials/index.js.map +1 -1
  76. package/Materials/materialHelper.js +1 -1
  77. package/Materials/materialHelper.js.map +1 -1
  78. package/Materials/standardMaterial.js +7 -0
  79. package/Materials/standardMaterial.js.map +1 -1
  80. package/Maths/math.vector.d.ts +132 -6
  81. package/Maths/math.vector.js +151 -7
  82. package/Maths/math.vector.js.map +1 -1
  83. package/Meshes/groundMesh.js +1 -1
  84. package/Meshes/groundMesh.js.map +1 -1
  85. package/Meshes/mesh.d.ts +12 -12
  86. package/Meshes/mesh.js +13 -12
  87. package/Meshes/mesh.js.map +1 -1
  88. package/Meshes/transformNode.js +1 -0
  89. package/Meshes/transformNode.js.map +1 -1
  90. package/Misc/assetsManager.d.ts +9 -0
  91. package/Misc/assetsManager.js +3 -1
  92. package/Misc/assetsManager.js.map +1 -1
  93. package/Misc/basis.js +7 -4
  94. package/Misc/basis.js.map +1 -1
  95. package/Misc/computePressure.d.ts +9 -3
  96. package/Misc/computePressure.js +13 -5
  97. package/Misc/computePressure.js.map +1 -1
  98. package/Misc/fileTools.js +7 -1
  99. package/Misc/fileTools.js.map +1 -1
  100. package/Misc/iInspectable.d.ts +14 -1
  101. package/Misc/iInspectable.js +4 -0
  102. package/Misc/iInspectable.js.map +1 -1
  103. package/Misc/sceneSerializer.js +1 -1
  104. package/Misc/sceneSerializer.js.map +1 -1
  105. package/Misc/tools.js +12 -1
  106. package/Misc/tools.js.map +1 -1
  107. package/Particles/solidParticleSystem.d.ts +1 -0
  108. package/Particles/solidParticleSystem.js +4 -1
  109. package/Particles/solidParticleSystem.js.map +1 -1
  110. package/Physics/physicsImpostor.js +8 -2
  111. package/Physics/physicsImpostor.js.map +1 -1
  112. package/XR/webXRDefaultExperience.d.ts +10 -0
  113. package/XR/webXRDefaultExperience.js +2 -12
  114. package/XR/webXRDefaultExperience.js.map +1 -1
  115. package/XR/webXRExperienceHelper.js +12 -12
  116. package/XR/webXRExperienceHelper.js.map +1 -1
  117. package/node.d.ts +2 -0
  118. package/node.js +2 -0
  119. package/node.js.map +1 -1
  120. package/package.json +1 -1
  121. package/scene.d.ts +1 -1
  122. package/scene.js +7 -3
  123. package/scene.js.map +1 -1
  124. package/DeviceInput/Helpers/eventFactory.js.map +0 -1
  125. package/DeviceInput/InputDevices/inputInterfaces.js.map +0 -1
  126. package/DeviceInput/InputDevices/internalDeviceSourceManager.js.map +0 -1
  127. package/DeviceInput/InputDevices/nativeDeviceInputSystem.js.map +0 -1
  128. package/DeviceInput/InputDevices/webDeviceInputSystem.js.map +0 -1
@@ -406,6 +406,16 @@ var Vector2 = /** @class */ (function () {
406
406
  Vector2.One = function () {
407
407
  return new Vector2(1, 1);
408
408
  };
409
+ Object.defineProperty(Vector2, "ZeroReadOnly", {
410
+ /**
411
+ * Gets a zero Vector2 that must not be updated
412
+ */
413
+ get: function () {
414
+ return Vector2._ZeroReadOnly;
415
+ },
416
+ enumerable: false,
417
+ configurable: true
418
+ });
409
419
  /**
410
420
  * Gets a new Vector2 set from the given index element of the given array
411
421
  * @param array defines the data source
@@ -677,6 +687,7 @@ var Vector2 = /** @class */ (function () {
677
687
  var proj = segA.add(v.multiplyByFloats(t, t));
678
688
  return Vector2.Distance(p, proj);
679
689
  };
690
+ Vector2._ZeroReadOnly = Vector2.Zero();
680
691
  return Vector2;
681
692
  }());
682
693
  export { Vector2 };
@@ -685,6 +696,7 @@ export { Vector2 };
685
696
  * A Vector3 is the main object used in 3D geometry
686
697
  * It can represent either the coordinates of a point the space, either a direction
687
698
  * Reminder: js uses a left handed forward facing system
699
+ * Example Playground - Overview - https://playground.babylonjs.com/#R1F8YU
688
700
  */
689
701
  var Vector3 = /** @class */ (function () {
690
702
  /**
@@ -741,6 +753,7 @@ var Vector3 = /** @class */ (function () {
741
753
  });
742
754
  /**
743
755
  * Creates a string representation of the Vector3
756
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#67
744
757
  * @returns a string with the Vector3 coordinates.
745
758
  */
746
759
  Vector3.prototype.toString = function () {
@@ -769,6 +782,7 @@ var Vector3 = /** @class */ (function () {
769
782
  // Operators
770
783
  /**
771
784
  * Creates an array containing three elements : the coordinates of the Vector3
785
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#10
772
786
  * @returns a new array of numbers
773
787
  */
774
788
  Vector3.prototype.asArray = function () {
@@ -778,6 +792,7 @@ var Vector3 = /** @class */ (function () {
778
792
  };
779
793
  /**
780
794
  * Populates the given array or Float32Array from the given index with the successive coordinates of the Vector3
795
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#65
781
796
  * @param array defines the destination array
782
797
  * @param index defines the offset in the destination array
783
798
  * @returns the current Vector3
@@ -791,6 +806,7 @@ var Vector3 = /** @class */ (function () {
791
806
  };
792
807
  /**
793
808
  * Update the current vector from an array
809
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#24
794
810
  * @param array defines the destination array
795
811
  * @param index defines the offset in the destination array
796
812
  * @returns the current Vector3
@@ -802,6 +818,7 @@ var Vector3 = /** @class */ (function () {
802
818
  };
803
819
  /**
804
820
  * Converts the current Vector3 into a quaternion (considering that the Vector3 contains Euler angles representation of a rotation)
821
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#66
805
822
  * @returns a new Quaternion object, computed from the Vector3 coordinates
806
823
  */
807
824
  Vector3.prototype.toQuaternion = function () {
@@ -809,6 +826,7 @@ var Vector3 = /** @class */ (function () {
809
826
  };
810
827
  /**
811
828
  * Adds the given vector to the current Vector3
829
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#4
812
830
  * @param otherVector defines the second operand
813
831
  * @returns the current updated Vector3
814
832
  */
@@ -817,6 +835,7 @@ var Vector3 = /** @class */ (function () {
817
835
  };
818
836
  /**
819
837
  * Adds the given coordinates to the current Vector3
838
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#5
820
839
  * @param x defines the x coordinate of the operand
821
840
  * @param y defines the y coordinate of the operand
822
841
  * @param z defines the z coordinate of the operand
@@ -830,6 +849,7 @@ var Vector3 = /** @class */ (function () {
830
849
  };
831
850
  /**
832
851
  * Gets a new Vector3, result of the addition the current Vector3 and the given vector
852
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#3
833
853
  * @param otherVector defines the second operand
834
854
  * @returns the resulting Vector3
835
855
  */
@@ -838,6 +858,7 @@ var Vector3 = /** @class */ (function () {
838
858
  };
839
859
  /**
840
860
  * Adds the current Vector3 to the given one and stores the result in the vector "result"
861
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#6
841
862
  * @param otherVector defines the second operand
842
863
  * @param result defines the Vector3 object where to store the result
843
864
  * @returns the current Vector3
@@ -847,6 +868,7 @@ var Vector3 = /** @class */ (function () {
847
868
  };
848
869
  /**
849
870
  * Subtract the given vector from the current Vector3
871
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#61
850
872
  * @param otherVector defines the second operand
851
873
  * @returns the current updated Vector3
852
874
  */
@@ -858,6 +880,7 @@ var Vector3 = /** @class */ (function () {
858
880
  };
859
881
  /**
860
882
  * Returns a new Vector3, result of the subtraction of the given vector from the current Vector3
883
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#60
861
884
  * @param otherVector defines the second operand
862
885
  * @returns the resulting Vector3
863
886
  */
@@ -866,6 +889,7 @@ var Vector3 = /** @class */ (function () {
866
889
  };
867
890
  /**
868
891
  * Subtracts the given vector from the current Vector3 and stores the result in the vector "result".
892
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#63
869
893
  * @param otherVector defines the second operand
870
894
  * @param result defines the Vector3 object where to store the result
871
895
  * @returns the current Vector3
@@ -875,6 +899,7 @@ var Vector3 = /** @class */ (function () {
875
899
  };
876
900
  /**
877
901
  * Returns a new Vector3 set with the subtraction of the given floats from the current Vector3 coordinates
902
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#62
878
903
  * @param x defines the x coordinate of the operand
879
904
  * @param y defines the y coordinate of the operand
880
905
  * @param z defines the z coordinate of the operand
@@ -885,6 +910,7 @@ var Vector3 = /** @class */ (function () {
885
910
  };
886
911
  /**
887
912
  * Subtracts the given floats from the current Vector3 coordinates and set the given vector "result" with this result
913
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#64
888
914
  * @param x defines the x coordinate of the operand
889
915
  * @param y defines the y coordinate of the operand
890
916
  * @param z defines the z coordinate of the operand
@@ -896,6 +922,7 @@ var Vector3 = /** @class */ (function () {
896
922
  };
897
923
  /**
898
924
  * Gets a new Vector3 set with the current Vector3 negated coordinates
925
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#35
899
926
  * @returns a new Vector3
900
927
  */
901
928
  Vector3.prototype.negate = function () {
@@ -903,6 +930,7 @@ var Vector3 = /** @class */ (function () {
903
930
  };
904
931
  /**
905
932
  * Negate this vector in place
933
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#36
906
934
  * @returns this
907
935
  */
908
936
  Vector3.prototype.negateInPlace = function () {
@@ -913,6 +941,7 @@ var Vector3 = /** @class */ (function () {
913
941
  };
914
942
  /**
915
943
  * Negate the current Vector3 and stores the result in the given vector "result" coordinates
944
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#37
916
945
  * @param result defines the Vector3 object where to store the result
917
946
  * @returns the current Vector3
918
947
  */
@@ -921,6 +950,7 @@ var Vector3 = /** @class */ (function () {
921
950
  };
922
951
  /**
923
952
  * Multiplies the Vector3 coordinates by the float "scale"
953
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#56
924
954
  * @param scale defines the multiplier factor
925
955
  * @returns the current updated Vector3
926
956
  */
@@ -932,6 +962,7 @@ var Vector3 = /** @class */ (function () {
932
962
  };
933
963
  /**
934
964
  * Returns a new Vector3 set with the current Vector3 coordinates multiplied by the float "scale"
965
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#53
935
966
  * @param scale defines the multiplier factor
936
967
  * @returns a new Vector3
937
968
  */
@@ -940,6 +971,7 @@ var Vector3 = /** @class */ (function () {
940
971
  };
941
972
  /**
942
973
  * Multiplies the current Vector3 coordinates by the float "scale" and stores the result in the given vector "result" coordinates
974
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#57
943
975
  * @param scale defines the multiplier factor
944
976
  * @param result defines the Vector3 object where to store the result
945
977
  * @returns the current Vector3
@@ -949,6 +981,7 @@ var Vector3 = /** @class */ (function () {
949
981
  };
950
982
  /**
951
983
  * Rotates the vector using the given unit quaternion and stores the new vector in result
984
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#9
952
985
  * @param q the unit quaternion representing the rotation
953
986
  * @param result the output vector
954
987
  * @returns the current Vector3
@@ -965,6 +998,7 @@ var Vector3 = /** @class */ (function () {
965
998
  };
966
999
  /**
967
1000
  * Rotates the vector in place using the given unit quaternion
1001
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#8
968
1002
  * @param q the unit quaternion representing the rotation
969
1003
  * @returns the current updated Vector3
970
1004
  */
@@ -973,6 +1007,7 @@ var Vector3 = /** @class */ (function () {
973
1007
  };
974
1008
  /**
975
1009
  * Rotates the vector using the given unit quaternion and returns the new vector
1010
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#7
976
1011
  * @param q the unit quaternion representing the rotation
977
1012
  * @returns a new Vector3
978
1013
  */
@@ -981,6 +1016,7 @@ var Vector3 = /** @class */ (function () {
981
1016
  };
982
1017
  /**
983
1018
  * Scale the current Vector3 values by a factor and add the result to a given Vector3
1019
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#55
984
1020
  * @param scale defines the scale factor
985
1021
  * @param result defines the Vector3 object where to store the result
986
1022
  * @returns the unmodified current Vector3
@@ -990,6 +1026,7 @@ var Vector3 = /** @class */ (function () {
990
1026
  };
991
1027
  /**
992
1028
  * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
1029
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#48
993
1030
  * @param plane defines the plane to project to
994
1031
  * @param origin defines the origin of the projection ray
995
1032
  * @returns the projected vector3
@@ -1001,6 +1038,7 @@ var Vector3 = /** @class */ (function () {
1001
1038
  };
1002
1039
  /**
1003
1040
  * Projects the current point Vector3 to a plane along a ray starting from a specified origin and passing through the current point Vector3.
1041
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#49
1004
1042
  * @param plane defines the plane to project to
1005
1043
  * @param origin defines the origin of the projection ray
1006
1044
  * @param result defines the Vector3 where to store the result
@@ -1015,7 +1053,7 @@ var Vector3 = /** @class */ (function () {
1015
1053
  var denom = Vector3.Dot(V, n);
1016
1054
  //When the ray is close to parallel to the plane return infinity vector
1017
1055
  if (Math.abs(denom) < Math.pow(10, -10)) {
1018
- origin.addToRef(new Vector3(Infinity, Infinity, Infinity), result);
1056
+ result.setAll(Infinity);
1019
1057
  }
1020
1058
  else {
1021
1059
  var t = -(Vector3.Dot(origin, n) + d) / denom;
@@ -1026,6 +1064,7 @@ var Vector3 = /** @class */ (function () {
1026
1064
  };
1027
1065
  /**
1028
1066
  * Returns true if the current Vector3 and the given vector coordinates are strictly equal
1067
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#19
1029
1068
  * @param otherVector defines the second operand
1030
1069
  * @returns true if both vectors are equals
1031
1070
  */
@@ -1034,6 +1073,7 @@ var Vector3 = /** @class */ (function () {
1034
1073
  };
1035
1074
  /**
1036
1075
  * Returns true if the current Vector3 and the given vector coordinates are distant less than epsilon
1076
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#21
1037
1077
  * @param otherVector defines the second operand
1038
1078
  * @param epsilon defines the minimal distance to define values as equals
1039
1079
  * @returns true if both vectors are distant less than epsilon
@@ -1047,16 +1087,18 @@ var Vector3 = /** @class */ (function () {
1047
1087
  };
1048
1088
  /**
1049
1089
  * Returns true if the current Vector3 coordinates equals the given floats
1090
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#20
1050
1091
  * @param x defines the x coordinate of the operand
1051
1092
  * @param y defines the y coordinate of the operand
1052
1093
  * @param z defines the z coordinate of the operand
1053
- * @returns true if both vectors are equals
1094
+ * @returns true if both vectors are equal
1054
1095
  */
1055
1096
  Vector3.prototype.equalsToFloats = function (x, y, z) {
1056
1097
  return this._x === x && this._y === y && this._z === z;
1057
1098
  };
1058
1099
  /**
1059
1100
  * Multiplies the current Vector3 coordinates by the given ones
1101
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#32
1060
1102
  * @param otherVector defines the second operand
1061
1103
  * @returns the current updated Vector3
1062
1104
  */
@@ -1068,6 +1110,7 @@ var Vector3 = /** @class */ (function () {
1068
1110
  };
1069
1111
  /**
1070
1112
  * Returns a new Vector3, result of the multiplication of the current Vector3 by the given vector
1113
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#31
1071
1114
  * @param otherVector defines the second operand
1072
1115
  * @returns the new Vector3
1073
1116
  */
@@ -1076,6 +1119,7 @@ var Vector3 = /** @class */ (function () {
1076
1119
  };
1077
1120
  /**
1078
1121
  * Multiplies the current Vector3 by the given one and stores the result in the given vector "result"
1122
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#33
1079
1123
  * @param otherVector defines the second operand
1080
1124
  * @param result defines the Vector3 object where to store the result
1081
1125
  * @returns the current Vector3
@@ -1085,6 +1129,7 @@ var Vector3 = /** @class */ (function () {
1085
1129
  };
1086
1130
  /**
1087
1131
  * Returns a new Vector3 set with the result of the multiplication of the current Vector3 coordinates by the given floats
1132
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#34
1088
1133
  * @param x defines the x coordinate of the operand
1089
1134
  * @param y defines the y coordinate of the operand
1090
1135
  * @param z defines the z coordinate of the operand
@@ -1095,6 +1140,7 @@ var Vector3 = /** @class */ (function () {
1095
1140
  };
1096
1141
  /**
1097
1142
  * Returns a new Vector3 set with the result of the division of the current Vector3 coordinates by the given ones
1143
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#16
1098
1144
  * @param otherVector defines the second operand
1099
1145
  * @returns the new Vector3
1100
1146
  */
@@ -1103,6 +1149,7 @@ var Vector3 = /** @class */ (function () {
1103
1149
  };
1104
1150
  /**
1105
1151
  * Divides the current Vector3 coordinates by the given ones and stores the result in the given vector "result"
1152
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#18
1106
1153
  * @param otherVector defines the second operand
1107
1154
  * @param result defines the Vector3 object where to store the result
1108
1155
  * @returns the current Vector3
@@ -1112,6 +1159,7 @@ var Vector3 = /** @class */ (function () {
1112
1159
  };
1113
1160
  /**
1114
1161
  * Divides the current Vector3 coordinates by the given ones.
1162
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#17
1115
1163
  * @param otherVector defines the second operand
1116
1164
  * @returns the current updated Vector3
1117
1165
  */
@@ -1120,6 +1168,7 @@ var Vector3 = /** @class */ (function () {
1120
1168
  };
1121
1169
  /**
1122
1170
  * Updates the current Vector3 with the minimal coordinate values between its and the given vector ones
1171
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#29
1123
1172
  * @param other defines the second operand
1124
1173
  * @returns the current updated Vector3
1125
1174
  */
@@ -1128,6 +1177,7 @@ var Vector3 = /** @class */ (function () {
1128
1177
  };
1129
1178
  /**
1130
1179
  * Updates the current Vector3 with the maximal coordinate values between its and the given vector ones.
1180
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#27
1131
1181
  * @param other defines the second operand
1132
1182
  * @returns the current updated Vector3
1133
1183
  */
@@ -1136,6 +1186,7 @@ var Vector3 = /** @class */ (function () {
1136
1186
  };
1137
1187
  /**
1138
1188
  * Updates the current Vector3 with the minimal coordinate values between its and the given coordinates
1189
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#30
1139
1190
  * @param x defines the x coordinate of the operand
1140
1191
  * @param y defines the y coordinate of the operand
1141
1192
  * @param z defines the z coordinate of the operand
@@ -1155,6 +1206,7 @@ var Vector3 = /** @class */ (function () {
1155
1206
  };
1156
1207
  /**
1157
1208
  * Updates the current Vector3 with the maximal coordinate values between its and the given coordinates.
1209
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#28
1158
1210
  * @param x defines the x coordinate of the operand
1159
1211
  * @param y defines the y coordinate of the operand
1160
1212
  * @param z defines the z coordinate of the operand
@@ -1214,13 +1266,15 @@ var Vector3 = /** @class */ (function () {
1214
1266
  });
1215
1267
  /**
1216
1268
  * Gets a new Vector3 from current Vector3 floored values
1269
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#22
1217
1270
  * @returns a new Vector3
1218
1271
  */
1219
1272
  Vector3.prototype.floor = function () {
1220
1273
  return new Vector3(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));
1221
1274
  };
1222
1275
  /**
1223
- * Gets a new Vector3 from current Vector3 floored values
1276
+ * Gets a new Vector3 from current Vector3 fractional values
1277
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#23
1224
1278
  * @returns a new Vector3
1225
1279
  */
1226
1280
  Vector3.prototype.fract = function () {
@@ -1229,6 +1283,7 @@ var Vector3 = /** @class */ (function () {
1229
1283
  // Properties
1230
1284
  /**
1231
1285
  * Gets the length of the Vector3
1286
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#25
1232
1287
  * @returns the length of the Vector3
1233
1288
  */
1234
1289
  Vector3.prototype.length = function () {
@@ -1236,6 +1291,7 @@ var Vector3 = /** @class */ (function () {
1236
1291
  };
1237
1292
  /**
1238
1293
  * Gets the squared length of the Vector3
1294
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#26
1239
1295
  * @returns squared length of the Vector3
1240
1296
  */
1241
1297
  Vector3.prototype.lengthSquared = function () {
@@ -1244,6 +1300,7 @@ var Vector3 = /** @class */ (function () {
1244
1300
  Object.defineProperty(Vector3.prototype, "hasAZeroComponent", {
1245
1301
  /**
1246
1302
  * Gets a boolean indicating if the vector contains a zero in one of its components
1303
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#1
1247
1304
  */
1248
1305
  get: function () {
1249
1306
  return this._x * this._y * this._z === 0;
@@ -1254,6 +1311,7 @@ var Vector3 = /** @class */ (function () {
1254
1311
  /**
1255
1312
  * Normalize the current Vector3.
1256
1313
  * Please note that this is an in place operation.
1314
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#122
1257
1315
  * @returns the current updated Vector3
1258
1316
  */
1259
1317
  Vector3.prototype.normalize = function () {
@@ -1261,6 +1319,7 @@ var Vector3 = /** @class */ (function () {
1261
1319
  };
1262
1320
  /**
1263
1321
  * Reorders the x y z properties of the vector in place
1322
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#44
1264
1323
  * @param order new ordering of the properties (eg. for vector 1,2,3 with "ZYX" will produce 3,2,1)
1265
1324
  * @returns the current updated vector
1266
1325
  */
@@ -1278,6 +1337,7 @@ var Vector3 = /** @class */ (function () {
1278
1337
  };
1279
1338
  /**
1280
1339
  * Rotates the vector around 0,0,0 by a quaternion
1340
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#47
1281
1341
  * @param quaternion the rotation quaternion
1282
1342
  * @param result vector to store the result
1283
1343
  * @returns the resulting vector
@@ -1289,6 +1349,7 @@ var Vector3 = /** @class */ (function () {
1289
1349
  };
1290
1350
  /**
1291
1351
  * Rotates a vector around a given point
1352
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#46
1292
1353
  * @param quaternion the rotation quaternion
1293
1354
  * @param point the point to rotate around
1294
1355
  * @param result vector to store the result
@@ -1303,6 +1364,7 @@ var Vector3 = /** @class */ (function () {
1303
1364
  /**
1304
1365
  * Returns a new Vector3 as the cross product of the current vector and the "other" one
1305
1366
  * The cross product is then orthogonal to both current and "other"
1367
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#14
1306
1368
  * @param other defines the right operand
1307
1369
  * @returns the cross product
1308
1370
  */
@@ -1312,6 +1374,7 @@ var Vector3 = /** @class */ (function () {
1312
1374
  /**
1313
1375
  * Normalize the current Vector3 with the given input length.
1314
1376
  * Please note that this is an in place operation.
1377
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#123
1315
1378
  * @param len the length of the vector
1316
1379
  * @returns the current updated Vector3
1317
1380
  */
@@ -1323,6 +1386,7 @@ var Vector3 = /** @class */ (function () {
1323
1386
  };
1324
1387
  /**
1325
1388
  * Normalize the current Vector3 to a new vector
1389
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#124
1326
1390
  * @returns the new Vector3
1327
1391
  */
1328
1392
  Vector3.prototype.normalizeToNew = function () {
@@ -1332,6 +1396,7 @@ var Vector3 = /** @class */ (function () {
1332
1396
  };
1333
1397
  /**
1334
1398
  * Normalize the current Vector3 to the reference
1399
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#125
1335
1400
  * @param reference define the Vector3 to update
1336
1401
  * @returns the updated Vector3
1337
1402
  */
@@ -1344,6 +1409,7 @@ var Vector3 = /** @class */ (function () {
1344
1409
  };
1345
1410
  /**
1346
1411
  * Creates a new Vector3 copied from the current Vector3
1412
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#11
1347
1413
  * @returns the new Vector3
1348
1414
  */
1349
1415
  Vector3.prototype.clone = function () {
@@ -1351,6 +1417,7 @@ var Vector3 = /** @class */ (function () {
1351
1417
  };
1352
1418
  /**
1353
1419
  * Copies the given vector coordinates to the current Vector3 ones
1420
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#12
1354
1421
  * @param source defines the source Vector3
1355
1422
  * @returns the current updated Vector3
1356
1423
  */
@@ -1359,6 +1426,7 @@ var Vector3 = /** @class */ (function () {
1359
1426
  };
1360
1427
  /**
1361
1428
  * Copies the given floats to the current Vector3 coordinates
1429
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#13
1362
1430
  * @param x defines the x coordinate of the operand
1363
1431
  * @param y defines the y coordinate of the operand
1364
1432
  * @param z defines the z coordinate of the operand
@@ -1372,6 +1440,7 @@ var Vector3 = /** @class */ (function () {
1372
1440
  };
1373
1441
  /**
1374
1442
  * Copies the given floats to the current Vector3 coordinates
1443
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#58
1375
1444
  * @param x defines the x coordinate of the operand
1376
1445
  * @param y defines the y coordinate of the operand
1377
1446
  * @param z defines the z coordinate of the operand
@@ -1382,6 +1451,7 @@ var Vector3 = /** @class */ (function () {
1382
1451
  };
1383
1452
  /**
1384
1453
  * Copies the given float to the current Vector3 coordinates
1454
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#59
1385
1455
  * @param v defines the x, y and z coordinates of the operand
1386
1456
  * @returns the current updated Vector3
1387
1457
  */
@@ -1392,6 +1462,7 @@ var Vector3 = /** @class */ (function () {
1392
1462
  // Statics
1393
1463
  /**
1394
1464
  * Get the clip factor between two vectors
1465
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#126
1395
1466
  * @param vector0 defines the first operand
1396
1467
  * @param vector1 defines the second operand
1397
1468
  * @param axis defines the axis to use
@@ -1406,6 +1477,7 @@ var Vector3 = /** @class */ (function () {
1406
1477
  };
1407
1478
  /**
1408
1479
  * Get angle between two vectors
1480
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#86
1409
1481
  * @param vector0 angle between vector0 and vector1
1410
1482
  * @param vector1 angle between vector0 and vector1
1411
1483
  * @param normal direction of the normal
@@ -1427,6 +1499,7 @@ var Vector3 = /** @class */ (function () {
1427
1499
  };
1428
1500
  /**
1429
1501
  * Get angle between two vectors projected on a plane
1502
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#87
1430
1503
  * @param vector0 angle between vector0 and vector1
1431
1504
  * @param vector1 angle between vector0 and vector1
1432
1505
  * @param normal Normal of the projection plane
@@ -1451,6 +1524,10 @@ var Vector3 = /** @class */ (function () {
1451
1524
  };
1452
1525
  /**
1453
1526
  * Slerp between two vectors. See also `SmoothToRef`
1527
+ * Slerp is a spherical linear interpolation
1528
+ * giving a slow in and out effect
1529
+ * Example Playground 1 https://playground.babylonjs.com/#R1F8YU#108
1530
+ * Example Playground 2 https://playground.babylonjs.com/#R1F8YU#109
1454
1531
  * @param vector0 Start vector
1455
1532
  * @param vector1 End vector
1456
1533
  * @param slerp amount (will be clamped between 0 and 1)
@@ -1487,6 +1564,7 @@ var Vector3 = /** @class */ (function () {
1487
1564
  };
1488
1565
  /**
1489
1566
  * Smooth interpolation between two vectors using Slerp
1567
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#110
1490
1568
  * @param source source vector
1491
1569
  * @param goal goal vector
1492
1570
  * @param deltaTime current interpolation frame
@@ -1498,6 +1576,7 @@ var Vector3 = /** @class */ (function () {
1498
1576
  };
1499
1577
  /**
1500
1578
  * Returns a new Vector3 set from the index "offset" of the given array
1579
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#83
1501
1580
  * @param array defines the source array
1502
1581
  * @param offset defines the offset in the source array
1503
1582
  * @returns the new Vector3
@@ -1518,6 +1597,7 @@ var Vector3 = /** @class */ (function () {
1518
1597
  };
1519
1598
  /**
1520
1599
  * Sets the given vector "result" with the element values from the index "offset" of the given array
1600
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#84
1521
1601
  * @param array defines the source array
1522
1602
  * @param offset defines the offset in the source array
1523
1603
  * @param result defines the Vector3 where to store the result
@@ -1539,6 +1619,7 @@ var Vector3 = /** @class */ (function () {
1539
1619
  };
1540
1620
  /**
1541
1621
  * Sets the given vector "result" with the given floats.
1622
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#85
1542
1623
  * @param x defines the x coordinate of the source
1543
1624
  * @param y defines the y coordinate of the source
1544
1625
  * @param z defines the z coordinate of the source
@@ -1556,13 +1637,14 @@ var Vector3 = /** @class */ (function () {
1556
1637
  };
1557
1638
  /**
1558
1639
  * Returns a new Vector3 set to (1.0, 1.0, 1.0)
1559
- * @returns a new unit Vector3
1640
+ * @returns a new Vector3
1560
1641
  */
1561
1642
  Vector3.One = function () {
1562
1643
  return new Vector3(1.0, 1.0, 1.0);
1563
1644
  };
1564
1645
  /**
1565
1646
  * Returns a new Vector3 set to (0.0, 1.0, 0.0)
1647
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#71
1566
1648
  * @returns a new up Vector3
1567
1649
  */
1568
1650
  Vector3.Up = function () {
@@ -1570,7 +1652,7 @@ var Vector3 = /** @class */ (function () {
1570
1652
  };
1571
1653
  Object.defineProperty(Vector3, "UpReadOnly", {
1572
1654
  /**
1573
- * Gets a up Vector3 that must not be updated
1655
+ * Gets an up Vector3 that must not be updated
1574
1656
  */
1575
1657
  get: function () {
1576
1658
  return Vector3._UpReadOnly;
@@ -1578,6 +1660,16 @@ var Vector3 = /** @class */ (function () {
1578
1660
  enumerable: false,
1579
1661
  configurable: true
1580
1662
  });
1663
+ Object.defineProperty(Vector3, "DownReadOnly", {
1664
+ /**
1665
+ * Gets a down Vector3 that must not be updated
1666
+ */
1667
+ get: function () {
1668
+ return Vector3._DownReadOnly;
1669
+ },
1670
+ enumerable: false,
1671
+ configurable: true
1672
+ });
1581
1673
  Object.defineProperty(Vector3, "RightReadOnly", {
1582
1674
  /**
1583
1675
  * Gets a right Vector3 that must not be updated
@@ -1630,6 +1722,7 @@ var Vector3 = /** @class */ (function () {
1630
1722
  });
1631
1723
  /**
1632
1724
  * Returns a new Vector3 set to (0.0, -1.0, 0.0)
1725
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#71
1633
1726
  * @returns a new down Vector3
1634
1727
  */
1635
1728
  Vector3.Down = function () {
@@ -1637,6 +1730,7 @@ var Vector3 = /** @class */ (function () {
1637
1730
  };
1638
1731
  /**
1639
1732
  * Returns a new Vector3 set to (0.0, 0.0, 1.0)
1733
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#71
1640
1734
  * @param rightHandedSystem is the scene right-handed (negative z)
1641
1735
  * @returns a new forward Vector3
1642
1736
  */
@@ -1646,8 +1740,9 @@ var Vector3 = /** @class */ (function () {
1646
1740
  };
1647
1741
  /**
1648
1742
  * Returns a new Vector3 set to (0.0, 0.0, -1.0)
1743
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#71
1649
1744
  * @param rightHandedSystem is the scene right-handed (negative-z)
1650
- * @returns a new forward Vector3
1745
+ * @returns a new Backward Vector3
1651
1746
  */
1652
1747
  Vector3.Backward = function (rightHandedSystem) {
1653
1748
  if (rightHandedSystem === void 0) { rightHandedSystem = false; }
@@ -1655,6 +1750,7 @@ var Vector3 = /** @class */ (function () {
1655
1750
  };
1656
1751
  /**
1657
1752
  * Returns a new Vector3 set to (1.0, 0.0, 0.0)
1753
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#71
1658
1754
  * @returns a new right Vector3
1659
1755
  */
1660
1756
  Vector3.Right = function () {
@@ -1662,6 +1758,7 @@ var Vector3 = /** @class */ (function () {
1662
1758
  };
1663
1759
  /**
1664
1760
  * Returns a new Vector3 set to (-1.0, 0.0, 0.0)
1761
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#71
1665
1762
  * @returns a new left Vector3
1666
1763
  */
1667
1764
  Vector3.Left = function () {
@@ -1670,6 +1767,7 @@ var Vector3 = /** @class */ (function () {
1670
1767
  /**
1671
1768
  * Returns a new Vector3 set with the result of the transformation by the given matrix of the given vector.
1672
1769
  * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
1770
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#111
1673
1771
  * @param vector defines the Vector3 to transform
1674
1772
  * @param transformation defines the transformation matrix
1675
1773
  * @returns the transformed Vector3
@@ -1682,6 +1780,7 @@ var Vector3 = /** @class */ (function () {
1682
1780
  /**
1683
1781
  * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector
1684
1782
  * This method computes transformed coordinates only, not transformed direction vectors (ie. it takes translation in account)
1783
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#113
1685
1784
  * @param vector defines the Vector3 to transform
1686
1785
  * @param transformation defines the transformation matrix
1687
1786
  * @param result defines the Vector3 where to store the result
@@ -1692,6 +1791,7 @@ var Vector3 = /** @class */ (function () {
1692
1791
  /**
1693
1792
  * Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
1694
1793
  * This method computes transformed coordinates only, not transformed direction vectors
1794
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#115
1695
1795
  * @param x define the x coordinate of the source vector
1696
1796
  * @param y define the y coordinate of the source vector
1697
1797
  * @param z define the z coordinate of the source vector
@@ -1711,6 +1811,7 @@ var Vector3 = /** @class */ (function () {
1711
1811
  /**
1712
1812
  * Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector
1713
1813
  * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
1814
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#112
1714
1815
  * @param vector defines the Vector3 to transform
1715
1816
  * @param transformation defines the transformation matrix
1716
1817
  * @returns the new Vector3
@@ -1723,6 +1824,7 @@ var Vector3 = /** @class */ (function () {
1723
1824
  /**
1724
1825
  * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector
1725
1826
  * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
1827
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#114
1726
1828
  * @param vector defines the Vector3 to transform
1727
1829
  * @param transformation defines the transformation matrix
1728
1830
  * @param result defines the Vector3 where to store the result
@@ -1733,6 +1835,7 @@ var Vector3 = /** @class */ (function () {
1733
1835
  /**
1734
1836
  * Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z)
1735
1837
  * This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
1838
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#116
1736
1839
  * @param x define the x coordinate of the source vector
1737
1840
  * @param y define the y coordinate of the source vector
1738
1841
  * @param z define the z coordinate of the source vector
@@ -1747,6 +1850,7 @@ var Vector3 = /** @class */ (function () {
1747
1850
  };
1748
1851
  /**
1749
1852
  * Returns a new Vector3 located for "amount" on the CatmullRom interpolation spline defined by the vectors "value1", "value2", "value3", "value4"
1853
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#69
1750
1854
  * @param value1 defines the first control point
1751
1855
  * @param value2 defines the second control point
1752
1856
  * @param value3 defines the third control point
@@ -1778,6 +1882,7 @@ var Vector3 = /** @class */ (function () {
1778
1882
  * 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"
1779
1883
  * If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
1780
1884
  * If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
1885
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#76
1781
1886
  * @param value defines the current value
1782
1887
  * @param min defines the lower range value
1783
1888
  * @param max defines the upper range value
@@ -1792,6 +1897,7 @@ var Vector3 = /** @class */ (function () {
1792
1897
  * 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"
1793
1898
  * If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one
1794
1899
  * If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
1900
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#77
1795
1901
  * @param value defines the current value
1796
1902
  * @param min defines the lower range value
1797
1903
  * @param max defines the upper range value
@@ -1811,6 +1917,7 @@ var Vector3 = /** @class */ (function () {
1811
1917
  };
1812
1918
  /**
1813
1919
  * Checks if a given vector is inside a specific range
1920
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#75
1814
1921
  * @param v defines the vector to test
1815
1922
  * @param min defines the minimum range
1816
1923
  * @param max defines the maximum range
@@ -1821,6 +1928,7 @@ var Vector3 = /** @class */ (function () {
1821
1928
  };
1822
1929
  /**
1823
1930
  * Returns a new Vector3 located for "amount" (float) on the Hermite interpolation spline defined by the vectors "value1", "tangent1", "value2", "tangent2"
1931
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#89
1824
1932
  * @param value1 defines the first control point
1825
1933
  * @param tangent1 defines the first tangent vector
1826
1934
  * @param value2 defines the second control point
@@ -1842,6 +1950,7 @@ var Vector3 = /** @class */ (function () {
1842
1950
  };
1843
1951
  /**
1844
1952
  * Returns a new Vector3 which is the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
1953
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#90
1845
1954
  * @param value1 defines the first control point
1846
1955
  * @param tangent1 defines the first tangent
1847
1956
  * @param value2 defines the second control point
@@ -1856,6 +1965,7 @@ var Vector3 = /** @class */ (function () {
1856
1965
  };
1857
1966
  /**
1858
1967
  * Update a Vector3 with the 1st derivative of the Hermite spline defined by the vectors "value1", "value2", "tangent1", "tangent2".
1968
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#91
1859
1969
  * @param value1 defines the first control point
1860
1970
  * @param tangent1 defines the first tangent
1861
1971
  * @param value2 defines the second control point
@@ -1871,6 +1981,7 @@ var Vector3 = /** @class */ (function () {
1871
1981
  };
1872
1982
  /**
1873
1983
  * Returns a new Vector3 located for "amount" (float) on the linear interpolation between the vectors "start" and "end"
1984
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#95
1874
1985
  * @param start defines the start value
1875
1986
  * @param end defines the end value
1876
1987
  * @param amount max defines amount between both (between 0 and 1)
@@ -1883,6 +1994,7 @@ var Vector3 = /** @class */ (function () {
1883
1994
  };
1884
1995
  /**
1885
1996
  * Sets the given vector "result" with the result of the linear interpolation from the vector "start" for "amount" to the vector "end"
1997
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#93
1886
1998
  * @param start defines the start value
1887
1999
  * @param end defines the end value
1888
2000
  * @param amount max defines amount between both (between 0 and 1)
@@ -1895,6 +2007,7 @@ var Vector3 = /** @class */ (function () {
1895
2007
  };
1896
2008
  /**
1897
2009
  * Returns the dot product (float) between the vectors "left" and "right"
2010
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#82
1898
2011
  * @param left defines the left operand
1899
2012
  * @param right defines the right operand
1900
2013
  * @returns the dot product
@@ -1905,6 +2018,7 @@ var Vector3 = /** @class */ (function () {
1905
2018
  /**
1906
2019
  * Returns a new Vector3 as the cross product of the vectors "left" and "right"
1907
2020
  * The cross product is then orthogonal to both "left" and "right"
2021
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#15
1908
2022
  * @param left defines the left operand
1909
2023
  * @param right defines the right operand
1910
2024
  * @returns the cross product
@@ -1917,6 +2031,7 @@ var Vector3 = /** @class */ (function () {
1917
2031
  /**
1918
2032
  * Sets the given vector "result" with the cross product of "left" and "right"
1919
2033
  * The cross product is then orthogonal to both "left" and "right"
2034
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#78
1920
2035
  * @param left defines the left operand
1921
2036
  * @param right defines the right operand
1922
2037
  * @param result defines the Vector3 where to store the result
@@ -1929,6 +2044,7 @@ var Vector3 = /** @class */ (function () {
1929
2044
  };
1930
2045
  /**
1931
2046
  * Returns a new Vector3 as the normalization of the given vector
2047
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#98
1932
2048
  * @param vector defines the Vector3 to normalize
1933
2049
  * @returns the new Vector3
1934
2050
  */
@@ -1939,6 +2055,7 @@ var Vector3 = /** @class */ (function () {
1939
2055
  };
1940
2056
  /**
1941
2057
  * Sets the given vector "result" with the normalization of the given first vector
2058
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#98
1942
2059
  * @param vector defines the Vector3 to normalize
1943
2060
  * @param result defines the Vector3 where to store the result
1944
2061
  */
@@ -1947,6 +2064,7 @@ var Vector3 = /** @class */ (function () {
1947
2064
  };
1948
2065
  /**
1949
2066
  * Project a Vector3 onto screen space
2067
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#101
1950
2068
  * @param vector defines the Vector3 to project
1951
2069
  * @param world defines the world matrix to use
1952
2070
  * @param transform defines the transform (view x projection) matrix to use
@@ -1960,6 +2078,7 @@ var Vector3 = /** @class */ (function () {
1960
2078
  };
1961
2079
  /**
1962
2080
  * Project a Vector3 onto screen space to reference
2081
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#102
1963
2082
  * @param vector defines the Vector3 to project
1964
2083
  * @param world defines the world matrix to use
1965
2084
  * @param transform defines the transform (view x projection) matrix to use
@@ -1996,6 +2115,7 @@ var Vector3 = /** @class */ (function () {
1996
2115
  };
1997
2116
  /**
1998
2117
  * Unproject from screen space to object space
2118
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#121
1999
2119
  * @param source defines the screen space Vector3 to use
2000
2120
  * @param viewportWidth defines the current width of the viewport
2001
2121
  * @param viewportHeight defines the current height of the viewport
@@ -2008,6 +2128,7 @@ var Vector3 = /** @class */ (function () {
2008
2128
  };
2009
2129
  /**
2010
2130
  * Unproject from screen space to object space
2131
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#117
2011
2132
  * @param source defines the screen space Vector3 to use
2012
2133
  * @param viewportWidth defines the current width of the viewport
2013
2134
  * @param viewportHeight defines the current height of the viewport
@@ -2023,6 +2144,7 @@ var Vector3 = /** @class */ (function () {
2023
2144
  };
2024
2145
  /**
2025
2146
  * Unproject from screen space to object space
2147
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#119
2026
2148
  * @param source defines the screen space Vector3 to use
2027
2149
  * @param viewportWidth defines the current width of the viewport
2028
2150
  * @param viewportHeight defines the current height of the viewport
@@ -2036,6 +2158,7 @@ var Vector3 = /** @class */ (function () {
2036
2158
  };
2037
2159
  /**
2038
2160
  * Unproject from screen space to object space
2161
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#120
2039
2162
  * @param sourceX defines the screen space x coordinate to use
2040
2163
  * @param sourceY defines the screen space y coordinate to use
2041
2164
  * @param sourceZ defines the screen space z coordinate to use
@@ -2065,6 +2188,7 @@ var Vector3 = /** @class */ (function () {
2065
2188
  };
2066
2189
  /**
2067
2190
  * Gets the minimal coordinate values between two Vector3
2191
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#97
2068
2192
  * @param left defines the first operand
2069
2193
  * @param right defines the second operand
2070
2194
  * @returns the new Vector3
@@ -2076,6 +2200,7 @@ var Vector3 = /** @class */ (function () {
2076
2200
  };
2077
2201
  /**
2078
2202
  * Gets the maximal coordinate values between two Vector3
2203
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#96
2079
2204
  * @param left defines the first operand
2080
2205
  * @param right defines the second operand
2081
2206
  * @returns the new Vector3
@@ -2087,6 +2212,7 @@ var Vector3 = /** @class */ (function () {
2087
2212
  };
2088
2213
  /**
2089
2214
  * Returns the distance between the vectors "value1" and "value2"
2215
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#81
2090
2216
  * @param value1 defines the first operand
2091
2217
  * @param value2 defines the second operand
2092
2218
  * @returns the distance
@@ -2096,6 +2222,7 @@ var Vector3 = /** @class */ (function () {
2096
2222
  };
2097
2223
  /**
2098
2224
  * Returns the squared distance between the vectors "value1" and "value2"
2225
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#80
2099
2226
  * @param value1 defines the first operand
2100
2227
  * @param value2 defines the second operand
2101
2228
  * @returns the squared distance
@@ -2109,6 +2236,7 @@ var Vector3 = /** @class */ (function () {
2109
2236
  /**
2110
2237
  * Projects "vector" on the triangle determined by its extremities "p0", "p1" and "p2", stores the result in "ref"
2111
2238
  * and returns the distance to the projected point.
2239
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#104
2112
2240
  * From http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.104.4264&rep=rep1&type=pdf
2113
2241
  *
2114
2242
  * @param vector the vector to get distance from
@@ -2247,6 +2375,7 @@ var Vector3 = /** @class */ (function () {
2247
2375
  };
2248
2376
  /**
2249
2377
  * Returns a new Vector3 located at the center between "value1" and "value2"
2378
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#72
2250
2379
  * @param value1 defines the first operand
2251
2380
  * @param value2 defines the second operand
2252
2381
  * @returns the new Vector3
@@ -2256,6 +2385,7 @@ var Vector3 = /** @class */ (function () {
2256
2385
  };
2257
2386
  /**
2258
2387
  * Gets the center of the vectors "value1" and "value2" and stores the result in the vector "ref"
2388
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#73
2259
2389
  * @param value1 defines first vector
2260
2390
  * @param value2 defines second vector
2261
2391
  * @param ref defines third vector
@@ -2269,6 +2399,7 @@ var Vector3 = /** @class */ (function () {
2269
2399
  * RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply
2270
2400
  * to something in order to rotate it from its local system to the given target system
2271
2401
  * Note: axis1, axis2 and axis3 are normalized during this operation
2402
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#106
2272
2403
  * @param axis1 defines the first axis
2273
2404
  * @param axis2 defines the second axis
2274
2405
  * @param axis3 defines the third axis
@@ -2282,6 +2413,7 @@ var Vector3 = /** @class */ (function () {
2282
2413
  };
2283
2414
  /**
2284
2415
  * The same than RotationFromAxis but updates the given ref Vector3 parameter instead of returning a new Vector3
2416
+ * Example Playground https://playground.babylonjs.com/#R1F8YU#107
2285
2417
  * @param axis1 defines the first axis
2286
2418
  * @param axis2 defines the second axis
2287
2419
  * @param axis3 defines the third axis
@@ -2293,6 +2425,7 @@ var Vector3 = /** @class */ (function () {
2293
2425
  quat.toEulerAnglesToRef(ref);
2294
2426
  };
2295
2427
  Vector3._UpReadOnly = Vector3.Up();
2428
+ Vector3._DownReadOnly = Vector3.Down();
2296
2429
  Vector3._LeftHandedForwardReadOnly = Vector3.Forward(false);
2297
2430
  Vector3._RightHandedForwardReadOnly = Vector3.Forward(true);
2298
2431
  Vector3._RightReadOnly = Vector3.Right();
@@ -2714,7 +2847,7 @@ var Vector4 = /** @class */ (function () {
2714
2847
  return new Vector4(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w));
2715
2848
  };
2716
2849
  /**
2717
- * Gets a new Vector4 from current Vector3 floored values
2850
+ * Gets a new Vector4 from current Vector4 fractional values
2718
2851
  * @returns a new Vector4
2719
2852
  */
2720
2853
  Vector4.prototype.fract = function () {
@@ -2870,6 +3003,16 @@ var Vector4 = /** @class */ (function () {
2870
3003
  Vector4.One = function () {
2871
3004
  return new Vector4(1.0, 1.0, 1.0, 1.0);
2872
3005
  };
3006
+ Object.defineProperty(Vector4, "ZeroReadOnly", {
3007
+ /**
3008
+ * Gets a zero Vector4 that must not be updated
3009
+ */
3010
+ get: function () {
3011
+ return Vector4._ZeroReadOnly;
3012
+ },
3013
+ enumerable: false,
3014
+ configurable: true
3015
+ });
2873
3016
  /**
2874
3017
  * Returns a new normalized Vector4 from the given one.
2875
3018
  * @param vector the vector to normalize
@@ -3053,6 +3196,7 @@ var Vector4 = /** @class */ (function () {
3053
3196
  if (w === void 0) { w = 0; }
3054
3197
  return new Vector4(source._x, source._y, source._z, w);
3055
3198
  };
3199
+ Vector4._ZeroReadOnly = Vector4.Zero();
3056
3200
  return Vector4;
3057
3201
  }());
3058
3202
  export { Vector4 };