mage-engine 3.21.1 → 3.21.2
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/.prettierrc.js +20 -0
- package/dist/mage.js +20 -4
- package/package.json +1 -1
package/.prettierrc.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
printWidth: 100,
|
|
5
|
+
trailingComma: "all",
|
|
6
|
+
arrowParens: "avoid",
|
|
7
|
+
semi: true,
|
|
8
|
+
tabWidth: 4,
|
|
9
|
+
|
|
10
|
+
overrides: [
|
|
11
|
+
{
|
|
12
|
+
files: ["*.md"],
|
|
13
|
+
options: { printWidth: 120 },
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
files: [".toolsharerc"],
|
|
17
|
+
options: { parser: "yaml" },
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
package/dist/mage.js
CHANGED
|
@@ -57751,7 +57751,7 @@ function applyMiddleware() {
|
|
|
57751
57751
|
|
|
57752
57752
|
var thunk = createThunkMiddleware();
|
|
57753
57753
|
thunk.withExtraArgument = createThunkMiddleware;var name = "mage-engine";
|
|
57754
|
-
var version$1 = "3.21.
|
|
57754
|
+
var version$1 = "3.21.2";
|
|
57755
57755
|
var description = "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.";
|
|
57756
57756
|
var main = "dist/mage.js";
|
|
57757
57757
|
var author$1 = {
|
|
@@ -60041,7 +60041,7 @@ var tweenTo = function tweenTo(origin, target) {
|
|
|
60041
60041
|
var _options$serializable = _options.serializable,
|
|
60042
60042
|
serializable = _options$serializable === void 0 ? true : _options$serializable,
|
|
60043
60043
|
_options$tag = _options.tag,
|
|
60044
|
-
tag = _options$tag === void 0 ?
|
|
60044
|
+
tag = _options$tag === void 0 ? "" : _options$tag,
|
|
60045
60045
|
_options$tags = _options.tags,
|
|
60046
60046
|
tags = _options$tags === void 0 ? [] : _options$tags;
|
|
60047
60047
|
_this = _super.call(this);
|
|
@@ -60290,7 +60290,7 @@ var tweenTo = function tweenTo(origin, target) {
|
|
|
60290
60290
|
var index = this.children.findIndex(function (m) {
|
|
60291
60291
|
return m.equals(element);
|
|
60292
60292
|
});
|
|
60293
|
-
if (index) this.children.splice(index, 1);
|
|
60293
|
+
if (index !== -1) this.children.splice(index, 1);
|
|
60294
60294
|
} else {
|
|
60295
60295
|
this.body.remove(element.getBody());
|
|
60296
60296
|
}
|
|
@@ -60456,6 +60456,7 @@ var tweenTo = function tweenTo(origin, target) {
|
|
|
60456
60456
|
type: ENTITY_EVENTS.DISPOSE
|
|
60457
60457
|
});
|
|
60458
60458
|
this.reset();
|
|
60459
|
+
this.disposed = true;
|
|
60459
60460
|
}
|
|
60460
60461
|
}, {
|
|
60461
60462
|
key: "addStateMachine",
|
|
@@ -60554,6 +60555,21 @@ var tweenTo = function tweenTo(origin, target) {
|
|
|
60554
60555
|
|
|
60555
60556
|
return script;
|
|
60556
60557
|
}
|
|
60558
|
+
}, {
|
|
60559
|
+
key: "removeScript",
|
|
60560
|
+
value: function removeScript(name) {
|
|
60561
|
+
var index = this.scripts.findIndex(function (script) {
|
|
60562
|
+
return script.name === name;
|
|
60563
|
+
});
|
|
60564
|
+
var script = this.scripts[index].script;
|
|
60565
|
+
|
|
60566
|
+
if (script) {
|
|
60567
|
+
script.onDispose();
|
|
60568
|
+
this.scripts.splice(index, 1);
|
|
60569
|
+
} else {
|
|
60570
|
+
console.log(SCRIPT_NOT_FOUND);
|
|
60571
|
+
}
|
|
60572
|
+
}
|
|
60557
60573
|
}, {
|
|
60558
60574
|
key: "enableScripts",
|
|
60559
60575
|
value: function enableScripts() {
|
|
@@ -60655,7 +60671,7 @@ var tweenTo = function tweenTo(origin, target) {
|
|
|
60655
60671
|
value: function getWorldTransform() {
|
|
60656
60672
|
var position = this.getBody().getWorldPosition(new Vector3$1());
|
|
60657
60673
|
var quaternion = this.getBody().getWorldQuaternion(new Quaternion(0, 0, 0, 1));
|
|
60658
|
-
var rotation = new Euler(0, 0, 0,
|
|
60674
|
+
var rotation = new Euler(0, 0, 0, "XYZ").setFromQuaternion(quaternion, "XYZ");
|
|
60659
60675
|
return {
|
|
60660
60676
|
position: position,
|
|
60661
60677
|
rotation: rotation,
|