@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/main.js +85 -126
- package/dist/main.js.map +1 -1
- package/dist/module.js +43 -87
- package/dist/module.js.map +1 -1
- package/package.json +1 -1
- package/dist/miniprogram.js +0 -5095
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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
ContainmentType
|
|
8
|
-
}
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
PlaneIntersectionType
|
|
17
|
-
}
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
FrustumFace
|
|
29
|
-
}
|
|
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
|
-
|
|
104
|
-
|
|
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
|
-
(
|
|
621
|
-
|
|
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
|
-
(
|
|
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
|
-
(
|
|
862
|
-
|
|
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
|
-
(
|
|
1260
|
-
|
|
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
|
-
(
|
|
2676
|
-
|
|
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
|
-
(
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
(
|
|
3625
|
-
|
|
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
|
-
(
|
|
4009
|
-
|
|
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
|
-
(
|
|
4458
|
-
|
|
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).
|