@babylonjs/core 5.19.0 → 5.20.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.
- package/DeviceInput/InputDevices/deviceSource.d.ts +1 -1
- package/DeviceInput/InputDevices/deviceSource.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.d.ts +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.js +1 -1
- package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
- package/DeviceInput/{Helpers/eventFactory.d.ts → eventFactory.d.ts} +4 -4
- package/DeviceInput/{Helpers/eventFactory.js → eventFactory.js} +2 -2
- package/DeviceInput/eventFactory.js.map +1 -0
- package/DeviceInput/{InputDevices/inputInterfaces.d.ts → inputInterfaces.d.ts} +2 -2
- package/DeviceInput/{InputDevices/inputInterfaces.js → inputInterfaces.js} +0 -0
- package/DeviceInput/inputInterfaces.js.map +1 -0
- package/DeviceInput/{InputDevices/internalDeviceSourceManager.d.ts → internalDeviceSourceManager.d.ts} +7 -7
- package/DeviceInput/{InputDevices/internalDeviceSourceManager.js → internalDeviceSourceManager.js} +2 -2
- package/DeviceInput/internalDeviceSourceManager.js.map +1 -0
- package/DeviceInput/{InputDevices/nativeDeviceInputSystem.d.ts → nativeDeviceInputSystem.d.ts} +2 -2
- package/DeviceInput/{InputDevices/nativeDeviceInputSystem.js → nativeDeviceInputSystem.js} +2 -2
- package/DeviceInput/nativeDeviceInputSystem.js.map +1 -0
- package/DeviceInput/{InputDevices/webDeviceInputSystem.d.ts → webDeviceInputSystem.d.ts} +3 -3
- package/DeviceInput/{InputDevices/webDeviceInputSystem.js → webDeviceInputSystem.js} +4 -4
- package/DeviceInput/webDeviceInputSystem.js.map +1 -0
- package/Engines/Native/nativeInterfaces.d.ts +1 -1
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +16 -4
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.d.ts +39 -0
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js +97 -0
- package/Materials/Node/Blocks/Fragment/heightToNormalBlock.js.map +1 -0
- package/Materials/Node/Blocks/Fragment/index.d.ts +1 -0
- package/Materials/Node/Blocks/Fragment/index.js +1 -0
- package/Materials/Node/Blocks/Fragment/index.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +5 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/texture.js +9 -5
- package/Materials/Textures/texture.js.map +1 -1
- package/Maths/math.vector.d.ts +116 -5
- package/Maths/math.vector.js +116 -5
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/mesh.js +1 -0
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/transformNode.js +1 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/iInspectable.d.ts +12 -2
- package/Misc/iInspectable.js +4 -0
- package/Misc/iInspectable.js.map +1 -1
- package/Misc/sceneSerializer.js +1 -1
- package/Misc/sceneSerializer.js.map +1 -1
- package/Particles/solidParticleSystem.d.ts +1 -0
- package/Particles/solidParticleSystem.js +4 -1
- package/Particles/solidParticleSystem.js.map +1 -1
- package/XR/webXRDefaultExperience.d.ts +10 -0
- package/XR/webXRDefaultExperience.js +2 -12
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXRExperienceHelper.js +12 -12
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/node.d.ts +2 -0
- package/node.js +2 -0
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +1 -1
- package/scene.js.map +1 -1
- package/DeviceInput/Helpers/eventFactory.js.map +0 -1
- package/DeviceInput/InputDevices/inputInterfaces.js.map +0 -1
- package/DeviceInput/InputDevices/internalDeviceSourceManager.js.map +0 -1
- package/DeviceInput/InputDevices/nativeDeviceInputSystem.js.map +0 -1
- package/DeviceInput/InputDevices/webDeviceInputSystem.js.map +0 -1
package/Maths/math.vector.js
CHANGED
|
@@ -696,6 +696,7 @@ export { Vector2 };
|
|
|
696
696
|
* A Vector3 is the main object used in 3D geometry
|
|
697
697
|
* It can represent either the coordinates of a point the space, either a direction
|
|
698
698
|
* Reminder: js uses a left handed forward facing system
|
|
699
|
+
* Example Playground - Overview - https://playground.babylonjs.com/#R1F8YU
|
|
699
700
|
*/
|
|
700
701
|
var Vector3 = /** @class */ (function () {
|
|
701
702
|
/**
|
|
@@ -752,6 +753,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
752
753
|
});
|
|
753
754
|
/**
|
|
754
755
|
* Creates a string representation of the Vector3
|
|
756
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#67
|
|
755
757
|
* @returns a string with the Vector3 coordinates.
|
|
756
758
|
*/
|
|
757
759
|
Vector3.prototype.toString = function () {
|
|
@@ -780,6 +782,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
780
782
|
// Operators
|
|
781
783
|
/**
|
|
782
784
|
* Creates an array containing three elements : the coordinates of the Vector3
|
|
785
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#10
|
|
783
786
|
* @returns a new array of numbers
|
|
784
787
|
*/
|
|
785
788
|
Vector3.prototype.asArray = function () {
|
|
@@ -789,6 +792,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
789
792
|
};
|
|
790
793
|
/**
|
|
791
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
|
|
792
796
|
* @param array defines the destination array
|
|
793
797
|
* @param index defines the offset in the destination array
|
|
794
798
|
* @returns the current Vector3
|
|
@@ -802,6 +806,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
802
806
|
};
|
|
803
807
|
/**
|
|
804
808
|
* Update the current vector from an array
|
|
809
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#24
|
|
805
810
|
* @param array defines the destination array
|
|
806
811
|
* @param index defines the offset in the destination array
|
|
807
812
|
* @returns the current Vector3
|
|
@@ -813,6 +818,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
813
818
|
};
|
|
814
819
|
/**
|
|
815
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
|
|
816
822
|
* @returns a new Quaternion object, computed from the Vector3 coordinates
|
|
817
823
|
*/
|
|
818
824
|
Vector3.prototype.toQuaternion = function () {
|
|
@@ -820,6 +826,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
820
826
|
};
|
|
821
827
|
/**
|
|
822
828
|
* Adds the given vector to the current Vector3
|
|
829
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#4
|
|
823
830
|
* @param otherVector defines the second operand
|
|
824
831
|
* @returns the current updated Vector3
|
|
825
832
|
*/
|
|
@@ -828,6 +835,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
828
835
|
};
|
|
829
836
|
/**
|
|
830
837
|
* Adds the given coordinates to the current Vector3
|
|
838
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#5
|
|
831
839
|
* @param x defines the x coordinate of the operand
|
|
832
840
|
* @param y defines the y coordinate of the operand
|
|
833
841
|
* @param z defines the z coordinate of the operand
|
|
@@ -841,6 +849,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
841
849
|
};
|
|
842
850
|
/**
|
|
843
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
|
|
844
853
|
* @param otherVector defines the second operand
|
|
845
854
|
* @returns the resulting Vector3
|
|
846
855
|
*/
|
|
@@ -849,6 +858,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
849
858
|
};
|
|
850
859
|
/**
|
|
851
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
|
|
852
862
|
* @param otherVector defines the second operand
|
|
853
863
|
* @param result defines the Vector3 object where to store the result
|
|
854
864
|
* @returns the current Vector3
|
|
@@ -858,6 +868,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
858
868
|
};
|
|
859
869
|
/**
|
|
860
870
|
* Subtract the given vector from the current Vector3
|
|
871
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#61
|
|
861
872
|
* @param otherVector defines the second operand
|
|
862
873
|
* @returns the current updated Vector3
|
|
863
874
|
*/
|
|
@@ -869,6 +880,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
869
880
|
};
|
|
870
881
|
/**
|
|
871
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
|
|
872
884
|
* @param otherVector defines the second operand
|
|
873
885
|
* @returns the resulting Vector3
|
|
874
886
|
*/
|
|
@@ -877,6 +889,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
877
889
|
};
|
|
878
890
|
/**
|
|
879
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
|
|
880
893
|
* @param otherVector defines the second operand
|
|
881
894
|
* @param result defines the Vector3 object where to store the result
|
|
882
895
|
* @returns the current Vector3
|
|
@@ -886,6 +899,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
886
899
|
};
|
|
887
900
|
/**
|
|
888
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
|
|
889
903
|
* @param x defines the x coordinate of the operand
|
|
890
904
|
* @param y defines the y coordinate of the operand
|
|
891
905
|
* @param z defines the z coordinate of the operand
|
|
@@ -896,6 +910,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
896
910
|
};
|
|
897
911
|
/**
|
|
898
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
|
|
899
914
|
* @param x defines the x coordinate of the operand
|
|
900
915
|
* @param y defines the y coordinate of the operand
|
|
901
916
|
* @param z defines the z coordinate of the operand
|
|
@@ -907,6 +922,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
907
922
|
};
|
|
908
923
|
/**
|
|
909
924
|
* Gets a new Vector3 set with the current Vector3 negated coordinates
|
|
925
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#35
|
|
910
926
|
* @returns a new Vector3
|
|
911
927
|
*/
|
|
912
928
|
Vector3.prototype.negate = function () {
|
|
@@ -914,6 +930,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
914
930
|
};
|
|
915
931
|
/**
|
|
916
932
|
* Negate this vector in place
|
|
933
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#36
|
|
917
934
|
* @returns this
|
|
918
935
|
*/
|
|
919
936
|
Vector3.prototype.negateInPlace = function () {
|
|
@@ -924,6 +941,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
924
941
|
};
|
|
925
942
|
/**
|
|
926
943
|
* Negate the current Vector3 and stores the result in the given vector "result" coordinates
|
|
944
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#37
|
|
927
945
|
* @param result defines the Vector3 object where to store the result
|
|
928
946
|
* @returns the current Vector3
|
|
929
947
|
*/
|
|
@@ -932,6 +950,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
932
950
|
};
|
|
933
951
|
/**
|
|
934
952
|
* Multiplies the Vector3 coordinates by the float "scale"
|
|
953
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#56
|
|
935
954
|
* @param scale defines the multiplier factor
|
|
936
955
|
* @returns the current updated Vector3
|
|
937
956
|
*/
|
|
@@ -943,6 +962,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
943
962
|
};
|
|
944
963
|
/**
|
|
945
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
|
|
946
966
|
* @param scale defines the multiplier factor
|
|
947
967
|
* @returns a new Vector3
|
|
948
968
|
*/
|
|
@@ -951,6 +971,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
951
971
|
};
|
|
952
972
|
/**
|
|
953
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
|
|
954
975
|
* @param scale defines the multiplier factor
|
|
955
976
|
* @param result defines the Vector3 object where to store the result
|
|
956
977
|
* @returns the current Vector3
|
|
@@ -960,6 +981,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
960
981
|
};
|
|
961
982
|
/**
|
|
962
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
|
|
963
985
|
* @param q the unit quaternion representing the rotation
|
|
964
986
|
* @param result the output vector
|
|
965
987
|
* @returns the current Vector3
|
|
@@ -976,6 +998,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
976
998
|
};
|
|
977
999
|
/**
|
|
978
1000
|
* Rotates the vector in place using the given unit quaternion
|
|
1001
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#8
|
|
979
1002
|
* @param q the unit quaternion representing the rotation
|
|
980
1003
|
* @returns the current updated Vector3
|
|
981
1004
|
*/
|
|
@@ -984,6 +1007,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
984
1007
|
};
|
|
985
1008
|
/**
|
|
986
1009
|
* Rotates the vector using the given unit quaternion and returns the new vector
|
|
1010
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#7
|
|
987
1011
|
* @param q the unit quaternion representing the rotation
|
|
988
1012
|
* @returns a new Vector3
|
|
989
1013
|
*/
|
|
@@ -992,6 +1016,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
992
1016
|
};
|
|
993
1017
|
/**
|
|
994
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
|
|
995
1020
|
* @param scale defines the scale factor
|
|
996
1021
|
* @param result defines the Vector3 object where to store the result
|
|
997
1022
|
* @returns the unmodified current Vector3
|
|
@@ -1001,6 +1026,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1001
1026
|
};
|
|
1002
1027
|
/**
|
|
1003
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
|
|
1004
1030
|
* @param plane defines the plane to project to
|
|
1005
1031
|
* @param origin defines the origin of the projection ray
|
|
1006
1032
|
* @returns the projected vector3
|
|
@@ -1012,6 +1038,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1012
1038
|
};
|
|
1013
1039
|
/**
|
|
1014
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
|
|
1015
1042
|
* @param plane defines the plane to project to
|
|
1016
1043
|
* @param origin defines the origin of the projection ray
|
|
1017
1044
|
* @param result defines the Vector3 where to store the result
|
|
@@ -1037,6 +1064,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1037
1064
|
};
|
|
1038
1065
|
/**
|
|
1039
1066
|
* Returns true if the current Vector3 and the given vector coordinates are strictly equal
|
|
1067
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#19
|
|
1040
1068
|
* @param otherVector defines the second operand
|
|
1041
1069
|
* @returns true if both vectors are equals
|
|
1042
1070
|
*/
|
|
@@ -1045,6 +1073,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1045
1073
|
};
|
|
1046
1074
|
/**
|
|
1047
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
|
|
1048
1077
|
* @param otherVector defines the second operand
|
|
1049
1078
|
* @param epsilon defines the minimal distance to define values as equals
|
|
1050
1079
|
* @returns true if both vectors are distant less than epsilon
|
|
@@ -1058,16 +1087,18 @@ var Vector3 = /** @class */ (function () {
|
|
|
1058
1087
|
};
|
|
1059
1088
|
/**
|
|
1060
1089
|
* Returns true if the current Vector3 coordinates equals the given floats
|
|
1090
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#20
|
|
1061
1091
|
* @param x defines the x coordinate of the operand
|
|
1062
1092
|
* @param y defines the y coordinate of the operand
|
|
1063
1093
|
* @param z defines the z coordinate of the operand
|
|
1064
|
-
* @returns true if both vectors are
|
|
1094
|
+
* @returns true if both vectors are equal
|
|
1065
1095
|
*/
|
|
1066
1096
|
Vector3.prototype.equalsToFloats = function (x, y, z) {
|
|
1067
1097
|
return this._x === x && this._y === y && this._z === z;
|
|
1068
1098
|
};
|
|
1069
1099
|
/**
|
|
1070
1100
|
* Multiplies the current Vector3 coordinates by the given ones
|
|
1101
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#32
|
|
1071
1102
|
* @param otherVector defines the second operand
|
|
1072
1103
|
* @returns the current updated Vector3
|
|
1073
1104
|
*/
|
|
@@ -1079,6 +1110,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1079
1110
|
};
|
|
1080
1111
|
/**
|
|
1081
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
|
|
1082
1114
|
* @param otherVector defines the second operand
|
|
1083
1115
|
* @returns the new Vector3
|
|
1084
1116
|
*/
|
|
@@ -1087,6 +1119,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1087
1119
|
};
|
|
1088
1120
|
/**
|
|
1089
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
|
|
1090
1123
|
* @param otherVector defines the second operand
|
|
1091
1124
|
* @param result defines the Vector3 object where to store the result
|
|
1092
1125
|
* @returns the current Vector3
|
|
@@ -1096,6 +1129,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1096
1129
|
};
|
|
1097
1130
|
/**
|
|
1098
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
|
|
1099
1133
|
* @param x defines the x coordinate of the operand
|
|
1100
1134
|
* @param y defines the y coordinate of the operand
|
|
1101
1135
|
* @param z defines the z coordinate of the operand
|
|
@@ -1106,6 +1140,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1106
1140
|
};
|
|
1107
1141
|
/**
|
|
1108
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
|
|
1109
1144
|
* @param otherVector defines the second operand
|
|
1110
1145
|
* @returns the new Vector3
|
|
1111
1146
|
*/
|
|
@@ -1114,6 +1149,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1114
1149
|
};
|
|
1115
1150
|
/**
|
|
1116
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
|
|
1117
1153
|
* @param otherVector defines the second operand
|
|
1118
1154
|
* @param result defines the Vector3 object where to store the result
|
|
1119
1155
|
* @returns the current Vector3
|
|
@@ -1123,6 +1159,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1123
1159
|
};
|
|
1124
1160
|
/**
|
|
1125
1161
|
* Divides the current Vector3 coordinates by the given ones.
|
|
1162
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#17
|
|
1126
1163
|
* @param otherVector defines the second operand
|
|
1127
1164
|
* @returns the current updated Vector3
|
|
1128
1165
|
*/
|
|
@@ -1131,6 +1168,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1131
1168
|
};
|
|
1132
1169
|
/**
|
|
1133
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
|
|
1134
1172
|
* @param other defines the second operand
|
|
1135
1173
|
* @returns the current updated Vector3
|
|
1136
1174
|
*/
|
|
@@ -1139,6 +1177,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1139
1177
|
};
|
|
1140
1178
|
/**
|
|
1141
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
|
|
1142
1181
|
* @param other defines the second operand
|
|
1143
1182
|
* @returns the current updated Vector3
|
|
1144
1183
|
*/
|
|
@@ -1147,6 +1186,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1147
1186
|
};
|
|
1148
1187
|
/**
|
|
1149
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
|
|
1150
1190
|
* @param x defines the x coordinate of the operand
|
|
1151
1191
|
* @param y defines the y coordinate of the operand
|
|
1152
1192
|
* @param z defines the z coordinate of the operand
|
|
@@ -1166,6 +1206,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1166
1206
|
};
|
|
1167
1207
|
/**
|
|
1168
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
|
|
1169
1210
|
* @param x defines the x coordinate of the operand
|
|
1170
1211
|
* @param y defines the y coordinate of the operand
|
|
1171
1212
|
* @param z defines the z coordinate of the operand
|
|
@@ -1225,13 +1266,15 @@ var Vector3 = /** @class */ (function () {
|
|
|
1225
1266
|
});
|
|
1226
1267
|
/**
|
|
1227
1268
|
* Gets a new Vector3 from current Vector3 floored values
|
|
1269
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#22
|
|
1228
1270
|
* @returns a new Vector3
|
|
1229
1271
|
*/
|
|
1230
1272
|
Vector3.prototype.floor = function () {
|
|
1231
1273
|
return new Vector3(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));
|
|
1232
1274
|
};
|
|
1233
1275
|
/**
|
|
1234
|
-
* Gets a new Vector3 from current Vector3
|
|
1276
|
+
* Gets a new Vector3 from current Vector3 fractional values
|
|
1277
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#23
|
|
1235
1278
|
* @returns a new Vector3
|
|
1236
1279
|
*/
|
|
1237
1280
|
Vector3.prototype.fract = function () {
|
|
@@ -1240,6 +1283,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1240
1283
|
// Properties
|
|
1241
1284
|
/**
|
|
1242
1285
|
* Gets the length of the Vector3
|
|
1286
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#25
|
|
1243
1287
|
* @returns the length of the Vector3
|
|
1244
1288
|
*/
|
|
1245
1289
|
Vector3.prototype.length = function () {
|
|
@@ -1247,6 +1291,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1247
1291
|
};
|
|
1248
1292
|
/**
|
|
1249
1293
|
* Gets the squared length of the Vector3
|
|
1294
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#26
|
|
1250
1295
|
* @returns squared length of the Vector3
|
|
1251
1296
|
*/
|
|
1252
1297
|
Vector3.prototype.lengthSquared = function () {
|
|
@@ -1255,6 +1300,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1255
1300
|
Object.defineProperty(Vector3.prototype, "hasAZeroComponent", {
|
|
1256
1301
|
/**
|
|
1257
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
|
|
1258
1304
|
*/
|
|
1259
1305
|
get: function () {
|
|
1260
1306
|
return this._x * this._y * this._z === 0;
|
|
@@ -1265,6 +1311,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1265
1311
|
/**
|
|
1266
1312
|
* Normalize the current Vector3.
|
|
1267
1313
|
* Please note that this is an in place operation.
|
|
1314
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#122
|
|
1268
1315
|
* @returns the current updated Vector3
|
|
1269
1316
|
*/
|
|
1270
1317
|
Vector3.prototype.normalize = function () {
|
|
@@ -1272,6 +1319,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1272
1319
|
};
|
|
1273
1320
|
/**
|
|
1274
1321
|
* Reorders the x y z properties of the vector in place
|
|
1322
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#44
|
|
1275
1323
|
* @param order new ordering of the properties (eg. for vector 1,2,3 with "ZYX" will produce 3,2,1)
|
|
1276
1324
|
* @returns the current updated vector
|
|
1277
1325
|
*/
|
|
@@ -1289,6 +1337,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1289
1337
|
};
|
|
1290
1338
|
/**
|
|
1291
1339
|
* Rotates the vector around 0,0,0 by a quaternion
|
|
1340
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#47
|
|
1292
1341
|
* @param quaternion the rotation quaternion
|
|
1293
1342
|
* @param result vector to store the result
|
|
1294
1343
|
* @returns the resulting vector
|
|
@@ -1300,6 +1349,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1300
1349
|
};
|
|
1301
1350
|
/**
|
|
1302
1351
|
* Rotates a vector around a given point
|
|
1352
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#46
|
|
1303
1353
|
* @param quaternion the rotation quaternion
|
|
1304
1354
|
* @param point the point to rotate around
|
|
1305
1355
|
* @param result vector to store the result
|
|
@@ -1314,6 +1364,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1314
1364
|
/**
|
|
1315
1365
|
* Returns a new Vector3 as the cross product of the current vector and the "other" one
|
|
1316
1366
|
* The cross product is then orthogonal to both current and "other"
|
|
1367
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#14
|
|
1317
1368
|
* @param other defines the right operand
|
|
1318
1369
|
* @returns the cross product
|
|
1319
1370
|
*/
|
|
@@ -1323,6 +1374,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1323
1374
|
/**
|
|
1324
1375
|
* Normalize the current Vector3 with the given input length.
|
|
1325
1376
|
* Please note that this is an in place operation.
|
|
1377
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#123
|
|
1326
1378
|
* @param len the length of the vector
|
|
1327
1379
|
* @returns the current updated Vector3
|
|
1328
1380
|
*/
|
|
@@ -1334,6 +1386,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1334
1386
|
};
|
|
1335
1387
|
/**
|
|
1336
1388
|
* Normalize the current Vector3 to a new vector
|
|
1389
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#124
|
|
1337
1390
|
* @returns the new Vector3
|
|
1338
1391
|
*/
|
|
1339
1392
|
Vector3.prototype.normalizeToNew = function () {
|
|
@@ -1343,6 +1396,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1343
1396
|
};
|
|
1344
1397
|
/**
|
|
1345
1398
|
* Normalize the current Vector3 to the reference
|
|
1399
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#125
|
|
1346
1400
|
* @param reference define the Vector3 to update
|
|
1347
1401
|
* @returns the updated Vector3
|
|
1348
1402
|
*/
|
|
@@ -1355,6 +1409,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1355
1409
|
};
|
|
1356
1410
|
/**
|
|
1357
1411
|
* Creates a new Vector3 copied from the current Vector3
|
|
1412
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#11
|
|
1358
1413
|
* @returns the new Vector3
|
|
1359
1414
|
*/
|
|
1360
1415
|
Vector3.prototype.clone = function () {
|
|
@@ -1362,6 +1417,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1362
1417
|
};
|
|
1363
1418
|
/**
|
|
1364
1419
|
* Copies the given vector coordinates to the current Vector3 ones
|
|
1420
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#12
|
|
1365
1421
|
* @param source defines the source Vector3
|
|
1366
1422
|
* @returns the current updated Vector3
|
|
1367
1423
|
*/
|
|
@@ -1370,6 +1426,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1370
1426
|
};
|
|
1371
1427
|
/**
|
|
1372
1428
|
* Copies the given floats to the current Vector3 coordinates
|
|
1429
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#13
|
|
1373
1430
|
* @param x defines the x coordinate of the operand
|
|
1374
1431
|
* @param y defines the y coordinate of the operand
|
|
1375
1432
|
* @param z defines the z coordinate of the operand
|
|
@@ -1383,6 +1440,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1383
1440
|
};
|
|
1384
1441
|
/**
|
|
1385
1442
|
* Copies the given floats to the current Vector3 coordinates
|
|
1443
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#58
|
|
1386
1444
|
* @param x defines the x coordinate of the operand
|
|
1387
1445
|
* @param y defines the y coordinate of the operand
|
|
1388
1446
|
* @param z defines the z coordinate of the operand
|
|
@@ -1393,6 +1451,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1393
1451
|
};
|
|
1394
1452
|
/**
|
|
1395
1453
|
* Copies the given float to the current Vector3 coordinates
|
|
1454
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#59
|
|
1396
1455
|
* @param v defines the x, y and z coordinates of the operand
|
|
1397
1456
|
* @returns the current updated Vector3
|
|
1398
1457
|
*/
|
|
@@ -1403,6 +1462,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1403
1462
|
// Statics
|
|
1404
1463
|
/**
|
|
1405
1464
|
* Get the clip factor between two vectors
|
|
1465
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#126
|
|
1406
1466
|
* @param vector0 defines the first operand
|
|
1407
1467
|
* @param vector1 defines the second operand
|
|
1408
1468
|
* @param axis defines the axis to use
|
|
@@ -1417,6 +1477,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1417
1477
|
};
|
|
1418
1478
|
/**
|
|
1419
1479
|
* Get angle between two vectors
|
|
1480
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#86
|
|
1420
1481
|
* @param vector0 angle between vector0 and vector1
|
|
1421
1482
|
* @param vector1 angle between vector0 and vector1
|
|
1422
1483
|
* @param normal direction of the normal
|
|
@@ -1438,6 +1499,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1438
1499
|
};
|
|
1439
1500
|
/**
|
|
1440
1501
|
* Get angle between two vectors projected on a plane
|
|
1502
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#87
|
|
1441
1503
|
* @param vector0 angle between vector0 and vector1
|
|
1442
1504
|
* @param vector1 angle between vector0 and vector1
|
|
1443
1505
|
* @param normal Normal of the projection plane
|
|
@@ -1462,6 +1524,10 @@ var Vector3 = /** @class */ (function () {
|
|
|
1462
1524
|
};
|
|
1463
1525
|
/**
|
|
1464
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
|
|
1465
1531
|
* @param vector0 Start vector
|
|
1466
1532
|
* @param vector1 End vector
|
|
1467
1533
|
* @param slerp amount (will be clamped between 0 and 1)
|
|
@@ -1498,6 +1564,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1498
1564
|
};
|
|
1499
1565
|
/**
|
|
1500
1566
|
* Smooth interpolation between two vectors using Slerp
|
|
1567
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#110
|
|
1501
1568
|
* @param source source vector
|
|
1502
1569
|
* @param goal goal vector
|
|
1503
1570
|
* @param deltaTime current interpolation frame
|
|
@@ -1509,6 +1576,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1509
1576
|
};
|
|
1510
1577
|
/**
|
|
1511
1578
|
* Returns a new Vector3 set from the index "offset" of the given array
|
|
1579
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#83
|
|
1512
1580
|
* @param array defines the source array
|
|
1513
1581
|
* @param offset defines the offset in the source array
|
|
1514
1582
|
* @returns the new Vector3
|
|
@@ -1529,6 +1597,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1529
1597
|
};
|
|
1530
1598
|
/**
|
|
1531
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
|
|
1532
1601
|
* @param array defines the source array
|
|
1533
1602
|
* @param offset defines the offset in the source array
|
|
1534
1603
|
* @param result defines the Vector3 where to store the result
|
|
@@ -1550,6 +1619,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1550
1619
|
};
|
|
1551
1620
|
/**
|
|
1552
1621
|
* Sets the given vector "result" with the given floats.
|
|
1622
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#85
|
|
1553
1623
|
* @param x defines the x coordinate of the source
|
|
1554
1624
|
* @param y defines the y coordinate of the source
|
|
1555
1625
|
* @param z defines the z coordinate of the source
|
|
@@ -1567,13 +1637,14 @@ var Vector3 = /** @class */ (function () {
|
|
|
1567
1637
|
};
|
|
1568
1638
|
/**
|
|
1569
1639
|
* Returns a new Vector3 set to (1.0, 1.0, 1.0)
|
|
1570
|
-
* @returns a new
|
|
1640
|
+
* @returns a new Vector3
|
|
1571
1641
|
*/
|
|
1572
1642
|
Vector3.One = function () {
|
|
1573
1643
|
return new Vector3(1.0, 1.0, 1.0);
|
|
1574
1644
|
};
|
|
1575
1645
|
/**
|
|
1576
1646
|
* Returns a new Vector3 set to (0.0, 1.0, 0.0)
|
|
1647
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#71
|
|
1577
1648
|
* @returns a new up Vector3
|
|
1578
1649
|
*/
|
|
1579
1650
|
Vector3.Up = function () {
|
|
@@ -1651,6 +1722,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1651
1722
|
});
|
|
1652
1723
|
/**
|
|
1653
1724
|
* Returns a new Vector3 set to (0.0, -1.0, 0.0)
|
|
1725
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#71
|
|
1654
1726
|
* @returns a new down Vector3
|
|
1655
1727
|
*/
|
|
1656
1728
|
Vector3.Down = function () {
|
|
@@ -1658,6 +1730,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1658
1730
|
};
|
|
1659
1731
|
/**
|
|
1660
1732
|
* Returns a new Vector3 set to (0.0, 0.0, 1.0)
|
|
1733
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#71
|
|
1661
1734
|
* @param rightHandedSystem is the scene right-handed (negative z)
|
|
1662
1735
|
* @returns a new forward Vector3
|
|
1663
1736
|
*/
|
|
@@ -1667,8 +1740,9 @@ var Vector3 = /** @class */ (function () {
|
|
|
1667
1740
|
};
|
|
1668
1741
|
/**
|
|
1669
1742
|
* Returns a new Vector3 set to (0.0, 0.0, -1.0)
|
|
1743
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#71
|
|
1670
1744
|
* @param rightHandedSystem is the scene right-handed (negative-z)
|
|
1671
|
-
* @returns a new
|
|
1745
|
+
* @returns a new Backward Vector3
|
|
1672
1746
|
*/
|
|
1673
1747
|
Vector3.Backward = function (rightHandedSystem) {
|
|
1674
1748
|
if (rightHandedSystem === void 0) { rightHandedSystem = false; }
|
|
@@ -1676,6 +1750,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1676
1750
|
};
|
|
1677
1751
|
/**
|
|
1678
1752
|
* Returns a new Vector3 set to (1.0, 0.0, 0.0)
|
|
1753
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#71
|
|
1679
1754
|
* @returns a new right Vector3
|
|
1680
1755
|
*/
|
|
1681
1756
|
Vector3.Right = function () {
|
|
@@ -1683,6 +1758,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1683
1758
|
};
|
|
1684
1759
|
/**
|
|
1685
1760
|
* Returns a new Vector3 set to (-1.0, 0.0, 0.0)
|
|
1761
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#71
|
|
1686
1762
|
* @returns a new left Vector3
|
|
1687
1763
|
*/
|
|
1688
1764
|
Vector3.Left = function () {
|
|
@@ -1691,6 +1767,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1691
1767
|
/**
|
|
1692
1768
|
* Returns a new Vector3 set with the result of the transformation by the given matrix of the given vector.
|
|
1693
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
|
|
1694
1771
|
* @param vector defines the Vector3 to transform
|
|
1695
1772
|
* @param transformation defines the transformation matrix
|
|
1696
1773
|
* @returns the transformed Vector3
|
|
@@ -1703,6 +1780,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1703
1780
|
/**
|
|
1704
1781
|
* Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given vector
|
|
1705
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
|
|
1706
1784
|
* @param vector defines the Vector3 to transform
|
|
1707
1785
|
* @param transformation defines the transformation matrix
|
|
1708
1786
|
* @param result defines the Vector3 where to store the result
|
|
@@ -1713,6 +1791,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1713
1791
|
/**
|
|
1714
1792
|
* Sets the given vector "result" coordinates with the result of the transformation by the given matrix of the given floats (x, y, z)
|
|
1715
1793
|
* This method computes transformed coordinates only, not transformed direction vectors
|
|
1794
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#115
|
|
1716
1795
|
* @param x define the x coordinate of the source vector
|
|
1717
1796
|
* @param y define the y coordinate of the source vector
|
|
1718
1797
|
* @param z define the z coordinate of the source vector
|
|
@@ -1732,6 +1811,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1732
1811
|
/**
|
|
1733
1812
|
* Returns a new Vector3 set with the result of the normal transformation by the given matrix of the given vector
|
|
1734
1813
|
* This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
|
|
1814
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#112
|
|
1735
1815
|
* @param vector defines the Vector3 to transform
|
|
1736
1816
|
* @param transformation defines the transformation matrix
|
|
1737
1817
|
* @returns the new Vector3
|
|
@@ -1744,6 +1824,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1744
1824
|
/**
|
|
1745
1825
|
* Sets the given vector "result" with the result of the normal transformation by the given matrix of the given vector
|
|
1746
1826
|
* This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
|
|
1827
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#114
|
|
1747
1828
|
* @param vector defines the Vector3 to transform
|
|
1748
1829
|
* @param transformation defines the transformation matrix
|
|
1749
1830
|
* @param result defines the Vector3 where to store the result
|
|
@@ -1754,6 +1835,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1754
1835
|
/**
|
|
1755
1836
|
* Sets the given vector "result" with the result of the normal transformation by the given matrix of the given floats (x, y, z)
|
|
1756
1837
|
* This methods computes transformed normalized direction vectors only (ie. it does not apply translation)
|
|
1838
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#116
|
|
1757
1839
|
* @param x define the x coordinate of the source vector
|
|
1758
1840
|
* @param y define the y coordinate of the source vector
|
|
1759
1841
|
* @param z define the z coordinate of the source vector
|
|
@@ -1768,6 +1850,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1768
1850
|
};
|
|
1769
1851
|
/**
|
|
1770
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
|
|
1771
1854
|
* @param value1 defines the first control point
|
|
1772
1855
|
* @param value2 defines the second control point
|
|
1773
1856
|
* @param value3 defines the third control point
|
|
@@ -1799,6 +1882,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1799
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"
|
|
1800
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
|
|
1801
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
|
|
1802
1886
|
* @param value defines the current value
|
|
1803
1887
|
* @param min defines the lower range value
|
|
1804
1888
|
* @param max defines the upper range value
|
|
@@ -1813,6 +1897,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1813
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"
|
|
1814
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
|
|
1815
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
|
|
1816
1901
|
* @param value defines the current value
|
|
1817
1902
|
* @param min defines the lower range value
|
|
1818
1903
|
* @param max defines the upper range value
|
|
@@ -1832,6 +1917,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1832
1917
|
};
|
|
1833
1918
|
/**
|
|
1834
1919
|
* Checks if a given vector is inside a specific range
|
|
1920
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#75
|
|
1835
1921
|
* @param v defines the vector to test
|
|
1836
1922
|
* @param min defines the minimum range
|
|
1837
1923
|
* @param max defines the maximum range
|
|
@@ -1842,6 +1928,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1842
1928
|
};
|
|
1843
1929
|
/**
|
|
1844
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
|
|
1845
1932
|
* @param value1 defines the first control point
|
|
1846
1933
|
* @param tangent1 defines the first tangent vector
|
|
1847
1934
|
* @param value2 defines the second control point
|
|
@@ -1863,6 +1950,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1863
1950
|
};
|
|
1864
1951
|
/**
|
|
1865
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
|
|
1866
1954
|
* @param value1 defines the first control point
|
|
1867
1955
|
* @param tangent1 defines the first tangent
|
|
1868
1956
|
* @param value2 defines the second control point
|
|
@@ -1877,6 +1965,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1877
1965
|
};
|
|
1878
1966
|
/**
|
|
1879
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
|
|
1880
1969
|
* @param value1 defines the first control point
|
|
1881
1970
|
* @param tangent1 defines the first tangent
|
|
1882
1971
|
* @param value2 defines the second control point
|
|
@@ -1892,6 +1981,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1892
1981
|
};
|
|
1893
1982
|
/**
|
|
1894
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
|
|
1895
1985
|
* @param start defines the start value
|
|
1896
1986
|
* @param end defines the end value
|
|
1897
1987
|
* @param amount max defines amount between both (between 0 and 1)
|
|
@@ -1904,6 +1994,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1904
1994
|
};
|
|
1905
1995
|
/**
|
|
1906
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
|
|
1907
1998
|
* @param start defines the start value
|
|
1908
1999
|
* @param end defines the end value
|
|
1909
2000
|
* @param amount max defines amount between both (between 0 and 1)
|
|
@@ -1916,6 +2007,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1916
2007
|
};
|
|
1917
2008
|
/**
|
|
1918
2009
|
* Returns the dot product (float) between the vectors "left" and "right"
|
|
2010
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#82
|
|
1919
2011
|
* @param left defines the left operand
|
|
1920
2012
|
* @param right defines the right operand
|
|
1921
2013
|
* @returns the dot product
|
|
@@ -1926,6 +2018,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1926
2018
|
/**
|
|
1927
2019
|
* Returns a new Vector3 as the cross product of the vectors "left" and "right"
|
|
1928
2020
|
* The cross product is then orthogonal to both "left" and "right"
|
|
2021
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#15
|
|
1929
2022
|
* @param left defines the left operand
|
|
1930
2023
|
* @param right defines the right operand
|
|
1931
2024
|
* @returns the cross product
|
|
@@ -1938,6 +2031,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1938
2031
|
/**
|
|
1939
2032
|
* Sets the given vector "result" with the cross product of "left" and "right"
|
|
1940
2033
|
* The cross product is then orthogonal to both "left" and "right"
|
|
2034
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#78
|
|
1941
2035
|
* @param left defines the left operand
|
|
1942
2036
|
* @param right defines the right operand
|
|
1943
2037
|
* @param result defines the Vector3 where to store the result
|
|
@@ -1950,6 +2044,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1950
2044
|
};
|
|
1951
2045
|
/**
|
|
1952
2046
|
* Returns a new Vector3 as the normalization of the given vector
|
|
2047
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#98
|
|
1953
2048
|
* @param vector defines the Vector3 to normalize
|
|
1954
2049
|
* @returns the new Vector3
|
|
1955
2050
|
*/
|
|
@@ -1960,6 +2055,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1960
2055
|
};
|
|
1961
2056
|
/**
|
|
1962
2057
|
* Sets the given vector "result" with the normalization of the given first vector
|
|
2058
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#98
|
|
1963
2059
|
* @param vector defines the Vector3 to normalize
|
|
1964
2060
|
* @param result defines the Vector3 where to store the result
|
|
1965
2061
|
*/
|
|
@@ -1968,6 +2064,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1968
2064
|
};
|
|
1969
2065
|
/**
|
|
1970
2066
|
* Project a Vector3 onto screen space
|
|
2067
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#101
|
|
1971
2068
|
* @param vector defines the Vector3 to project
|
|
1972
2069
|
* @param world defines the world matrix to use
|
|
1973
2070
|
* @param transform defines the transform (view x projection) matrix to use
|
|
@@ -1981,6 +2078,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
1981
2078
|
};
|
|
1982
2079
|
/**
|
|
1983
2080
|
* Project a Vector3 onto screen space to reference
|
|
2081
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#102
|
|
1984
2082
|
* @param vector defines the Vector3 to project
|
|
1985
2083
|
* @param world defines the world matrix to use
|
|
1986
2084
|
* @param transform defines the transform (view x projection) matrix to use
|
|
@@ -2017,6 +2115,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2017
2115
|
};
|
|
2018
2116
|
/**
|
|
2019
2117
|
* Unproject from screen space to object space
|
|
2118
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#121
|
|
2020
2119
|
* @param source defines the screen space Vector3 to use
|
|
2021
2120
|
* @param viewportWidth defines the current width of the viewport
|
|
2022
2121
|
* @param viewportHeight defines the current height of the viewport
|
|
@@ -2029,6 +2128,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2029
2128
|
};
|
|
2030
2129
|
/**
|
|
2031
2130
|
* Unproject from screen space to object space
|
|
2131
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#117
|
|
2032
2132
|
* @param source defines the screen space Vector3 to use
|
|
2033
2133
|
* @param viewportWidth defines the current width of the viewport
|
|
2034
2134
|
* @param viewportHeight defines the current height of the viewport
|
|
@@ -2044,6 +2144,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2044
2144
|
};
|
|
2045
2145
|
/**
|
|
2046
2146
|
* Unproject from screen space to object space
|
|
2147
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#119
|
|
2047
2148
|
* @param source defines the screen space Vector3 to use
|
|
2048
2149
|
* @param viewportWidth defines the current width of the viewport
|
|
2049
2150
|
* @param viewportHeight defines the current height of the viewport
|
|
@@ -2057,6 +2158,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2057
2158
|
};
|
|
2058
2159
|
/**
|
|
2059
2160
|
* Unproject from screen space to object space
|
|
2161
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#120
|
|
2060
2162
|
* @param sourceX defines the screen space x coordinate to use
|
|
2061
2163
|
* @param sourceY defines the screen space y coordinate to use
|
|
2062
2164
|
* @param sourceZ defines the screen space z coordinate to use
|
|
@@ -2086,6 +2188,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2086
2188
|
};
|
|
2087
2189
|
/**
|
|
2088
2190
|
* Gets the minimal coordinate values between two Vector3
|
|
2191
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#97
|
|
2089
2192
|
* @param left defines the first operand
|
|
2090
2193
|
* @param right defines the second operand
|
|
2091
2194
|
* @returns the new Vector3
|
|
@@ -2097,6 +2200,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2097
2200
|
};
|
|
2098
2201
|
/**
|
|
2099
2202
|
* Gets the maximal coordinate values between two Vector3
|
|
2203
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#96
|
|
2100
2204
|
* @param left defines the first operand
|
|
2101
2205
|
* @param right defines the second operand
|
|
2102
2206
|
* @returns the new Vector3
|
|
@@ -2108,6 +2212,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2108
2212
|
};
|
|
2109
2213
|
/**
|
|
2110
2214
|
* Returns the distance between the vectors "value1" and "value2"
|
|
2215
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#81
|
|
2111
2216
|
* @param value1 defines the first operand
|
|
2112
2217
|
* @param value2 defines the second operand
|
|
2113
2218
|
* @returns the distance
|
|
@@ -2117,6 +2222,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2117
2222
|
};
|
|
2118
2223
|
/**
|
|
2119
2224
|
* Returns the squared distance between the vectors "value1" and "value2"
|
|
2225
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#80
|
|
2120
2226
|
* @param value1 defines the first operand
|
|
2121
2227
|
* @param value2 defines the second operand
|
|
2122
2228
|
* @returns the squared distance
|
|
@@ -2130,6 +2236,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2130
2236
|
/**
|
|
2131
2237
|
* Projects "vector" on the triangle determined by its extremities "p0", "p1" and "p2", stores the result in "ref"
|
|
2132
2238
|
* and returns the distance to the projected point.
|
|
2239
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#104
|
|
2133
2240
|
* From http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.104.4264&rep=rep1&type=pdf
|
|
2134
2241
|
*
|
|
2135
2242
|
* @param vector the vector to get distance from
|
|
@@ -2268,6 +2375,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2268
2375
|
};
|
|
2269
2376
|
/**
|
|
2270
2377
|
* Returns a new Vector3 located at the center between "value1" and "value2"
|
|
2378
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#72
|
|
2271
2379
|
* @param value1 defines the first operand
|
|
2272
2380
|
* @param value2 defines the second operand
|
|
2273
2381
|
* @returns the new Vector3
|
|
@@ -2277,6 +2385,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2277
2385
|
};
|
|
2278
2386
|
/**
|
|
2279
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
|
|
2280
2389
|
* @param value1 defines first vector
|
|
2281
2390
|
* @param value2 defines second vector
|
|
2282
2391
|
* @param ref defines third vector
|
|
@@ -2290,6 +2399,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2290
2399
|
* RotationFromAxis() returns the rotation Euler angles (ex : rotation.x, rotation.y, rotation.z) to apply
|
|
2291
2400
|
* to something in order to rotate it from its local system to the given target system
|
|
2292
2401
|
* Note: axis1, axis2 and axis3 are normalized during this operation
|
|
2402
|
+
* Example Playground https://playground.babylonjs.com/#R1F8YU#106
|
|
2293
2403
|
* @param axis1 defines the first axis
|
|
2294
2404
|
* @param axis2 defines the second axis
|
|
2295
2405
|
* @param axis3 defines the third axis
|
|
@@ -2303,6 +2413,7 @@ var Vector3 = /** @class */ (function () {
|
|
|
2303
2413
|
};
|
|
2304
2414
|
/**
|
|
2305
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
|
|
2306
2417
|
* @param axis1 defines the first axis
|
|
2307
2418
|
* @param axis2 defines the second axis
|
|
2308
2419
|
* @param axis3 defines the third axis
|
|
@@ -2736,7 +2847,7 @@ var Vector4 = /** @class */ (function () {
|
|
|
2736
2847
|
return new Vector4(Math.floor(this.x), Math.floor(this.y), Math.floor(this.z), Math.floor(this.w));
|
|
2737
2848
|
};
|
|
2738
2849
|
/**
|
|
2739
|
-
* Gets a new Vector4 from current
|
|
2850
|
+
* Gets a new Vector4 from current Vector4 fractional values
|
|
2740
2851
|
* @returns a new Vector4
|
|
2741
2852
|
*/
|
|
2742
2853
|
Vector4.prototype.fract = function () {
|