mage-engine 3.23.10 → 3.23.11

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 (2) hide show
  1. package/dist/mage.js +54 -19
  2. package/package.json +1 -1
package/dist/mage.js CHANGED
@@ -57798,7 +57798,7 @@ function applyMiddleware() {
57798
57798
 
57799
57799
  var thunk = createThunkMiddleware();
57800
57800
  thunk.withExtraArgument = createThunkMiddleware;var name$1 = "mage-engine";
57801
- var version$1 = "3.23.10";
57801
+ var version$1 = "3.23.11";
57802
57802
  var description = "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.";
57803
57803
  var main = "dist/mage.js";
57804
57804
  var author$1 = {
@@ -89372,24 +89372,37 @@ var FirstPersonControl = /*#__PURE__*/function (_EventDispatcher) {
89372
89372
 
89373
89373
  return FlyControl;
89374
89374
  }(EventDispatcher);var CONTROLS = {
89375
- ORBIT: "orbit",
89376
- TRANSFORM: "transform",
89377
- FPS: "fps",
89378
- FLY: "fly"
89375
+ ORBIT: "CONTROLS:ORBIT",
89376
+ TRANSFORM: "CONTROLS:TRANSFORM",
89377
+ FPS: "CONTROLS:FPS",
89378
+ FLY: "CONTROLS:FLY"
89379
89379
  };
89380
- var AVAILABLE_CONTROLS = Object.keys(CONTROLS);
89381
- var EVENTS = {
89380
+ var AVAILABLE_CONTROLS = Object.keys(CONTROLS);var controls_contants=/*#__PURE__*/Object.freeze({__proto__:null,CONTROLS:CONTROLS,AVAILABLE_CONTROLS:AVAILABLE_CONTROLS});var THREEJS_CONTROL_EVENTS = {
89382
89381
  CHANGE: "change",
89382
+ OBJECT_CHANGE: "objectChange",
89383
89383
  DRAGGING_CHANGE: "dragging-changed"
89384
89384
  };
89385
- var Controls = /*#__PURE__*/function () {
89385
+ var CONTROL_EVENTS = {
89386
+ TRANSFORM: {
89387
+ CHANGE: "".concat(CONTROLS.TRANSFORM, ":CHANGE"),
89388
+ DRAGGING_CHANGE: "".concat(CONTROLS.TRANSFORM, ":DRAGGING_CHANGE")
89389
+ }
89390
+ };
89391
+ var Controls = /*#__PURE__*/function (_EventDispatcher) {
89392
+ _inherits(Controls, _EventDispatcher);
89393
+
89394
+ var _super = _createSuper(Controls);
89395
+
89386
89396
  function Controls() {
89387
- var _this = this,
89388
- _this$controls;
89397
+ var _this$controls;
89398
+
89399
+ var _this;
89389
89400
 
89390
89401
  _classCallCheck(this, Controls);
89391
89402
 
89392
- _defineProperty$1(this, "disposeSingleControls", function (control) {
89403
+ _this = _super.call(this);
89404
+
89405
+ _defineProperty$1(_assertThisInitialized(_this), "disposeSingleControls", function (control) {
89393
89406
  if (_this.controls[control] && _this.controls[control].dispose) {
89394
89407
  _this.controls[control].dispose();
89395
89408
 
@@ -89397,7 +89410,8 @@ var Controls = /*#__PURE__*/function () {
89397
89410
  }
89398
89411
  });
89399
89412
 
89400
- this.controls = (_this$controls = {}, _defineProperty$1(_this$controls, CONTROLS.ORBIT, undefined), _defineProperty$1(_this$controls, CONTROLS.TRANSFORM, undefined), _defineProperty$1(_this$controls, CONTROLS.FPS, undefined), _defineProperty$1(_this$controls, CONTROLS.FLY, undefined), _this$controls);
89413
+ _this.controls = (_this$controls = {}, _defineProperty$1(_this$controls, CONTROLS.ORBIT, undefined), _defineProperty$1(_this$controls, CONTROLS.TRANSFORM, undefined), _defineProperty$1(_this$controls, CONTROLS.FPS, undefined), _defineProperty$1(_this$controls, CONTROLS.FLY, undefined), _this$controls);
89414
+ return _this;
89401
89415
  }
89402
89416
 
89403
89417
  _createClass(Controls, [{
@@ -89466,15 +89480,36 @@ var Controls = /*#__PURE__*/function () {
89466
89480
  value: function setTransformControls() {
89467
89481
  var _this4 = this;
89468
89482
 
89469
- this.controls[CONTROLS.TRANSFORM] = new TransformControls(Scene$1.getCameraBody(), Scene$1.getDOMElement());
89470
- this.controls[CONTROLS.TRANSFORM].init();
89471
- this.controls[CONTROLS.TRANSFORM].addEventListener(EVENTS.CHANGE, Scene$1.render.bind(Scene$1));
89472
- this.controls[CONTROLS.TRANSFORM].addEventListener(EVENTS.DRAGGING_CHANGE, function (event) {
89483
+ var control = new TransformControls(Scene$1.getCameraBody(), Scene$1.getDOMElement());
89484
+ control.init();
89485
+ control.addEventListener(THREEJS_CONTROL_EVENTS.CHANGE, function () {
89486
+ _this4.dispatchEvent({
89487
+ type: CONTROL_EVENTS.TRANSFORM.CHANGE,
89488
+ element: Universe$1.find(control.object)
89489
+ });
89490
+
89491
+ Scene$1.render.call(Scene$1);
89492
+ });
89493
+ control.addEventListener(THREEJS_CONTROL_EVENTS.OBJECT_CHANGE, function () {
89494
+ _this4.dispatchEvent({
89495
+ type: CONTROL_EVENTS.TRANSFORM.CHANGE,
89496
+ element: Universe$1.find(control.object)
89497
+ });
89498
+
89499
+ Scene$1.render.call(Scene$1);
89500
+ });
89501
+ control.addEventListener(THREEJS_CONTROL_EVENTS.DRAGGING_CHANGE, function (event) {
89502
+ _this4.dispatchEvent({
89503
+ type: CONTROL_EVENTS.TRANSFORM.DRAGGING_CHANGE,
89504
+ element: Universe$1.find(control.object)
89505
+ });
89506
+
89473
89507
  if (_this4.controls[CONTROLS.ORBIT]) {
89474
89508
  _this4.controls[CONTROLS.ORBIT].enabled = !event.value;
89475
89509
  }
89476
89510
  });
89477
- return this.controls.transform;
89511
+ this.controls[CONTROLS.TRANSFORM] = control;
89512
+ return this.controls[CONTROLS.TRANSFORM];
89478
89513
  }
89479
89514
  }, {
89480
89515
  key: "setFirstPersonControl",
@@ -89505,7 +89540,7 @@ var Controls = /*#__PURE__*/function () {
89505
89540
  }]);
89506
89541
 
89507
89542
  return Controls;
89508
- }();
89543
+ }(EventDispatcher);
89509
89544
  var Controls$1 = new Controls();var author = {
89510
89545
  name: "Marco Stagni",
89511
89546
  email: "mrc.stagni@gmail.com",
@@ -94466,4 +94501,4 @@ var Shaders$1 = new Shaders();var Shader = function Shader(name, attributes, uni
94466
94501
  } else {
94467
94502
  this.instance = this.shader.instance;
94468
94503
  }
94469
- };var constants = _objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, lib_constants), light_contants), material_constants);export{AUDIO_RAMPS,AmbientLight,AmbientSound,Atmosphere,Audio$1 as Audio,Axes,BUILTIN,BaseScript,Box,Camera,Color,Cone,Config$1 as Config,Controls$1 as Controls,Cube,CurveLine,Cylinder,DirectionalSound,ENTITY_EVENTS,ENTITY_TYPES,Element$1 as Element,Entity,EventDispatcher,FEATURES,Features$1 as Features,GameRunner$1 as GameRunner,Grid,HelperSprite,HemisphereLight,INPUT_EVENTS,Images$1 as Images,Input$1 as Input,Label,LabelComponent,Level,Lights$1 as Lights,Line,Mirror,Models$1 as Models,Ocean,PALETTES,PARTICLES,constants$1 as PHYSICS_CONSTANTS,PHYSICS_EVENTS,ParticleEmitter,ParticleEmitterGroup,Particles$1 as Particles,index$1 as Partykals,Physics$1 as Physics,Plane,PointLight,PostProcessing$1 as PostProcessing,Proton,ProtonParticleEmitter,Provider,Router$1 as Router,Scene$1 as Scene,Scripts$1 as Scripts,Shader,Sky,Skybox,Sound,Sphere,SpotLight,Sprite,Stats$1 as Stats,SunLight,three_module as THREE,Universe$1 as Universe,Vector3$1 as Vector3,Water,author,connect,constants,createElement,easing,functions,hitbox as hitboxUtils,index_esm as inferno,math,utils as physicsUtils,index$2 as rxjs,index as store,strings,uuid$1 as uuid,workers,index$3 as xstate};
94504
+ };var constants = _objectSpread2$1(_objectSpread2$1(_objectSpread2$1(_objectSpread2$1({}, lib_constants), light_contants), material_constants), controls_contants);export{AUDIO_RAMPS,AmbientLight,AmbientSound,Atmosphere,Audio$1 as Audio,Axes,BUILTIN,BaseScript,Box,CONTROL_EVENTS,Camera,Color,Cone,Config$1 as Config,Controls$1 as Controls,Cube,CurveLine,Cylinder,DirectionalSound,ENTITY_EVENTS,ENTITY_TYPES,Element$1 as Element,Entity,EventDispatcher,FEATURES,Features$1 as Features,GameRunner$1 as GameRunner,Grid,HelperSprite,HemisphereLight,INPUT_EVENTS,Images$1 as Images,Input$1 as Input,Label,LabelComponent,Level,Lights$1 as Lights,Line,Mirror,Models$1 as Models,Ocean,PALETTES,PARTICLES,constants$1 as PHYSICS_CONSTANTS,PHYSICS_EVENTS,ParticleEmitter,ParticleEmitterGroup,Particles$1 as Particles,index$1 as Partykals,Physics$1 as Physics,Plane,PointLight,PostProcessing$1 as PostProcessing,Proton,ProtonParticleEmitter,Provider,Router$1 as Router,Scene$1 as Scene,Scripts$1 as Scripts,Shader,Sky,Skybox,Sound,Sphere,SpotLight,Sprite,Stats$1 as Stats,SunLight,three_module as THREE,THREEJS_CONTROL_EVENTS,Universe$1 as Universe,Vector3$1 as Vector3,Water,author,connect,constants,createElement,easing,functions,hitbox as hitboxUtils,index_esm as inferno,math,utils as physicsUtils,index$2 as rxjs,index as store,strings,uuid$1 as uuid,workers,index$3 as xstate};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mage-engine",
3
- "version": "3.23.10",
3
+ "version": "3.23.11",
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": {