@galacean/engine-math 1.3.24 → 1.4.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -1,32 +1,32 @@
1
1
  /**
2
2
  * Defines how the bounding volumes intersects or contain one another.
3
- */ var ContainmentType;
4
- (function(ContainmentType) {
5
- ContainmentType[ContainmentType[/** Indicates that there is no overlap between two bounding volumes. */ "Disjoint"] = 0] = "Disjoint";
6
- ContainmentType[ContainmentType[/** Indicates that one bounding volume completely contains another volume. */ "Contains"] = 1] = "Contains";
7
- ContainmentType[ContainmentType[/** Indicates that bounding volumes partially overlap one another. */ "Intersects"] = 2] = "Intersects";
8
- })(ContainmentType || (ContainmentType = {}));
3
+ */ var ContainmentType = /*#__PURE__*/ function(ContainmentType) {
4
+ /** Indicates that there is no overlap between two bounding volumes. */ ContainmentType[ContainmentType["Disjoint"] = 0] = "Disjoint";
5
+ /** Indicates that one bounding volume completely contains another volume. */ ContainmentType[ContainmentType["Contains"] = 1] = "Contains";
6
+ /** Indicates that bounding volumes partially overlap one another. */ ContainmentType[ContainmentType["Intersects"] = 2] = "Intersects";
7
+ return ContainmentType;
8
+ }({});
9
9
 
10
10
  /**
11
11
  * Defines the intersection between a plane and a bounding volume.
12
- */ var PlaneIntersectionType;
13
- (function(PlaneIntersectionType) {
14
- PlaneIntersectionType[PlaneIntersectionType[/** There is no intersection, the bounding volume is in the back of the plane. */ "Back"] = 0] = "Back";
15
- PlaneIntersectionType[PlaneIntersectionType[/** There is no intersection, the bounding volume is in the front of the plane. */ "Front"] = 1] = "Front";
16
- PlaneIntersectionType[PlaneIntersectionType[/** The plane is intersected. */ "Intersecting"] = 2] = "Intersecting";
17
- })(PlaneIntersectionType || (PlaneIntersectionType = {}));
12
+ */ var PlaneIntersectionType = /*#__PURE__*/ function(PlaneIntersectionType) {
13
+ /** There is no intersection, the bounding volume is in the back of the plane. */ PlaneIntersectionType[PlaneIntersectionType["Back"] = 0] = "Back";
14
+ /** There is no intersection, the bounding volume is in the front of the plane. */ PlaneIntersectionType[PlaneIntersectionType["Front"] = 1] = "Front";
15
+ /** The plane is intersected. */ PlaneIntersectionType[PlaneIntersectionType["Intersecting"] = 2] = "Intersecting";
16
+ return PlaneIntersectionType;
17
+ }({});
18
18
 
19
19
  /**
20
20
  * Frustum face
21
- */ var FrustumFace;
22
- (function(FrustumFace) {
23
- FrustumFace[FrustumFace[/** Near face */ "Near"] = 0] = "Near";
24
- FrustumFace[FrustumFace[/** Far face */ "Far"] = 1] = "Far";
25
- FrustumFace[FrustumFace[/** Left face */ "Left"] = 2] = "Left";
26
- FrustumFace[FrustumFace[/** Right face */ "Right"] = 3] = "Right";
27
- FrustumFace[FrustumFace[/** Bottom face */ "Bottom"] = 4] = "Bottom";
28
- FrustumFace[FrustumFace[/** Top face */ "Top"] = 5] = "Top";
29
- })(FrustumFace || (FrustumFace = {}));
21
+ */ var FrustumFace = /*#__PURE__*/ function(FrustumFace) {
22
+ /** Near face */ FrustumFace[FrustumFace["Near"] = 0] = "Near";
23
+ /** Far face */ FrustumFace[FrustumFace["Far"] = 1] = "Far";
24
+ /** Left face */ FrustumFace[FrustumFace["Left"] = 2] = "Left";
25
+ /** Right face */ FrustumFace[FrustumFace["Right"] = 3] = "Right";
26
+ /** Bottom face */ FrustumFace[FrustumFace["Bottom"] = 4] = "Bottom";
27
+ /** Top face */ FrustumFace[FrustumFace["Top"] = 5] = "Top";
28
+ return FrustumFace;
29
+ }({});
30
30
 
31
31
  function _defineProperties(target, props) {
32
32
  for (var i = 0; i < props.length; i++) {
@@ -100,15 +100,9 @@ function _create_class(Constructor, protoProps, staticProps) {
100
100
  };
101
101
  return MathUtil;
102
102
  }();
103
- (function() {
104
- /** The value for which all absolute numbers smaller than are considered equal to zero. */ MathUtil.zeroTolerance = 1e-6;
105
- })();
106
- (function() {
107
- /** The conversion factor that radian to degree. */ MathUtil.radToDegreeFactor = 180 / Math.PI;
108
- })();
109
- (function() {
110
- /** The conversion factor that degree to radian. */ MathUtil.degreeToRadFactor = Math.PI / 180;
111
- })();
103
+ /** The value for which all absolute numbers smaller than are considered equal to zero. */ MathUtil.zeroTolerance = 1e-6;
104
+ /** The conversion factor that radian to degree. */ MathUtil.radToDegreeFactor = 180 / Math.PI;
105
+ /** The conversion factor that degree to radian. */ MathUtil.degreeToRadFactor = Math.PI / 180;
112
106
 
113
107
  /**
114
108
  * Describes a 3D-vector.
@@ -617,12 +611,8 @@ function _create_class(Constructor, protoProps, staticProps) {
617
611
  ]);
618
612
  return Vector3;
619
613
  }();
620
- (function() {
621
- /** @internal */ Vector3._zero = new Vector3(0.0, 0.0, 0.0);
622
- })();
623
- (function() {
624
- /** @internal */ Vector3._one = new Vector3(1.0, 1.0, 1.0);
625
- })();
614
+ /** @internal */ Vector3._zero = new Vector3(0.0, 0.0, 0.0);
615
+ /** @internal */ Vector3._one = new Vector3(1.0, 1.0, 1.0);
626
616
 
627
617
  /**
628
618
  * A bounding sphere.
@@ -691,9 +681,7 @@ function _create_class(Constructor, protoProps, staticProps) {
691
681
  };
692
682
  return BoundingSphere;
693
683
  }();
694
- (function() {
695
- BoundingSphere._tempVec30 = new Vector3();
696
- })();
684
+ BoundingSphere._tempVec30 = new Vector3();
697
685
 
698
686
  /**
699
687
  * Axis Aligned Bound Box (AABB).
@@ -858,12 +846,8 @@ function _create_class(Constructor, protoProps, staticProps) {
858
846
  };
859
847
  return BoundingBox;
860
848
  }();
861
- (function() {
862
- BoundingBox._tempVec30 = new Vector3();
863
- })();
864
- (function() {
865
- BoundingBox._tempVec31 = new Vector3();
866
- })();
849
+ BoundingBox._tempVec30 = new Vector3();
850
+ BoundingBox._tempVec31 = new Vector3();
867
851
 
868
852
  /**
869
853
  * Contains static methods to help in determining intersections, containment, etc.
@@ -1256,15 +1240,9 @@ function _create_class(Constructor, protoProps, staticProps) {
1256
1240
  };
1257
1241
  return CollisionUtil;
1258
1242
  }();
1259
- (function() {
1260
- CollisionUtil._tempVec30 = new Vector3();
1261
- })();
1262
- (function() {
1263
- CollisionUtil._tempVec31 = new Vector3();
1264
- })();
1265
- (function() {
1266
- CollisionUtil._tempVec32 = new Vector3();
1267
- })();
1243
+ CollisionUtil._tempVec30 = new Vector3();
1244
+ CollisionUtil._tempVec31 = new Vector3();
1245
+ CollisionUtil._tempVec32 = new Vector3();
1268
1246
 
1269
1247
  /**
1270
1248
  * Represents a plane in three-dimensional space.
@@ -2672,12 +2650,8 @@ function _create_class(Constructor, protoProps, staticProps) {
2672
2650
  ]);
2673
2651
  return Quaternion;
2674
2652
  }();
2675
- (function() {
2676
- /** @internal */ Quaternion._tempVector3 = new Vector3();
2677
- })();
2678
- (function() {
2679
- /** @internal */ Quaternion._tempQuat1 = new Quaternion();
2680
- })();
2653
+ /** @internal */ Quaternion._tempVector3 = new Vector3();
2654
+ /** @internal */ Quaternion._tempQuat1 = new Quaternion();
2681
2655
 
2682
2656
  /**
2683
2657
  * Represents a 4x4 mathematical matrix.
@@ -3618,21 +3592,11 @@ function _create_class(Constructor, protoProps, staticProps) {
3618
3592
  };
3619
3593
  return Matrix;
3620
3594
  }();
3621
- (function() {
3622
- Matrix._tempVec30 = new Vector3();
3623
- })();
3624
- (function() {
3625
- Matrix._tempVec31 = new Vector3();
3626
- })();
3627
- (function() {
3628
- Matrix._tempVec32 = new Vector3();
3629
- })();
3630
- (function() {
3631
- Matrix._tempMat30 = new Matrix3x3();
3632
- })();
3633
- (function() {
3634
- /** @internal Identity matrix. */ Matrix._identity = new Matrix(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
3635
- })();
3595
+ Matrix._tempVec30 = new Vector3();
3596
+ Matrix._tempVec31 = new Vector3();
3597
+ Matrix._tempVec32 = new Vector3();
3598
+ Matrix._tempMat30 = new Matrix3x3();
3599
+ /** @internal Identity matrix. */ Matrix._identity = new Matrix(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0);
3636
3600
 
3637
3601
  /**
3638
3602
  * Represents a ray with an origin and a direction in 3D space.
@@ -4005,12 +3969,8 @@ function _create_class(Constructor, protoProps, staticProps) {
4005
3969
  ]);
4006
3970
  return Vector2;
4007
3971
  }();
4008
- (function() {
4009
- /** @internal */ Vector2._zero = new Vector2(0.0, 0.0);
4010
- })();
4011
- (function() {
4012
- /** @internal */ Vector2._one = new Vector2(1.0, 1.0);
4013
- })();
3972
+ /** @internal */ Vector2._zero = new Vector2(0.0, 0.0);
3973
+ /** @internal */ Vector2._one = new Vector2(1.0, 1.0);
4014
3974
 
4015
3975
  /**
4016
3976
  * Describes a 4D-vector.
@@ -4454,12 +4414,8 @@ function _create_class(Constructor, protoProps, staticProps) {
4454
4414
  ]);
4455
4415
  return Vector4;
4456
4416
  }();
4457
- (function() {
4458
- /** @internal */ Vector4._zero = new Vector4(0.0, 0.0, 0.0, 0.0);
4459
- })();
4460
- (function() {
4461
- /** @internal */ Vector4._one = new Vector4(1.0, 1.0, 1.0, 1.0);
4462
- })();
4417
+ /** @internal */ Vector4._zero = new Vector4(0.0, 0.0, 0.0, 0.0);
4418
+ /** @internal */ Vector4._one = new Vector4(1.0, 1.0, 1.0, 1.0);
4463
4419
 
4464
4420
  /**
4465
4421
  * Describes a color in the from of RGBA (in order: R, G, B, A).