mage-engine 3.15.0 → 3.15.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.
Files changed (3) hide show
  1. package/README.md +9 -5
  2. package/dist/mage.js +35 -20
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,15 +1,19 @@
1
1
  # Mage
2
2
 
3
- ![npm](https://img.shields.io/npm/v/mage-engine?color=%232ecc71&style=for-the-badge)
4
- ![npm](https://img.shields.io/npm/dy/mage-engine?color=%23e67e22&style=for-the-badge)
5
- ![npm bundle size](https://img.shields.io/bundlephobia/min/mage-engine?&style=for-the-badge)
6
- ![GitHub repo size](https://img.shields.io/github/repo-size/MageStudio/Mage?&style=for-the-badge)
3
+ ![npm](https://img.shields.io/npm/v/mage-engine?color=%232ecc71)
4
+ ![npm](https://img.shields.io/npm/dy/mage-engine?color=%23e67e22)
5
+ ![npm bundle size](https://img.shields.io/bundlephobia/min/mage-engine)
6
+ ![GitHub repo size](https://img.shields.io/github/repo-size/MageStudio/Mage)
7
+ ![Discord](https://badgen.net/discord/members/NR5ZDGFG5j)
7
8
 
8
9
  ---
9
10
 
10
11
  Mage is a game engine built on top of THREEJS. It features all you need to create fully interactive 3D application that can be distributed via web, desktop or mobile.
11
12
 
12
- [Documentation](https://magestudio.github.io/docs/#/)
13
+ [Documentation](https://www.mage.studio/docs)
14
+
15
+ ## Development
16
+ The engine is under heavy development. The best way to stay up to date with changes, new features and bug fixes is to [join the Discord server](https://discord.gg/NR5ZDGFG5j).
13
17
 
14
18
  ---
15
19
 
package/dist/mage.js CHANGED
@@ -54270,7 +54270,9 @@ function () {
54270
54270
  near: 0.1,
54271
54271
  far: 100
54272
54272
  },
54273
- ui: {}
54273
+ ui: {
54274
+ enabled: true
54275
+ }
54274
54276
  };
54275
54277
  this.isDefault = true;
54276
54278
  }
@@ -54764,17 +54766,13 @@ function () {
54764
54766
  });
54765
54767
 
54766
54768
  _defineProperty(this, "onResize", function () {
54767
- var _Config$screen = Config$1.screen(),
54768
- h = _Config$screen.h,
54769
- w = _Config$screen.w,
54770
- ratio = _Config$screen.ratio;
54771
-
54772
54769
  if (!_this.camera || !_this.renderer) return;
54773
- _this.camera.getBody().aspect = ratio;
54774
54770
 
54775
- _this.camera.getBody().updateProjectionMatrix();
54771
+ var _Config$screen = Config$1.screen(),
54772
+ h = _Config$screen.h,
54773
+ w = _Config$screen.w;
54776
54774
 
54777
- _this.renderer.setSize(w, h);
54775
+ _this.resize(w, h);
54778
54776
  });
54779
54777
 
54780
54778
  _defineProperty(this, "render", function () {
@@ -54991,6 +54989,15 @@ function () {
54991
54989
  this.renderer.toneMapping = toneMapping;
54992
54990
  this.renderer.toneMappingExposure = toneMappingExposure;
54993
54991
  }
54992
+ }, {
54993
+ key: "resize",
54994
+ value: function resize(width, height) {
54995
+ if (!width || !height) return;
54996
+ var ratio = width / height;
54997
+ this.camera.getBody().aspect = ratio;
54998
+ this.camera.getBody().updateProjectionMatrix();
54999
+ this.renderer.setSize(width, height);
55000
+ }
54994
55001
  }, {
54995
55002
  key: "setFog",
54996
55003
  value: function setFog(color, density) {
@@ -56147,7 +56154,7 @@ function applyMiddleware() {
56147
56154
 
56148
56155
  var thunk = createThunkMiddleware();
56149
56156
  thunk.withExtraArgument = createThunkMiddleware;var name = "mage-engine";
56150
- var version = "3.15.0";
56157
+ var version = "3.15.1";
56151
56158
  var description = "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.";
56152
56159
  var main = "dist/mage.js";
56153
56160
  var author = {
@@ -73026,7 +73033,7 @@ function (_EventDispatcher) {
73026
73033
  _this.offset = new Vector3$1(); // so camera.up is the orbit axis
73027
73034
 
73028
73035
  _this.quat = new Quaternion().setFromUnitVectors(_this.object.up, new Vector3$1(0, 1, 0));
73029
- _this.quatInverse = _this.quat.clone().inverse();
73036
+ _this.quatInverse = _this.quat.clone().invert();
73030
73037
  _this.lastPosition = new Vector3$1();
73031
73038
  _this.lastQuaternion = new Quaternion();
73032
73039
  return _this;
@@ -73202,7 +73209,7 @@ function (_Object3D) {
73202
73209
 
73203
73210
  _this.tempVector.set(1e-10, 1e-10, 1e-10).add(_this.worldPositionStart).sub(_this.worldPosition).multiplyScalar(-1);
73204
73211
 
73205
- _this.tempVector.applyQuaternion(_this.worldQuaternionStart.clone().inverse());
73212
+ _this.tempVector.applyQuaternion(_this.worldQuaternionStart.clone().invert());
73206
73213
 
73207
73214
  handle.scale.copy(_this.tempVector);
73208
73215
  handle.visible = _this.dragging;
@@ -73315,7 +73322,7 @@ function (_Object3D) {
73315
73322
  // Align handles to current local or world rotation
73316
73323
  _this.tempQuaternion2.copy(quaternion);
73317
73324
 
73318
- _this.alignVector.copy(_this.eye).applyQuaternion(_this.tempQuaternion.copy(quaternion).inverse());
73325
+ _this.alignVector.copy(_this.eye).applyQuaternion(_this.tempQuaternion.copy(quaternion).invert());
73319
73326
 
73320
73327
  if (handle.name.search("E") !== -1) {
73321
73328
  handle.quaternion.setFromRotationMatrix(_this.lookAtMatrix.lookAt(_this.eye, _this.zeroVector, _this.unitY));
@@ -73849,7 +73856,7 @@ function (_Object3D) {
73849
73856
  _this.pointStart.copy(planeIntersect.point).sub(_this.worldPositionStart);
73850
73857
 
73851
73858
  if (space === 'local') {
73852
- _this.pointStart.applyQuaternion(_this.worldQuaternionStart.clone().inverse());
73859
+ _this.pointStart.applyQuaternion(_this.worldQuaternionStart.clone().invert());
73853
73860
  }
73854
73861
  }
73855
73862
 
@@ -73881,7 +73888,7 @@ function (_Object3D) {
73881
73888
 
73882
73889
  _this.pointEnd.copy(planeIntersect.point).sub(_this.worldPositionStart);
73883
73890
 
73884
- if (space === 'local') _this.pointEnd.applyQuaternion(_this.worldQuaternionStart.clone().inverse());
73891
+ if (space === 'local') _this.pointEnd.applyQuaternion(_this.worldQuaternionStart.clone().invert());
73885
73892
 
73886
73893
  if (mode === 'translate') {
73887
73894
  if (axis.search('X') === -1) {
@@ -73907,7 +73914,7 @@ function (_Object3D) {
73907
73914
 
73908
73915
  if (_this.translationSnap) {
73909
73916
  if (space === 'local') {
73910
- object.position.applyQuaternion(_this._tempQuaternion.copy(_this._quaternionStart).inverse());
73917
+ object.position.applyQuaternion(_this._tempQuaternion.copy(_this._quaternionStart).invert());
73911
73918
 
73912
73919
  if (axis.search('X') !== -1) {
73913
73920
  object.position.x = Math.round(object.position.x / _this.translationSnap) * _this.translationSnap;
@@ -74044,7 +74051,7 @@ function (_Object3D) {
74044
74051
 
74045
74052
  _this.pointEnd.copy(planeIntersect.point).sub(_this.worldPositionStart);
74046
74053
 
74047
- if (space === 'local') _this.pointEnd.applyQuaternion(_this.worldQuaternionStart.clone().inverse());
74054
+ if (space === 'local') _this.pointEnd.applyQuaternion(_this.worldQuaternionStart.clone().invert());
74048
74055
 
74049
74056
  if (mode === 'translate') {
74050
74057
  if (axis.search('X') === -1) {
@@ -74070,7 +74077,7 @@ function (_Object3D) {
74070
74077
 
74071
74078
  if (_this.translationSnap) {
74072
74079
  if (space === 'local') {
74073
- object.position.applyQuaternion(_this._tempQuaternion.copy(_this._quaternionStart).inverse());
74080
+ object.position.applyQuaternion(_this._tempQuaternion.copy(_this._quaternionStart).invert());
74074
74081
 
74075
74082
  if (axis.search('X') !== -1) {
74076
74083
  object.position.x = Math.round(object.position.x / _this.translationSnap) * _this.translationSnap;
@@ -81325,8 +81332,11 @@ var dispatchLocationPathChange = function dispatchLocationPathChange(path) {
81325
81332
  var mount$2 = function mount() {
81326
81333
  var _Config$ui = Config$1.ui(),
81327
81334
  _Config$ui$root = _Config$ui.root,
81328
- root = _Config$ui$root === void 0 ? BaseUI : _Config$ui$root;
81335
+ root = _Config$ui$root === void 0 ? BaseUI : _Config$ui$root,
81336
+ _Config$ui$enabled = _Config$ui.enabled,
81337
+ enabled = _Config$ui$enabled === void 0 ? true : _Config$ui$enabled;
81329
81338
 
81339
+ if (!enabled) return;
81330
81340
  var store = getStore();
81331
81341
  var uiElement = createElement(root, createProps());
81332
81342
 
@@ -81340,8 +81350,13 @@ var mount$2 = function mount() {
81340
81350
  }
81341
81351
  };
81342
81352
  var unmount$2 = function unmount() {
81343
- // Rendering null will trigger unmount lifecycle hooks for whole vDOM tree and remove global event listeners.
81353
+ var _Config$ui2 = Config$1.ui(),
81354
+ _Config$ui2$enabled = _Config$ui2.enabled,
81355
+ enabled = _Config$ui2$enabled === void 0 ? true : _Config$ui2$enabled;
81356
+
81357
+ if (!enabled) return; // Rendering null will trigger unmount lifecycle hooks for whole vDOM tree and remove global event listeners.
81344
81358
  // https://github.com/infernojs/inferno#tear-down
81359
+
81345
81360
  render(null, document.querySelector(ROOT_ID));
81346
81361
  };var hasLocation = function hasLocation() {
81347
81362
  return window && window.location;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mage-engine",
3
- "version": "3.15.0",
3
+ "version": "3.15.1",
4
4
  "description": "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.",
5
5
  "main": "dist/mage.js",
6
6
  "author": {