@galacean/engine-physics-lite 0.9.21 → 0.9.22
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 +1249 -1170
- package/dist/browser.min.js +1 -1
- package/dist/main.js +112 -37
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +32571 -31674
- package/dist/module.js +97 -15
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
package/dist/module.js
CHANGED
|
@@ -1,9 +1,71 @@
|
|
|
1
|
-
import _ts_decorate from '@swc/helpers/src/_ts_decorate.mjs';
|
|
2
|
-
import _inherits from '@swc/helpers/src/_inherits.mjs';
|
|
3
|
-
import _create_class from '@swc/helpers/src/_create_class.mjs';
|
|
4
|
-
import _instanceof from '@swc/helpers/src/_instanceof.mjs';
|
|
5
1
|
import { Ray, Vector3, Matrix, Quaternion, MathUtil, BoundingBox, BoundingSphere, CollisionUtil } from '@galacean/engine';
|
|
6
2
|
|
|
3
|
+
/******************************************************************************
|
|
4
|
+
Copyright (c) Microsoft Corporation.
|
|
5
|
+
|
|
6
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
7
|
+
purpose with or without fee is hereby granted.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
***************************************************************************** */
|
|
17
|
+
|
|
18
|
+
function __decorate(decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function _set_prototype_of(o, p) {
|
|
26
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
27
|
+
o.__proto__ = p;
|
|
28
|
+
|
|
29
|
+
return o;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return _set_prototype_of(o, p);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function _inherits(subClass, superClass) {
|
|
36
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
37
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
|
|
41
|
+
|
|
42
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function _defineProperties(target, props) {
|
|
46
|
+
for (var i = 0; i < props.length; i++) {
|
|
47
|
+
var descriptor = props[i];
|
|
48
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
49
|
+
descriptor.configurable = true;
|
|
50
|
+
|
|
51
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
52
|
+
|
|
53
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
57
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
58
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
59
|
+
|
|
60
|
+
return Constructor;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function _instanceof(left, right) {
|
|
64
|
+
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
65
|
+
return !!right[Symbol.hasInstance](left);
|
|
66
|
+
} else return left instanceof right;
|
|
67
|
+
}
|
|
68
|
+
|
|
7
69
|
/**
|
|
8
70
|
* Fastly remove an element from array.
|
|
9
71
|
* @param array - Array
|
|
@@ -132,8 +194,12 @@ import { Ray, Vector3, Matrix, Quaternion, MathUtil, BoundingBox, BoundingSphere
|
|
|
132
194
|
};
|
|
133
195
|
return LiteColliderShape;
|
|
134
196
|
}();
|
|
135
|
-
|
|
136
|
-
LiteColliderShape.
|
|
197
|
+
(function() {
|
|
198
|
+
LiteColliderShape._ray = new Ray();
|
|
199
|
+
})();
|
|
200
|
+
(function() {
|
|
201
|
+
LiteColliderShape._tempPoint = new Vector3();
|
|
202
|
+
})();
|
|
137
203
|
|
|
138
204
|
/**
|
|
139
205
|
* Used to implement transformation related functions.
|
|
@@ -425,8 +491,12 @@ LiteColliderShape._tempPoint = new Vector3();
|
|
|
425
491
|
]);
|
|
426
492
|
return LiteTransform;
|
|
427
493
|
}();
|
|
428
|
-
|
|
429
|
-
LiteTransform.
|
|
494
|
+
(function() {
|
|
495
|
+
LiteTransform._tempQuat0 = new Quaternion();
|
|
496
|
+
})();
|
|
497
|
+
(function() {
|
|
498
|
+
LiteTransform._tempMat42 = new Matrix();
|
|
499
|
+
})();
|
|
430
500
|
var /**
|
|
431
501
|
* Dirty flag of transform.
|
|
432
502
|
*/ TransformFlag;
|
|
@@ -731,7 +801,9 @@ var /**
|
|
|
731
801
|
};
|
|
732
802
|
return LiteBoxColliderShape;
|
|
733
803
|
}(LiteColliderShape);
|
|
734
|
-
|
|
804
|
+
(function() {
|
|
805
|
+
LiteBoxColliderShape._tempBox = new BoundingBox();
|
|
806
|
+
})();
|
|
735
807
|
|
|
736
808
|
/**
|
|
737
809
|
* Sphere collider shape in Lite.
|
|
@@ -781,7 +853,9 @@ LiteBoxColliderShape._tempBox = new BoundingBox();
|
|
|
781
853
|
]);
|
|
782
854
|
return LiteSphereColliderShape;
|
|
783
855
|
}(LiteColliderShape);
|
|
784
|
-
|
|
856
|
+
(function() {
|
|
857
|
+
LiteSphereColliderShape._tempSphere = new BoundingSphere();
|
|
858
|
+
})();
|
|
785
859
|
|
|
786
860
|
/**
|
|
787
861
|
* A manager is a collection of colliders and constraints which can interact.
|
|
@@ -1033,10 +1107,18 @@ LiteSphereColliderShape._tempSphere = new BoundingSphere();
|
|
|
1033
1107
|
};
|
|
1034
1108
|
return LitePhysicsManager;
|
|
1035
1109
|
}();
|
|
1036
|
-
|
|
1037
|
-
LitePhysicsManager.
|
|
1038
|
-
|
|
1039
|
-
|
|
1110
|
+
(function() {
|
|
1111
|
+
LitePhysicsManager._tempSphere = new BoundingSphere();
|
|
1112
|
+
})();
|
|
1113
|
+
(function() {
|
|
1114
|
+
LitePhysicsManager._tempBox = new BoundingBox();
|
|
1115
|
+
})();
|
|
1116
|
+
(function() {
|
|
1117
|
+
LitePhysicsManager._currentHit = new LiteHitResult();
|
|
1118
|
+
})();
|
|
1119
|
+
(function() {
|
|
1120
|
+
LitePhysicsManager._hitResult = new LiteHitResult();
|
|
1121
|
+
})();
|
|
1040
1122
|
var /**
|
|
1041
1123
|
* Physics state
|
|
1042
1124
|
*/ TriggerEventState;
|
|
@@ -1176,7 +1258,7 @@ var LitePhysics = /*#__PURE__*/ function() {
|
|
|
1176
1258
|
};
|
|
1177
1259
|
return LitePhysics;
|
|
1178
1260
|
}();
|
|
1179
|
-
LitePhysics =
|
|
1261
|
+
LitePhysics = __decorate([
|
|
1180
1262
|
StaticInterfaceImplement()
|
|
1181
1263
|
], LitePhysics);
|
|
1182
1264
|
|