mx3d 0.0.10 → 0.0.14
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/core/mx3d.dazzle.min.js +85 -1
- package/core/mx3d.seat.min.js +2 -0
- package/index.d.ts +6 -2
- package/lib/App.d.ts +8 -2
- package/lib/EffectControls.d.ts +42 -0
- package/lib/HeatMapMgr.d.ts +2 -0
- package/lib/TipsTool.d.ts +15 -0
- package/lib/Tools.d.ts +2 -2
- package/lib/UI.d.ts +9 -0
- package/lib/VisualAngle.d.ts +8 -0
- package/lib/components/AirFlowObject.d.ts +9 -0
- package/lib/components/DefaultObject.d.ts +6 -5
- package/lib/components/IObject.d.ts +1 -2
- package/lib/components/Project.d.ts +3 -2
- package/lib/components/Region.d.ts +1 -1
- package/mx3d.js +493 -196
- package/mx3d.min.js +3 -3
- package/package.json +11 -10
- package/lib/index.d.ts +0 -23
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 = factory(root["TWEEN"];
|
|
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(
|
|
7
|
+
exports["MX3D"] = factory(root["TWEEN"];
|
|
8
8
|
else
|
|
9
|
-
root["MX3D"] = factory(root["TWEEN"]
|
|
10
|
-
})(window, function(__WEBPACK_EXTERNAL_MODULE__2__,
|
|
9
|
+
root["MX3D"] = factory(root["TWEEN"];
|
|
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__(
|
|
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__(
|
|
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,13 +1817,13 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
|
|
|
1811
1817
|
}));
|
|
1812
1818
|
|
|
1813
1819
|
/***/ }),
|
|
1814
|
-
/*
|
|
1820
|
+
/* 5 */
|
|
1815
1821
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1816
1822
|
|
|
1817
1823
|
;(function (root, factory, undef) {
|
|
1818
1824
|
if (true) {
|
|
1819
1825
|
// CommonJS
|
|
1820
|
-
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(
|
|
1826
|
+
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(9), __webpack_require__(10));
|
|
1821
1827
|
}
|
|
1822
1828
|
else {}
|
|
1823
1829
|
}(this, function (CryptoJS) {
|
|
@@ -1943,7 +1949,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
|
|
|
1943
1949
|
}));
|
|
1944
1950
|
|
|
1945
1951
|
/***/ }),
|
|
1946
|
-
/*
|
|
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
|
-
/*
|
|
2086
|
+
/* 7 */
|
|
2081
2087
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2082
2088
|
|
|
2083
2089
|
;(function (root, factory) {
|
|
@@ -2343,7 +2349,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
|
|
|
2343
2349
|
}));
|
|
2344
2350
|
|
|
2345
2351
|
/***/ }),
|
|
2346
|
-
/*
|
|
2352
|
+
/* 8 */
|
|
2347
2353
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2348
2354
|
|
|
2349
2355
|
;(function (root, factory) {
|
|
@@ -2645,7 +2651,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
|
|
|
2645
2651
|
}));
|
|
2646
2652
|
|
|
2647
2653
|
/***/ }),
|
|
2648
|
-
/*
|
|
2654
|
+
/* 9 */
|
|
2649
2655
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2650
2656
|
|
|
2651
2657
|
;(function (root, factory) {
|
|
@@ -2793,7 +2799,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
|
|
|
2793
2799
|
}));
|
|
2794
2800
|
|
|
2795
2801
|
/***/ }),
|
|
2796
|
-
/*
|
|
2802
|
+
/* 10 */
|
|
2797
2803
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2798
2804
|
|
|
2799
2805
|
;(function (root, factory) {
|
|
@@ -2934,7 +2940,7 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
|
|
|
2934
2940
|
}));
|
|
2935
2941
|
|
|
2936
2942
|
/***/ }),
|
|
2937
|
-
/*
|
|
2943
|
+
/* 11 */
|
|
2938
2944
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2939
2945
|
|
|
2940
2946
|
;(function (root, factory) {
|
|
@@ -3131,13 +3137,13 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
|
|
|
3131
3137
|
}));
|
|
3132
3138
|
|
|
3133
3139
|
/***/ }),
|
|
3134
|
-
/*
|
|
3140
|
+
/* 12 */
|
|
3135
3141
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3136
3142
|
|
|
3137
3143
|
;(function (root, factory, undef) {
|
|
3138
3144
|
if (true) {
|
|
3139
3145
|
// CommonJS
|
|
3140
|
-
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(
|
|
3146
|
+
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(8));
|
|
3141
3147
|
}
|
|
3142
3148
|
else {}
|
|
3143
3149
|
}(this, function (CryptoJS) {
|
|
@@ -3454,12 +3460,6 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__2__;
|
|
|
3454
3460
|
|
|
3455
3461
|
}));
|
|
3456
3462
|
|
|
3457
|
-
/***/ }),
|
|
3458
|
-
/* 12 */
|
|
3459
|
-
/***/ (function(module, exports) {
|
|
3460
|
-
|
|
3461
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__12__;
|
|
3462
|
-
|
|
3463
3463
|
/***/ }),
|
|
3464
3464
|
/* 13 */
|
|
3465
3465
|
/***/ (function(module, exports) {
|
|
@@ -3888,7 +3888,7 @@ module.exports = g;
|
|
|
3888
3888
|
;(function (root, factory, undef) {
|
|
3889
3889
|
if (true) {
|
|
3890
3890
|
// CommonJS
|
|
3891
|
-
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(
|
|
3891
|
+
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(11));
|
|
3892
3892
|
}
|
|
3893
3893
|
else {}
|
|
3894
3894
|
}(this, function (CryptoJS) {
|
|
@@ -3966,7 +3966,7 @@ module.exports = g;
|
|
|
3966
3966
|
;(function (root, factory, undef) {
|
|
3967
3967
|
if (true) {
|
|
3968
3968
|
// CommonJS
|
|
3969
|
-
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(
|
|
3969
|
+
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(8), __webpack_require__(12));
|
|
3970
3970
|
}
|
|
3971
3971
|
else {}
|
|
3972
3972
|
}(this, function (CryptoJS) {
|
|
@@ -4047,7 +4047,7 @@ module.exports = g;
|
|
|
4047
4047
|
;(function (root, factory, undef) {
|
|
4048
4048
|
if (true) {
|
|
4049
4049
|
// CommonJS
|
|
4050
|
-
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(
|
|
4050
|
+
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(8));
|
|
4051
4051
|
}
|
|
4052
4052
|
else {}
|
|
4053
4053
|
}(this, function (CryptoJS) {
|
|
@@ -4636,7 +4636,7 @@ module.exports = g;
|
|
|
4636
4636
|
;(function (root, factory, undef) {
|
|
4637
4637
|
if (true) {
|
|
4638
4638
|
// CommonJS
|
|
4639
|
-
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(
|
|
4639
|
+
module.exports = exports = factory(__webpack_require__(0), __webpack_require__(9), __webpack_require__(10));
|
|
4640
4640
|
}
|
|
4641
4641
|
else {}
|
|
4642
4642
|
}(this, function (CryptoJS) {
|
|
@@ -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__(
|
|
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__(
|
|
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__(
|
|
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__(
|
|
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__(
|
|
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) {
|
|
@@ -6932,6 +6932,9 @@ class Camera_Camera {
|
|
|
6932
6932
|
constructor(_app) {
|
|
6933
6933
|
this.app = _app;
|
|
6934
6934
|
this.camera = new BABYLON.ArcRotateCamera("camera", -Math.PI / 4, Math.PI / 4, 50, new BABYLON.Vector3(0, 0, 0), this.app.scene);
|
|
6935
|
+
console.log(this.camera.pinchDeltaPercentage);
|
|
6936
|
+
// this.camera.pinchDeltaPercentage=0.01;
|
|
6937
|
+
this.camera.pinchPrecision = 200;
|
|
6935
6938
|
this.app.scene.activeCamera = this.camera;
|
|
6936
6939
|
this.camera.attachControl(this.app.canvas, true, true);
|
|
6937
6940
|
this.camera.minZ = 0.3;
|
|
@@ -6983,7 +6986,11 @@ class Camera_Camera {
|
|
|
6983
6986
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
6984
6987
|
}
|
|
6985
6988
|
flyTo(_visualAngle, _sheep = 300) {
|
|
6986
|
-
this.tw_target.to({ x: _visualAngle.focus.x, y: _visualAngle.focus.y, z: _visualAngle.focus.z }, _sheep).start().onComplete(() => { this.tw_camera.to({ radius: _visualAngle.radius }, _sheep).start(); });
|
|
6989
|
+
this.tw_target.to({ x: _visualAngle.focus.x, y: _visualAngle.focus.y, z: _visualAngle.focus.z }, _sheep).start().onComplete(() => { this.tw_camera.to({ radius: _visualAngle.radius, beta: _visualAngle.beta }, _sheep).start(); });
|
|
6990
|
+
this.camera.lowerRadiusLimit = _visualAngle.minimumLimit;
|
|
6991
|
+
this.camera.upperRadiusLimit = _visualAngle.maximumLimit;
|
|
6992
|
+
this.camera.lowerBetaLimit = _visualAngle.minBeta;
|
|
6993
|
+
this.camera.upperBetaLimit = _visualAngle.maxBeta;
|
|
6987
6994
|
}
|
|
6988
6995
|
computeCameraView() {
|
|
6989
6996
|
const ratio = this.app.canvas.clientWidth / this.app.canvas.clientHeight;
|
|
@@ -7045,7 +7052,7 @@ class Dictionary {
|
|
|
7045
7052
|
}
|
|
7046
7053
|
}
|
|
7047
7054
|
|
|
7048
|
-
// CONCATENATED MODULE: ./src/
|
|
7055
|
+
// CONCATENATED MODULE: ./src/dazzle/GUID.ts
|
|
7049
7056
|
class GUID {
|
|
7050
7057
|
static getGUID(length) {
|
|
7051
7058
|
var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
|
|
@@ -7163,13 +7170,8 @@ class Spot_Spot extends LightObject {
|
|
|
7163
7170
|
}
|
|
7164
7171
|
}
|
|
7165
7172
|
|
|
7166
|
-
// CONCATENATED MODULE: ./src/lib/VisualAngle.ts
|
|
7167
|
-
class VisualAngle {
|
|
7168
|
-
}
|
|
7169
|
-
|
|
7170
7173
|
// CONCATENATED MODULE: ./src/lib/Tools.ts
|
|
7171
|
-
|
|
7172
|
-
class Tools_Tools {
|
|
7174
|
+
class Tools {
|
|
7173
7175
|
//字符串转为Vector3;
|
|
7174
7176
|
static vector3ToJson(old) {
|
|
7175
7177
|
return { x: Math.floor(old.x * 1000) / 1000, y: Math.floor(old.y * 1000) / 1000, z: Math.floor(old.z * 1000) / 1000 };
|
|
@@ -7310,12 +7312,12 @@ class Tools_Tools {
|
|
|
7310
7312
|
}
|
|
7311
7313
|
}
|
|
7312
7314
|
static getVisualAngle(_bound, app) {
|
|
7313
|
-
let _visualAngle =
|
|
7315
|
+
let _visualAngle = {};
|
|
7314
7316
|
let radius = _bound.boundingSphere.radiusWorld;
|
|
7315
|
-
let aspectRatio = app.engine.getAspectRatio(app.
|
|
7316
|
-
let halfMinFov = app.
|
|
7317
|
+
let aspectRatio = app.engine.getAspectRatio(app.camera.camera);
|
|
7318
|
+
let halfMinFov = app.camera.camera.fov / 1.2;
|
|
7317
7319
|
if (aspectRatio < 1)
|
|
7318
|
-
halfMinFov = Math.atan(aspectRatio * Math.tan(app.
|
|
7320
|
+
halfMinFov = Math.atan(aspectRatio * Math.tan(app.camera.camera.fov / 2));
|
|
7319
7321
|
_visualAngle.radius = Math.abs(radius / Math.sin(halfMinFov)) * 1.1;
|
|
7320
7322
|
_visualAngle.alpha = Math.PI / 2;
|
|
7321
7323
|
_visualAngle.beta = Math.PI / 4;
|
|
@@ -7361,6 +7363,12 @@ class Tools_Tools {
|
|
|
7361
7363
|
static getAngleFromVector3(startV, coreV, endV) {
|
|
7362
7364
|
return this.getAngleFromVector2(new BABYLON.Vector2(startV.x, startV.z), new BABYLON.Vector2(coreV.x, coreV.z), new BABYLON.Vector2(endV.x, endV.z));
|
|
7363
7365
|
}
|
|
7366
|
+
static RandomNumBoth(Min, Max) {
|
|
7367
|
+
var Range = Max - Min;
|
|
7368
|
+
var Rand = Math.random();
|
|
7369
|
+
var num = Min + Math.round(Rand * Range); //四舍五入
|
|
7370
|
+
return num;
|
|
7371
|
+
}
|
|
7364
7372
|
}
|
|
7365
7373
|
|
|
7366
7374
|
// CONCATENATED MODULE: ./src/lib/Environment.ts
|
|
@@ -7467,7 +7475,7 @@ class Environment_Environment {
|
|
|
7467
7475
|
_light.id = _oldLight.id;
|
|
7468
7476
|
_light.lightType = _oldLight.lightType;
|
|
7469
7477
|
_light.name = _oldLight.name;
|
|
7470
|
-
_light.direction =
|
|
7478
|
+
_light.direction = Tools.ToVector3(_oldLight.direction);
|
|
7471
7479
|
_light.color = _oldLight.color;
|
|
7472
7480
|
_light.intensity = _oldLight.intensity;
|
|
7473
7481
|
}
|
|
@@ -7476,8 +7484,8 @@ class Environment_Environment {
|
|
|
7476
7484
|
_light.id = _oldLight.id;
|
|
7477
7485
|
_light.lightType = _oldLight.lightType;
|
|
7478
7486
|
_light.name = _oldLight.name;
|
|
7479
|
-
_light.direction =
|
|
7480
|
-
_light.position =
|
|
7487
|
+
_light.direction = Tools.ToVector3(_oldLight.direction);
|
|
7488
|
+
_light.position = Tools.ToVector3(_oldLight.position);
|
|
7481
7489
|
_light.color = _oldLight.color;
|
|
7482
7490
|
_light.intensity = _oldLight.intensity;
|
|
7483
7491
|
}
|
|
@@ -7486,8 +7494,8 @@ class Environment_Environment {
|
|
|
7486
7494
|
_light.id = _oldLight.id;
|
|
7487
7495
|
_light.lightType = _oldLight.lightType;
|
|
7488
7496
|
_light.name = _oldLight.name;
|
|
7489
|
-
_light.direction =
|
|
7490
|
-
_light.position =
|
|
7497
|
+
_light.direction = Tools.ToVector3(_oldLight.direction);
|
|
7498
|
+
_light.position = Tools.ToVector3(_oldLight.position);
|
|
7491
7499
|
_light.angle = _oldLight.angle;
|
|
7492
7500
|
_light.exponent = _oldLight.exponent;
|
|
7493
7501
|
_light.range = _oldLight.range;
|
|
@@ -7499,7 +7507,7 @@ class Environment_Environment {
|
|
|
7499
7507
|
_light.id = _oldLight.id;
|
|
7500
7508
|
_light.lightType = _oldLight.lightType;
|
|
7501
7509
|
_light.name = _oldLight.name;
|
|
7502
|
-
_light.position =
|
|
7510
|
+
_light.position = Tools.ToVector3(_oldLight.position);
|
|
7503
7511
|
_light.range = _oldLight.range;
|
|
7504
7512
|
_light.color = _oldLight.color;
|
|
7505
7513
|
_light.intensity = _oldLight.intensity;
|
|
@@ -7541,7 +7549,7 @@ class ReadJSON {
|
|
|
7541
7549
|
}
|
|
7542
7550
|
|
|
7543
7551
|
// EXTERNAL MODULE: ./node_modules/crypto-js/index.js
|
|
7544
|
-
var crypto_js = __webpack_require__(
|
|
7552
|
+
var crypto_js = __webpack_require__(4);
|
|
7545
7553
|
var crypto_js_default = /*#__PURE__*/__webpack_require__.n(crypto_js);
|
|
7546
7554
|
|
|
7547
7555
|
// CONCATENATED MODULE: ./src/lib/Cryptojs.ts
|
|
@@ -7564,7 +7572,7 @@ class EffectMgr_EffectMgr {
|
|
|
7564
7572
|
5: BABYLON.Color3.Green()
|
|
7565
7573
|
};
|
|
7566
7574
|
let tyiji = new external_TWEEN_default.a.Tween(this.colors[1]).to({ r: 1, g: 0, b: 0 }, 500);
|
|
7567
|
-
let tyiji1 = new external_TWEEN_default.a.Tween(this.colors[1]).to({ r:
|
|
7575
|
+
let tyiji1 = new external_TWEEN_default.a.Tween(this.colors[1]).to({ r: 1, g: 0.5, b: 0.5 }, 500);
|
|
7568
7576
|
tyiji1.chain(tyiji);
|
|
7569
7577
|
tyiji.chain(tyiji1);
|
|
7570
7578
|
tyiji.start();
|
|
@@ -7782,8 +7790,10 @@ class Project_Project {
|
|
|
7782
7790
|
delete() {
|
|
7783
7791
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
7784
7792
|
for (const _o in this.objectDatas.map) {
|
|
7785
|
-
this.objectDatas.find(_o).instance
|
|
7793
|
+
if (this.objectDatas.find(_o).instance)
|
|
7794
|
+
this.objectDatas.find(_o).instance.dispose();
|
|
7786
7795
|
}
|
|
7796
|
+
this.objectDatas.clear();
|
|
7787
7797
|
this.current = null;
|
|
7788
7798
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
7789
7799
|
}
|
|
@@ -7791,12 +7801,10 @@ class Project_Project {
|
|
|
7791
7801
|
//冻结活动网格,与自发光合用回导致内存泄露
|
|
7792
7802
|
this.app.scene.freezeActiveMeshes();
|
|
7793
7803
|
}
|
|
7794
|
-
|
|
7795
|
-
}
|
|
7796
|
-
getChildNode(_id) {
|
|
7804
|
+
getChildNodes(_id) {
|
|
7797
7805
|
let _objects = new Array();
|
|
7798
7806
|
for (const id in this.objectDatas.map) {
|
|
7799
|
-
let _object = this.app.
|
|
7807
|
+
let _object = this.app.project.objectDatas.find(id);
|
|
7800
7808
|
if (_object.parentId == _id && _object.objectType != ObjectType.Wall && _object.objectType != ObjectType.Corner)
|
|
7801
7809
|
_objects.push(_object);
|
|
7802
7810
|
}
|
|
@@ -7805,10 +7813,20 @@ class Project_Project {
|
|
|
7805
7813
|
find(_id) {
|
|
7806
7814
|
return this.objectDatas.find(_id);
|
|
7807
7815
|
}
|
|
7816
|
+
findFormObjectType(_type, isCurent = true) {
|
|
7817
|
+
let _objects = new Array();
|
|
7818
|
+
for (const id in this.objectDatas.map) {
|
|
7819
|
+
let _object = this.app.project.objectDatas.find(id);
|
|
7820
|
+
if ((isCurent && _object.parentId != this.current.id) || _object.objectType != _type)
|
|
7821
|
+
continue;
|
|
7822
|
+
_objects.push(_object);
|
|
7823
|
+
}
|
|
7824
|
+
return _objects;
|
|
7825
|
+
}
|
|
7808
7826
|
show() {
|
|
7809
7827
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
7810
|
-
for (const id in this.app.
|
|
7811
|
-
let _object = this.app.
|
|
7828
|
+
for (const id in this.app.project.objectDatas.map) {
|
|
7829
|
+
let _object = this.app.project.objectDatas.find(id);
|
|
7812
7830
|
_object.setEnabled(true);
|
|
7813
7831
|
}
|
|
7814
7832
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
@@ -7844,6 +7862,7 @@ class Resources_Resources {
|
|
|
7844
7862
|
this.transparentBox.visibility = 0.3;
|
|
7845
7863
|
let boxId = GUID.getGUID(12);
|
|
7846
7864
|
this.BOX = BABYLON.MeshBuilder.CreateBox(boxId, { size: 1 }, this.app.scene);
|
|
7865
|
+
this.BOX.edgesColor = BABYLON.Color4.FromHexString("#4ba3fff2");
|
|
7847
7866
|
// this.BOX.registerInstancedBuffer("color", 4);
|
|
7848
7867
|
// this.BOX.instancedBuffers.color = new BABYLON.Color4(1, 0, 0, 1);
|
|
7849
7868
|
this.BOX.setEnabled(false);
|
|
@@ -7867,10 +7886,14 @@ class Resources_Resources {
|
|
|
7867
7886
|
_mesh.animationGroups[0].stop();
|
|
7868
7887
|
_mesh.addAllToScene();
|
|
7869
7888
|
_mesh.meshes[0].setEnabled(false);
|
|
7870
|
-
_mesh.meshes[0].getChildMeshes().forEach(
|
|
7871
|
-
|
|
7872
|
-
if (e.metadata && e.metadata.gltf && e.metadata.gltf.extras && (e.metadata.gltf.extras.U || e.metadata.gltf.extras.V))
|
|
7889
|
+
_mesh.meshes[0].getChildMeshes().forEach(m => {
|
|
7890
|
+
if (m.metadata && m.metadata.gltf && m.metadata.gltf.extras) {
|
|
7873
7891
|
_mesh.isExtras = true;
|
|
7892
|
+
if (m.metadata.gltf.extras.U)
|
|
7893
|
+
BABYLON.Animation.CreateAndStartAnimation("u", m.material.albedoTexture, "uOffset", m.metadata.gltf.extras.Uspeed * 30, 30, 0, 1, 1);
|
|
7894
|
+
if (m.metadata.gltf.extras.V)
|
|
7895
|
+
BABYLON.Animation.CreateAndStartAnimation("v", m.material.albedoTexture, "vOffset", m.metadata.gltf.extras.Vspeed * 30, 30, 0, 1, 1);
|
|
7896
|
+
}
|
|
7874
7897
|
});
|
|
7875
7898
|
if (baseModel.objectType != ObjectType.OutDoorScene && !_mesh.isExtras) {
|
|
7876
7899
|
_mesh.meshes[0].getChildMeshes().forEach(e => {
|
|
@@ -7892,10 +7915,10 @@ class Resources_Resources {
|
|
|
7892
7915
|
BABYLON.SceneLoader.LoadAssetContainerAsync(this.resourcePath + "Bundle/" + baseModel.modelId + "/", baseModel.modelId + baseModel.extension, this.app.scene).then((container) => {
|
|
7893
7916
|
if (container.animationGroups.length > 0)
|
|
7894
7917
|
container.animationGroups[0].stop();
|
|
7895
|
-
container.meshes[0].getChildMeshes().forEach(e => {
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
});
|
|
7918
|
+
// container.meshes[0].getChildMeshes().forEach(e => {
|
|
7919
|
+
// (e as BABYLON.Mesh).registerInstancedBuffer("color", 4);
|
|
7920
|
+
// e.instancedBuffers.color = new BABYLON.Color4(1, 1, 1, 1);
|
|
7921
|
+
// });
|
|
7899
7922
|
this.resources.add(baseModel.modelId, container);
|
|
7900
7923
|
callback(container);
|
|
7901
7924
|
}).catch(() => {
|
|
@@ -8031,6 +8054,55 @@ var EventType;
|
|
|
8031
8054
|
EventType["out"] = "out";
|
|
8032
8055
|
})(EventType || (EventType = {}));
|
|
8033
8056
|
|
|
8057
|
+
// CONCATENATED MODULE: ./src/lib/VisualAngle.ts
|
|
8058
|
+
|
|
8059
|
+
|
|
8060
|
+
class VisualAngle_VisualAngle {
|
|
8061
|
+
constructor(_object) {
|
|
8062
|
+
this.object = _object;
|
|
8063
|
+
//重新计算包围盒
|
|
8064
|
+
if (this.object instanceof Region_Region) {
|
|
8065
|
+
let bound = this.object.getBounding();
|
|
8066
|
+
let _vis = src.Tools.getVisualAngle(bound, this.object.app);
|
|
8067
|
+
this.alpha = _vis.alpha;
|
|
8068
|
+
this.beta = _vis.beta;
|
|
8069
|
+
this.focus = _vis.focus;
|
|
8070
|
+
this.radius = bound.boundingSphere.radiusWorld + 3;
|
|
8071
|
+
this.focus.y = this.object.height;
|
|
8072
|
+
}
|
|
8073
|
+
else {
|
|
8074
|
+
let bound = this.object.instance.getBoundingInfo();
|
|
8075
|
+
let _vis = src.Tools.getVisualAngle(bound, this.object.app);
|
|
8076
|
+
this.alpha = _vis.alpha;
|
|
8077
|
+
this.beta = _vis.beta;
|
|
8078
|
+
this.focus = this.object.instance.getAbsolutePosition();
|
|
8079
|
+
this.radius = bound.boundingSphere.radiusWorld + 3;
|
|
8080
|
+
}
|
|
8081
|
+
this.minimumLimit = 0.3;
|
|
8082
|
+
this.maximumLimit = this.radius * 2;
|
|
8083
|
+
this.minBeta = 0.01;
|
|
8084
|
+
this.maxBeta = (Math.PI / 2) * 0.98;
|
|
8085
|
+
}
|
|
8086
|
+
//设置视角参数
|
|
8087
|
+
setVisual(_visual) {
|
|
8088
|
+
let config = JSON.parse(_visual);
|
|
8089
|
+
this.alpha = config.alpha;
|
|
8090
|
+
this.beta = config.beta;
|
|
8091
|
+
this.radius = config.radius;
|
|
8092
|
+
this.focus = src.Tools.ToVector3(config.focus);
|
|
8093
|
+
}
|
|
8094
|
+
//设置缩放范围
|
|
8095
|
+
setLimit(_miniLimit, _maxiLimit) {
|
|
8096
|
+
this.minimumLimit = _miniLimit + 0.3;
|
|
8097
|
+
this.maximumLimit = _maxiLimit;
|
|
8098
|
+
}
|
|
8099
|
+
//设置上下视角限制
|
|
8100
|
+
setBeta(_minBeta, _maxBeta) {
|
|
8101
|
+
this.minBeta = _minBeta;
|
|
8102
|
+
this.maxBeta = _maxBeta;
|
|
8103
|
+
}
|
|
8104
|
+
}
|
|
8105
|
+
|
|
8034
8106
|
// CONCATENATED MODULE: ./src/lib/EffectType.ts
|
|
8035
8107
|
var EffectType;
|
|
8036
8108
|
(function (EffectType) {
|
|
@@ -8044,6 +8116,7 @@ var EffectType;
|
|
|
8044
8116
|
|
|
8045
8117
|
|
|
8046
8118
|
|
|
8119
|
+
|
|
8047
8120
|
class DefaultObject_DefaultObject {
|
|
8048
8121
|
constructor(_app) {
|
|
8049
8122
|
this.isVisible = true;
|
|
@@ -8054,8 +8127,6 @@ class DefaultObject_DefaultObject {
|
|
|
8054
8127
|
this._isMonitor = true;
|
|
8055
8128
|
this.app = _app;
|
|
8056
8129
|
}
|
|
8057
|
-
;
|
|
8058
|
-
;
|
|
8059
8130
|
set isMonitor(_value) {
|
|
8060
8131
|
this._isMonitor = _value;
|
|
8061
8132
|
}
|
|
@@ -8084,22 +8155,16 @@ class DefaultObject_DefaultObject {
|
|
|
8084
8155
|
get showBoundingBox() {
|
|
8085
8156
|
return this.instance.showBoundingBox;
|
|
8086
8157
|
}
|
|
8087
|
-
setVisualAngle(_visualAngle, _miniLimit = 1, _maxiLimit = 3000) {
|
|
8088
|
-
let config = JSON.parse(_visualAngle);
|
|
8089
|
-
this.visualAngle.alpha = config.alpha;
|
|
8090
|
-
this.visualAngle.beta = config.beta;
|
|
8091
|
-
this.visualAngle.radius = config.radius;
|
|
8092
|
-
this.visualAngle.focus = src.Tools.ToVector3(config.focus);
|
|
8093
|
-
this.visualAngle.minimumLimit = _miniLimit;
|
|
8094
|
-
this.visualAngle.maximumLimit = _maxiLimit;
|
|
8095
|
-
}
|
|
8096
8158
|
bind(_m) {
|
|
8097
8159
|
this.id = _m.id;
|
|
8098
8160
|
this.name = _m.name;
|
|
8099
8161
|
this.parentId = _m.parentId;
|
|
8100
8162
|
this.modelId = _m.baseModel.modelId;
|
|
8163
|
+
this.animation = _m.animation;
|
|
8164
|
+
this.isAutoPlay = _m.isAutoPlay;
|
|
8165
|
+
this.isloop = _m.isloop;
|
|
8101
8166
|
this.isMonitor = _m.isMonitor;
|
|
8102
|
-
if (_m.isVisible)
|
|
8167
|
+
if (_m.isVisible != null)
|
|
8103
8168
|
this.isVisible = _m.isVisible;
|
|
8104
8169
|
this.objectType = _m.objectType;
|
|
8105
8170
|
let _o = new BABYLON.Mesh(this.id, this.app.scene);
|
|
@@ -8126,27 +8191,19 @@ class DefaultObject_DefaultObject {
|
|
|
8126
8191
|
this.instance.position.y = (bound.maximum.y - bound.minimum.y) / 2 + _o.position.y;
|
|
8127
8192
|
this.instance.rotation = _o.rotation.clone();
|
|
8128
8193
|
_o.setParent(this.instance);
|
|
8129
|
-
this.instance.setBoundingInfo(bound);
|
|
8130
|
-
// this.instance.getChildMeshes().forEach(e => e.setParent(box));
|
|
8131
8194
|
this.alwaysActive();
|
|
8132
8195
|
this.optimization(true);
|
|
8133
8196
|
this.instance.setEnabled(false);
|
|
8134
|
-
this.
|
|
8197
|
+
this.visualAngle = new VisualAngle_VisualAngle(this);
|
|
8198
|
+
if (this.isAutoPlay)
|
|
8199
|
+
this.play();
|
|
8135
8200
|
// this.addEventListener(EventType.doubleClick, (x) => {
|
|
8136
8201
|
// console.log(x)
|
|
8137
8202
|
// x.play(true);
|
|
8138
|
-
// x.color = { r: 1, g: 0, b: 0 }
|
|
8139
8203
|
// });
|
|
8140
8204
|
// this.play(true);
|
|
8141
8205
|
// this.alwaysSelect();
|
|
8142
8206
|
}
|
|
8143
|
-
restVisualAngle() {
|
|
8144
|
-
//重新计算包围盒
|
|
8145
|
-
let bound = this.instance.getBoundingInfo();
|
|
8146
|
-
this.visualAngle = src.Tools.getVisualAngle(this.instance.getBoundingInfo(), this.app);
|
|
8147
|
-
this.visualAngle.focus = this.instance.getAbsolutePosition();
|
|
8148
|
-
this.visualAngle.radius = bound.boundingSphere.radiusWorld + 3;
|
|
8149
|
-
}
|
|
8150
8207
|
//true:优化,false:取消优化
|
|
8151
8208
|
optimization(_isOptimization) {
|
|
8152
8209
|
this.instance.getChildMeshes().forEach(x => {
|
|
@@ -8229,19 +8286,55 @@ class DefaultObject_DefaultObject {
|
|
|
8229
8286
|
}
|
|
8230
8287
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
8231
8288
|
}
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8289
|
+
//设置告警闪烁
|
|
8290
|
+
setFlash(_level) {
|
|
8291
|
+
if (this.effectType != EffectType.Opaque)
|
|
8292
|
+
return;
|
|
8293
|
+
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
8294
|
+
this.instance.getChildMeshes().forEach(e => {
|
|
8295
|
+
if (e.instancedBuffers)
|
|
8296
|
+
e.instancedBuffers.color = src.EffectMgr.colors[_level];
|
|
8297
|
+
});
|
|
8298
|
+
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
8299
|
+
this.effectType = EffectType.Flash;
|
|
8300
|
+
}
|
|
8301
|
+
//设置正常
|
|
8302
|
+
setOpaque() {
|
|
8303
|
+
if (this.effectType == EffectType.Opaque)
|
|
8304
|
+
return;
|
|
8305
|
+
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
8306
|
+
this.instance.getChildMeshes().forEach(e => {
|
|
8307
|
+
e.setEnabled(true);
|
|
8308
|
+
if (e.instancedBuffers)
|
|
8309
|
+
e.instancedBuffers.color = new BABYLON.Color4(1, 1, 1, 1);
|
|
8310
|
+
});
|
|
8311
|
+
this.instance.disableEdgesRendering();
|
|
8312
|
+
this.instance.visibility = 0;
|
|
8313
|
+
this.setEnabled(this.isEnabled);
|
|
8314
|
+
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
8315
|
+
this.effectType = EffectType.Opaque;
|
|
8316
|
+
}
|
|
8317
|
+
//设置半透明
|
|
8318
|
+
setTransparent(alpha = 0.3) {
|
|
8319
|
+
if (this.effectType != EffectType.Opaque)
|
|
8320
|
+
return;
|
|
8321
|
+
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
8322
|
+
this.instance.getChildMeshes().forEach(e => e.setEnabled(false));
|
|
8323
|
+
this.instance.visibility = alpha;
|
|
8324
|
+
this.instance.enableEdgesRendering();
|
|
8325
|
+
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
8326
|
+
this.effectType = EffectType.Transparent;
|
|
8327
|
+
}
|
|
8328
|
+
play() {
|
|
8236
8329
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
8237
8330
|
this.instance.getChildMeshes().forEach(m => {
|
|
8238
8331
|
let open;
|
|
8239
8332
|
m.animations.forEach((e) => { if (e.name.indexOf("open") != -1)
|
|
8240
8333
|
open = e; });
|
|
8241
8334
|
if (open)
|
|
8242
|
-
this.app.scene.beginDirectAnimation(m, [open], 0, open.getKeys().length * 10, isloop);
|
|
8335
|
+
this.app.scene.beginDirectAnimation(m, [open], 0, open.getKeys().length * 10, this.isloop);
|
|
8243
8336
|
else
|
|
8244
|
-
m.animations.forEach((e) => this.app.scene.beginDirectAnimation(m, [e], 0, e.getKeys().length * 10, isloop));
|
|
8337
|
+
m.animations.forEach((e) => this.app.scene.beginDirectAnimation(m, [e], 0, e.getKeys().length * 10, this.isloop));
|
|
8245
8338
|
});
|
|
8246
8339
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
8247
8340
|
}
|
|
@@ -8259,7 +8352,7 @@ class DefaultObject_DefaultObject {
|
|
|
8259
8352
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
8260
8353
|
}
|
|
8261
8354
|
flyTo() {
|
|
8262
|
-
this.app.
|
|
8355
|
+
this.app.camera.flyTo(this.visualAngle, 500);
|
|
8263
8356
|
}
|
|
8264
8357
|
focus() {
|
|
8265
8358
|
// this.app.Camera.focusingFromProperty(this.visualAngle);
|
|
@@ -8307,6 +8400,7 @@ class WallObject_WallObject extends DefaultObject_DefaultObject {
|
|
|
8307
8400
|
// CONCATENATED MODULE: ./src/lib/components/WindowObject.ts
|
|
8308
8401
|
|
|
8309
8402
|
|
|
8403
|
+
|
|
8310
8404
|
//窗户
|
|
8311
8405
|
class WindowObject_WindowObject extends DefaultObject_DefaultObject {
|
|
8312
8406
|
// virtualBox: BABYLON.InstancedMesh;
|
|
@@ -8347,7 +8441,7 @@ class WindowObject_WindowObject extends DefaultObject_DefaultObject {
|
|
|
8347
8441
|
this.instance = new BABYLON.Mesh(this.id, this.app.scene);
|
|
8348
8442
|
let res = this.app.Resources.resources.find(this.modelId);
|
|
8349
8443
|
res.meshes[0].getChildMeshes().forEach(x => {
|
|
8350
|
-
var m = x.createInstance(this.id);
|
|
8444
|
+
var m = this.app.highQualityMode ? x.clone(this.id) : x.createInstance(this.id);
|
|
8351
8445
|
m.parent = this.instance;
|
|
8352
8446
|
});
|
|
8353
8447
|
let bound = src.Tools.computeBounds(this.instance);
|
|
@@ -8368,7 +8462,7 @@ class WindowObject_WindowObject extends DefaultObject_DefaultObject {
|
|
|
8368
8462
|
this.alwaysActive();
|
|
8369
8463
|
this.optimization(true);
|
|
8370
8464
|
this.instance.setEnabled(false);
|
|
8371
|
-
this.
|
|
8465
|
+
this.visualAngle = new VisualAngle_VisualAngle(this);
|
|
8372
8466
|
//重新计算包围盒
|
|
8373
8467
|
// this.bound = this.instance.getBoundingInfo();
|
|
8374
8468
|
// this.visualAngle = this.app.Tools.getVisualAngle(this.bound);
|
|
@@ -8381,6 +8475,7 @@ class WindowObject_WindowObject extends DefaultObject_DefaultObject {
|
|
|
8381
8475
|
// CONCATENATED MODULE: ./src/lib/components/DoorObject.ts
|
|
8382
8476
|
|
|
8383
8477
|
|
|
8478
|
+
|
|
8384
8479
|
//门
|
|
8385
8480
|
class DoorObject_DoorObject extends DefaultObject_DefaultObject {
|
|
8386
8481
|
bind(_m) {
|
|
@@ -8394,7 +8489,7 @@ class DoorObject_DoorObject extends DefaultObject_DefaultObject {
|
|
|
8394
8489
|
this.instance = new BABYLON.Mesh(this.id, this.app.scene);
|
|
8395
8490
|
let res = this.app.Resources.resources.find(this.modelId);
|
|
8396
8491
|
res.meshes[0].getChildMeshes().forEach(x => {
|
|
8397
|
-
var m = x.createInstance(this.id);
|
|
8492
|
+
var m = this.app.highQualityMode ? x.clone(this.id) : x.createInstance(this.id);
|
|
8398
8493
|
m.parent = this.instance;
|
|
8399
8494
|
});
|
|
8400
8495
|
let bound = src.Tools.computeBounds(this.instance);
|
|
@@ -8415,7 +8510,7 @@ class DoorObject_DoorObject extends DefaultObject_DefaultObject {
|
|
|
8415
8510
|
this.alwaysActive();
|
|
8416
8511
|
this.optimization(true);
|
|
8417
8512
|
this.instance.setEnabled(false);
|
|
8418
|
-
this.
|
|
8513
|
+
this.visualAngle = new VisualAngle_VisualAngle(this);
|
|
8419
8514
|
}
|
|
8420
8515
|
}
|
|
8421
8516
|
|
|
@@ -8429,27 +8524,9 @@ class CabinetObject_CabinetObject extends DefaultObject_DefaultObject {
|
|
|
8429
8524
|
|
|
8430
8525
|
|
|
8431
8526
|
|
|
8527
|
+
|
|
8432
8528
|
//漏水线
|
|
8433
8529
|
class LeakWaterObject_LeakWaterObject extends DefaultObject_DefaultObject {
|
|
8434
|
-
// set transparent(_value: boolean) {
|
|
8435
|
-
// if (this._transparent == _value) return;
|
|
8436
|
-
// this._transparent = _value;
|
|
8437
|
-
// this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
8438
|
-
// if (this._transparent) this.instance.getChildMeshes().forEach(x => x.visibility = 0.2);
|
|
8439
|
-
// else this.instance.getChildMeshes().forEach(x => x.visibility = 1);
|
|
8440
|
-
// this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
8441
|
-
// }
|
|
8442
|
-
// constructor(_app: App) {
|
|
8443
|
-
// super();
|
|
8444
|
-
// this.app = _app;
|
|
8445
|
-
// }
|
|
8446
|
-
// set color(_value: { r: number, g: number, b: number }) {
|
|
8447
|
-
// this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
8448
|
-
// this.instance.getChildMeshes().forEach(e => {
|
|
8449
|
-
// e.instancedBuffers.color = new BABYLON.Color4(_value.r, _value.g, _value.b, 1);
|
|
8450
|
-
// })
|
|
8451
|
-
// this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
8452
|
-
// }
|
|
8453
8530
|
bind(_l) {
|
|
8454
8531
|
let lines = src.Tools.ToARRVector3(_l.lines);
|
|
8455
8532
|
this.instance = src.Tools.createTube(_l.id, lines, 0.02, this.app);
|
|
@@ -8462,12 +8539,11 @@ class LeakWaterObject_LeakWaterObject extends DefaultObject_DefaultObject {
|
|
|
8462
8539
|
this.isMonitor = _l.isMonitor;
|
|
8463
8540
|
var material0 = this.app.Resources.GetMaterial(_l.baseModel, this.app.scene).clone(this.id);
|
|
8464
8541
|
BABYLON.Animation.CreateAndStartAnimation("u", material0.diffuseTexture, "vOffset", 15, 30, 0, 1, 1);
|
|
8465
|
-
|
|
8466
|
-
material0.diffuseTexture.vScale = this.instance.getTotalVertices() / 200;
|
|
8542
|
+
material0.diffuseTexture.vScale = this.instance.getTotalVertices() / 50;
|
|
8467
8543
|
this.instance.material = material0;
|
|
8468
8544
|
this.alwaysActive();
|
|
8469
8545
|
this.optimization(true);
|
|
8470
|
-
this.
|
|
8546
|
+
this.visualAngle = new VisualAngle_VisualAngle(this);
|
|
8471
8547
|
// let bound = this.instance.getBoundingInfo();
|
|
8472
8548
|
// this.instance.position = this.bound.boundingBox.center.clone();
|
|
8473
8549
|
// this.visualAngle = MX3D.Tools.getVisualAngle(bound);
|
|
@@ -8543,6 +8619,7 @@ class LeakWaterObject_LeakWaterObject extends DefaultObject_DefaultObject {
|
|
|
8543
8619
|
// CONCATENATED MODULE: ./src/lib/components/VirtualBoxObject.ts
|
|
8544
8620
|
|
|
8545
8621
|
|
|
8622
|
+
|
|
8546
8623
|
//虚拟盒子
|
|
8547
8624
|
class VirtualBoxObject_VirtualBoxObject extends DefaultObject_DefaultObject {
|
|
8548
8625
|
async bind(_m) {
|
|
@@ -8592,7 +8669,7 @@ class VirtualBoxObject_VirtualBoxObject extends DefaultObject_DefaultObject {
|
|
|
8592
8669
|
this.instance.scaling = src.Tools.ToVector3(_m.scaling);
|
|
8593
8670
|
this.alwaysActive();
|
|
8594
8671
|
this.optimization(true);
|
|
8595
|
-
this.
|
|
8672
|
+
this.visualAngle = new VisualAngle_VisualAngle(this);
|
|
8596
8673
|
//重新计算包围盒
|
|
8597
8674
|
// this.bound = this.instance.getBoundingInfo();
|
|
8598
8675
|
// this.visualAngle = this.app.Tools.getVisualAngle(this.bound);
|
|
@@ -8605,6 +8682,7 @@ class VirtualBoxObject_VirtualBoxObject extends DefaultObject_DefaultObject {
|
|
|
8605
8682
|
// CONCATENATED MODULE: ./src/lib/components/UI3DTextObject.ts
|
|
8606
8683
|
|
|
8607
8684
|
|
|
8685
|
+
|
|
8608
8686
|
//3d文本
|
|
8609
8687
|
class UI3DTextObject_UI3DTextObject extends DefaultObject_DefaultObject {
|
|
8610
8688
|
// set transparent(_value: boolean) {
|
|
@@ -8662,7 +8740,7 @@ class UI3DTextObject_UI3DTextObject extends DefaultObject_DefaultObject {
|
|
|
8662
8740
|
this.instance.material = mat;
|
|
8663
8741
|
this.alwaysActive();
|
|
8664
8742
|
this.optimization(true);
|
|
8665
|
-
this.
|
|
8743
|
+
this.visualAngle = new VisualAngle_VisualAngle(this);
|
|
8666
8744
|
//重新计算包围盒
|
|
8667
8745
|
// this.bound = this.instance.getBoundingInfo();
|
|
8668
8746
|
// this.visualAngle = this.app.Tools.getVisualAngle(this.bound);
|
|
@@ -8673,6 +8751,8 @@ class UI3DTextObject_UI3DTextObject extends DefaultObject_DefaultObject {
|
|
|
8673
8751
|
}
|
|
8674
8752
|
|
|
8675
8753
|
// CONCATENATED MODULE: ./src/lib/components/ConduitObject.ts
|
|
8754
|
+
// import MX3D from "../../index";
|
|
8755
|
+
|
|
8676
8756
|
|
|
8677
8757
|
|
|
8678
8758
|
//墙角
|
|
@@ -8684,8 +8764,8 @@ class ConduitObject_ConduitObject extends DefaultObject_DefaultObject {
|
|
|
8684
8764
|
this.isMonitor = _m.isMonitor;
|
|
8685
8765
|
this.objectType = _m.objectType;
|
|
8686
8766
|
this.isVisible = true;
|
|
8687
|
-
let pists =
|
|
8688
|
-
this.instance =
|
|
8767
|
+
let pists = Tools.ToARRVector3(_m.pints);
|
|
8768
|
+
this.instance = Tools.createTube(_m.id, pists, _m.radius, this.app);
|
|
8689
8769
|
let mat = new BABYLON.StandardMaterial(_m.id, this.app.scene);
|
|
8690
8770
|
mat.diffuseColor = BABYLON.Color3.FromHexString(_m.color);
|
|
8691
8771
|
mat.alpha = _m.alpha;
|
|
@@ -8695,7 +8775,7 @@ class ConduitObject_ConduitObject extends DefaultObject_DefaultObject {
|
|
|
8695
8775
|
this.instance.setEnabled(false);
|
|
8696
8776
|
this.alwaysActive();
|
|
8697
8777
|
this.optimization(true);
|
|
8698
|
-
this.
|
|
8778
|
+
this.visualAngle = new VisualAngle_VisualAngle(this);
|
|
8699
8779
|
//重新计算包围盒
|
|
8700
8780
|
// this.bound = this.instance.getBoundingInfo();
|
|
8701
8781
|
// this.visualAngle = this.app.Tools.getVisualAngle(this.bound);
|
|
@@ -8707,6 +8787,7 @@ class ConduitObject_ConduitObject extends DefaultObject_DefaultObject {
|
|
|
8707
8787
|
// CONCATENATED MODULE: ./src/lib/components/FloorObject.ts
|
|
8708
8788
|
|
|
8709
8789
|
|
|
8790
|
+
|
|
8710
8791
|
//房间
|
|
8711
8792
|
class FloorObject_FloorObject extends DefaultObject_DefaultObject {
|
|
8712
8793
|
bind(_m) {
|
|
@@ -8716,7 +8797,7 @@ class FloorObject_FloorObject extends DefaultObject_DefaultObject {
|
|
|
8716
8797
|
this.modelId = _m.baseModel.modelId;
|
|
8717
8798
|
this.objectType = _m.objectType;
|
|
8718
8799
|
this.isMonitor = true;
|
|
8719
|
-
this.instance = BABYLON.MeshBuilder.CreatePolygon("地板", { shape:
|
|
8800
|
+
this.instance = BABYLON.MeshBuilder.CreatePolygon("地板", { shape: Tools.Expand(_m.vectors, -0.01), holes: _m.buckles, sideOrientation: BABYLON.Mesh.DOUBLESIDE }, this.app.scene);
|
|
8720
8801
|
this.alwaysActive();
|
|
8721
8802
|
this.instance.setEnabled(false);
|
|
8722
8803
|
this.instance.isPickable = false;
|
|
@@ -8727,7 +8808,7 @@ class FloorObject_FloorObject extends DefaultObject_DefaultObject {
|
|
|
8727
8808
|
this.instance.name = "地板";
|
|
8728
8809
|
var material0 = this.app.Resources.GetMaterial(_m.baseModel, this.app.scene).clone(_m.id);
|
|
8729
8810
|
let bound = this.instance.getBoundingInfo();
|
|
8730
|
-
this.visualAngle =
|
|
8811
|
+
this.visualAngle = Tools.getVisualAngle(bound, this.app);
|
|
8731
8812
|
// let zz = this.bound.boundingBox.center;
|
|
8732
8813
|
// this.instance.setPivotMatrix(BABYLON.Matrix.Translation(0, 0, 0), false);
|
|
8733
8814
|
if (_m.baseModel.isTiling) {
|
|
@@ -8736,7 +8817,7 @@ class FloorObject_FloorObject extends DefaultObject_DefaultObject {
|
|
|
8736
8817
|
}
|
|
8737
8818
|
this.instance.material = material0;
|
|
8738
8819
|
this.optimization(true);
|
|
8739
|
-
this.
|
|
8820
|
+
this.visualAngle = new VisualAngle_VisualAngle(this);
|
|
8740
8821
|
// this.nativeMaterial = material0;
|
|
8741
8822
|
// this.material = this.nativeMaterial;
|
|
8742
8823
|
// this.alwaysSelect();
|
|
@@ -8749,6 +8830,7 @@ class FloorObject_FloorObject extends DefaultObject_DefaultObject {
|
|
|
8749
8830
|
|
|
8750
8831
|
// CONCATENATED MODULE: ./src/lib/components/OptimizedWallObject.ts
|
|
8751
8832
|
|
|
8833
|
+
|
|
8752
8834
|
//墙体
|
|
8753
8835
|
class OptimizedWallObject_OptimizedWallObject extends DefaultObject_DefaultObject {
|
|
8754
8836
|
// set transparent(_value: boolean) {
|
|
@@ -8806,12 +8888,13 @@ class OptimizedWallObject_OptimizedWallObject extends DefaultObject_DefaultObjec
|
|
|
8806
8888
|
this.alwaysActive();
|
|
8807
8889
|
this.optimization(true);
|
|
8808
8890
|
this.instance.setEnabled(false);
|
|
8809
|
-
this.
|
|
8891
|
+
this.visualAngle = new VisualAngle_VisualAngle(this);
|
|
8810
8892
|
}
|
|
8811
8893
|
}
|
|
8812
8894
|
}
|
|
8813
8895
|
|
|
8814
8896
|
// CONCATENATED MODULE: ./src/lib/components/CornerObject.ts
|
|
8897
|
+
// import MX3D from "../../index";
|
|
8815
8898
|
|
|
8816
8899
|
|
|
8817
8900
|
|
|
@@ -8837,7 +8920,7 @@ class CornerObject_CornerObject extends DefaultObject_DefaultObject {
|
|
|
8837
8920
|
if (meshs.length < 1)
|
|
8838
8921
|
return result;
|
|
8839
8922
|
if (meshs.length > 1)
|
|
8840
|
-
this.instance =
|
|
8923
|
+
this.instance = Tools.MergeMeshes(meshs, this.app);
|
|
8841
8924
|
else
|
|
8842
8925
|
this.instance = meshs[0];
|
|
8843
8926
|
this.instance.id = this.id;
|
|
@@ -8862,14 +8945,14 @@ class BuildingObject_BuildingObject extends DefaultObject_DefaultObject {
|
|
|
8862
8945
|
focus() {
|
|
8863
8946
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
8864
8947
|
let childs = new Array();
|
|
8865
|
-
for (const id in this.app.
|
|
8866
|
-
let _object = this.app.
|
|
8948
|
+
for (const id in this.app.project.objectDatas.map) {
|
|
8949
|
+
let _object = this.app.project.objectDatas.find(id);
|
|
8867
8950
|
if (_object.parentId == this.id)
|
|
8868
8951
|
childs.push(_object);
|
|
8869
8952
|
_object.setEnabled(false);
|
|
8870
8953
|
}
|
|
8871
|
-
for (const id in this.app.
|
|
8872
|
-
let _object = this.app.
|
|
8954
|
+
for (const id in this.app.project.objectDatas.map) {
|
|
8955
|
+
let _object = this.app.project.objectDatas.find(id);
|
|
8873
8956
|
if (_object.objectType != ObjectType.Wall
|
|
8874
8957
|
&& _object.objectType != ObjectType.Corner
|
|
8875
8958
|
&& _object.objectType != ObjectType.Floor
|
|
@@ -8885,7 +8968,73 @@ class BuildingObject_BuildingObject extends DefaultObject_DefaultObject {
|
|
|
8885
8968
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
8886
8969
|
}
|
|
8887
8970
|
restVisualAngle() {
|
|
8888
|
-
this.visualAngle =
|
|
8971
|
+
this.visualAngle = Tools.getVisualAngle(this.instance.getBoundingInfo(), this.app);
|
|
8972
|
+
}
|
|
8973
|
+
}
|
|
8974
|
+
|
|
8975
|
+
// CONCATENATED MODULE: ./src/lib/components/AirFlowObject.ts
|
|
8976
|
+
|
|
8977
|
+
|
|
8978
|
+
|
|
8979
|
+
//气流模拟
|
|
8980
|
+
class AirFlowObject_AirFlowObject extends DefaultObject_DefaultObject {
|
|
8981
|
+
bind(_m) {
|
|
8982
|
+
this.id = _m.id;
|
|
8983
|
+
this.name = _m.name;
|
|
8984
|
+
this.parentId = _m.parentId;
|
|
8985
|
+
this.modelId = _m.baseModel.modelId;
|
|
8986
|
+
this.animation = true;
|
|
8987
|
+
this.isAutoPlay = true;
|
|
8988
|
+
this.isloop = true;
|
|
8989
|
+
this.isVisible = false;
|
|
8990
|
+
this.isMonitor = _m.isMonitor;
|
|
8991
|
+
if (_m.isVisible != null)
|
|
8992
|
+
this.isVisible = _m.isVisible;
|
|
8993
|
+
this.objectType = _m.objectType;
|
|
8994
|
+
let _o = new BABYLON.Mesh(this.id, this.app.scene);
|
|
8995
|
+
let res = this.app.Resources.resources.find(this.modelId);
|
|
8996
|
+
res.meshes[0].getChildMeshes().forEach(x => {
|
|
8997
|
+
var m = x.createInstance(this.id);
|
|
8998
|
+
m.isPickable = false;
|
|
8999
|
+
m.enablePointerMoveEvents = false;
|
|
9000
|
+
m.parent = _o;
|
|
9001
|
+
});
|
|
9002
|
+
_o.rotation = src.Tools.ToVector3(_m.rotation);
|
|
9003
|
+
_o.position = src.Tools.ToVector3(_m.position);
|
|
9004
|
+
_o.scaling = src.Tools.ToVector3(_m.scaling);
|
|
9005
|
+
let bound = src.Tools.computeBounds(_o);
|
|
9006
|
+
_o.setBoundingInfo(bound);
|
|
9007
|
+
this.instance = _o;
|
|
9008
|
+
this.alwaysActive();
|
|
9009
|
+
this.optimization(true);
|
|
9010
|
+
this.instance.setEnabled(false);
|
|
9011
|
+
this.visualAngle = new VisualAngle_VisualAngle(this);
|
|
9012
|
+
if (this.isAutoPlay)
|
|
9013
|
+
this.play();
|
|
9014
|
+
}
|
|
9015
|
+
setFlash(_level) {
|
|
9016
|
+
}
|
|
9017
|
+
setTransparent(_alpha) {
|
|
9018
|
+
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
9019
|
+
this.setEnabled(false);
|
|
9020
|
+
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
9021
|
+
}
|
|
9022
|
+
setOpaque() {
|
|
9023
|
+
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
9024
|
+
this.setEnabled(true);
|
|
9025
|
+
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
9026
|
+
}
|
|
9027
|
+
play() {
|
|
9028
|
+
// this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
9029
|
+
// this.instance.getChildMeshes().forEach(m => {
|
|
9030
|
+
// if (m.metadata && m.metadata.gltf && m.metadata.gltf.extras) {
|
|
9031
|
+
// 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);
|
|
9032
|
+
// 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);
|
|
9033
|
+
// }
|
|
9034
|
+
// });
|
|
9035
|
+
// this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
9036
|
+
}
|
|
9037
|
+
stop() {
|
|
8889
9038
|
}
|
|
8890
9039
|
}
|
|
8891
9040
|
|
|
@@ -8907,6 +9056,7 @@ class BuildingObject_BuildingObject extends DefaultObject_DefaultObject {
|
|
|
8907
9056
|
|
|
8908
9057
|
|
|
8909
9058
|
|
|
9059
|
+
|
|
8910
9060
|
class Region_Region extends DefaultObject_DefaultObject {
|
|
8911
9061
|
constructor(app, _storey) {
|
|
8912
9062
|
super(app);
|
|
@@ -8931,7 +9081,7 @@ class Region_Region extends DefaultObject_DefaultObject {
|
|
|
8931
9081
|
let _wall = new OptimizedWallObject_OptimizedWallObject(this.app);
|
|
8932
9082
|
_wall.bind(_nw);
|
|
8933
9083
|
if (_wall.instance)
|
|
8934
|
-
this.app.
|
|
9084
|
+
this.app.project.objectDatas.add(_wall.id, _wall);
|
|
8935
9085
|
}
|
|
8936
9086
|
let walls = new Array();
|
|
8937
9087
|
for (let i = 0; i < _storey.length; i++) {
|
|
@@ -8974,7 +9124,7 @@ class Region_Region extends DefaultObject_DefaultObject {
|
|
|
8974
9124
|
let result = _corner.bind(corners);
|
|
8975
9125
|
if (result) {
|
|
8976
9126
|
_corner.parentId = this.id;
|
|
8977
|
-
this.app.
|
|
9127
|
+
this.app.project.objectDatas.add(_corner.id, _corner);
|
|
8978
9128
|
}
|
|
8979
9129
|
else
|
|
8980
9130
|
_corner = null;
|
|
@@ -9017,7 +9167,7 @@ class Region_Region extends DefaultObject_DefaultObject {
|
|
|
9017
9167
|
let _object = new FloorObject_FloorObject(this.app);
|
|
9018
9168
|
_object.height = this.height;
|
|
9019
9169
|
_object.bind(_floor);
|
|
9020
|
-
this.app.
|
|
9170
|
+
this.app.project.objectDatas.add(_object.id, _object);
|
|
9021
9171
|
}
|
|
9022
9172
|
dicVector = null;
|
|
9023
9173
|
//灯光
|
|
@@ -9048,10 +9198,12 @@ class Region_Region extends DefaultObject_DefaultObject {
|
|
|
9048
9198
|
continue;
|
|
9049
9199
|
else if (_m.objectType == ObjectType.Floor)
|
|
9050
9200
|
continue;
|
|
9201
|
+
else if (_m.objectType == ObjectType.AirFlow)
|
|
9202
|
+
_object = new AirFlowObject_AirFlowObject(this.app);
|
|
9051
9203
|
else
|
|
9052
9204
|
_object = new DefaultObject_DefaultObject(this.app);
|
|
9053
9205
|
_object.bind(_m);
|
|
9054
|
-
this.app.
|
|
9206
|
+
this.app.project.objectDatas.add(_object.id, _object);
|
|
9055
9207
|
}
|
|
9056
9208
|
//创建未优化的墙
|
|
9057
9209
|
if (!isOptimized) {
|
|
@@ -9069,7 +9221,7 @@ class Region_Region extends DefaultObject_DefaultObject {
|
|
|
9069
9221
|
_obejct.subMeshes.push(new BABYLON.SubMesh(0, 2, verticesCount, 30, 6, _obejct)); //2
|
|
9070
9222
|
for (let w = 0; w < walls[i].wallwindows.length; w++) {
|
|
9071
9223
|
const ames1 = BABYLON.CSG.FromMesh(_obejct);
|
|
9072
|
-
let _win = this.app.
|
|
9224
|
+
let _win = this.app.project.objectDatas.find(walls[i].wallwindows[w]);
|
|
9073
9225
|
var bout = _win.instance.getBoundingInfo();
|
|
9074
9226
|
var box = BABYLON.MeshBuilder.CreateBox(new Date().getTime().toString(), { height: bout.maximum.y - bout.minimum.y, width: bout.maximum.x - bout.minimum.x, depth: parseFloat(walls[i].ply) * 2 + 0.1 }, this.app.scene);
|
|
9075
9227
|
box.position = _win.instance.position.clone();
|
|
@@ -9112,31 +9264,32 @@ class Region_Region extends DefaultObject_DefaultObject {
|
|
|
9112
9264
|
_wall.parentId = this.id;
|
|
9113
9265
|
_wall.height = this.height;
|
|
9114
9266
|
_wall.bind(beforeWalls.find(key));
|
|
9115
|
-
this.app.
|
|
9267
|
+
this.app.project.objectDatas.add(_wall.id, _wall);
|
|
9116
9268
|
}
|
|
9117
9269
|
}
|
|
9118
9270
|
}
|
|
9119
9271
|
//清除临时变量
|
|
9120
9272
|
walls = null;
|
|
9121
|
-
this.
|
|
9273
|
+
this.visualAngle = new VisualAngle_VisualAngle(this);
|
|
9122
9274
|
}
|
|
9123
9275
|
focus() {
|
|
9124
9276
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
9125
|
-
for (const id in this.app.
|
|
9126
|
-
let _object = this.app.
|
|
9277
|
+
for (const id in this.app.project.objectDatas.map) {
|
|
9278
|
+
let _object = this.app.project.objectDatas.find(id);
|
|
9127
9279
|
if (_object.parentId == this.id)
|
|
9128
|
-
_object.setEnabled(
|
|
9280
|
+
_object.setEnabled(_object.isVisible);
|
|
9129
9281
|
else
|
|
9130
9282
|
_object.setEnabled(false);
|
|
9131
9283
|
}
|
|
9132
9284
|
this.isEnabled = true;
|
|
9285
|
+
this.app.project.current = this;
|
|
9133
9286
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
9134
9287
|
}
|
|
9135
9288
|
setEnabled(_value) { }
|
|
9136
|
-
|
|
9289
|
+
getBounding() {
|
|
9137
9290
|
var min, max;
|
|
9138
|
-
for (const _id in this.app.
|
|
9139
|
-
let _model = this.app.
|
|
9291
|
+
for (const _id in this.app.project.objectDatas.map) {
|
|
9292
|
+
let _model = this.app.project.objectDatas.find(_id);
|
|
9140
9293
|
if (_model.objectType == ObjectType.ParkModel || _model.objectType == ObjectType.Storey || _model.parentId != this.id)
|
|
9141
9294
|
continue;
|
|
9142
9295
|
let boundingInfo = _model.instance.getBoundingInfo();
|
|
@@ -9149,8 +9302,7 @@ class Region_Region extends DefaultObject_DefaultObject {
|
|
|
9149
9302
|
min = BABYLON.Vector3.Zero();
|
|
9150
9303
|
max = new BABYLON.Vector3(12, this.height, 8);
|
|
9151
9304
|
}
|
|
9152
|
-
|
|
9153
|
-
this.visualAngle.focus.y = this.height;
|
|
9305
|
+
return new BABYLON.BoundingInfo(min, max);
|
|
9154
9306
|
}
|
|
9155
9307
|
dispose() { }
|
|
9156
9308
|
}
|
|
@@ -9227,7 +9379,7 @@ class OptimizedRegion_OptimizedRegion extends DefaultObject_DefaultObject {
|
|
|
9227
9379
|
let result = _corner.bind(corners);
|
|
9228
9380
|
if (result) {
|
|
9229
9381
|
_corner.parentId = this.id;
|
|
9230
|
-
this.app.
|
|
9382
|
+
this.app.project.objectDatas.add(_corner.id, _corner);
|
|
9231
9383
|
}
|
|
9232
9384
|
else
|
|
9233
9385
|
_corner = null;
|
|
@@ -9270,7 +9422,7 @@ class OptimizedRegion_OptimizedRegion extends DefaultObject_DefaultObject {
|
|
|
9270
9422
|
let _object = new FloorObject_FloorObject(this.app);
|
|
9271
9423
|
_object.height = this.height;
|
|
9272
9424
|
_object.bind(_floor);
|
|
9273
|
-
this.app.
|
|
9425
|
+
this.app.project.objectDatas.add(_object.id, _object);
|
|
9274
9426
|
}
|
|
9275
9427
|
}
|
|
9276
9428
|
dicVector = null;
|
|
@@ -9307,7 +9459,7 @@ class OptimizedRegion_OptimizedRegion extends DefaultObject_DefaultObject {
|
|
|
9307
9459
|
else
|
|
9308
9460
|
continue;
|
|
9309
9461
|
_object.bind(_m);
|
|
9310
|
-
this.app.
|
|
9462
|
+
this.app.project.objectDatas.add(_object.id, _object);
|
|
9311
9463
|
}
|
|
9312
9464
|
//创建未优化的墙
|
|
9313
9465
|
//墙体建立
|
|
@@ -9324,7 +9476,7 @@ class OptimizedRegion_OptimizedRegion extends DefaultObject_DefaultObject {
|
|
|
9324
9476
|
_obejct.subMeshes.push(new BABYLON.SubMesh(0, 2, verticesCount, 30, 6, _obejct)); //2
|
|
9325
9477
|
for (let w = 0; w < walls[i].wallwindows.length; w++) {
|
|
9326
9478
|
const ames1 = BABYLON.CSG.FromMesh(_obejct);
|
|
9327
|
-
let _win = this.app.
|
|
9479
|
+
let _win = this.app.project.objectDatas.find(walls[i].wallwindows[w]);
|
|
9328
9480
|
var bout = _win.instance.getBoundingInfo();
|
|
9329
9481
|
var box = BABYLON.MeshBuilder.CreateBox(new Date().getTime().toString(), { height: bout.maximum.y - bout.minimum.y, width: bout.maximum.x - bout.minimum.x, depth: parseFloat(walls[i].ply) * 2 + 0.1 }, this.app.scene);
|
|
9330
9482
|
box.position = _win.instance.position.clone();
|
|
@@ -9367,7 +9519,7 @@ class OptimizedRegion_OptimizedRegion extends DefaultObject_DefaultObject {
|
|
|
9367
9519
|
_wall.parentId = this.id;
|
|
9368
9520
|
_wall.height = this.height;
|
|
9369
9521
|
_wall.bind(beforeWalls.find(key));
|
|
9370
|
-
this.app.
|
|
9522
|
+
this.app.project.objectDatas.add(_wall.id, _wall);
|
|
9371
9523
|
}
|
|
9372
9524
|
}
|
|
9373
9525
|
//清除临时变量
|
|
@@ -9376,8 +9528,8 @@ class OptimizedRegion_OptimizedRegion extends DefaultObject_DefaultObject {
|
|
|
9376
9528
|
}
|
|
9377
9529
|
focus() {
|
|
9378
9530
|
this.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
9379
|
-
for (const id in this.app.
|
|
9380
|
-
let _object = this.app.
|
|
9531
|
+
for (const id in this.app.project.objectDatas.map) {
|
|
9532
|
+
let _object = this.app.project.objectDatas.find(id);
|
|
9381
9533
|
if (_object.parentId == this.id)
|
|
9382
9534
|
_object.setEnabled(true);
|
|
9383
9535
|
else
|
|
@@ -9389,8 +9541,8 @@ class OptimizedRegion_OptimizedRegion extends DefaultObject_DefaultObject {
|
|
|
9389
9541
|
setEnabled(_value) { }
|
|
9390
9542
|
restVisualAngle() {
|
|
9391
9543
|
var min, max;
|
|
9392
|
-
for (const _id in this.app.
|
|
9393
|
-
let _model = this.app.
|
|
9544
|
+
for (const _id in this.app.project.objectDatas.map) {
|
|
9545
|
+
let _model = this.app.project.objectDatas.find(_id);
|
|
9394
9546
|
if (_model.objectType == ObjectType.ParkModel || _model.objectType == ObjectType.Storey || _model.parentId != this.id)
|
|
9395
9547
|
continue;
|
|
9396
9548
|
let boundingInfo = _model.instance.getBoundingInfo();
|
|
@@ -9403,13 +9555,64 @@ class OptimizedRegion_OptimizedRegion extends DefaultObject_DefaultObject {
|
|
|
9403
9555
|
min = BABYLON.Vector3.Zero();
|
|
9404
9556
|
max = new BABYLON.Vector3(12, this.height, 8);
|
|
9405
9557
|
}
|
|
9406
|
-
this.visualAngle =
|
|
9558
|
+
this.visualAngle = Tools.getVisualAngle(new BABYLON.BoundingInfo(min, max), this.app);
|
|
9407
9559
|
this.visualAngle.focus.y = this.height;
|
|
9408
9560
|
}
|
|
9409
9561
|
}
|
|
9410
9562
|
|
|
9411
9563
|
// EXTERNAL MODULE: external "Dazzle"
|
|
9412
|
-
var external_Dazzle_ = __webpack_require__(
|
|
9564
|
+
var external_Dazzle_ = __webpack_require__(3);
|
|
9565
|
+
|
|
9566
|
+
// CONCATENATED MODULE: ./src/lib/TipsTool.ts
|
|
9567
|
+
class TipsTool {
|
|
9568
|
+
constructor(parent, _app) {
|
|
9569
|
+
this.isOK = false;
|
|
9570
|
+
this.app = _app;
|
|
9571
|
+
this.ele = document.createElement("div");
|
|
9572
|
+
this.ele.style.cssText = 'position: absolute;z-index:999999999; font-size: 10px;color: rgb(211, 211, 211);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0; padding: 5px 8px;';
|
|
9573
|
+
parent.appendChild(this.ele);
|
|
9574
|
+
this.close();
|
|
9575
|
+
setInterval(() => {
|
|
9576
|
+
if (new Date().getTime() - this.time > 1000 && this.isOK && !this.text) {
|
|
9577
|
+
let obj = this.app.project.objectDatas.find(this.id);
|
|
9578
|
+
if (obj)
|
|
9579
|
+
this.text = obj.name;
|
|
9580
|
+
}
|
|
9581
|
+
}, 100);
|
|
9582
|
+
}
|
|
9583
|
+
set text(vlaue) {
|
|
9584
|
+
this._text = vlaue;
|
|
9585
|
+
this.ele.innerText = vlaue;
|
|
9586
|
+
if (vlaue)
|
|
9587
|
+
this.ele.style.display = null;
|
|
9588
|
+
}
|
|
9589
|
+
update(e) {
|
|
9590
|
+
if (e.pickInfo.pickedMesh) {
|
|
9591
|
+
if (e.pickInfo.pickedMesh.id != this.id) {
|
|
9592
|
+
this.close();
|
|
9593
|
+
this.id = e.pickInfo.pickedMesh.id;
|
|
9594
|
+
this.time = new Date().getTime();
|
|
9595
|
+
}
|
|
9596
|
+
else
|
|
9597
|
+
this.isOK = true;
|
|
9598
|
+
}
|
|
9599
|
+
else
|
|
9600
|
+
this.close();
|
|
9601
|
+
this.ele.style.top = e.event.offsetY + "px";
|
|
9602
|
+
this.ele.style.left = e.event.offsetX + 20 + "px";
|
|
9603
|
+
}
|
|
9604
|
+
close() {
|
|
9605
|
+
this.isOK = false;
|
|
9606
|
+
this.time = new Date().getTime();
|
|
9607
|
+
this.ele.style.display = "none";
|
|
9608
|
+
this.text = "";
|
|
9609
|
+
}
|
|
9610
|
+
setBackground(_url) {
|
|
9611
|
+
this.url = _url;
|
|
9612
|
+
this.ele.style.background = "url(" + this.url + ") no-repeat";
|
|
9613
|
+
this.ele.style.backgroundSize = "cover";
|
|
9614
|
+
}
|
|
9615
|
+
}
|
|
9413
9616
|
|
|
9414
9617
|
// CONCATENATED MODULE: ./src/lib/App.ts
|
|
9415
9618
|
|
|
@@ -9427,10 +9630,12 @@ var external_Dazzle_ = __webpack_require__(12);
|
|
|
9427
9630
|
|
|
9428
9631
|
|
|
9429
9632
|
|
|
9633
|
+
|
|
9430
9634
|
// import Core from "../engine/Core";
|
|
9431
9635
|
class App_App {
|
|
9432
9636
|
constructor(_canvas, _rootUrl) {
|
|
9433
9637
|
this.index = 0;
|
|
9638
|
+
this.highQualityMode = false;
|
|
9434
9639
|
let global = external_Dazzle_["SceneLoader"].create(_canvas);
|
|
9435
9640
|
this.canvas = global.canvas;
|
|
9436
9641
|
this.engine = global.engine;
|
|
@@ -9449,10 +9654,8 @@ class App_App {
|
|
|
9449
9654
|
//资源管理
|
|
9450
9655
|
this.Resources = new Resources_Resources(this);
|
|
9451
9656
|
//相机操作类
|
|
9452
|
-
this.
|
|
9657
|
+
this.camera = new Camera_Camera(this);
|
|
9453
9658
|
this.highlightLayer = new BABYLON.HighlightLayer("highlightLayer", this.scene);
|
|
9454
|
-
//自发光,有可能造成内存泄露;且性能要求较高
|
|
9455
|
-
// this.Glow = new BABYLON.GlowLayer("glow", this.scene);
|
|
9456
9659
|
// this.Glow.intensity = 5;
|
|
9457
9660
|
// this.gl.gl1 = new BABYLON.GlowLayer("glow", this.scene);
|
|
9458
9661
|
// this.gl.gl1.intensity = 0.25;
|
|
@@ -9462,9 +9665,10 @@ class App_App {
|
|
|
9462
9665
|
this.container = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("screenUI");
|
|
9463
9666
|
// this.toolTip = new ToolTip(this, this.container);
|
|
9464
9667
|
this.Environment = new Environment_Environment(this);
|
|
9465
|
-
this.
|
|
9668
|
+
this.project = new Project_Project(this);
|
|
9466
9669
|
//闪烁特效
|
|
9467
9670
|
src.EffectMgr = new EffectMgr_EffectMgr();
|
|
9671
|
+
//鼠标经过提示
|
|
9468
9672
|
this.engine.runRenderLoop(() => {
|
|
9469
9673
|
if (this.fps)
|
|
9470
9674
|
this.fps.innerText = this.engine.getFps().toFixed() + " fps";
|
|
@@ -9482,17 +9686,21 @@ class App_App {
|
|
|
9482
9686
|
// this.touchtime = new Date().getTime();
|
|
9483
9687
|
switch (pointerInfo.type) {
|
|
9484
9688
|
case BABYLON.PointerEventTypes.POINTERMOVE:
|
|
9689
|
+
if (!this.tipsTool)
|
|
9690
|
+
return;
|
|
9485
9691
|
if (pointerInfo.pickInfo && pointerInfo.pickInfo.pickedPoint) {
|
|
9486
|
-
|
|
9692
|
+
this.tipsTool.update(pointerInfo);
|
|
9487
9693
|
}
|
|
9694
|
+
else
|
|
9695
|
+
this.tipsTool.close();
|
|
9488
9696
|
break;
|
|
9489
9697
|
case BABYLON.PointerEventTypes.POINTERWHEEL:
|
|
9490
|
-
if (!this.
|
|
9491
|
-
let bii = 1000 / (this.
|
|
9492
|
-
this.
|
|
9698
|
+
if (!this.camera.isOverLook) {
|
|
9699
|
+
let bii = 1000 / (this.camera.camera.radius / 20);
|
|
9700
|
+
this.camera.camera.panningSensibility = bii > 2000 ? 2000 : bii < 10 ? 10 : bii;
|
|
9493
9701
|
}
|
|
9494
9702
|
else
|
|
9495
|
-
this.
|
|
9703
|
+
this.camera._wheel(pointerInfo.event);
|
|
9496
9704
|
break;
|
|
9497
9705
|
}
|
|
9498
9706
|
});
|
|
@@ -9502,13 +9710,16 @@ class App_App {
|
|
|
9502
9710
|
case BABYLON.KeyboardEventTypes.KEYDOWN:
|
|
9503
9711
|
{
|
|
9504
9712
|
if (kbInfo.event.keyCode === 70) //按F控制台输出视角
|
|
9505
|
-
prompt("请复制输入框内的视角参数", JSON.stringify({ alpha: this.
|
|
9713
|
+
prompt("请复制输入框内的视角参数", JSON.stringify({ alpha: this.camera.camera.alpha, focus: Tools.vector3ToJson(this.camera.camera.target), radius: this.camera.camera.radius, beta: this.camera.camera.beta }));
|
|
9506
9714
|
}
|
|
9507
9715
|
break;
|
|
9508
9716
|
}
|
|
9509
9717
|
});
|
|
9510
9718
|
}
|
|
9511
9719
|
create(_config) {
|
|
9720
|
+
this.highQualityMode = _config.highQualityMode;
|
|
9721
|
+
if (this.highQualityMode)
|
|
9722
|
+
this.Glow = new BABYLON.GlowLayer("glow", this.scene); //自发光,有可能造成内存泄露;且性能要求较高
|
|
9512
9723
|
if (_config.libraryUrl)
|
|
9513
9724
|
this.Resources.resourcePath = _config.libraryUrl;
|
|
9514
9725
|
return new Promise(async (resolve, reject) => {
|
|
@@ -9518,7 +9729,7 @@ class App_App {
|
|
|
9518
9729
|
let _data = JSON.parse(Cryptojs_Crypto.de(_projectData));
|
|
9519
9730
|
// let _data = JSON.parse(_sceneData);
|
|
9520
9731
|
// console.log(_data)
|
|
9521
|
-
this.
|
|
9732
|
+
this.project.id = _data.id;
|
|
9522
9733
|
this.Environment.color = _data.environmentSettings.backColor == "#7A7A7A" ? new BABYLON.Color4(0, 0.0588, 0.1176, 1) : new BABYLON.Color4(...BABYLON.Color3.FromHexString(_data.environmentSettings.backColor).asArray(), 1);
|
|
9523
9734
|
this.Environment.fogDistance = _data.environmentSettings.fogDensity;
|
|
9524
9735
|
this.Environment.setFlexIntensity(_data.environmentSettings.reflexIntensity);
|
|
@@ -9550,11 +9761,11 @@ class App_App {
|
|
|
9550
9761
|
let _m = _data.scenes[i];
|
|
9551
9762
|
if (_m.objectType == ObjectType.Storey || _m.objectType == ObjectType.ParkModel) {
|
|
9552
9763
|
let _storey = new Region_Region(this, _m);
|
|
9553
|
-
this.
|
|
9764
|
+
this.project.objectDatas.add(_storey.id, _storey);
|
|
9554
9765
|
_regions.add(_storey.id, _storey);
|
|
9555
9766
|
_objects.add(_storey.id, new Array());
|
|
9556
9767
|
if (_m.objectType == ObjectType.ParkModel)
|
|
9557
|
-
this.
|
|
9768
|
+
this.project.root = _storey;
|
|
9558
9769
|
}
|
|
9559
9770
|
else if (_m.objectType == ObjectType.Floor)
|
|
9560
9771
|
_regions.add(_m.id, _m);
|
|
@@ -9570,13 +9781,13 @@ class App_App {
|
|
|
9570
9781
|
_objects.find(_m.parentId).push(_m);
|
|
9571
9782
|
}
|
|
9572
9783
|
for (const _o in _objects.map) {
|
|
9573
|
-
await this.
|
|
9784
|
+
await this.project.objectDatas.find(_o).bind(_objects.find(_o));
|
|
9574
9785
|
i++;
|
|
9575
9786
|
_config.progress && _config.progress(0.8 + (i / _data.scenes.length * 0.2));
|
|
9576
9787
|
}
|
|
9577
9788
|
_regions = null;
|
|
9578
9789
|
_objects = null;
|
|
9579
|
-
this.
|
|
9790
|
+
this.project.optimization();
|
|
9580
9791
|
// this.scene.debugLayer.show();
|
|
9581
9792
|
this.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
9582
9793
|
resolve(null);
|
|
@@ -9593,7 +9804,7 @@ class App_App {
|
|
|
9593
9804
|
return new Promise(async (resolve, reject) => {
|
|
9594
9805
|
try {
|
|
9595
9806
|
let _data = JSON.parse(Cryptojs_Crypto.de(_config.file));
|
|
9596
|
-
this.
|
|
9807
|
+
this.project.id = _data.id;
|
|
9597
9808
|
this.Environment.color = _data.environmentSettings.backColor == "#7A7A7A" ? new BABYLON.Color4(0, 0.0588, 0.1176, 1) : new BABYLON.Color4(...BABYLON.Color3.FromHexString(_data.environmentSettings.backColor).asArray(), 1);
|
|
9598
9809
|
this.Environment.fogDistance = _data.environmentSettings.fogDensity;
|
|
9599
9810
|
this.Environment.setFlexIntensity(_data.environmentSettings.reflexIntensity);
|
|
@@ -9625,11 +9836,11 @@ class App_App {
|
|
|
9625
9836
|
let _m = _data.scenes[i];
|
|
9626
9837
|
if (_m.objectType == ObjectType.Storey || _m.objectType == ObjectType.ParkModel) {
|
|
9627
9838
|
let _storey = new OptimizedRegion_OptimizedRegion(this, _m);
|
|
9628
|
-
this.
|
|
9839
|
+
this.project.objectDatas.add(_storey.id, _storey);
|
|
9629
9840
|
_regions.add(_storey.id, _storey);
|
|
9630
9841
|
_objects.add(_storey.id, new Array());
|
|
9631
9842
|
if (_m.objectType == ObjectType.ParkModel)
|
|
9632
|
-
this.
|
|
9843
|
+
this.project.root = _storey;
|
|
9633
9844
|
}
|
|
9634
9845
|
else if (_m.objectType == ObjectType.Floor)
|
|
9635
9846
|
_regions.add(_m.id, _m);
|
|
@@ -9645,18 +9856,18 @@ class App_App {
|
|
|
9645
9856
|
_objects.find(_m.parentId).push(_m);
|
|
9646
9857
|
}
|
|
9647
9858
|
for (const _o in _objects.map) {
|
|
9648
|
-
await this.
|
|
9859
|
+
await this.project.objectDatas.find(_o).bind(_objects.find(_o), _config._isOptimized);
|
|
9649
9860
|
i++;
|
|
9650
9861
|
_config.progress && _config.progress(0.8 + (i / _data.scenes.length * 0.2));
|
|
9651
9862
|
}
|
|
9652
9863
|
_regions = null;
|
|
9653
9864
|
_objects = null;
|
|
9654
|
-
this.
|
|
9865
|
+
this.project.optimization();
|
|
9655
9866
|
this.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
9656
9867
|
if (_config._isOptimized) {
|
|
9657
9868
|
let _objectDatas = [];
|
|
9658
|
-
for (const _id in this.
|
|
9659
|
-
let obj = this.
|
|
9869
|
+
for (const _id in this.project.objectDatas.map) {
|
|
9870
|
+
let obj = this.project.objectDatas.find(_id);
|
|
9660
9871
|
if (obj.objectType == ObjectType.Wall || obj.objectType == ObjectType.Corner)
|
|
9661
9872
|
_objectDatas.push({ id: obj.id, parentId: obj.parentId, objectType: "optimizedWall", baseModel: obj.baseModel });
|
|
9662
9873
|
}
|
|
@@ -9678,19 +9889,19 @@ class App_App {
|
|
|
9678
9889
|
}
|
|
9679
9890
|
outGltf(call) {
|
|
9680
9891
|
this.Resources.delete(true);
|
|
9681
|
-
for (const _id in this.
|
|
9682
|
-
let obj = this.
|
|
9892
|
+
for (const _id in this.project.objectDatas.map) {
|
|
9893
|
+
let obj = this.project.objectDatas.find(_id);
|
|
9683
9894
|
if (obj.objectType != ObjectType.Wall && obj.objectType != ObjectType.Corner) {
|
|
9684
9895
|
if (obj.instance)
|
|
9685
9896
|
obj.instance.dispose();
|
|
9686
|
-
this.
|
|
9897
|
+
this.project.objectDatas.remove(_id);
|
|
9687
9898
|
}
|
|
9688
9899
|
else
|
|
9689
9900
|
obj.instance.material = null;
|
|
9690
9901
|
}
|
|
9691
|
-
return BABYLON.GLTF2Export.GLTFAsync(this.scene, this.
|
|
9902
|
+
return BABYLON.GLTF2Export.GLTFAsync(this.scene, this.project.id, {
|
|
9692
9903
|
shouldExportNode: (e) => {
|
|
9693
|
-
let obj = this.
|
|
9904
|
+
let obj = this.project.objectDatas.find(e.id);
|
|
9694
9905
|
return obj && (obj.objectType == ObjectType.Wall || obj.objectType == ObjectType.Corner);
|
|
9695
9906
|
}
|
|
9696
9907
|
}).then((exportResponse) => {
|
|
@@ -9699,29 +9910,102 @@ class App_App {
|
|
|
9699
9910
|
call();
|
|
9700
9911
|
});
|
|
9701
9912
|
}
|
|
9913
|
+
showTips() {
|
|
9914
|
+
this.tipsTool = new TipsTool(this.canvas.parentElement, this);
|
|
9915
|
+
}
|
|
9702
9916
|
//开启帧率显示
|
|
9703
|
-
showFps(cssText = 'position:
|
|
9917
|
+
showFps(cssText = 'position: absolute;left: 5px;bottom: 5px;z-index:999999999; font-size: 10px;color: rgb(0, 255, 0);text-shadow:rgba(0, 0, 0, 0.2) 1px 1px 0;') {
|
|
9704
9918
|
if (!this.fps) {
|
|
9705
9919
|
this.fps = document.createElement("div");
|
|
9706
|
-
|
|
9920
|
+
this.canvas.parentElement.appendChild(this.fps);
|
|
9707
9921
|
}
|
|
9708
9922
|
this.fps.style.cssText = cssText;
|
|
9709
9923
|
}
|
|
9710
9924
|
//关闭帧率显示
|
|
9711
9925
|
hideFps() {
|
|
9712
9926
|
if (this.fps)
|
|
9713
|
-
|
|
9927
|
+
this.canvas.parentElement.removeChild(this.fps);
|
|
9714
9928
|
this.fps = null;
|
|
9715
9929
|
}
|
|
9716
9930
|
//销毁整个场景
|
|
9717
9931
|
dispose() {
|
|
9718
9932
|
if (this.fps)
|
|
9719
|
-
|
|
9933
|
+
this.canvas.parentElement.removeChild(this.fps);
|
|
9720
9934
|
this.fps = null;
|
|
9721
|
-
this.
|
|
9935
|
+
this.project.delete();
|
|
9722
9936
|
this.Resources.delete();
|
|
9723
9937
|
this.engine.dispose();
|
|
9724
9938
|
}
|
|
9939
|
+
showDebug() {
|
|
9940
|
+
this.scene.debugLayer.show();
|
|
9941
|
+
}
|
|
9942
|
+
}
|
|
9943
|
+
|
|
9944
|
+
// CONCATENATED MODULE: ./src/lib/EffectControls.ts
|
|
9945
|
+
|
|
9946
|
+
|
|
9947
|
+
class EffectControls_EffectControls {
|
|
9948
|
+
//创建容量
|
|
9949
|
+
static createCapacity(_object, RATIO) {
|
|
9950
|
+
return external_Dazzle_["Builder"].createCapacity(_object, RATIO);
|
|
9951
|
+
}
|
|
9952
|
+
///创建矩阵云图
|
|
9953
|
+
static createMatrixHeatMap(_anchor, //地板对象
|
|
9954
|
+
_data) {
|
|
9955
|
+
if (_anchor.objectType != ObjectType.Floor) {
|
|
9956
|
+
console.error("矩阵云图对象必须为房间!");
|
|
9957
|
+
return;
|
|
9958
|
+
}
|
|
9959
|
+
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 });
|
|
9960
|
+
}
|
|
9961
|
+
//创建柜式云图
|
|
9962
|
+
static createColumnarHeatMap(_anchor, _data) {
|
|
9963
|
+
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 });
|
|
9964
|
+
}
|
|
9965
|
+
}
|
|
9966
|
+
|
|
9967
|
+
// CONCATENATED MODULE: ./src/lib/UI.ts
|
|
9968
|
+
|
|
9969
|
+
class UI_UI {
|
|
9970
|
+
/// <summary>
|
|
9971
|
+
/// 创建3dUI
|
|
9972
|
+
/// </summary>
|
|
9973
|
+
/// <param name="_anchor">挂载的物体标识</param>
|
|
9974
|
+
/// <param name="url">图片地址</param>
|
|
9975
|
+
/// <param name="_scaling">大小</param>
|
|
9976
|
+
/// <param name="_height">相对于物体高度</param>
|
|
9977
|
+
/// <param name="_app">场景实例</param>
|
|
9978
|
+
static createIconFromMesh(_id, _anchor, url, _scaling, _height) {
|
|
9979
|
+
let icon = new external_Dazzle_["IconFromMesh"](_id, _anchor.instance, url, _scaling, _height, _anchor.app.scene);
|
|
9980
|
+
return icon;
|
|
9981
|
+
}
|
|
9982
|
+
/// <summary>
|
|
9983
|
+
/// 创建2d跟随UI
|
|
9984
|
+
/// </summary>
|
|
9985
|
+
static createIcon(_id, _anchor, _size, _height) {
|
|
9986
|
+
let icon;
|
|
9987
|
+
_anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups = true;
|
|
9988
|
+
icon = new external_Dazzle_["Icon"](_id);
|
|
9989
|
+
icon.size = _size;
|
|
9990
|
+
icon.height = _height;
|
|
9991
|
+
icon.pint = new BABYLON.Mesh(_anchor[0].id + '_pint');
|
|
9992
|
+
let pos = _anchor[0].instance.getAbsolutePosition();
|
|
9993
|
+
// if (_anchor[0].objectType == ObjectType.Floor) {
|
|
9994
|
+
// pos = _anchor[0].instance.getAbsolutePivotPoint();
|
|
9995
|
+
// }
|
|
9996
|
+
icon.pint.position = pos;
|
|
9997
|
+
icon.pint.position.y += _height;
|
|
9998
|
+
icon.rect = new BABYLON.GUI.Rectangle();
|
|
9999
|
+
icon.rect.isPointerBlocker = false;
|
|
10000
|
+
icon.rect.width = _size.width + "px";
|
|
10001
|
+
icon.rect.height = _size.height + "px";
|
|
10002
|
+
icon.rect.thickness = 0;
|
|
10003
|
+
_anchor.app.container.addControl(icon.rect);
|
|
10004
|
+
icon.rect.linkWithMesh(icon.pint);
|
|
10005
|
+
// icon.rect.linkOffsetY = -_height;
|
|
10006
|
+
_anchor.app.scene.blockfreeActiveMeshesAndRenderingGroups = false;
|
|
10007
|
+
return icon;
|
|
10008
|
+
}
|
|
9725
10009
|
}
|
|
9726
10010
|
|
|
9727
10011
|
// CONCATENATED MODULE: ./src/index.ts
|
|
@@ -9736,14 +10020,27 @@ class App_App {
|
|
|
9736
10020
|
|
|
9737
10021
|
|
|
9738
10022
|
|
|
10023
|
+
|
|
10024
|
+
|
|
10025
|
+
// export default class MX3D {
|
|
10026
|
+
// static App = App;
|
|
10027
|
+
// static Tools = Tools;
|
|
10028
|
+
// static EffectMgr: EffectMgr;
|
|
10029
|
+
// static EffectType = EffectType;
|
|
10030
|
+
// static EventType = EventType;
|
|
10031
|
+
// static GUID = GUID;
|
|
10032
|
+
// static Dictionary = Dictionary;
|
|
10033
|
+
// }
|
|
9739
10034
|
let _EffectMgr;
|
|
9740
10035
|
const MX3D = {
|
|
9741
10036
|
App: App_App,
|
|
9742
|
-
Tools:
|
|
10037
|
+
Tools: Tools,
|
|
10038
|
+
UI: UI_UI,
|
|
10039
|
+
ObjectType: ObjectType,
|
|
9743
10040
|
EffectMgr: _EffectMgr,
|
|
9744
10041
|
EffectType: EffectType,
|
|
9745
10042
|
EventType: EventType,
|
|
9746
|
-
|
|
10043
|
+
EffectControls: EffectControls_EffectControls,
|
|
9747
10044
|
Dictionary: Dictionary
|
|
9748
10045
|
};
|
|
9749
10046
|
/* harmony default export */ var src = __webpack_exports__["default"] = (MX3D);
|