mx3d 0.0.11 → 0.0.12

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/mx3d.js CHANGED
@@ -1,13 +1,13 @@
1
1
  (function webpackUniversalModuleDefinition(root, factory) {
2
2
  if(typeof exports === 'object' && typeof module === 'object')
3
- module.exports = factory(root["TWEEN"]);
3
+ module.exports = null;
4
4
  else if(typeof define === 'function' && define.amd)
5
5
  define(["TWEEN", "Dazzle", "BABYLON", "babylonjs-materials", "BABYLON.GUI", "BABYLON.SceneLoader", "babylonjs-serializers"], factory);
6
6
  else if(typeof exports === 'object')
7
- exports["MX3D"] = factory(root["TWEEN"]);
7
+ exports["MX3D"] = null;
8
8
  else
9
- root["MX3D"] = factory(root["TWEEN"]);
10
- })(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__7__, __WEBPACK_EXTERNAL_MODULE__13__, __WEBPACK_EXTERNAL_MODULE__14__, __WEBPACK_EXTERNAL_MODULE__15__, __WEBPACK_EXTERNAL_MODULE__16__, __WEBPACK_EXTERNAL_MODULE__17__) {
9
+ root["MX3D"] = null;
10
+ })(window, function(__WEBPACK_EXTERNAL_MODULE__2__, __WEBPACK_EXTERNAL_MODULE__3__, __WEBPACK_EXTERNAL_MODULE__13__, __WEBPACK_EXTERNAL_MODULE__14__, __WEBPACK_EXTERNAL_MODULE__15__, __WEBPACK_EXTERNAL_MODULE__16__, __WEBPACK_EXTERNAL_MODULE__17__) {
11
11
  return /******/ (function(modules) { // webpackBootstrap
12
12
  /******/ // The module cache
13
13
  /******/ var installedModules = {};
@@ -907,7 +907,7 @@ return /******/ (function(modules) { // webpackBootstrap
907
907
  ;(function (root, factory, undef) {
908
908
  if (true) {
909
909
  // CommonJS
910
- module.exports = exports = factory(__webpack_require__(0), __webpack_require__(4));
910
+ module.exports = exports = factory(__webpack_require__(0), __webpack_require__(5));
911
911
  }
912
912
  else {}
913
913
  }(this, function (CryptoJS) {
@@ -1796,12 +1796,18 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
1796
1796
 
1797
1797
  /***/ }),
1798
1798
  /* 3 */
1799
+ /***/ (function(module, exports) {
1800
+
1801
+ module.exports = __WEBPACK_EXTERNAL_MODULE__3__;
1802
+
1803
+ /***/ }),
1804
+ /* 4 */
1799
1805
  /***/ (function(module, exports, __webpack_require__) {
1800
1806
 
1801
1807
  ;(function (root, factory, undef) {
1802
1808
  if (true) {
1803
1809
  // CommonJS
1804
- module.exports = exports = factory(__webpack_require__(0), __webpack_require__(8), __webpack_require__(20), __webpack_require__(21), __webpack_require__(5), __webpack_require__(22), __webpack_require__(6), __webpack_require__(9), __webpack_require__(11), __webpack_require__(23), __webpack_require__(12), __webpack_require__(24), __webpack_require__(25), __webpack_require__(26), __webpack_require__(10), __webpack_require__(27), __webpack_require__(4), __webpack_require__(1), __webpack_require__(28), __webpack_require__(29), __webpack_require__(30), __webpack_require__(31), __webpack_require__(32), __webpack_require__(33), __webpack_require__(34), __webpack_require__(35), __webpack_require__(36), __webpack_require__(37), __webpack_require__(38), __webpack_require__(39), __webpack_require__(40), __webpack_require__(41), __webpack_require__(42), __webpack_require__(43));
1810
+ module.exports = exports = factory(__webpack_require__(0), __webpack_require__(8), __webpack_require__(20), __webpack_require__(21), __webpack_require__(6), __webpack_require__(22), __webpack_require__(7), __webpack_require__(9), __webpack_require__(11), __webpack_require__(23), __webpack_require__(12), __webpack_require__(24), __webpack_require__(25), __webpack_require__(26), __webpack_require__(10), __webpack_require__(27), __webpack_require__(5), __webpack_require__(1), __webpack_require__(28), __webpack_require__(29), __webpack_require__(30), __webpack_require__(31), __webpack_require__(32), __webpack_require__(33), __webpack_require__(34), __webpack_require__(35), __webpack_require__(36), __webpack_require__(37), __webpack_require__(38), __webpack_require__(39), __webpack_require__(40), __webpack_require__(41), __webpack_require__(42), __webpack_require__(43));
1805
1811
  }
1806
1812
  else {}
1807
1813
  }(this, function (CryptoJS) {
@@ -1811,7 +1817,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
1811
1817
  }));
1812
1818
 
1813
1819
  /***/ }),
1814
- /* 4 */
1820
+ /* 5 */
1815
1821
  /***/ (function(module, exports, __webpack_require__) {
1816
1822
 
1817
1823
  ;(function (root, factory, undef) {
@@ -1943,7 +1949,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
1943
1949
  }));
1944
1950
 
1945
1951
  /***/ }),
1946
- /* 5 */
1952
+ /* 6 */
1947
1953
  /***/ (function(module, exports, __webpack_require__) {
1948
1954
 
1949
1955
  ;(function (root, factory) {
@@ -2077,7 +2083,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
2077
2083
  }));
2078
2084
 
2079
2085
  /***/ }),
2080
- /* 6 */
2086
+ /* 7 */
2081
2087
  /***/ (function(module, exports, __webpack_require__) {
2082
2088
 
2083
2089
  ;(function (root, factory) {
@@ -2342,12 +2348,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
2342
2348
 
2343
2349
  }));
2344
2350
 
2345
- /***/ }),
2346
- /* 7 */
2347
- /***/ (function(module, exports) {
2348
-
2349
- module.exports = __WEBPACK_EXTERNAL_MODULE__7__;
2350
-
2351
2351
  /***/ }),
2352
2352
  /* 8 */
2353
2353
  /***/ (function(module, exports, __webpack_require__) {
@@ -5381,7 +5381,7 @@ module.exports = g;
5381
5381
  ;(function (root, factory, undef) {
5382
5382
  if (true) {
5383
5383
  // CommonJS
5384
- module.exports = exports = factory(__webpack_require__(0), __webpack_require__(5), __webpack_require__(6), __webpack_require__(4), __webpack_require__(1));
5384
+ module.exports = exports = factory(__webpack_require__(0), __webpack_require__(6), __webpack_require__(7), __webpack_require__(5), __webpack_require__(1));
5385
5385
  }
5386
5386
  else {}
5387
5387
  }(this, function (CryptoJS) {
@@ -5613,7 +5613,7 @@ module.exports = g;
5613
5613
  ;(function (root, factory, undef) {
5614
5614
  if (true) {
5615
5615
  // CommonJS
5616
- module.exports = exports = factory(__webpack_require__(0), __webpack_require__(5), __webpack_require__(6), __webpack_require__(4), __webpack_require__(1));
5616
+ module.exports = exports = factory(__webpack_require__(0), __webpack_require__(6), __webpack_require__(7), __webpack_require__(5), __webpack_require__(1));
5617
5617
  }
5618
5618
  else {}
5619
5619
  }(this, function (CryptoJS) {
@@ -6390,7 +6390,7 @@ module.exports = g;
6390
6390
  ;(function (root, factory, undef) {
6391
6391
  if (true) {
6392
6392
  // CommonJS
6393
- module.exports = exports = factory(__webpack_require__(0), __webpack_require__(5), __webpack_require__(6), __webpack_require__(4), __webpack_require__(1));
6393
+ module.exports = exports = factory(__webpack_require__(0), __webpack_require__(6), __webpack_require__(7), __webpack_require__(5), __webpack_require__(1));
6394
6394
  }
6395
6395
  else {}
6396
6396
  }(this, function (CryptoJS) {
@@ -6527,7 +6527,7 @@ module.exports = g;
6527
6527
  ;(function (root, factory, undef) {
6528
6528
  if (true) {
6529
6529
  // CommonJS
6530
- module.exports = exports = factory(__webpack_require__(0), __webpack_require__(5), __webpack_require__(6), __webpack_require__(4), __webpack_require__(1));
6530
+ module.exports = exports = factory(__webpack_require__(0), __webpack_require__(6), __webpack_require__(7), __webpack_require__(5), __webpack_require__(1));
6531
6531
  }
6532
6532
  else {}
6533
6533
  }(this, function (CryptoJS) {
@@ -6717,7 +6717,7 @@ module.exports = g;
6717
6717
  ;(function (root, factory, undef) {
6718
6718
  if (true) {
6719
6719
  // CommonJS
6720
- module.exports = exports = factory(__webpack_require__(0), __webpack_require__(5), __webpack_require__(6), __webpack_require__(4), __webpack_require__(1));
6720
+ module.exports = exports = factory(__webpack_require__(0), __webpack_require__(6), __webpack_require__(7), __webpack_require__(5), __webpack_require__(1));
6721
6721
  }
6722
6722
  else {}
6723
6723
  }(this, function (CryptoJS) {
@@ -7540,7 +7540,7 @@ class ReadJSON {
7540
7540
  }
7541
7541
 
7542
7542
  // EXTERNAL MODULE: ./node_modules/crypto-js/index.js
7543
- var crypto_js = __webpack_require__(3);
7543
+ var crypto_js = __webpack_require__(4);
7544
7544
  var crypto_js_default = /*#__PURE__*/__webpack_require__.n(crypto_js);
7545
7545
 
7546
7546
  // CONCATENATED MODULE: ./src/lib/Cryptojs.ts
@@ -7781,8 +7781,10 @@ class Project_Project {
7781
7781
  delete() {
7782
7782
  this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
7783
7783
  for (const _o in this.objectDatas.map) {
7784
- this.objectDatas.find(_o).instance.dispose();
7784
+ if (this.objectDatas.find(_o).instance)
7785
+ this.objectDatas.find(_o).instance.dispose();
7785
7786
  }
7787
+ this.objectDatas.clear();
7786
7788
  this.current = null;
7787
7789
  this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
7788
7790
  }
@@ -7802,6 +7804,16 @@ class Project_Project {
7802
7804
  find(_id) {
7803
7805
  return this.objectDatas.find(_id);
7804
7806
  }
7807
+ findFormObjectType(_type, isCurent = true) {
7808
+ let _objects = new Array();
7809
+ for (const id in this.objectDatas.map) {
7810
+ let _object = this.app.project.objectDatas.find(id);
7811
+ if ((isCurent && _object.parentId != this.current.id) || _object.objectType != _type)
7812
+ continue;
7813
+ _objects.push(_object);
7814
+ }
7815
+ return _objects;
7816
+ }
7805
7817
  show() {
7806
7818
  this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
7807
7819
  for (const id in this.app.project.objectDatas.map) {
@@ -7841,6 +7853,7 @@ class Resources_Resources {
7841
7853
  this.transparentBox.visibility = 0.3;
7842
7854
  let boxId = GUID.getGUID(12);
7843
7855
  this.BOX = BABYLON.MeshBuilder.CreateBox(boxId, { size: 1 }, this.app.scene);
7856
+ this.BOX.edgesColor = BABYLON.Color4.FromHexString("#4ba3fff2");
7844
7857
  // this.BOX.registerInstancedBuffer("color", 4);
7845
7858
  // this.BOX.instancedBuffers.color = new BABYLON.Color4(1, 0, 0, 1);
7846
7859
  this.BOX.setEnabled(false);
@@ -7864,10 +7877,14 @@ class Resources_Resources {
7864
7877
  _mesh.animationGroups[0].stop();
7865
7878
  _mesh.addAllToScene();
7866
7879
  _mesh.meshes[0].setEnabled(false);
7867
- _mesh.meshes[0].getChildMeshes().forEach(e => {
7868
- // if (e.material) e.material.freeze();
7869
- if (e.metadata && e.metadata.gltf && e.metadata.gltf.extras && (e.metadata.gltf.extras.U || e.metadata.gltf.extras.V))
7880
+ _mesh.meshes[0].getChildMeshes().forEach(m => {
7881
+ if (m.metadata && m.metadata.gltf && m.metadata.gltf.extras) {
7870
7882
  _mesh.isExtras = true;
7883
+ if (m.metadata.gltf.extras.U)
7884
+ BABYLON.Animation.CreateAndStartAnimation("u", m.material.albedoTexture, "uOffset", m.metadata.gltf.extras.Uspeed * 30, 30, 0, 1, 1);
7885
+ if (m.metadata.gltf.extras.V)
7886
+ BABYLON.Animation.CreateAndStartAnimation("v", m.material.albedoTexture, "vOffset", m.metadata.gltf.extras.Vspeed * 30, 30, 0, 1, 1);
7887
+ }
7871
7888
  });
7872
7889
  if (baseModel.objectType != ObjectType.OutDoorScene && !_mesh.isExtras) {
7873
7890
  _mesh.meshes[0].getChildMeshes().forEach(e => {
@@ -8138,7 +8155,7 @@ class DefaultObject_DefaultObject {
8138
8155
  this.isAutoPlay = _m.isAutoPlay;
8139
8156
  this.isloop = _m.isloop;
8140
8157
  this.isMonitor = _m.isMonitor;
8141
- if (_m.isVisible)
8158
+ if (_m.isVisible != null)
8142
8159
  this.isVisible = _m.isVisible;
8143
8160
  this.objectType = _m.objectType;
8144
8161
  let _o = new BABYLON.Mesh(this.id, this.app.scene);
@@ -8172,11 +8189,10 @@ class DefaultObject_DefaultObject {
8172
8189
  this.visualAngle = new VisualAngle_VisualAngle(this);
8173
8190
  if (this.isAutoPlay)
8174
8191
  this.play();
8175
- // this.addEventListener(EventType.doubleClick, (x) => {
8176
- // console.log(x)
8177
- // x.play(true);
8178
- // x.color = { r: 1, g: 0, b: 0 }
8179
- // });
8192
+ this.addEventListener(EventType.doubleClick, (x) => {
8193
+ console.log(x);
8194
+ x.play(true);
8195
+ });
8180
8196
  // this.play(true);
8181
8197
  // this.alwaysSelect();
8182
8198
  }
@@ -8284,6 +8300,7 @@ class DefaultObject_DefaultObject {
8284
8300
  if (e.instancedBuffers)
8285
8301
  e.instancedBuffers.color = new BABYLON.Color4(1, 1, 1, 1);
8286
8302
  });
8303
+ this.instance.disableEdgesRendering();
8287
8304
  this.instance.visibility = 0;
8288
8305
  this.setEnabled(this.isEnabled);
8289
8306
  this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
@@ -8296,6 +8313,7 @@ class DefaultObject_DefaultObject {
8296
8313
  this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
8297
8314
  this.instance.getChildMeshes().forEach(e => e.setEnabled(false));
8298
8315
  this.instance.visibility = alpha;
8316
+ this.instance.enableEdgesRendering();
8299
8317
  this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
8300
8318
  this.effectType = EffectType.Transparent;
8301
8319
  }
@@ -8501,25 +8519,6 @@ class CabinetObject_CabinetObject extends DefaultObject_DefaultObject {
8501
8519
 
8502
8520
  //漏水线
8503
8521
  class LeakWaterObject_LeakWaterObject extends DefaultObject_DefaultObject {
8504
- // set transparent(_value: boolean) {
8505
- // if (this._transparent == _value) return;
8506
- // this._transparent = _value;
8507
- // this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
8508
- // if (this._transparent) this.instance.getChildMeshes().forEach(x => x.visibility = 0.2);
8509
- // else this.instance.getChildMeshes().forEach(x => x.visibility = 1);
8510
- // this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
8511
- // }
8512
- // constructor(_app: App) {
8513
- // super();
8514
- // this.app = _app;
8515
- // }
8516
- // set color(_value: { r: number, g: number, b: number }) {
8517
- // this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
8518
- // this.instance.getChildMeshes().forEach(e => {
8519
- // e.instancedBuffers.color = new BABYLON.Color4(_value.r, _value.g, _value.b, 1);
8520
- // })
8521
- // this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
8522
- // }
8523
8522
  bind(_l) {
8524
8523
  let lines = src.Tools.ToARRVector3(_l.lines);
8525
8524
  this.instance = src.Tools.createTube(_l.id, lines, 0.02, this.app);
@@ -8532,8 +8531,7 @@ class LeakWaterObject_LeakWaterObject extends DefaultObject_DefaultObject {
8532
8531
  this.isMonitor = _l.isMonitor;
8533
8532
  var material0 = this.app.Resources.GetMaterial(_l.baseModel, this.app.scene).clone(this.id);
8534
8533
  BABYLON.Animation.CreateAndStartAnimation("u", material0.diffuseTexture, "vOffset", 15, 30, 0, 1, 1);
8535
- if (_l.baseModel.isTiling)
8536
- material0.diffuseTexture.vScale = this.instance.getTotalVertices() / 200;
8534
+ material0.diffuseTexture.vScale = this.instance.getTotalVertices() / 50;
8537
8535
  this.instance.material = material0;
8538
8536
  this.alwaysActive();
8539
8537
  this.optimization(true);
@@ -8966,6 +8964,72 @@ class BuildingObject_BuildingObject extends DefaultObject_DefaultObject {
8966
8964
  }
8967
8965
  }
8968
8966
 
8967
+ // CONCATENATED MODULE: ./src/lib/components/AirFlowObject.ts
8968
+
8969
+
8970
+
8971
+ //气流模拟
8972
+ class AirFlowObject_AirFlowObject extends DefaultObject_DefaultObject {
8973
+ bind(_m) {
8974
+ this.id = _m.id;
8975
+ this.name = _m.name;
8976
+ this.parentId = _m.parentId;
8977
+ this.modelId = _m.baseModel.modelId;
8978
+ this.animation = true;
8979
+ this.isAutoPlay = true;
8980
+ this.isloop = true;
8981
+ this.isVisible = false;
8982
+ this.isMonitor = _m.isMonitor;
8983
+ if (_m.isVisible != null)
8984
+ this.isVisible = _m.isVisible;
8985
+ this.objectType = _m.objectType;
8986
+ let _o = new BABYLON.Mesh(this.id, this.app.scene);
8987
+ let res = this.app.Resources.resources.find(this.modelId);
8988
+ res.meshes[0].getChildMeshes().forEach(x => {
8989
+ var m = x.createInstance(this.id);
8990
+ m.isPickable = false;
8991
+ m.enablePointerMoveEvents = false;
8992
+ m.parent = _o;
8993
+ });
8994
+ _o.rotation = src.Tools.ToVector3(_m.rotation);
8995
+ _o.position = src.Tools.ToVector3(_m.position);
8996
+ _o.scaling = src.Tools.ToVector3(_m.scaling);
8997
+ let bound = src.Tools.computeBounds(_o);
8998
+ _o.setBoundingInfo(bound);
8999
+ this.instance = _o;
9000
+ this.alwaysActive();
9001
+ this.optimization(true);
9002
+ this.instance.setEnabled(false);
9003
+ this.visualAngle = new VisualAngle_VisualAngle(this);
9004
+ if (this.isAutoPlay)
9005
+ this.play();
9006
+ }
9007
+ setFlash(_level) {
9008
+ }
9009
+ setTransparent(_alpha) {
9010
+ this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
9011
+ this.setEnabled(false);
9012
+ this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
9013
+ }
9014
+ setOpaque() {
9015
+ this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
9016
+ this.setEnabled(true);
9017
+ this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
9018
+ }
9019
+ play() {
9020
+ // this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
9021
+ // this.instance.getChildMeshes().forEach(m => {
9022
+ // if (m.metadata && m.metadata.gltf && m.metadata.gltf.extras) {
9023
+ // if (m.metadata.gltf.extras.U) BABYLON.Animation.CreateAndStartAnimation("u", (m.material as any).albedoTexture, "uOffset", m.metadata.gltf.extras.Uspeed * 30, 30, 0, 1, 1);
9024
+ // if (m.metadata.gltf.extras.V) BABYLON.Animation.CreateAndStartAnimation("v", (m.material as any).albedoTexture, "vOffset", m.metadata.gltf.extras.Vspeed * 30, 30, 0, 1, 1);
9025
+ // }
9026
+ // });
9027
+ // this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
9028
+ }
9029
+ stop() {
9030
+ }
9031
+ }
9032
+
8969
9033
  // CONCATENATED MODULE: ./src/lib/components/Region.ts
8970
9034
 
8971
9035
 
@@ -8984,6 +9048,7 @@ class BuildingObject_BuildingObject extends DefaultObject_DefaultObject {
8984
9048
 
8985
9049
 
8986
9050
 
9051
+
8987
9052
  class Region_Region extends DefaultObject_DefaultObject {
8988
9053
  constructor(app, _storey) {
8989
9054
  super(app);
@@ -9125,6 +9190,8 @@ class Region_Region extends DefaultObject_DefaultObject {
9125
9190
  continue;
9126
9191
  else if (_m.objectType == ObjectType.Floor)
9127
9192
  continue;
9193
+ else if (_m.objectType == ObjectType.AirFlow)
9194
+ _object = new AirFlowObject_AirFlowObject(this.app);
9128
9195
  else
9129
9196
  _object = new DefaultObject_DefaultObject(this.app);
9130
9197
  _object.bind(_m);
@@ -9202,11 +9269,12 @@ class Region_Region extends DefaultObject_DefaultObject {
9202
9269
  for (const id in this.app.project.objectDatas.map) {
9203
9270
  let _object = this.app.project.objectDatas.find(id);
9204
9271
  if (_object.parentId == this.id)
9205
- _object.setEnabled(true);
9272
+ _object.setEnabled(_object.isVisible);
9206
9273
  else
9207
9274
  _object.setEnabled(false);
9208
9275
  }
9209
9276
  this.isEnabled = true;
9277
+ this.app.project.current = this;
9210
9278
  this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
9211
9279
  }
9212
9280
  setEnabled(_value) { }
@@ -9485,7 +9553,7 @@ class OptimizedRegion_OptimizedRegion extends DefaultObject_DefaultObject {
9485
9553
  }
9486
9554
 
9487
9555
  // EXTERNAL MODULE: external "Dazzle"
9488
- var external_Dazzle_ = __webpack_require__(7);
9556
+ var external_Dazzle_ = __webpack_require__(3);
9489
9557
 
9490
9558
  // CONCATENATED MODULE: ./src/lib/App.ts
9491
9559
 
@@ -9800,23 +9868,75 @@ class App_App {
9800
9868
  this.Resources.delete();
9801
9869
  this.engine.dispose();
9802
9870
  }
9871
+ showDebug() {
9872
+ this.scene.debugLayer.show();
9873
+ }
9803
9874
  }
9804
9875
 
9805
- // CONCATENATED MODULE: ./src/lib/HeatMapMgr.ts
9876
+ // CONCATENATED MODULE: ./src/lib/EffectControls.ts
9806
9877
 
9807
9878
 
9808
- class HeatMapMgr_HeatMapMgr {
9879
+ class EffectControls_EffectControls {
9880
+ //创建容量
9881
+ static createCapacity(_object, RATIO) {
9882
+ return external_Dazzle_["Builder"].createCapacity(_object, RATIO);
9883
+ }
9809
9884
  ///创建矩阵云图
9810
- static createMatrixHeatMap(_anchor, _config, _displayValues = true, _height = 0.5, _isAlpha = true, _isParticle = true, _radius = 2.8, _range = { max: 30, min: 16 }) {
9885
+ static createMatrixHeatMap(_anchor, //地板对象
9886
+ _data) {
9811
9887
  if (_anchor.objectType != ObjectType.Floor) {
9812
9888
  console.error("矩阵云图对象必须为房间!");
9813
9889
  return;
9814
9890
  }
9815
- return external_Dazzle_["Builder"].createMatrixHeatMap(_anchor.instance, _anchor.app.rootUrl, _anchor.app.Resources.FogTex, _anchor.app.container, _config, _displayValues, _height, _isAlpha, _isParticle, _radius, _range);
9891
+ return external_Dazzle_["Builder"].createMatrixHeatMap({ anchor: _anchor.instance, rootUrl: _anchor.app.rootUrl, FogTex: _anchor.app.Resources.FogTex, container: _anchor.app.container, config: _data.config, displayValues: _data.displayValues, height: _data.height, isAlpha: _data.isAlpha, isLevelRender: _data.isLevelRender, isParticle: _data.isParticle, radius: _data.radius, range: _data.range });
9816
9892
  }
9817
9893
  //创建柜式云图
9818
- static createColumnarHeatMap(_anchor, _config, _displayValues = true, _isAlpha = true, _isParticle = true, _radius = 4, _range = { max: 30, min: 16 }) {
9819
- return external_Dazzle_["Builder"].createColumnarHeatMap(_anchor.instance, _anchor.app.Resources.FogTex, _anchor.app.container, _config, _displayValues, _isAlpha, _isParticle, _radius, _range);
9894
+ static createColumnarHeatMap(_anchor, _data) {
9895
+ return external_Dazzle_["Builder"].createColumnarHeatMap({ anchor: _anchor.instance, FogTex: _anchor.app.Resources.FogTex, container: _anchor.app.container, config: _data.config, displayValues: _data.displayValues, isAlpha: _data.isAlpha, isLevelRender: _data.isLevelRender, isParticle: _data.isParticle, radius: _data.radius, range: _data.range });
9896
+ }
9897
+ }
9898
+
9899
+ // CONCATENATED MODULE: ./src/lib/UI.ts
9900
+
9901
+ class UI_UI {
9902
+ /// <summary>
9903
+ /// 创建3dUI
9904
+ /// </summary>
9905
+ /// <param name="_anchor">挂载的物体标识</param>
9906
+ /// <param name="url">图片地址</param>
9907
+ /// <param name="_scaling">大小</param>
9908
+ /// <param name="_height">相对于物体高度</param>
9909
+ /// <param name="_app">场景实例</param>
9910
+ static createIconFromMesh(_id, _anchor, url, _scaling, _height) {
9911
+ let icon = new external_Dazzle_["IconFromMesh"](_id, _anchor.instance, url, _scaling, _height, _anchor.app.scene);
9912
+ return icon;
9913
+ }
9914
+ /// <summary>
9915
+ /// 创建2d跟随UI
9916
+ /// </summary>
9917
+ static createIcon(_id, _anchor, _size, _height) {
9918
+ let icon;
9919
+ _anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
9920
+ icon = new external_Dazzle_["Icon"](_id);
9921
+ icon.size = _size;
9922
+ icon.height = _height;
9923
+ icon.pint = new BABYLON.Mesh(_anchor[0].id + '_pint');
9924
+ let pos = _anchor[0].instance.getAbsolutePosition();
9925
+ // if (_anchor[0].objectType == ObjectType.Floor) {
9926
+ // pos = _anchor[0].instance.getAbsolutePivotPoint();
9927
+ // }
9928
+ icon.pint.position = pos;
9929
+ icon.pint.position.y += _height;
9930
+ icon.rect = new BABYLON.GUI.Rectangle();
9931
+ icon.rect.isPointerBlocker = false;
9932
+ icon.rect.width = _size.width + "px";
9933
+ icon.rect.height = _size.height + "px";
9934
+ icon.rect.thickness = 0;
9935
+ _anchor.app.container.addControl(icon.rect);
9936
+ icon.rect.linkWithMesh(icon.pint);
9937
+ // icon.rect.linkOffsetY = -_height;
9938
+ _anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
9939
+ return icon;
9820
9940
  }
9821
9941
  }
9822
9942
 
@@ -9832,6 +9952,8 @@ class HeatMapMgr_HeatMapMgr {
9832
9952
 
9833
9953
 
9834
9954
 
9955
+
9956
+
9835
9957
  // export default class MX3D {
9836
9958
  // static App = App;
9837
9959
  // static Tools = Tools;
@@ -9845,10 +9967,12 @@ let _EffectMgr;
9845
9967
  const MX3D = {
9846
9968
  App: App_App,
9847
9969
  Tools: Tools,
9970
+ UI: UI_UI,
9971
+ ObjectType: ObjectType,
9848
9972
  EffectMgr: _EffectMgr,
9849
9973
  EffectType: EffectType,
9850
9974
  EventType: EventType,
9851
- HeatMapMgr: HeatMapMgr_HeatMapMgr,
9975
+ EffectControls: EffectControls_EffectControls,
9852
9976
  Dictionary: Dictionary
9853
9977
  };
9854
9978
  /* harmony default export */ var src = __webpack_exports__["default"] = (MX3D);