@galacean/engine-math 0.9.0-beta.81 → 0.9.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/dist/main.js +84 -38
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +84 -38
- package/dist/module.js +84 -38
- package/dist/module.js.map +1 -1
- package/package.json +1 -1
- package/dist/browser.js +0 -4819
- package/dist/browser.min.js +0 -1
package/dist/main.js
CHANGED
|
@@ -33,19 +33,21 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
33
33
|
})(exports.FrustumFace || (exports.FrustumFace = {}));
|
|
34
34
|
|
|
35
35
|
function _defineProperties(target, props) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
for (var i = 0; i < props.length; i++) {
|
|
37
|
+
var descriptor = props[i];
|
|
38
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
39
|
+
descriptor.configurable = true;
|
|
40
|
+
|
|
41
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
42
|
+
|
|
43
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
44
|
+
}
|
|
43
45
|
}
|
|
46
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
47
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
48
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
47
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
48
|
-
return Constructor;
|
|
50
|
+
return Constructor;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
/**
|
|
@@ -93,9 +95,15 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
93
95
|
};
|
|
94
96
|
return MathUtil;
|
|
95
97
|
}();
|
|
96
|
-
|
|
97
|
-
/** The
|
|
98
|
-
|
|
98
|
+
(function() {
|
|
99
|
+
/** The value for which all absolute numbers smaller than are considered equal to zero. */ MathUtil.zeroTolerance = 1e-6;
|
|
100
|
+
})();
|
|
101
|
+
(function() {
|
|
102
|
+
/** The conversion factor that radian to degree. */ MathUtil.radToDegreeFactor = 180 / Math.PI;
|
|
103
|
+
})();
|
|
104
|
+
(function() {
|
|
105
|
+
/** The conversion factor that degree to radian. */ MathUtil.degreeToRadFactor = Math.PI / 180;
|
|
106
|
+
})();
|
|
99
107
|
|
|
100
108
|
/**
|
|
101
109
|
* Describes a 3D-vector.
|
|
@@ -554,7 +562,7 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
554
562
|
out._z = iz * qw - iw * qz - ix * qy + iy * qx;
|
|
555
563
|
out._onValueChanged && out._onValueChanged();
|
|
556
564
|
};
|
|
557
|
-
|
|
565
|
+
_create_class(Vector3, [
|
|
558
566
|
{
|
|
559
567
|
key: "x",
|
|
560
568
|
get: /**
|
|
@@ -594,8 +602,12 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
594
602
|
]);
|
|
595
603
|
return Vector3;
|
|
596
604
|
}();
|
|
597
|
-
|
|
598
|
-
/** @internal */ Vector3.
|
|
605
|
+
(function() {
|
|
606
|
+
/** @internal */ Vector3._zero = new Vector3(0.0, 0.0, 0.0);
|
|
607
|
+
})();
|
|
608
|
+
(function() {
|
|
609
|
+
/** @internal */ Vector3._one = new Vector3(1.0, 1.0, 1.0);
|
|
610
|
+
})();
|
|
599
611
|
|
|
600
612
|
/**
|
|
601
613
|
* A bounding sphere.
|
|
@@ -664,7 +676,9 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
664
676
|
};
|
|
665
677
|
return BoundingSphere;
|
|
666
678
|
}();
|
|
667
|
-
|
|
679
|
+
(function() {
|
|
680
|
+
BoundingSphere._tempVec30 = new Vector3();
|
|
681
|
+
})();
|
|
668
682
|
|
|
669
683
|
/**
|
|
670
684
|
* Axis Aligned Bound Box (AABB).
|
|
@@ -823,8 +837,12 @@ BoundingSphere._tempVec30 = new Vector3();
|
|
|
823
837
|
};
|
|
824
838
|
return BoundingBox;
|
|
825
839
|
}();
|
|
826
|
-
|
|
827
|
-
BoundingBox.
|
|
840
|
+
(function() {
|
|
841
|
+
BoundingBox._tempVec30 = new Vector3();
|
|
842
|
+
})();
|
|
843
|
+
(function() {
|
|
844
|
+
BoundingBox._tempVec31 = new Vector3();
|
|
845
|
+
})();
|
|
828
846
|
|
|
829
847
|
/**
|
|
830
848
|
* Contains static methods to help in determining intersections, containment, etc.
|
|
@@ -1173,9 +1191,15 @@ BoundingBox._tempVec31 = new Vector3();
|
|
|
1173
1191
|
};
|
|
1174
1192
|
return CollisionUtil;
|
|
1175
1193
|
}();
|
|
1176
|
-
|
|
1177
|
-
CollisionUtil.
|
|
1178
|
-
|
|
1194
|
+
(function() {
|
|
1195
|
+
CollisionUtil._tempVec30 = new Vector3();
|
|
1196
|
+
})();
|
|
1197
|
+
(function() {
|
|
1198
|
+
CollisionUtil._tempVec31 = new Vector3();
|
|
1199
|
+
})();
|
|
1200
|
+
(function() {
|
|
1201
|
+
CollisionUtil._tempVec32 = new Vector3();
|
|
1202
|
+
})();
|
|
1179
1203
|
|
|
1180
1204
|
/**
|
|
1181
1205
|
* Represents a plane in three-dimensional space.
|
|
@@ -2499,7 +2523,7 @@ CollisionUtil._tempVec32 = new Vector3();
|
|
|
2499
2523
|
out._w = a._w * s;
|
|
2500
2524
|
out._onValueChanged && out._onValueChanged();
|
|
2501
2525
|
};
|
|
2502
|
-
|
|
2526
|
+
_create_class(Quaternion, [
|
|
2503
2527
|
{
|
|
2504
2528
|
key: "x",
|
|
2505
2529
|
get: /**
|
|
@@ -2559,8 +2583,12 @@ CollisionUtil._tempVec32 = new Vector3();
|
|
|
2559
2583
|
]);
|
|
2560
2584
|
return Quaternion;
|
|
2561
2585
|
}();
|
|
2562
|
-
|
|
2563
|
-
/** @internal */ Quaternion.
|
|
2586
|
+
(function() {
|
|
2587
|
+
/** @internal */ Quaternion._tempVector3 = new Vector3();
|
|
2588
|
+
})();
|
|
2589
|
+
(function() {
|
|
2590
|
+
/** @internal */ Quaternion._tempQuat1 = new Quaternion();
|
|
2591
|
+
})();
|
|
2564
2592
|
|
|
2565
2593
|
/**
|
|
2566
2594
|
* Represents a 4x4 mathematical matrix.
|
|
@@ -3506,11 +3534,21 @@ CollisionUtil._tempVec32 = new Vector3();
|
|
|
3506
3534
|
};
|
|
3507
3535
|
return Matrix;
|
|
3508
3536
|
}();
|
|
3509
|
-
|
|
3510
|
-
Matrix.
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3537
|
+
(function() {
|
|
3538
|
+
Matrix._tempVec30 = new Vector3();
|
|
3539
|
+
})();
|
|
3540
|
+
(function() {
|
|
3541
|
+
Matrix._tempVec31 = new Vector3();
|
|
3542
|
+
})();
|
|
3543
|
+
(function() {
|
|
3544
|
+
Matrix._tempVec32 = new Vector3();
|
|
3545
|
+
})();
|
|
3546
|
+
(function() {
|
|
3547
|
+
Matrix._tempMat30 = new Matrix3x3();
|
|
3548
|
+
})();
|
|
3549
|
+
(function() {
|
|
3550
|
+
/** @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);
|
|
3551
|
+
})();
|
|
3514
3552
|
|
|
3515
3553
|
/**
|
|
3516
3554
|
* Represents a ray with an origin and a direction in 3D space.
|
|
@@ -3846,7 +3884,7 @@ Matrix._tempMat30 = new Matrix3x3();
|
|
|
3846
3884
|
out._y = left._y * s;
|
|
3847
3885
|
out._onValueChanged && out._onValueChanged();
|
|
3848
3886
|
};
|
|
3849
|
-
|
|
3887
|
+
_create_class(Vector2, [
|
|
3850
3888
|
{
|
|
3851
3889
|
key: "x",
|
|
3852
3890
|
get: /**
|
|
@@ -3874,8 +3912,12 @@ Matrix._tempMat30 = new Matrix3x3();
|
|
|
3874
3912
|
]);
|
|
3875
3913
|
return Vector2;
|
|
3876
3914
|
}();
|
|
3877
|
-
|
|
3878
|
-
/** @internal */ Vector2.
|
|
3915
|
+
(function() {
|
|
3916
|
+
/** @internal */ Vector2._zero = new Vector2(0.0, 0.0);
|
|
3917
|
+
})();
|
|
3918
|
+
(function() {
|
|
3919
|
+
/** @internal */ Vector2._one = new Vector2(1.0, 1.0);
|
|
3920
|
+
})();
|
|
3879
3921
|
|
|
3880
3922
|
/**
|
|
3881
3923
|
* Describes a 4D-vector.
|
|
@@ -4256,7 +4298,7 @@ Matrix._tempMat30 = new Matrix3x3();
|
|
|
4256
4298
|
out._w = w;
|
|
4257
4299
|
out._onValueChanged && out._onValueChanged();
|
|
4258
4300
|
};
|
|
4259
|
-
|
|
4301
|
+
_create_class(Vector4, [
|
|
4260
4302
|
{
|
|
4261
4303
|
key: "x",
|
|
4262
4304
|
get: /**
|
|
@@ -4308,8 +4350,12 @@ Matrix._tempMat30 = new Matrix3x3();
|
|
|
4308
4350
|
]);
|
|
4309
4351
|
return Vector4;
|
|
4310
4352
|
}();
|
|
4311
|
-
|
|
4312
|
-
/** @internal */ Vector4.
|
|
4353
|
+
(function() {
|
|
4354
|
+
/** @internal */ Vector4._zero = new Vector4(0.0, 0.0, 0.0, 0.0);
|
|
4355
|
+
})();
|
|
4356
|
+
(function() {
|
|
4357
|
+
/** @internal */ Vector4._one = new Vector4(1.0, 1.0, 1.0, 1.0);
|
|
4358
|
+
})();
|
|
4313
4359
|
|
|
4314
4360
|
/**
|
|
4315
4361
|
* Describes a color in the from of RGBA (in order: R, G, B, A).
|
|
@@ -4519,7 +4565,7 @@ Matrix._tempMat30 = new Matrix3x3();
|
|
|
4519
4565
|
out._onValueChanged && out._onValueChanged();
|
|
4520
4566
|
return out;
|
|
4521
4567
|
};
|
|
4522
|
-
|
|
4568
|
+
_create_class(Color, [
|
|
4523
4569
|
{
|
|
4524
4570
|
key: "r",
|
|
4525
4571
|
get: /**
|