@galacean/engine-physics-lite 1.0.0-alpha.6 → 1.0.0-beta.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/browser.js +1199 -1203
- package/dist/browser.min.js +1 -1
- package/dist/main.js +61 -65
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +2080 -1526
- package/dist/module.js +62 -66
- package/dist/module.js.map +1 -1
- package/package.json +10 -4
- package/types/LiteUpdateFlag.d.ts +0 -6
- package/types/shape/LiteBoxColliderShape.d.ts +2 -2
package/dist/module.js
CHANGED
|
@@ -1,73 +1,49 @@
|
|
|
1
|
-
import { Ray, Vector3, Matrix, Quaternion, MathUtil, BoundingBox, BoundingSphere, CollisionUtil } from '@galacean/engine';
|
|
1
|
+
import { Utils, Ray, Vector3, Matrix, Quaternion, MathUtil, BoundingBox, BoundingSphere, CollisionUtil } from '@galacean/engine';
|
|
2
2
|
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return o;
|
|
7
|
-
};
|
|
3
|
+
function _set_prototype_of(o, p) {
|
|
4
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
5
|
+
o.__proto__ = p;
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
}
|
|
7
|
+
return o;
|
|
8
|
+
};
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
return setPrototypeOf(o, p);
|
|
10
|
+
return _set_prototype_of(o, p);
|
|
14
11
|
}
|
|
15
12
|
|
|
16
13
|
function _inherits(subClass, superClass) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
22
|
-
constructor: {
|
|
23
|
-
value: subClass,
|
|
24
|
-
writable: true,
|
|
25
|
-
configurable: true
|
|
14
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
15
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
26
16
|
}
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
|
|
18
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
19
|
+
|
|
20
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
29
21
|
}
|
|
30
22
|
|
|
31
23
|
function _defineProperties(target, props) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
for (var i = 0; i < props.length; i++) {
|
|
25
|
+
var descriptor = props[i];
|
|
26
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
27
|
+
descriptor.configurable = true;
|
|
28
|
+
|
|
29
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
30
|
+
|
|
31
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
32
|
+
}
|
|
39
33
|
}
|
|
34
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
35
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
36
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
43
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
44
|
-
return Constructor;
|
|
38
|
+
return Constructor;
|
|
45
39
|
}
|
|
46
40
|
|
|
47
41
|
function _instanceof(left, right) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return left instanceof right;
|
|
52
|
-
}
|
|
42
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
43
|
+
return !!right[Symbol.hasInstance](left);
|
|
44
|
+
} else return left instanceof right;
|
|
53
45
|
}
|
|
54
46
|
|
|
55
|
-
/**
|
|
56
|
-
* Fastly remove an element from array.
|
|
57
|
-
* @param array - Array
|
|
58
|
-
* @param item - Element
|
|
59
|
-
*/ function removeFromArray(array, item) {
|
|
60
|
-
var index = array.indexOf(item);
|
|
61
|
-
if (index < 0) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
var last = array.length - 1;
|
|
65
|
-
if (index !== last) {
|
|
66
|
-
array[index] = array[last];
|
|
67
|
-
}
|
|
68
|
-
array.length--;
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
47
|
/**
|
|
72
48
|
* Used to update tags.
|
|
73
49
|
*/ var LiteUpdateFlag = /*#__PURE__*/ function() {
|
|
@@ -81,7 +57,7 @@ function _instanceof(left, right) {
|
|
|
81
57
|
/**
|
|
82
58
|
* Destroy.
|
|
83
59
|
*/ _proto.destroy = function destroy() {
|
|
84
|
-
removeFromArray(this._flags, this);
|
|
60
|
+
Utils.removeFromArray(this._flags, this);
|
|
85
61
|
this._flags = null;
|
|
86
62
|
};
|
|
87
63
|
return LiteUpdateFlag;
|
|
@@ -180,8 +156,12 @@ function _instanceof(left, right) {
|
|
|
180
156
|
};
|
|
181
157
|
return LiteColliderShape;
|
|
182
158
|
}();
|
|
183
|
-
|
|
184
|
-
LiteColliderShape.
|
|
159
|
+
(function() {
|
|
160
|
+
LiteColliderShape._ray = new Ray();
|
|
161
|
+
})();
|
|
162
|
+
(function() {
|
|
163
|
+
LiteColliderShape._tempPoint = new Vector3();
|
|
164
|
+
})();
|
|
185
165
|
|
|
186
166
|
/**
|
|
187
167
|
* Used to implement transformation related functions.
|
|
@@ -324,7 +304,7 @@ LiteColliderShape._tempPoint = new Vector3();
|
|
|
324
304
|
this._dirtyFlag |= type;
|
|
325
305
|
this._updateFlagManager.distribute();
|
|
326
306
|
};
|
|
327
|
-
|
|
307
|
+
_create_class(LiteTransform, [
|
|
328
308
|
{
|
|
329
309
|
key: "owner",
|
|
330
310
|
set: function set(value) {
|
|
@@ -473,8 +453,12 @@ LiteColliderShape._tempPoint = new Vector3();
|
|
|
473
453
|
]);
|
|
474
454
|
return LiteTransform;
|
|
475
455
|
}();
|
|
476
|
-
|
|
477
|
-
LiteTransform.
|
|
456
|
+
(function() {
|
|
457
|
+
LiteTransform._tempQuat0 = new Quaternion();
|
|
458
|
+
})();
|
|
459
|
+
(function() {
|
|
460
|
+
LiteTransform._tempMat42 = new Matrix();
|
|
461
|
+
})();
|
|
478
462
|
var /**
|
|
479
463
|
* Dirty flag of transform.
|
|
480
464
|
*/ TransformFlag;
|
|
@@ -779,7 +763,9 @@ var /**
|
|
|
779
763
|
};
|
|
780
764
|
return LiteBoxColliderShape;
|
|
781
765
|
}(LiteColliderShape);
|
|
782
|
-
|
|
766
|
+
(function() {
|
|
767
|
+
LiteBoxColliderShape._tempBox = new BoundingBox();
|
|
768
|
+
})();
|
|
783
769
|
|
|
784
770
|
/**
|
|
785
771
|
* Sphere collider shape in Lite.
|
|
@@ -819,7 +805,7 @@ LiteBoxColliderShape._tempBox = new BoundingBox();
|
|
|
819
805
|
return false;
|
|
820
806
|
}
|
|
821
807
|
};
|
|
822
|
-
|
|
808
|
+
_create_class(LiteSphereColliderShape, [
|
|
823
809
|
{
|
|
824
810
|
key: "worldRadius",
|
|
825
811
|
get: function get() {
|
|
@@ -829,7 +815,9 @@ LiteBoxColliderShape._tempBox = new BoundingBox();
|
|
|
829
815
|
]);
|
|
830
816
|
return LiteSphereColliderShape;
|
|
831
817
|
}(LiteColliderShape);
|
|
832
|
-
|
|
818
|
+
(function() {
|
|
819
|
+
LiteSphereColliderShape._tempSphere = new BoundingSphere();
|
|
820
|
+
})();
|
|
833
821
|
|
|
834
822
|
/**
|
|
835
823
|
* A manager is a collection of colliders and constraints which can interact.
|
|
@@ -1081,10 +1069,18 @@ LiteSphereColliderShape._tempSphere = new BoundingSphere();
|
|
|
1081
1069
|
};
|
|
1082
1070
|
return LitePhysicsManager;
|
|
1083
1071
|
}();
|
|
1084
|
-
|
|
1085
|
-
LitePhysicsManager.
|
|
1086
|
-
|
|
1087
|
-
|
|
1072
|
+
(function() {
|
|
1073
|
+
LitePhysicsManager._tempSphere = new BoundingSphere();
|
|
1074
|
+
})();
|
|
1075
|
+
(function() {
|
|
1076
|
+
LitePhysicsManager._tempBox = new BoundingBox();
|
|
1077
|
+
})();
|
|
1078
|
+
(function() {
|
|
1079
|
+
LitePhysicsManager._currentHit = new LiteHitResult();
|
|
1080
|
+
})();
|
|
1081
|
+
(function() {
|
|
1082
|
+
LitePhysicsManager._hitResult = new LiteHitResult();
|
|
1083
|
+
})();
|
|
1088
1084
|
var /**
|
|
1089
1085
|
* Physics state
|
|
1090
1086
|
*/ TriggerEventState;
|