fl-web-component 2.1.1-beta.1 → 2.1.1-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -863,13 +863,6 @@ module.exports = !$assign || __webpack_require__("4b8b")(function () {
863
863
 
864
864
  /***/ }),
865
865
 
866
- /***/ "075a":
867
- /***/ (function(module, exports, __webpack_require__) {
868
-
869
- // extracted by mini-css-extract-plugin
870
-
871
- /***/ }),
872
-
873
866
  /***/ "0983":
874
867
  /***/ (function(module, exports, __webpack_require__) {
875
868
 
@@ -1443,17 +1436,6 @@ module.exports = function (bitmap, value) {
1443
1436
  };
1444
1437
  };
1445
1438
 
1446
- /***/ }),
1447
-
1448
- /***/ "1160":
1449
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1450
-
1451
- "use strict";
1452
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_d40d4870_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7615");
1453
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_d40d4870_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_d40d4870_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
1454
- /* unused harmony reexport * */
1455
-
1456
-
1457
1439
  /***/ }),
1458
1440
 
1459
1441
  /***/ "122f":
@@ -2029,6 +2011,13 @@ exports.f = __webpack_require__("0bad") ? Object.defineProperty : function defin
2029
2011
 
2030
2012
  /***/ }),
2031
2013
 
2014
+ /***/ "1abf":
2015
+ /***/ (function(module, exports, __webpack_require__) {
2016
+
2017
+ // extracted by mini-css-extract-plugin
2018
+
2019
+ /***/ }),
2020
+
2032
2021
  /***/ "1bd8":
2033
2022
  /***/ (function(module, exports, __webpack_require__) {
2034
2023
 
@@ -13539,6 +13528,17 @@ deepmerge.all = function deepmergeAll(array, optionsArgument) {
13539
13528
  var deepmerge_1 = deepmerge;
13540
13529
  module.exports = deepmerge_1;
13541
13530
 
13531
+ /***/ }),
13532
+
13533
+ /***/ "3d44":
13534
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
13535
+
13536
+ "use strict";
13537
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_43473926_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1abf");
13538
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_43473926_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_43473926_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
13539
+ /* unused harmony reexport * */
13540
+
13541
+
13542
13542
  /***/ }),
13543
13543
 
13544
13544
  /***/ "3f6b":
@@ -13827,13 +13827,6 @@ function isVNode(node) {
13827
13827
 
13828
13828
  /***/ }),
13829
13829
 
13830
- /***/ "4326":
13831
- /***/ (function(module, exports, __webpack_require__) {
13832
-
13833
- // extracted by mini-css-extract-plugin
13834
-
13835
- /***/ }),
13836
-
13837
13830
  /***/ "4546":
13838
13831
  /***/ (function(module, exports, __webpack_require__) {
13839
13832
 
@@ -19958,17 +19951,6 @@ _$export.U = 64; // safe
19958
19951
  _$export.R = 128; // real proto method for `library`
19959
19952
  module.exports = _$export;
19960
19953
 
19961
- /***/ }),
19962
-
19963
- /***/ "5144":
19964
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
19965
-
19966
- "use strict";
19967
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_d40d4870_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("075a");
19968
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_d40d4870_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_d40d4870_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
19969
- /* unused harmony reexport * */
19970
-
19971
-
19972
19954
  /***/ }),
19973
19955
 
19974
19956
  /***/ "5159":
@@ -41737,7 +41719,7 @@ function unzipSync(data, opts) {
41737
41719
 
41738
41720
  /***/ }),
41739
41721
 
41740
- /***/ "7615":
41722
+ /***/ "749e":
41741
41723
  /***/ (function(module, exports, __webpack_require__) {
41742
41724
 
41743
41725
  // extracted by mini-css-extract-plugin
@@ -56195,6 +56177,13 @@ Factory_1.Factory.addGetterSetter(Path, 'data');
56195
56177
 
56196
56178
  /***/ }),
56197
56179
 
56180
+ /***/ "8d26":
56181
+ /***/ (function(module, exports, __webpack_require__) {
56182
+
56183
+ // extracted by mini-css-extract-plugin
56184
+
56185
+ /***/ }),
56186
+
56198
56187
  /***/ "8e84":
56199
56188
  /***/ (function(module, exports, __webpack_require__) {
56200
56189
 
@@ -56514,7 +56503,7 @@ module.exports = document && document.documentElement;
56514
56503
  /***/ "9224":
56515
56504
  /***/ (function(module) {
56516
56505
 
56517
- module.exports = JSON.parse("{\"name\":\"fl-web-component\",\"version\":\"2.1.1-beta.1\",\"scripts\":{\"postinstall\":\"patch-package\",\"tip1\":\"仅调试本组件不涉及业务组件,请执行dev\",\"dev\":\"vue-cli-service serve\",\"lint\":\"eslint \\\"{src,packages}/**/*.{vue,js}\\\" --fix\",\"prettier\":\"prettier --write \\\"packages/**/*.{js,css,less,scss,vue,html}\\\"\",\"=\":\"=============================================================\",\"tip2\":\"同时调试本组件与业务组件,请执行watch,生产模式监听请执行watch:prod\",\"watch\":\"vue-cli-service build --watch --mode development --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"watch:prod\":\"vue-cli-service build --watch --mode production --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build\":\"npm run lint && vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build:test\":\"vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"publish:base\":\"npm run build && npm publish --registry https://registry.npmjs.org/\",\"publish:beta:base\":\"npm run build && npm publish --tag beta --registry https://registry.npmjs.org/\",\"==\":\"=============================================================\",\"tip3\":\"发版注意: 【测试版执行publish:beta】【修改bug执行publish:fix】【新增功能执行publish:feat】【新特性执行publish:perf】\",\"publish:beta\":\"npm version prerelease --preid=beta && npm run publish:beta:base\",\"publish:fix\":\"npm version patch && npm run publish:base\",\"publish:feat\":\"npm version minor && npm run publish:base\",\"publish:perf\":\"npm version major && npm run publish:base\"},\"files\":[\"dist\",\"packages\",\"src\"],\"main\":\"dist/fl-web-component.common.js\",\"dependencies\":{\"camera-controls\":\"2.9.0\",\"core-js\":\"^3.42.0\",\"dxf-parser\":\"^1.1.2\",\"element-ui\":\"2.15.14\",\"fflate\":\"^0.8.2\",\"html2canvas\":\"^1.4.1\",\"jspdf\":\"^3.0.1\",\"konva\":\"^9.3.12\",\"lodash\":\"^4.17.21\",\"meshline\":\"^3.3.1\",\"regenerator-runtime\":\"^0.14.1\",\"svg-pan-zoom\":\"^3.6.2\",\"three\":\"^0.176.0\",\"three.path\":\"^1.0.1\",\"vue\":\"^2.6.11\"},\"devDependencies\":{\"@babel/core\":\"^7.12.16\",\"@babel/plugin-proposal-nullish-coalescing-operator\":\"^7.18.6\",\"@babel/plugin-proposal-optional-chaining\":\"^7.21.0\",\"@babel/preset-env\":\"^7.0.0\",\"@babel/runtime-corejs3\":\"^7.27.1\",\"@vue/cli-plugin-babel\":\"~4.4.0\",\"@vue/cli-plugin-eslint\":\"~4.4.0\",\"@vue/cli-service\":\"~4.4.0\",\"babel-eslint\":\"^10.1.0\",\"babel-loader\":\"^8.0.0\",\"copy-webpack-plugin\":\"^4.0.1\",\"eslint\":\"^6.7.2\",\"eslint-config-prettier\":\"^6.15.0\",\"eslint-plugin-prettier\":\"^3.4.1\",\"eslint-plugin-vue\":\"^6.2.2\",\"patch-package\":\"^6.4.7\",\"prettier\":\"^2.8.8\",\"sass\":\"1.32.13\",\"sass-loader\":\"10.1.1\",\"vue-template-compiler\":\"^2.6.11\",\"worker-loader\":\"^3.0.8\"},\"browserslist\":[\"> 1%\",\"last 2 versions\"]}");
56506
+ module.exports = JSON.parse("{\"name\":\"fl-web-component\",\"version\":\"2.1.1-beta.11\",\"scripts\":{\"postinstall\":\"patch-package\",\"tip1\":\"仅调试本组件不涉及业务组件,请执行dev\",\"dev\":\"vue-cli-service serve\",\"lint\":\"eslint \\\"{src,packages}/**/*.{vue,js}\\\" --fix\",\"prettier\":\"prettier --write \\\"packages/**/*.{js,css,less,scss,vue,html}\\\"\",\"=\":\"=============================================================\",\"tip2\":\"同时调试本组件与业务组件,请执行watch,生产模式监听请执行watch:prod\",\"watch\":\"vue-cli-service build --watch --mode development --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"watch:prod\":\"vue-cli-service build --watch --mode production --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build\":\"npm run lint && vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"build:test\":\"vue-cli-service build --target lib --name fl-web-component --formats commonjs ./src/main.js\",\"publish:base\":\"npm run build && npm publish --registry https://registry.npmjs.org/\",\"publish:beta:base\":\"npm run build && npm publish --tag beta --registry https://registry.npmjs.org/\",\"==\":\"=============================================================\",\"tip3\":\"发版注意: 【测试版执行publish:beta】【修改bug执行publish:fix】【新增功能执行publish:feat】【新特性执行publish:perf】\",\"publish:beta\":\"npm version prerelease --preid=beta && npm run publish:beta:base\",\"publish:fix\":\"npm version patch && npm run publish:base\",\"publish:feat\":\"npm version minor && npm run publish:base\",\"publish:perf\":\"npm version major && npm run publish:base\"},\"files\":[\"dist\",\"packages\",\"src\"],\"main\":\"dist/fl-web-component.common.js\",\"dependencies\":{\"camera-controls\":\"2.9.0\",\"core-js\":\"^3.42.0\",\"dxf-parser\":\"^1.1.2\",\"element-ui\":\"2.15.14\",\"fflate\":\"^0.8.2\",\"html2canvas\":\"^1.4.1\",\"jspdf\":\"^3.0.1\",\"konva\":\"^9.3.12\",\"lodash\":\"^4.17.21\",\"meshline\":\"^3.3.1\",\"regenerator-runtime\":\"^0.14.1\",\"svg-pan-zoom\":\"^3.6.2\",\"three\":\"^0.176.0\",\"three.path\":\"^1.0.1\",\"vue\":\"^2.6.11\"},\"devDependencies\":{\"@babel/core\":\"^7.12.16\",\"@babel/plugin-proposal-nullish-coalescing-operator\":\"^7.18.6\",\"@babel/plugin-proposal-optional-chaining\":\"^7.21.0\",\"@babel/preset-env\":\"^7.0.0\",\"@babel/runtime-corejs3\":\"^7.27.1\",\"@vue/cli-plugin-babel\":\"~4.4.0\",\"@vue/cli-plugin-eslint\":\"~4.4.0\",\"@vue/cli-service\":\"~4.4.0\",\"babel-eslint\":\"^10.1.0\",\"babel-loader\":\"^8.0.0\",\"copy-webpack-plugin\":\"^4.0.1\",\"eslint\":\"^6.7.2\",\"eslint-config-prettier\":\"^6.15.0\",\"eslint-plugin-prettier\":\"^3.4.1\",\"eslint-plugin-vue\":\"^6.2.2\",\"patch-package\":\"^6.4.7\",\"prettier\":\"^2.8.8\",\"sass\":\"1.32.13\",\"sass-loader\":\"10.1.1\",\"vue-template-compiler\":\"^2.6.11\",\"worker-loader\":\"^3.0.8\"},\"browserslist\":[\"> 1%\",\"last 2 versions\"]}");
56518
56507
 
56519
56508
  /***/ }),
56520
56509
 
@@ -59332,17 +59321,6 @@ var isDefined = exports.isDefined = function isDefined(val) {
59332
59321
 
59333
59322
  module.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAACGUlEQVR4AeSUPU4CURSFgRW4A7FwAUYLC4yY2DNUFhZApLPRxMKOsAPsSYAVACuQCdqZ2NiYmIiFPQsw4Hfe/GTeMINkEirJO3N/3n333PsuM4Xcln//gMBxnHJwi+jFQJeM2/LFkXpFHC5Xq9VPDtSQj9j1fD4v2UIXetpD74E6euJKJSBZazgc7o1Go8ZyuRxgX/h2m0znwGVPepu9FnbiWiGgGlM5SeeREzvY3xH7naQfsiGZsffDucROLAKCdMenfqVVJRBI0gFN6YJ0Yp6kC9j7oAFpzc8ht4FFgEcD/UJmWnQyix+0CKii71dRZ7CleHCardhKpXLH2TI5LBKLIJLgimqOIvZaldh6oVC4RPbjgRaB7o+gCVWcgE48OM0mtslMDtgvKgcyXBYBXg0ZkX1Bln5FbE50j1QxBTeb0hDbZQ6vxLvAWvEOzCbX9AzRizE2e7xxZkLoLrCWRUAlZQWOx+N77jT8n1snEgw613tyy9afM9D9ZZ4DXRchUw64vGV14G+6juPotZ96Ibkc91vC1w1s6SCcEbo+gj2617cpCDPSIpAHkj5ooJtvDTK3WCyOqe5QuuDru9J9zHQGaA6+yxMrBJ7bPF0qN5XxEl1T3YhK1ZkqfSBiLlsx6AOQuFIJqKZPUnXSZuD6bKv9Nv4GUJfGZu8Me6XygC2VQAEcVOvh0GTLHyBuB/6oXEsQDcyqb53gFwAA//9V8fpjAAAABklEQVQDAOkWA0BYT6hNAAAAAElFTkSuQmCC"
59334
59323
 
59335
- /***/ }),
59336
-
59337
- /***/ "affa":
59338
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
59339
-
59340
- "use strict";
59341
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_e2de7752_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("4326");
59342
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_e2de7752_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_e2de7752_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
59343
- /* unused harmony reexport * */
59344
-
59345
-
59346
59324
  /***/ }),
59347
59325
 
59348
59326
  /***/ "b2fd":
@@ -69114,6 +69092,17 @@ var Contrast = function Contrast(imageData) {
69114
69092
  exports.Contrast = Contrast;
69115
69093
  Factory_1.Factory.addGetterSetter(Node_1.Node, 'contrast', 0, (0, Validators_1.getNumberValidator)(), Factory_1.Factory.afterSetFilter);
69116
69094
 
69095
+ /***/ }),
69096
+
69097
+ /***/ "c89b":
69098
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
69099
+
69100
+ "use strict";
69101
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_41b98e1a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("8d26");
69102
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_41b98e1a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_41b98e1a_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
69103
+ /* unused harmony reexport * */
69104
+
69105
+
69117
69106
  /***/ }),
69118
69107
 
69119
69108
  /***/ "c8ba":
@@ -69279,6 +69268,17 @@ function isKorean(text) {
69279
69268
  return reg.test(text);
69280
69269
  }
69281
69270
 
69271
+ /***/ }),
69272
+
69273
+ /***/ "d447":
69274
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
69275
+
69276
+ "use strict";
69277
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_43473926_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("749e");
69278
+ /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_43473926_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_1_id_43473926_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
69279
+ /* unused harmony reexport * */
69280
+
69281
+
69282
69282
  /***/ }),
69283
69283
 
69284
69284
  /***/ "d488":
@@ -78634,8 +78634,8 @@ if (typeof window !== 'undefined') {
78634
78634
  // Indicate to webpack that this file can be concatenated
78635
78635
  /* harmony default export */ var setPublicPath = (null);
78636
78636
 
78637
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b074442e-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/index.vue?vue&type=template&id=d40d4870&scoped=true
78638
- var com_graphicsvue_type_template_id_d40d4870_scoped_true_render = function render() {
78637
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"d898cbea-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/index.vue?vue&type=template&id=43473926&scoped=true
78638
+ var com_graphicsvue_type_template_id_43473926_scoped_true_render = function render() {
78639
78639
  var _vm = this,
78640
78640
  _c = _vm._self._c;
78641
78641
  return _c('div', {
@@ -78647,7 +78647,7 @@ var com_graphicsvue_type_template_id_d40d4870_scoped_true_render = function rend
78647
78647
  };
78648
78648
  var staticRenderFns = [];
78649
78649
 
78650
- // CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=template&id=d40d4870&scoped=true
78650
+ // CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=template&id=43473926&scoped=true
78651
78651
 
78652
78652
  // CONCATENATED MODULE: ./node_modules/camera-controls/dist/camera-controls.module.js
78653
78653
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
@@ -112489,9 +112489,14 @@ function draw2Dmodel(geom, instanceName, instanceCount, nColor, nOpacity) {
112489
112489
  color = _geom$prop2.color,
112490
112490
  linewidth = _geom$prop2.linewidth;
112491
112491
  var formatLinewidth = (linewidth < 1 ? linewidth * 50 : linewidth) || 5;
112492
+ var meshLineResolution = options.meshLineResolution || {};
112493
+ var resolutionWidth = meshLineResolution.width || window.innerWidth || 1;
112494
+ var resolutionHeight = meshLineResolution.height || window.innerHeight || 1;
112492
112495
  var material = new dist_MeshLineMaterial({
112493
112496
  color: new Color("rgb(".concat(color[0], ", ").concat(color[1], ", ").concat(color[2], ")")),
112494
- lineWidth: formatLinewidth
112497
+ lineWidth: formatLinewidth,
112498
+ resolution: new Vector2(resolutionWidth, resolutionHeight),
112499
+ sizeAttenuation: 0
112495
112500
  });
112496
112501
  var lineGeometry = new dist_MeshLineGeometry();
112497
112502
  lineGeometry.setPoints(geometry);
@@ -121487,9 +121492,15 @@ var LOG_INTERVAL = 30;
121487
121492
 
121488
121493
  var isDebug = false || false === true;
121489
121494
  // const isDebug = false;
121490
- var COLLISION_PENETRATION_EPSILON = 10;
121495
+ var COLLISION_CONTACT_EPSILON = 1;
121491
121496
  var COLLISION_OBB_AXIS_EPSILON = 1e-8;
121492
121497
  var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
121498
+ var OCCLUSION_DEBUG_GROUP_NAME = '__occlusion_bounds_debug_group__';
121499
+ var OCCLUSION_DEBUG_FLAG_COLORS = {
121500
+ 1: 0xffc107,
121501
+ 2: 0x409eff,
121502
+ 3: 0xff4dff
121503
+ };
121493
121504
  /* harmony default export */ var com_graphicsvue_type_script_lang_js = ({
121494
121505
  name: 'FlModel',
121495
121506
  props: {
@@ -121519,8 +121530,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
121519
121530
  occlusionState: {
121520
121531
  // enabled: false,
121521
121532
  enabled: true,
121522
- // previewEnabled: false,
121523
- previewEnabled: isDebug,
121533
+ previewEnabled: false,
121534
+ // previewEnabled: isDebug,
121524
121535
  bufferWidth: 1700,
121525
121536
  sampleStride: 1,
121526
121537
  minSampleCount: 5
@@ -121536,7 +121547,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
121536
121547
  isPaused: false
121537
121548
  },
121538
121549
  isolateMode: false,
121539
- collisionObbDebugEnabled: isDebug
121550
+ sceneBoundingBoxDebugEnabled: false,
121551
+ // collisionObbDebugEnabled: isDebug,
121552
+ collisionObbDebugEnabled: false,
121553
+ // occlusionBoundsDebugEnabled: isDebug,
121554
+ occlusionBoundsDebugEnabled: false
121540
121555
  };
121541
121556
  },
121542
121557
  watch: {
@@ -121544,16 +121559,23 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
121544
121559
  if (val) {
121545
121560
  this.detachTransformControls();
121546
121561
  }
121562
+ },
121563
+ sceneBoundingBoxDebugEnabled: function sceneBoundingBoxDebugEnabled(val) {
121564
+ if (val) {
121565
+ this.refreshSceneBoundingBoxHelper(true);
121566
+ } else {
121567
+ this.hideSceneBoundingBox();
121568
+ }
121547
121569
  }
121548
121570
  },
121549
121571
  beforeCreate: function beforeCreate() {
121550
121572
  var _this2 = this;
121551
121573
  this.spaceUp = true;
121552
- var arr = ['renderer', 'scene', 'camera', 'cameraControls', 'instructions', 'raycaster', 'mouse', 'labelRenderer', 'lineTexture', 'curve', 'downRaycaster', 'velocity', 'direction', 'clock', 'pointControls', 'threeMeasure', 'modelGroup', 'animateId', 'scenePass', 'outlineComposer', 'outlinePass', 'renderTarget', 'sceneClock', 'bizToThreeMatrix', 'threeToBizMatrix', 'stats', 'centeringDebounceTimer', 'sceneBoundingBox', 'sceneBoundingBoxHelper', 'collisionObbDebugGroup'];
121574
+ var arr = ['renderer', 'scene', 'camera', 'cameraControls', 'instructions', 'raycaster', 'mouse', 'labelRenderer', 'lineTexture', 'curve', 'downRaycaster', 'velocity', 'direction', 'clock', 'pointControls', 'threeMeasure', 'modelGroup', 'animateId', 'scenePass', 'outlineComposer', 'outlinePass', 'renderTarget', 'sceneClock', 'bizToThreeMatrix', 'threeToBizMatrix', 'stats', 'centeringDebounceTimer', 'sceneBoundingBox', 'sceneBoundingBoxHelper', 'collisionObbDebugGroup', 'occlusionBoundsDebugGroup'];
121553
121575
  arr.forEach(function (item) {
121554
121576
  _this2[item] = null;
121555
121577
  });
121556
- ['roaming', 'firstPerSign', 'canJump', 'moveForward', 'moveBackward', 'moveLeft', 'moveRight', 'measureFlag', 'skipNextRenderFrame', 'forceSkipRendering', 'userInteracting', 'hasExecutedCentering', 'needsCenteringAfterInteraction', 'isDragging', 'boundingBoxVisible', 'collisionObbDebugEnabled'].forEach(function (item) {
121578
+ ['roaming', 'firstPerSign', 'canJump', 'moveForward', 'moveBackward', 'moveLeft', 'moveRight', 'measureFlag', 'skipNextRenderFrame', 'forceSkipRendering', 'userInteracting', 'hasExecutedCentering', 'needsCenteringAfterInteraction', 'isDragging', 'boundingBoxVisible', 'collisionObbDebugEnabled', 'occlusionBoundsDebugEnabled'].forEach(function (item) {
121557
121579
  _this2[item] = false;
121558
121580
  });
121559
121581
  ['clippingMesh', 'modelActive'].forEach(function (item) {
@@ -121640,12 +121662,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
121640
121662
  wheelTimeout: null
121641
121663
  }
121642
121664
  },
121665
+ cameraControlMoveObserver: {
121666
+ enabled: false,
121667
+ interval: 500
121668
+ },
121643
121669
  streamLoader: null,
121644
121670
  // isPerformingInitialCentering: false, // 标记是否正在执行初始居中
121645
121671
  isObserverEnabled: true,
121646
121672
  // 标记相机变更观察者是否启用
121647
121673
  sceneBoxes: new Map(),
121648
121674
  documentModelIds: new Map(),
121675
+ documentSceneBoundsIds: new Map(),
121649
121676
  outlineInstanceProxyMap: new Map(),
121650
121677
  occlusionWorker: null,
121651
121678
  occlusionWorkerRequestMap: new Map(),
@@ -122479,6 +122506,21 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122479
122506
  if (instancedMesh && instancedMesh.userData) return instancedMesh.userData.copyMatrix || null;
122480
122507
  return null;
122481
122508
  },
122509
+ setInstanceCullingVisible: function setInstanceCullingVisible(instancedMesh, instanceId, visible) {
122510
+ var instanceState = this.getInstanceState(instancedMesh, instanceId);
122511
+ if (!instanceState || typeof instanceState.instanceIndex !== 'number') return;
122512
+ var copyMatrix = instanceState.copyMatrix || this.getInstanceCopyMatrix(instancedMesh, instanceId);
122513
+ if (!copyMatrix) return;
122514
+ var shouldShow = visible && instanceState.visible !== false && this.isSourceVisible(instanceId, instancedMesh);
122515
+ var matrix = new this.THREE.Matrix4().copy(copyMatrix);
122516
+ if (!shouldShow) {
122517
+ matrix.makeTranslation(9999999, 9999999, 9999999);
122518
+ this.removeOutlineObject(instancedMesh, instanceState.instanceIndex);
122519
+ }
122520
+ instancedMesh.setMatrixAt(instanceState.instanceIndex, matrix);
122521
+ instancedMesh.instanceMatrix.needsUpdate = true;
122522
+ instanceState.cullingVisible = !!visible;
122523
+ },
122482
122524
  isSourceHiddenInstance: function isSourceHiddenInstance(instancedMesh, instanceId) {
122483
122525
  var instanceState = this.getInstanceState(instancedMesh, instanceId);
122484
122526
  if (instanceState && instanceState.sourceVisible !== undefined) {
@@ -122750,61 +122792,145 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122750
122792
  updateGlobalSceneBoundingBox: function updateGlobalSceneBoundingBox() {
122751
122793
  var state = this.noObserver || {};
122752
122794
  var occScene = state.occlusionState && state.occlusionState._occScene;
122795
+ var mergedBox = new this.THREE.Box3();
122796
+ var hasValidBox = false;
122797
+ var mergeBox = function mergeBox(box) {
122798
+ if (!box || !box.isBox3 || box.isEmpty()) return;
122799
+ if (!hasValidBox) {
122800
+ mergedBox.copy(box);
122801
+ hasValidBox = true;
122802
+ return;
122803
+ }
122804
+ mergedBox.union(box);
122805
+ };
122753
122806
 
122754
- // 优先使用由 boxIndex 构建出的离屏全场景,作为整体居中与 home 的统一范围
122807
+ // 离屏遮挡场景只包含参与遮挡的模型,需要继续合并场景范围索引中的二维图形范围。
122755
122808
  if (occScene && occScene.children && occScene.children.length > 0) {
122756
122809
  var occBox = new this.THREE.Box3().setFromObject(occScene);
122757
- if (!occBox.isEmpty()) {
122758
- this.sceneBoundingBox = occBox;
122759
- return this.sceneBoundingBox;
122760
- }
122810
+ mergeBox(occBox);
122761
122811
  }
122762
122812
 
122763
- // 离屏场景尚未完成时,回退到 boxIndex 联合包围盒,确保每次 add boxIndex 都能更新全场景范围
122764
- if (this._boxIndex && this._boxIndex.size > 0) {
122765
- var minX = Infinity,
122766
- minY = Infinity,
122767
- minZ = Infinity;
122768
- var maxX = -Infinity,
122769
- maxY = -Infinity,
122770
- maxZ = -Infinity;
122771
- this._boxIndex.forEach(function (box) {
122772
- if (!box || !box.isBox3 || box.isEmpty()) return;
122773
- var mn = box.min;
122774
- var mx = box.max;
122775
- if (mn.x < minX) minX = mn.x;
122776
- if (mn.y < minY) minY = mn.y;
122777
- if (mn.z < minZ) minZ = mn.z;
122778
- if (mx.x > maxX) maxX = mx.x;
122779
- if (mx.y > maxY) maxY = mx.y;
122780
- if (mx.z > maxZ) maxZ = mx.z;
122813
+ // sceneBoundsIndex 包含二维和三维图形,是全场景 dolly 距离的主要范围来源。
122814
+ if (this._sceneBoundsIndex && this._sceneBoundsIndex.size > 0) {
122815
+ this._sceneBoundsIndex.forEach(function (box) {
122816
+ mergeBox(box);
122781
122817
  });
122782
- if (Number.isFinite(minX) && Number.isFinite(minY) && Number.isFinite(minZ) && Number.isFinite(maxX) && Number.isFinite(maxY) && Number.isFinite(maxZ)) {
122783
- this.sceneBoundingBox = new this.THREE.Box3(new this.THREE.Vector3(minX, minY, minZ), new this.THREE.Vector3(maxX, maxY, maxZ));
122784
- return this.sceneBoundingBox;
122785
- }
122786
122818
  }
122787
122819
  var boxes = Array.from(state.sceneBoxes && state.sceneBoxes.values() || []);
122788
122820
  if (boxes.length > 0) {
122789
- var firstBox = boxes[0].clone();
122790
- for (var i = 1; i < boxes.length; i++) {
122791
- firstBox.union(boxes[i]);
122821
+ for (var i = 0; i < boxes.length; i++) {
122822
+ mergeBox(boxes[i]);
122792
122823
  }
122793
- this.sceneBoundingBox = firstBox;
122824
+ }
122825
+ if (hasValidBox) {
122826
+ this.sceneBoundingBox = mergedBox;
122827
+ this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
122794
122828
  return this.sceneBoundingBox;
122795
122829
  }
122796
122830
  this.sceneBoundingBox = new this.THREE.Box3();
122831
+ this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
122797
122832
  return this.sceneBoundingBox;
122798
122833
  },
122834
+ upsertIndexedBox: function upsertIndexedBox(indexMap, modelId, box) {
122835
+ if (!indexMap || !modelId || !box || !box.isBox3) return null;
122836
+ var key = String(modelId);
122837
+ var existingBox = indexMap.get(key);
122838
+ if (!existingBox) {
122839
+ indexMap.set(key, box);
122840
+ return box;
122841
+ }
122842
+ existingBox.union(box);
122843
+ return existingBox;
122844
+ },
122845
+ createOcclusionProxyBox: function createOcclusionProxyBox(box) {
122846
+ if (!box || !box.isBox3) return null;
122847
+ var proxyBox = box.clone();
122848
+ proxyBox.userData = com_graphicsvue_type_script_lang_js_objectSpread({}, box.userData || {});
122849
+ delete proxyBox.userData.occlusionProxyBoxes;
122850
+ return proxyBox;
122851
+ },
122852
+ mergeModelBoxUserData: function mergeModelBoxUserData(targetBox, sourceBox) {
122853
+ if (!targetBox || !sourceBox || !sourceBox.userData) return;
122854
+ var sourceUserData = sourceBox.userData;
122855
+ if (!targetBox.userData) {
122856
+ targetBox.userData = sourceUserData;
122857
+ return;
122858
+ }
122859
+ var targetUserData = targetBox.userData;
122860
+ var targetProxyBoxes = Array.isArray(targetUserData.occlusionProxyBoxes) ? targetUserData.occlusionProxyBoxes : [this.createOcclusionProxyBox(targetBox)].filter(Boolean);
122861
+ var sourceProxyBoxes = Array.isArray(sourceUserData.occlusionProxyBoxes) ? sourceUserData.occlusionProxyBoxes : [this.createOcclusionProxyBox(sourceBox)].filter(Boolean);
122862
+ targetUserData.visible = targetUserData.visible !== false || sourceUserData.visible !== false;
122863
+ targetUserData.sourceVisible = targetUserData.sourceVisible !== false || sourceUserData.sourceVisible !== false;
122864
+ targetUserData.transparent = !!targetUserData.transparent && !!sourceUserData.transparent;
122865
+ targetUserData.mergedBoxCount = (targetUserData.mergedBoxCount || 1) + 1;
122866
+ // 多图元模型分别参与遮挡测试,任一图元可见时都会保留整个模型。
122867
+ targetUserData.occlusionEnabled = !!targetUserData.occlusionEnabled && !!sourceUserData.occlusionEnabled;
122868
+ targetUserData.occlusionProxyBoxes = targetProxyBoxes.concat(sourceProxyBoxes);
122869
+ var targetObbs = Array.isArray(targetUserData.collisionObbs) ? targetUserData.collisionObbs : [];
122870
+ var sourceObbs = Array.isArray(sourceUserData.collisionObbs) ? sourceUserData.collisionObbs : [];
122871
+ if (sourceObbs.length > 0) {
122872
+ targetUserData.collisionObbs = targetObbs.concat(sourceObbs);
122873
+ }
122874
+ },
122875
+ _createCollisionObb: function _createCollisionObb(center, halfSize, rotation, matrix) {
122876
+ var worldCenter = center.clone();
122877
+ var worldHalfSize = halfSize.clone();
122878
+ var worldRotation = new this.THREE.Matrix3();
122879
+ if (!matrix) {
122880
+ return new OBB_OBB(worldCenter, worldHalfSize, rotation.clone());
122881
+ }
122882
+ worldCenter.applyMatrix4(matrix);
122883
+ var localAxes = [new this.THREE.Vector3(), new this.THREE.Vector3(), new this.THREE.Vector3()];
122884
+ rotation.extractBasis(localAxes[0], localAxes[1], localAxes[2]);
122885
+ var linearMatrix = new this.THREE.Matrix3().setFromMatrix4(matrix);
122886
+ var worldAxes = localAxes.map(function (axis) {
122887
+ return axis.clone().applyMatrix3(linearMatrix);
122888
+ });
122889
+ var halfSizes = [halfSize.x, halfSize.y, halfSize.z];
122890
+ for (var i = 0; i < 3; i++) {
122891
+ var axisLength = worldAxes[i].length();
122892
+ if (axisLength <= COLLISION_OBB_AXIS_EPSILON) {
122893
+ worldAxes[i].copy(localAxes[i]);
122894
+ continue;
122895
+ }
122896
+ worldAxes[i].multiplyScalar(1 / axisLength);
122897
+ halfSizes[i] *= axisLength;
122898
+ }
122899
+ worldHalfSize.set(halfSizes[0], halfSizes[1], halfSizes[2]);
122900
+ worldRotation.set(worldAxes[0].x, worldAxes[1].x, worldAxes[2].x, worldAxes[0].y, worldAxes[1].y, worldAxes[2].y, worldAxes[0].z, worldAxes[1].z, worldAxes[2].z);
122901
+ return new OBB_OBB(worldCenter, worldHalfSize, worldRotation);
122902
+ },
122903
+ _createCollisionObbFromBox: function _createCollisionObbFromBox(box, matrix) {
122904
+ var center = box.getCenter(new this.THREE.Vector3());
122905
+ var halfSize = box.getSize(new this.THREE.Vector3()).multiplyScalar(0.5);
122906
+ var rotation = new this.THREE.Matrix3().identity();
122907
+ return this._createCollisionObb(center, halfSize, rotation, matrix);
122908
+ },
122909
+ upsertModelBox: function upsertModelBox(modelId, box) {
122910
+ if (!this._boxIndex || !modelId || !box || !box.isBox3) return;
122911
+ var key = String(modelId);
122912
+ var existingBox = this._boxIndex.get(key);
122913
+ if (!existingBox) {
122914
+ this._boxIndex.set(key, box);
122915
+ return;
122916
+ }
122917
+ this.mergeModelBoxUserData(existingBox, box);
122918
+ existingBox.union(box);
122919
+ },
122799
122920
  setBoxIndex: function setBoxIndex(boxJson, documentId) {
122800
122921
  var _this0 = this;
122801
122922
  var isAdd = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
122802
122923
  if (!this._boxIndex) this._boxIndex = new Map();
122924
+ if (!this._sceneBoundsIndex) this._sceneBoundsIndex = new Map();
122803
122925
  if (!documentId) {
122804
122926
  this._boxIndex.clear();
122927
+ this._sceneBoundsIndex.clear();
122805
122928
  if (this.noObserver && this.noObserver.documentModelIds) {
122806
122929
  this.noObserver.documentModelIds.clear();
122807
122930
  }
122931
+ if (this.noObserver && this.noObserver.documentSceneBoundsIds) {
122932
+ this.noObserver.documentSceneBoundsIds.clear();
122933
+ }
122808
122934
  this.hasExecutedCentering = false;
122809
122935
  this.buildOctreeFromBoxIndex();
122810
122936
  return;
@@ -122812,19 +122938,25 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122812
122938
  if (isAdd && boxJson) {
122813
122939
  var arr = boxJson ? boxJson : [];
122814
122940
  var modelIds = new Set();
122941
+ var sceneBoundIds = new Set();
122815
122942
  var validGeomTypes = new Set(Object.values(GEOM_TYPES));
122816
122943
  for (var i = 0; i < arr.length; i++) {
122817
122944
  var it = arr[i];
122818
122945
  if (!validGeomTypes.has(it.geomType)) {
122819
122946
  continue;
122820
122947
  }
122821
- if (it.obb.length == 0) {
122948
+ var minSource = it.min;
122949
+ var maxSource = it.max;
122950
+ var hasValidMinMax = minSource && maxSource && minSource.length >= 3 && maxSource.length >= 3 && Number.isFinite(minSource[0]) && Number.isFinite(minSource[1]) && Number.isFinite(minSource[2]) && Number.isFinite(maxSource[0]) && Number.isFinite(maxSource[1]) && Number.isFinite(maxSource[2]);
122951
+ if (!hasValidMinMax) {
122822
122952
  continue;
122823
122953
  }
122954
+ var obbData = it.obb || [];
122955
+ var modelId = String(it.id);
122824
122956
 
122825
122957
  // 使用新的 min/max 数据结构
122826
- var min = new this.THREE.Vector3(it.min[0], it.min[1], it.min[2]);
122827
- var max = new this.THREE.Vector3(it.max[0], it.max[1], it.max[2]);
122958
+ var min = new this.THREE.Vector3(minSource[0], minSource[1], minSource[2]);
122959
+ var max = new this.THREE.Vector3(maxSource[0], maxSource[1], maxSource[2]);
122828
122960
  var sourceBox = new this.THREE.Box3(min.clone(), max.clone());
122829
122961
  // 八叉树仍使用 AABB 粗筛,最终碰撞使用 sourceBox 派生的 OBB 精筛
122830
122962
  var boxThree = sourceBox.clone();
@@ -122854,11 +122986,18 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122854
122986
  collisionMatrix = this.bizToThreeMatrix.clone();
122855
122987
  boxThree.applyMatrix4(collisionMatrix);
122856
122988
  }
122989
+ this.upsertIndexedBox(this._sceneBoundsIndex, modelId, boxThree.clone());
122990
+ sceneBoundIds.add(modelId);
122991
+
122992
+ // 没有 OBB 数据的二维图形只参与全场景范围,不纳入碰撞和遮挡索引。
122993
+ if (obbData.length === 0) {
122994
+ continue;
122995
+ }
122857
122996
  var userData = {
122858
122997
  flag: it.flag || 1,
122859
122998
  // 默认为 1
122860
122999
  geomType: it.geomType,
122861
- obbData: it.obb,
123000
+ obbData: obbData,
122862
123001
  // 存储原始 OBB 数据
122863
123002
  transparent: it.transp > 0,
122864
123003
  sourceVisible: it.visible === false ? false : true,
@@ -122873,8 +123012,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122873
123012
  // userData.matrix = new this.THREE.Matrix4().identity();
122874
123013
  }
122875
123014
  // 如果是 flag=3,解析并存储中心点、半轴长、旋转矩阵
122876
- else if (it.flag === 3 && it.obb && it.obb.length === 15) {
122877
- var obbData = it.obb;
123015
+ else if (it.flag === 3 && obbData.length === 15) {
122878
123016
  var center = new this.THREE.Vector3(obbData[0], obbData[1], obbData[2]);
122879
123017
  var halfSize = new this.THREE.Vector3(obbData[3], obbData[4], obbData[5]);
122880
123018
  var rotation = new this.THREE.Matrix3().fromArray(obbData.slice(6, 15));
@@ -122891,29 +123029,23 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122891
123029
  center: center,
122892
123030
  halfSize: halfSize
122893
123031
  };
122894
- var collisionObb = new OBB_OBB(center.clone(), halfSize.clone(), rotation.clone());
122895
- if (collisionMatrix) {
122896
- collisionObb.applyMatrix4(collisionMatrix);
122897
- }
123032
+ var collisionObb = this._createCollisionObb(center, halfSize, rotation, collisionMatrix);
122898
123033
  userData.collisionObbs = [collisionObb];
122899
123034
  }
122900
123035
  // 如果是 flag=2,解析并存储多个子包围盒 (min, max)
122901
- else if (it.flag === 2 && it.obb && it.obb.length > 0) {
123036
+ else if (it.flag === 2 && obbData.length > 0) {
122902
123037
  var subBoxes = [];
122903
123038
  var collisionObbs = [];
122904
- for (var k = 0; k < it.obb.length; k += 6) {
122905
- if (k + 5 < it.obb.length) {
122906
- var _min = new this.THREE.Vector3(it.obb[k], it.obb[k + 1], it.obb[k + 2]);
122907
- var _max = new this.THREE.Vector3(it.obb[k + 3], it.obb[k + 4], it.obb[k + 5]);
123039
+ for (var k = 0; k < obbData.length; k += 6) {
123040
+ if (k + 5 < obbData.length) {
123041
+ var _min = new this.THREE.Vector3(obbData[k], obbData[k + 1], obbData[k + 2]);
123042
+ var _max = new this.THREE.Vector3(obbData[k + 3], obbData[k + 4], obbData[k + 5]);
122908
123043
  subBoxes.push({
122909
123044
  min: _min,
122910
123045
  max: _max
122911
123046
  });
122912
123047
  var subBox = new this.THREE.Box3(_min.clone(), _max.clone());
122913
- var _collisionObb = new OBB_OBB().fromBox3(subBox);
122914
- if (collisionMatrix) {
122915
- _collisionObb.applyMatrix4(collisionMatrix);
122916
- }
123048
+ var _collisionObb = this._createCollisionObbFromBox(subBox, collisionMatrix);
122917
123049
  collisionObbs.push(_collisionObb);
122918
123050
  }
122919
123051
  }
@@ -122923,18 +123055,15 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122923
123055
  }
122924
123056
  }
122925
123057
  if (!userData.collisionObbs || userData.collisionObbs.length === 0) {
122926
- var _collisionObb2 = new OBB_OBB().fromBox3(sourceBox);
122927
- if (collisionMatrix) {
122928
- _collisionObb2.applyMatrix4(collisionMatrix);
122929
- }
123058
+ var _collisionObb2 = this._createCollisionObbFromBox(sourceBox, collisionMatrix);
122930
123059
  userData.collisionObbs = [_collisionObb2];
122931
123060
  }
122932
123061
  boxThree.userData = userData;
122933
- var modelId = String(it.id);
122934
- this._boxIndex.set(modelId, boxThree);
123062
+ this.upsertModelBox(modelId, boxThree);
122935
123063
  modelIds.add(modelId);
122936
123064
  }
122937
123065
  this.noObserver.documentModelIds.set(documentId, modelIds);
123066
+ this.noObserver.documentSceneBoundsIds.set(documentId, sceneBoundIds);
122938
123067
  } else {
122939
123068
  var _modelIds = this.noObserver.documentModelIds.get(documentId);
122940
123069
  if (_modelIds) {
@@ -122948,18 +123077,42 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
122948
123077
  this.hasExecutedCentering = false;
122949
123078
  }
122950
123079
  }
123080
+ var _sceneBoundIds = this.noObserver.documentSceneBoundsIds && this.noObserver.documentSceneBoundsIds.get(documentId);
123081
+ if (_sceneBoundIds) {
123082
+ _sceneBoundIds.forEach(function (id) {
123083
+ _this0._sceneBoundsIndex.delete(id);
123084
+ });
123085
+ this.noObserver.documentSceneBoundsIds.delete(documentId);
123086
+ }
122951
123087
  }
122952
123088
  this.buildOctreeFromBoxIndex();
122953
123089
  this.refreshCollisionObbDebug();
123090
+ this.refreshOcclusionBoundsDebug();
122954
123091
  console.log('time end', Date.now());
122955
123092
  },
122956
123093
  shouldApplyOcclusionByBox: function shouldApplyOcclusionByBox(box) {
122957
123094
  return !!(box && box.userData && box.userData.occlusionEnabled);
122958
123095
  },
123096
+ appendOcclusionCandidates: function appendOcclusionCandidates(candidates, modelId, box, frustum) {
123097
+ if (!box) return;
123098
+ var userData = box.userData || {};
123099
+ var proxyBoxes = Array.isArray(userData.occlusionProxyBoxes) ? userData.occlusionProxyBoxes : [box];
123100
+ for (var i = 0; i < proxyBoxes.length; i++) {
123101
+ var proxyBox = proxyBoxes[i];
123102
+ if (!proxyBox || proxyBox.userData && proxyBox.userData.visible === false) continue;
123103
+ if (frustum && !frustum.intersectsBox(proxyBox)) continue;
123104
+ candidates.push({
123105
+ modelId: modelId,
123106
+ box: proxyBox
123107
+ });
123108
+ }
123109
+ },
122959
123110
  tryInitialCenterAfterBoundsReady: function tryInitialCenterAfterBoundsReady() {
122960
123111
  if (this.hasExecutedCentering || this.userInteracting) return;
122961
123112
  if (!this.sceneBoundingBox || !this.sceneBoundingBox.isBox3 || this.sceneBoundingBox.isEmpty()) return;
122962
- if (!this._boxIndex || this._boxIndex.size === 0) return;
123113
+ var hasBoxIndex = this._boxIndex && this._boxIndex.size > 0;
123114
+ var hasSceneBoundsIndex = this._sceneBoundsIndex && this._sceneBoundsIndex.size > 0;
123115
+ if (!hasBoxIndex && !hasSceneBoundsIndex) return;
122963
123116
  this.smartModelCenter(this.sceneBoundingBox, 0);
122964
123117
  },
122965
123118
  buildOctreeFromBoxIndex: function buildOctreeFromBoxIndex() {
@@ -123065,6 +123218,45 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123065
123218
  box: box
123066
123219
  });
123067
123220
  },
123221
+ _buildCollisionOctreeFromEntries: function _buildCollisionOctreeFromEntries(entries) {
123222
+ var _this10 = this;
123223
+ if (!Array.isArray(entries) || entries.length === 0) {
123224
+ return null;
123225
+ }
123226
+ var minX = Infinity;
123227
+ var minY = Infinity;
123228
+ var minZ = Infinity;
123229
+ var maxX = -Infinity;
123230
+ var maxY = -Infinity;
123231
+ var maxZ = -Infinity;
123232
+ entries.forEach(function (item) {
123233
+ var box = item && item.box;
123234
+ if (!box || !box.isBox3) return;
123235
+ var mn = box.min;
123236
+ var mx = box.max;
123237
+ if (mn.x < minX) minX = mn.x;
123238
+ if (mn.y < minY) minY = mn.y;
123239
+ if (mn.z < minZ) minZ = mn.z;
123240
+ if (mx.x > maxX) maxX = mx.x;
123241
+ if (mx.y > maxY) maxY = mx.y;
123242
+ if (mx.z > maxZ) maxZ = mx.z;
123243
+ });
123244
+ if (minX === Infinity) {
123245
+ return null;
123246
+ }
123247
+ var rootBox = new this.THREE.Box3(new this.THREE.Vector3(minX, minY, minZ), new this.THREE.Vector3(maxX, maxY, maxZ));
123248
+ var root = {
123249
+ box: rootBox,
123250
+ items: [],
123251
+ children: null,
123252
+ depth: 0
123253
+ };
123254
+ entries.forEach(function (item) {
123255
+ if (!item || !item.box) return;
123256
+ _this10._octreeInsert(root, String(item.id), item.box);
123257
+ });
123258
+ return root;
123259
+ },
123068
123260
  _isCollisionBoxAvailable: function _isCollisionBoxAvailable(box) {
123069
123261
  if (!box || !box.isBox3 || box.isEmpty()) return false;
123070
123262
  if (box.userData && box.userData.visible === false) return false;
@@ -123189,22 +123381,22 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123189
123381
  return pairMap;
123190
123382
  },
123191
123383
  refreshCollisionObbDebug: function refreshCollisionObbDebug() {
123192
- var _this10 = this;
123384
+ var _this11 = this;
123193
123385
  if (!this.collisionObbDebugEnabled) return;
123194
123386
  var group = this._getCollisionDebugGroup();
123195
123387
  if (!group) return;
123196
123388
  this._clearCollisionObbDebugGroup(false);
123197
123389
  var pairMap = this._buildCollisionPairMap();
123198
- if (pairMap.size === 0) return;
123199
- pairMap.forEach(function (relatedIds, modelId) {
123200
- var box = _this10._boxIndex && _this10._boxIndex.has(String(modelId)) ? _this10._boxIndex.get(String(modelId)) : _this10._boxIndex && _this10._boxIndex.has(modelId) ? _this10._boxIndex.get(modelId) : null;
123201
- if (!_this10._isCollisionBoxAvailable(box)) return;
123202
- var obbs = _this10._getCollisionObbs(box);
123390
+ if (!this._boxIndex || this._boxIndex.size === 0) return;
123391
+ this._boxIndex.forEach(function (box, modelId) {
123392
+ if (!_this11._isCollisionBoxAvailable(box)) return;
123393
+ var obbs = _this11._getCollisionObbs(box);
123203
123394
  if (!obbs.length) return;
123395
+ var relatedIds = pairMap.get(String(modelId));
123204
123396
  var isColliding = relatedIds && relatedIds.size > 0;
123205
123397
  var color = isColliding ? 0xff3b30 : 0x36cfc9;
123206
123398
  for (var i = 0; i < obbs.length; i++) {
123207
- var lineSegments = _this10._createCollisionObbLineSegments(obbs[i], color);
123399
+ var lineSegments = _this11._createCollisionObbLineSegments(obbs[i], color);
123208
123400
  if (!lineSegments) continue;
123209
123401
  lineSegments.name = "".concat(COLLISION_DEBUG_GROUP_NAME, ":").concat(modelId, ":").concat(i);
123210
123402
  lineSegments.userData.modelId = modelId;
@@ -123225,6 +123417,152 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123225
123417
  this.hideCollisionObbDebug();
123226
123418
  }
123227
123419
  },
123420
+ _getOcclusionDebugGroup: function _getOcclusionDebugGroup() {
123421
+ if (!this.scene) return null;
123422
+ if (this.occlusionBoundsDebugGroup && this.occlusionBoundsDebugGroup.parent === this.scene) {
123423
+ return this.occlusionBoundsDebugGroup;
123424
+ }
123425
+ var group = new this.THREE.Group();
123426
+ group.name = OCCLUSION_DEBUG_GROUP_NAME;
123427
+ group.userData.transformControlHelper = true;
123428
+ group.userData.occlusionBoundsDebugHelper = true;
123429
+ this.scene.add(group);
123430
+ this.occlusionBoundsDebugGroup = group;
123431
+ return group;
123432
+ },
123433
+ _createOcclusionFlag1LineSegments: function _createOcclusionFlag1LineSegments(box, color) {
123434
+ var userData = box && box.userData ? box.userData : {};
123435
+ var vertices = userData.obbData;
123436
+ if (!vertices || vertices.length < 9) return null;
123437
+ var sourceGeometry = new this.THREE.BufferGeometry();
123438
+ sourceGeometry.setAttribute('position', new this.THREE.BufferAttribute(new Float32Array(vertices), 3));
123439
+ var indices = userData.indices;
123440
+ if (indices && indices.length >= 3) {
123441
+ if (indices.isBufferAttribute) {
123442
+ sourceGeometry.setIndex(indices);
123443
+ } else if (ArrayBuffer.isView(indices)) {
123444
+ sourceGeometry.setIndex(new this.THREE.BufferAttribute(indices, 1));
123445
+ } else {
123446
+ sourceGeometry.setIndex(indices);
123447
+ }
123448
+ }
123449
+ var wireframeGeometry = null;
123450
+ try {
123451
+ // flag=1 对应真实遮挡网格,必须按顶点和三角形索引绘制,不能退化成 AABB/OBB。
123452
+ wireframeGeometry = new this.THREE.WireframeGeometry(sourceGeometry);
123453
+ } catch (error) {
123454
+ console.warn('flag=1 遮挡调试线框生成失败', error);
123455
+ }
123456
+ sourceGeometry.dispose();
123457
+ if (!wireframeGeometry || wireframeGeometry.getAttribute('position').count === 0) {
123458
+ if (wireframeGeometry) wireframeGeometry.dispose();
123459
+ return null;
123460
+ }
123461
+ var material = new this.THREE.LineBasicMaterial({
123462
+ color: color,
123463
+ transparent: true,
123464
+ opacity: 0.95,
123465
+ depthTest: false,
123466
+ depthWrite: false,
123467
+ toneMapped: false
123468
+ });
123469
+ var lineSegments = new this.THREE.LineSegments(wireframeGeometry, material);
123470
+ var transformMatrix = new this.THREE.Matrix4();
123471
+ var matrixArr = userData.matrix;
123472
+ if (matrixArr && matrixArr.length >= 16) {
123473
+ transformMatrix.fromArray(matrixArr);
123474
+ }
123475
+ if (this.bizToThreeMatrix) {
123476
+ transformMatrix.premultiply(this.bizToThreeMatrix);
123477
+ }
123478
+ lineSegments.matrixAutoUpdate = false;
123479
+ lineSegments.matrix.copy(transformMatrix);
123480
+ lineSegments.matrixWorldNeedsUpdate = true;
123481
+ lineSegments.renderOrder = 998;
123482
+ lineSegments.userData.transformControlHelper = true;
123483
+ lineSegments.userData.occlusionBoundsDebugHelper = true;
123484
+ lineSegments.userData.occlusionFlag = 1;
123485
+ return lineSegments;
123486
+ },
123487
+ _createOcclusionBoxLineSegments: function _createOcclusionBoxLineSegments(obb, color, flag) {
123488
+ var lineSegments = this._createCollisionObbLineSegments(obb, color);
123489
+ if (!lineSegments) return null;
123490
+ lineSegments.renderOrder = 998;
123491
+ lineSegments.userData.collisionObbDebugHelper = false;
123492
+ lineSegments.userData.occlusionBoundsDebugHelper = true;
123493
+ lineSegments.userData.occlusionFlag = flag;
123494
+ return lineSegments;
123495
+ },
123496
+ _clearOcclusionBoundsDebugGroup: function _clearOcclusionBoundsDebugGroup() {
123497
+ var removeGroup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
123498
+ var group = this.occlusionBoundsDebugGroup;
123499
+ if (!group) return;
123500
+ while (group.children.length > 0) {
123501
+ var child = group.children[group.children.length - 1];
123502
+ group.remove(child);
123503
+ if (child.geometry) child.geometry.dispose();
123504
+ if (Array.isArray(child.material)) {
123505
+ child.material.forEach(function (material) {
123506
+ return material && material.dispose();
123507
+ });
123508
+ } else if (child.material) {
123509
+ child.material.dispose();
123510
+ }
123511
+ }
123512
+ if (removeGroup && this.scene && group.parent === this.scene) {
123513
+ this.scene.remove(group);
123514
+ this.occlusionBoundsDebugGroup = null;
123515
+ } else if (!this.scene) {
123516
+ this.occlusionBoundsDebugGroup = null;
123517
+ }
123518
+ },
123519
+ hideOcclusionBoundsDebug: function hideOcclusionBoundsDebug() {
123520
+ this._clearOcclusionBoundsDebugGroup();
123521
+ this.occlusionBoundsDebugEnabled = false;
123522
+ },
123523
+ refreshOcclusionBoundsDebug: function refreshOcclusionBoundsDebug() {
123524
+ var _this12 = this;
123525
+ if (!this.occlusionBoundsDebugEnabled) return;
123526
+ var group = this._getOcclusionDebugGroup();
123527
+ if (!group) return;
123528
+ this._clearOcclusionBoundsDebugGroup(false);
123529
+ if (!this._boxIndex || this._boxIndex.size === 0) return;
123530
+ this._boxIndex.forEach(function (box, modelId) {
123531
+ if (!_this12._isCollisionBoxAvailable(box) || !_this12.shouldApplyOcclusionByBox(box)) return;
123532
+ var userData = box.userData || {};
123533
+ var flag = Number(userData.flag) || 1;
123534
+ var color = OCCLUSION_DEBUG_FLAG_COLORS[flag];
123535
+ if (!color) return;
123536
+ if (flag === 1) {
123537
+ var lineSegments = _this12._createOcclusionFlag1LineSegments(box, color);
123538
+ if (!lineSegments) return;
123539
+ lineSegments.name = "".concat(OCCLUSION_DEBUG_GROUP_NAME, ":").concat(modelId, ":flag-1");
123540
+ lineSegments.userData.modelId = modelId;
123541
+ group.add(lineSegments);
123542
+ return;
123543
+ }
123544
+ var obbs = _this12._getCollisionObbs(box);
123545
+ for (var i = 0; i < obbs.length; i++) {
123546
+ var _lineSegments = _this12._createOcclusionBoxLineSegments(obbs[i], color, flag);
123547
+ if (!_lineSegments) continue;
123548
+ _lineSegments.name = "".concat(OCCLUSION_DEBUG_GROUP_NAME, ":").concat(modelId, ":flag-").concat(flag, ":").concat(i);
123549
+ _lineSegments.userData.modelId = modelId;
123550
+ group.add(_lineSegments);
123551
+ }
123552
+ });
123553
+ },
123554
+ showOcclusionBoundsDebug: function showOcclusionBoundsDebug() {
123555
+ this.occlusionBoundsDebugEnabled = true;
123556
+ this.refreshOcclusionBoundsDebug();
123557
+ },
123558
+ toggleOcclusionBoundsDebug: function toggleOcclusionBoundsDebug(forceVisible) {
123559
+ var nextVisible = typeof forceVisible === 'boolean' ? forceVisible : !this.occlusionBoundsDebugEnabled;
123560
+ if (nextVisible) {
123561
+ this.showOcclusionBoundsDebug();
123562
+ } else {
123563
+ this.hideOcclusionBoundsDebug();
123564
+ }
123565
+ },
123228
123566
  _getObbAxisInfo: function _getObbAxisInfo(obb) {
123229
123567
  var xAxis = new this.THREE.Vector3();
123230
123568
  var yAxis = new this.THREE.Vector3();
@@ -123240,7 +123578,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123240
123578
  return axisInfo.halfSizes[0] * Math.abs(axis.dot(axisInfo.axes[0])) + axisInfo.halfSizes[1] * Math.abs(axis.dot(axisInfo.axes[1])) + axisInfo.halfSizes[2] * Math.abs(axis.dot(axisInfo.axes[2]));
123241
123579
  },
123242
123580
  _getObbMinPenetration: function _getObbMinPenetration(obbA, obbB) {
123243
- var _this11 = this;
123581
+ var _this13 = this;
123244
123582
  var axisInfoA = this._getObbAxisInfo(obbA);
123245
123583
  var axisInfoB = this._getObbAxisInfo(obbB);
123246
123584
  var centerDelta = new this.THREE.Vector3().subVectors(axisInfoB.center, axisInfoA.center);
@@ -123250,7 +123588,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123250
123588
  if (lengthSq <= COLLISION_OBB_AXIS_EPSILON) return true;
123251
123589
  var normalizedAxis = axis.clone().multiplyScalar(1 / Math.sqrt(lengthSq));
123252
123590
  var projectionDistance = Math.abs(centerDelta.dot(normalizedAxis));
123253
- var penetration = _this11._getObbProjectionRadius(axisInfoA, normalizedAxis) + _this11._getObbProjectionRadius(axisInfoB, normalizedAxis) - projectionDistance;
123591
+ var penetration = _this13._getObbProjectionRadius(axisInfoA, normalizedAxis) + _this13._getObbProjectionRadius(axisInfoB, normalizedAxis) - projectionDistance;
123254
123592
  if (penetration <= 0) {
123255
123593
  minPenetration = penetration;
123256
123594
  return false;
@@ -123281,16 +123619,15 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123281
123619
  var obbsB = this._getCollisionObbs(boxB);
123282
123620
  for (var i = 0; i < obbsA.length; i++) {
123283
123621
  for (var j = 0; j < obbsB.length; j++) {
123284
- if (this._getObbMinPenetration(obbsA[i], obbsB[j]) > COLLISION_PENETRATION_EPSILON) {
123622
+ if (this._getObbMinPenetration(obbsA[i], obbsB[j]) >= COLLISION_CONTACT_EPSILON) {
123285
123623
  return true;
123286
123624
  }
123287
123625
  }
123288
123626
  }
123289
123627
  return false;
123290
123628
  },
123291
- _queryOctreeByBox: function _queryOctreeByBox(box) {
123629
+ _queryOctreeByBoxWithRoot: function _queryOctreeByBoxWithRoot(root, box) {
123292
123630
  var results = [];
123293
- var root = this._octree;
123294
123631
  if (!root || !this._isCollisionBoxAvailable(box)) return results;
123295
123632
  var stack = [root];
123296
123633
  while (stack.length) {
@@ -123312,29 +123649,95 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123312
123649
  }
123313
123650
  return results;
123314
123651
  },
123652
+ _queryOctreeByBox: function _queryOctreeByBox(box) {
123653
+ return this._queryOctreeByBoxWithRoot(this._octree, box);
123654
+ },
123315
123655
  getOctreeCollisionPairs: function getOctreeCollisionPairs() {
123316
- var _this12 = this;
123656
+ var _this14 = this;
123657
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
123317
123658
  var pairs = [];
123318
123659
  if (!this._boxIndex || this._boxIndex.size === 0) return {
123319
123660
  pairs: pairs
123320
123661
  };
123321
- if (!this._octree) {
123322
- this.buildOctreeFromBoxIndex();
123323
- }
123324
- if (!this._octree) return {
123325
- pairs: pairs
123662
+ var normalizeIds = function normalizeIds(value) {
123663
+ return Array.isArray(value) ? Array.from(new Set(value.map(function (item) {
123664
+ return item === null || item === undefined ? '' : String(item);
123665
+ }).filter(function (item) {
123666
+ return item !== '';
123667
+ }))) : [];
123326
123668
  };
123327
- this._boxIndex.forEach(function (boxA, idA) {
123328
- if (!_this12._isCollisionBoxAvailable(boxA)) return;
123329
- var hits = _this12._queryOctreeByBox(boxA);
123669
+ var getEntriesByIds = function getEntriesByIds(ids) {
123670
+ var entries = [];
123671
+ var idSet = new Set(ids);
123672
+ _this14._boxIndex.forEach(function (box, id) {
123673
+ var key = String(id);
123674
+ if (idSet.has(key)) {
123675
+ entries.push({
123676
+ id: key,
123677
+ box: box
123678
+ });
123679
+ }
123680
+ });
123681
+ return entries;
123682
+ };
123683
+ var sourceIds = normalizeIds(options.sourceIds);
123684
+ var targetIds = normalizeIds(options.targetIds);
123685
+ var includeIds = Array.isArray(options.includeIds) ? normalizeIds(options.includeIds) : [];
123686
+ var root = this._octree;
123687
+ var sourceEntries = [];
123688
+ var dedupePairKeySet = null;
123689
+ if (sourceIds.length > 0 && targetIds.length > 0) {
123690
+ var targetEntries = getEntriesByIds(targetIds);
123691
+ sourceEntries = getEntriesByIds(sourceIds);
123692
+ if (sourceEntries.length === 0 || targetEntries.length === 0) return {
123693
+ pairs: pairs
123694
+ };
123695
+ root = this._buildCollisionOctreeFromEntries(targetEntries);
123696
+ if (!root) return {
123697
+ pairs: pairs
123698
+ };
123699
+ dedupePairKeySet = new Set();
123700
+ } else if (includeIds.length > 0) {
123701
+ sourceEntries = getEntriesByIds(includeIds);
123702
+ if (sourceEntries.length === 0) return {
123703
+ pairs: pairs
123704
+ };
123705
+ root = this._buildCollisionOctreeFromEntries(sourceEntries);
123706
+ if (!root) return {
123707
+ pairs: pairs
123708
+ };
123709
+ } else {
123710
+ if (!this._octree) {
123711
+ this.buildOctreeFromBoxIndex();
123712
+ }
123713
+ if (!this._octree) return {
123714
+ pairs: pairs
123715
+ };
123716
+ this._boxIndex.forEach(function (box, id) {
123717
+ sourceEntries.push({
123718
+ id: String(id),
123719
+ box: box
123720
+ });
123721
+ });
123722
+ }
123723
+ sourceEntries.forEach(function (_ref) {
123724
+ var idA = _ref.id,
123725
+ boxA = _ref.box;
123726
+ if (!_this14._isCollisionBoxAvailable(boxA)) return;
123727
+ var hits = _this14._queryOctreeByBoxWithRoot(root, boxA);
123330
123728
  for (var i = 0; i < hits.length; i++) {
123331
123729
  var item = hits[i];
123332
123730
  if (!item || String(item.id) === String(idA)) continue;
123333
123731
  var boxB = item.box;
123334
- if (!_this12._isCollisionBoxMatched(boxA, boxB)) continue;
123732
+ if (!_this14._isCollisionBoxMatched(boxA, boxB)) continue;
123733
+ if (dedupePairKeySet) {
123734
+ var pairKey = "".concat(String(idA), "__").concat(String(item.id));
123735
+ if (dedupePairKeySet.has(pairKey)) continue;
123736
+ dedupePairKeySet.add(pairKey);
123737
+ }
123335
123738
  pairs.push({
123336
- idA: _this12._formatCollisionPairId(idA),
123337
- idB: _this12._formatCollisionPairId(item.id)
123739
+ idA: _this14._formatCollisionPairId(idA),
123740
+ idB: _this14._formatCollisionPairId(item.id)
123338
123741
  });
123339
123742
  }
123340
123743
  });
@@ -123471,7 +123874,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123471
123874
  * @returns {Object|null} { planeBox: THREE.Box3|null, frustumBox: THREE.Box3, frustumY: {min, max} } 或 null(当没有平面交点且未请求 frustumY)
123472
123875
  */
123473
123876
  getScreenPlaneBounds: function getScreenPlaneBounds(camera, width, height, plane) {
123474
- var _this13 = this;
123877
+ var _this15 = this;
123475
123878
  var opts = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
123476
123879
  var _opts$includeFrustumY = opts.includeFrustumY,
123477
123880
  includeFrustumY = _opts$includeFrustumY === void 0 ? false : _opts$includeFrustumY;
@@ -123516,7 +123919,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123516
123919
  var volumeCorners = nearCorners.concat(farCorners);
123517
123920
  var projectedPoints = volumeCorners.map(function (p) {
123518
123921
  var yProj = -(a * p.x + c * p.z + d) / b;
123519
- return new _this13.THREE.Vector3(p.x, yProj, p.z);
123922
+ return new _this15.THREE.Vector3(p.x, yProj, p.z);
123520
123923
  });
123521
123924
  planeBox = new this.THREE.Box3().setFromPoints(projectedPoints);
123522
123925
  }
@@ -123746,14 +124149,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123746
124149
  * 执行视椎体裁切,清理视椎体外的InstancedMesh实例
123747
124150
  */
123748
124151
  performFrustumCulling: function performFrustumCulling() {
123749
- var _this14 = this;
124152
+ var _arguments = arguments,
124153
+ _this16 = this;
123750
124154
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee3() {
123751
- var modelState, now, globalFrustum, globalVpMatrix, toUnload, bypassList, visibleIds, candidates, visibleIdSet, frustum, exclude, hits, i, occlusionState, occlusionEnabled, state, w, h, aspectRatio, sw, sh, rt, t0, opaqueCandidates, transparentCandidates, _i5, totalInstances, transparentTotal, activeIdIndexArr, transparentIdIndexArr, occObjs, asyncBuildEnabled, _occBuild, asyncState, token, opaqueSnapshot, transparentMesh, transparentCapacity, nextCap, geometry, material, tempMatrix, tempScale, tempObj, tempColor, tIdx, _i0, c, idx, r, g, b, _c$box$userData$obb, matrix, halfSize, tMaxIdx, prevToneMapping, prevTarget, prevClearColorHex, prevClearAlpha, _c3, cvs, cssW, cssH, dst, src, row, srcRow, dstRow, idIndexArr, maxIdx, totalPixels, targetSamples, baseStride, extraStride, stride, minSampleCount, scanResult, indices, _i1, id, transparentMaxIdx, tIdIndexArr, tScanResult, tIndices, _i10, _id, _i11, _i12, toLoadSet, parentsToCheck, _i15, _toUnload, _toUnload$_i, modelId, child, _t2;
124155
+ var options, skipUnload, modelState, now, globalFrustum, globalVpMatrix, toUnload, bypassList, visibleIds, candidates, visibleIdSet, frustum, exclude, hits, i, occlusionState, occlusionEnabled, state, w, h, aspectRatio, sw, sh, rt, t0, opaqueCandidates, transparentCandidates, _i5, totalInstances, transparentTotal, activeIdIndexArr, transparentIdIndexArr, occObjs, asyncBuildEnabled, _occBuild, asyncState, token, opaqueSnapshot, transparentMesh, transparentCapacity, nextCap, geometry, material, tempMatrix, tempScale, tempObj, tempColor, tIdx, _i0, c, idx, r, g, b, _c$box$userData$obb, matrix, halfSize, tMaxIdx, prevToneMapping, prevTarget, prevClearColorHex, prevClearAlpha, _c3, cvs, cssW, cssH, dst, src, row, srcRow, dstRow, idIndexArr, maxIdx, totalPixels, targetSamples, baseStride, extraStride, stride, minSampleCount, scanResult, indices, _i1, id, transparentMaxIdx, tIdIndexArr, tScanResult, tIndices, _i10, _id, _i11, _i12, toLoadSet, parentsToCheck, _i15, _toUnload, _toUnload$_i, modelId, child, _t2;
123752
124156
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context3) {
123753
124157
  while (1) switch (_context3.p = _context3.n) {
123754
124158
  case 0:
123755
- modelState = _this14.noObserver ? _this14.noObserver.modelStateManager : _this14.modelStateManager;
123756
- if (!(!_this14.modelStateManager.frustumCheckEnabled || !_this14.scene)) {
124159
+ options = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : {};
124160
+ skipUnload = !!(options && options.skipUnload);
124161
+ modelState = _this16.noObserver ? _this16.noObserver.modelStateManager : _this16.modelStateManager;
124162
+ if (!(!_this16.modelStateManager.frustumCheckEnabled || !_this16.scene)) {
123757
124163
  _context3.n = 1;
123758
124164
  break;
123759
124165
  }
@@ -123769,10 +124175,10 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123769
124175
  modelState.lastCullingTime = now;
123770
124176
 
123771
124177
  // 预先创建视椎体,供后续遍历复用
123772
- if (!_this14._frustum) _this14._frustum = new _this14.THREE.Frustum();
123773
- if (!_this14._vpMatrix) _this14._vpMatrix = new _this14.THREE.Matrix4();
123774
- globalFrustum = _this14._frustum;
123775
- globalVpMatrix = _this14._vpMatrix.multiplyMatrices(_this14.camera.projectionMatrix, _this14.camera.matrixWorldInverse);
124178
+ if (!_this16._frustum) _this16._frustum = new _this16.THREE.Frustum();
124179
+ if (!_this16._vpMatrix) _this16._vpMatrix = new _this16.THREE.Matrix4();
124180
+ globalFrustum = _this16._frustum;
124181
+ globalVpMatrix = _this16._vpMatrix.multiplyMatrices(_this16.camera.projectionMatrix, _this16.camera.matrixWorldInverse);
123776
124182
  globalFrustum.setFromProjectionMatrix(globalVpMatrix);
123777
124183
 
123778
124184
  // 使用局部变量收集 ID,最后一次性赋值
@@ -123786,13 +124192,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123786
124192
  });
123787
124193
  }
123788
124194
  visibleIdSet = new Set(visibleIds);
123789
- if (!_this14._octree) {
124195
+ if (!_this16._octree) {
123790
124196
  _context3.n = 8;
123791
124197
  break;
123792
124198
  }
123793
- frustum = _this14._getCurrentFrustum();
124199
+ frustum = _this16._getCurrentFrustum();
123794
124200
  exclude = bypassList || new Set();
123795
- hits = _this14.queryOctreeByFrustum(frustum, exclude);
124201
+ hits = _this16.queryOctreeByFrustum(frustum, exclude);
123796
124202
  i = 0;
123797
124203
  case 3:
123798
124204
  if (!(i < hits.length)) {
@@ -123805,14 +124211,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123805
124211
  }
123806
124212
  return _context3.a(3, 6);
123807
124213
  case 4:
123808
- if (_this14.shouldApplyOcclusionByBox(hits[i].box)) {
124214
+ if (_this16.shouldApplyOcclusionByBox(hits[i].box)) {
123809
124215
  _context3.n = 5;
123810
124216
  break;
123811
124217
  }
123812
- visibleIdSet.add(_this14.formatModelId(hits[i].modelId));
124218
+ visibleIdSet.add(_this16.formatModelId(hits[i].modelId));
123813
124219
  return _context3.a(3, 6);
123814
124220
  case 5:
123815
- candidates.push(hits[i]);
124221
+ _this16.appendOcclusionCandidates(candidates, hits[i].modelId, hits[i].box, globalFrustum);
123816
124222
  case 6:
123817
124223
  i++;
123818
124224
  _context3.n = 3;
@@ -123821,35 +124227,32 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123821
124227
  _context3.n = 9;
123822
124228
  break;
123823
124229
  case 8:
123824
- if (_this14._boxIndex && _this14._boxIndex.size > 0) {
123825
- _this14._boxIndex.forEach(function (box, modelId) {
124230
+ if (_this16._boxIndex && _this16._boxIndex.size > 0) {
124231
+ _this16._boxIndex.forEach(function (box, modelId) {
123826
124232
  if (bypassList && bypassList.size > 0 && bypassList.has(modelId)) return;
123827
124233
  if (box.userData && box.userData.visible === false) return;
123828
- if (_this14.isBoxInFrustum(box)) {
123829
- if (!_this14.shouldApplyOcclusionByBox(box)) {
123830
- visibleIdSet.add(_this14.formatModelId(modelId));
124234
+ if (_this16.isBoxInFrustum(box)) {
124235
+ if (!_this16.shouldApplyOcclusionByBox(box)) {
124236
+ visibleIdSet.add(_this16.formatModelId(modelId));
123831
124237
  return;
123832
124238
  }
123833
- candidates.push({
123834
- modelId: modelId,
123835
- box: box
123836
- });
124239
+ _this16.appendOcclusionCandidates(candidates, modelId, box, globalFrustum);
123837
124240
  }
123838
124241
  });
123839
124242
  }
123840
124243
  case 9:
123841
- occlusionState = _this14.noObserver ? _this14.noObserver.occlusionState : _this14.occlusionState; // 从响应式对象获取开关状态
123842
- occlusionEnabled = _this14.occlusionState && _this14.occlusionState.enabled;
124244
+ occlusionState = _this16.noObserver ? _this16.noObserver.occlusionState : _this16.occlusionState; // 从响应式对象获取开关状态
124245
+ occlusionEnabled = _this16.occlusionState && _this16.occlusionState.enabled;
123843
124246
  if (!occlusionEnabled) {
123844
124247
  _context3.n = 16;
123845
124248
  break;
123846
124249
  }
123847
124250
  state = occlusionState;
123848
- w = _this14.renderer && _this14.renderer.domElement ? _this14.renderer.domElement.clientWidth || _this14.renderer.domElement.width || 0 : 0;
123849
- h = _this14.renderer && _this14.renderer.domElement ? _this14.renderer.domElement.clientHeight || _this14.renderer.domElement.height || 0 : 0; // bufferWidth/Height 仍从响应式对象读取以支持动态修改
124251
+ w = _this16.renderer && _this16.renderer.domElement ? _this16.renderer.domElement.clientWidth || _this16.renderer.domElement.width || 0 : 0;
124252
+ h = _this16.renderer && _this16.renderer.domElement ? _this16.renderer.domElement.clientHeight || _this16.renderer.domElement.height || 0 : 0; // bufferWidth/Height 仍从响应式对象读取以支持动态修改
123850
124253
  // 性能优化:使用降采样缓冲区进行遮挡剔除,大幅减少 readPixels 耗时 (从全屏降至约 256px 宽)
123851
124254
  aspectRatio = h > 0 ? w / h : 1;
123852
- sw = _this14.occlusionState.bufferWidth || 256;
124255
+ sw = _this16.occlusionState.bufferWidth || 256;
123853
124256
  sh = Math.floor(sw / aspectRatio);
123854
124257
  sw = Math.max(1, sw);
123855
124258
  sh = Math.max(1, sh);
@@ -123858,16 +124261,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123858
124261
  _context3.p = 10;
123859
124262
  if (!rt || state._rtW !== sw || state._rtH !== sh) {
123860
124263
  if (rt && typeof rt.dispose === 'function') rt.dispose();
123861
- rt = new _this14.THREE.WebGLRenderTarget(sw, sh, {
124264
+ rt = new _this16.THREE.WebGLRenderTarget(sw, sh, {
123862
124265
  depthBuffer: true,
123863
124266
  stencilBuffer: false,
123864
124267
  samples: 0
123865
124268
  });
123866
- rt.texture.minFilter = _this14.THREE.NearestFilter;
123867
- rt.texture.magFilter = _this14.THREE.NearestFilter;
124269
+ rt.texture.minFilter = _this16.THREE.NearestFilter;
124270
+ rt.texture.magFilter = _this16.THREE.NearestFilter;
123868
124271
  rt.texture.generateMipmaps = false;
123869
- rt.texture.type = _this14.THREE.UnsignedByteType;
123870
- rt.texture.format = _this14.THREE.RGBAFormat;
124272
+ rt.texture.type = _this16.THREE.UnsignedByteType;
124273
+ rt.texture.format = _this16.THREE.RGBAFormat;
123871
124274
  rt.samples = 0;
123872
124275
  state._colorRT = rt;
123873
124276
  state._rtW = sw;
@@ -123876,7 +124279,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123876
124279
  } else if (!state._colorBuffer || state._colorBuffer.length !== sw * sh * 4) {
123877
124280
  state._colorBuffer = new Uint8Array(sw * sh * 4);
123878
124281
  }
123879
- if (!state._occScene) state._occScene = new _this14.THREE.Scene();
124282
+ if (!state._occScene) state._occScene = new _this16.THREE.Scene();
123880
124283
  // if (!state._occPerfStats) state._occPerfStats = Object.create(null);
123881
124284
  // const _occRecordPerf = (name, ms, meta) => {
123882
124285
  // const this.stats = state._occPerfStats;
@@ -123925,10 +124328,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123925
124328
  // child.parent = null;
123926
124329
  // // child.dispatchEvent({ type: 'removed' }); // 保持轻量,暂不触发事件
123927
124330
  // }
123928
- asyncBuildEnabled = _this14.occlusionState && _this14.occlusionState.asyncBuildEnabled && !!window.requestAnimationFrame;
124331
+ asyncBuildEnabled = _this16.occlusionState && _this16.occlusionState.asyncBuildEnabled && !!window.requestAnimationFrame;
123929
124332
  _occBuild = function _occBuild(opaqueList) {
123930
124333
  var tBuild0 = performance.now();
123931
124334
  var flag1Items = [];
124335
+ var flag2Items = [];
123932
124336
  var flag3Items = [];
123933
124337
  var globalIdx = 1;
123934
124338
  for (var _i6 = 0; _i6 < opaqueList.length; _i6++) {
@@ -123936,13 +124340,18 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123936
124340
  var obbData = c.box && c.box.userData ? c.box.userData.obbData : null;
123937
124341
  if (!obbData || !obbData.length) continue;
123938
124342
  var idx = globalIdx++;
123939
- activeIdIndexArr[idx] = _this14.formatModelId(c.modelId);
124343
+ activeIdIndexArr[idx] = _this16.formatModelId(c.modelId);
123940
124344
  var flag = c.box.userData && c.box.userData.flag || 1;
123941
124345
  if (flag === 3 && c.box.userData && c.box.userData.obb) {
123942
124346
  flag3Items.push({
123943
124347
  c: c,
123944
124348
  idx: idx
123945
124349
  });
124350
+ } else if (flag === 2) {
124351
+ flag2Items.push({
124352
+ c: c,
124353
+ idx: idx
124354
+ });
123946
124355
  } else if (flag === 1) {
123947
124356
  flag1Items.push({
123948
124357
  c: c,
@@ -123952,13 +124361,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123952
124361
  }
123953
124362
  var maxIdx = globalIdx - 1;
123954
124363
  activeIdIndexArr.length = maxIdx + 1;
123955
- var _tempMatrix = occObjs._tempMatrix || (occObjs._tempMatrix = new _this14.THREE.Matrix4());
123956
- var _tempColor = occObjs._tempColor || (occObjs._tempColor = new _this14.THREE.Color());
123957
- var _tempScale = occObjs._tempScale || (occObjs._tempScale = new _this14.THREE.Vector3());
123958
- var _tempVec3 = occObjs._tempVec3 || (occObjs._tempVec3 = new _this14.THREE.Vector3());
123959
- var _tempMatA = occObjs._tempMatA || (occObjs._tempMatA = new _this14.THREE.Matrix4());
124364
+ var _tempMatrix = occObjs._tempMatrix || (occObjs._tempMatrix = new _this16.THREE.Matrix4());
124365
+ var _tempColor = occObjs._tempColor || (occObjs._tempColor = new _this16.THREE.Color());
124366
+ var _tempScale = occObjs._tempScale || (occObjs._tempScale = new _this16.THREE.Vector3());
124367
+ var _tempVec3 = occObjs._tempVec3 || (occObjs._tempVec3 = new _this16.THREE.Vector3());
124368
+ var _tempMatA = occObjs._tempMatA || (occObjs._tempMatA = new _this16.THREE.Matrix4());
123960
124369
  var boxes = occObjs.boxes;
123961
- var boxCount = flag3Items.length;
124370
+ var boxItems = flag3Items.concat(flag2Items);
124371
+ var boxCount = boxItems.length;
123962
124372
  if (boxCount > 0) {
123963
124373
  var needCapacity = boxCount;
123964
124374
  var capacity = boxes && typeof boxes.capacity === 'number' ? boxes.capacity : 0;
@@ -123969,16 +124379,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123969
124379
  if (boxes.mesh.material) boxes.mesh.material.dispose();
123970
124380
  }
123971
124381
  var nextCap = Math.max(needCapacity, capacity > 0 ? capacity * 2 : 256);
123972
- var geometry = new _this14.THREE.BoxGeometry(1, 1, 1);
123973
- var mat = new _this14.THREE.MeshBasicMaterial({
124382
+ var geometry = new _this16.THREE.BoxGeometry(1, 1, 1);
124383
+ var mat = new _this16.THREE.MeshBasicMaterial({
123974
124384
  color: 0xffffff,
123975
- side: _this14.THREE.DoubleSide,
123976
- blending: _this14.THREE.NoBlending,
124385
+ side: _this16.THREE.DoubleSide,
124386
+ blending: _this16.THREE.NoBlending,
123977
124387
  depthTest: true,
123978
124388
  depthWrite: true,
123979
124389
  toneMapped: false
123980
124390
  });
123981
- var mesh = new _this14.THREE.InstancedMesh(geometry, mat, nextCap);
124391
+ var mesh = new _this16.THREE.InstancedMesh(geometry, mat, nextCap);
123982
124392
  mesh.frustumCulled = false;
123983
124393
  mesh.matrixAutoUpdate = false;
123984
124394
  state._occScene.add(mesh);
@@ -123991,20 +124401,25 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
123991
124401
  }
123992
124402
  boxes.mesh.count = boxCount;
123993
124403
  for (var _i7 = 0; _i7 < boxCount; _i7++) {
123994
- var item = flag3Items[_i7];
123995
- var _item$c$box$userData$ = item.c.box.userData.obb,
123996
- matrix = _item$c$box$userData$.matrix,
123997
- halfSize = _item$c$box$userData$.halfSize;
124404
+ var item = boxItems[_i7];
123998
124405
  var _idx = item.idx;
123999
124406
  var r = (_idx & 255) / 255;
124000
124407
  var g = (_idx >> 8 & 255) / 255;
124001
124408
  var b = (_idx >> 16 & 255) / 255;
124002
124409
  _tempColor.setRGB(r, g, b);
124003
- _tempScale.copy(halfSize).multiplyScalar(2);
124004
- _tempMatrix.copy(matrix);
124005
- _tempMatrix.scale(_tempScale);
124006
- if (typeof _this14.bizToThreeMatrix !== 'undefined' && _this14.bizToThreeMatrix) {
124007
- _tempMatrix.premultiply(_this14.bizToThreeMatrix);
124410
+ var obb = item.c.box.userData && item.c.box.userData.obb;
124411
+ if (obb) {
124412
+ _tempScale.copy(obb.halfSize).multiplyScalar(2);
124413
+ _tempMatrix.copy(obb.matrix);
124414
+ _tempMatrix.scale(_tempScale);
124415
+ if (typeof _this16.bizToThreeMatrix !== 'undefined' && _this16.bizToThreeMatrix) {
124416
+ _tempMatrix.premultiply(_this16.bizToThreeMatrix);
124417
+ }
124418
+ } else {
124419
+ item.c.box.getSize(_tempScale);
124420
+ item.c.box.getCenter(_tempVec3);
124421
+ _tempMatrix.makeTranslation(_tempVec3.x, _tempVec3.y, _tempVec3.z);
124422
+ _tempMatrix.scale(_tempScale);
124008
124423
  }
124009
124424
  boxes.mesh.setMatrixAt(_i7, _tempMatrix);
124010
124425
  boxes.mesh.setColorAt(_i7, _tempColor);
@@ -124033,16 +124448,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124033
124448
  var needIdx = totalIdx;
124034
124449
  var ensureBatch1 = function ensureBatch1() {
124035
124450
  if (batch1 && batch1.mesh && batch1.geometry && batch1.material) return;
124036
- var geometry = new _this14.THREE.BufferGeometry();
124037
- var material = new _this14.THREE.MeshBasicMaterial({
124451
+ var geometry = new _this16.THREE.BufferGeometry();
124452
+ var material = new _this16.THREE.MeshBasicMaterial({
124038
124453
  vertexColors: true,
124039
- side: _this14.THREE.DoubleSide,
124040
- blending: _this14.THREE.NoBlending,
124454
+ side: _this16.THREE.DoubleSide,
124455
+ blending: _this16.THREE.NoBlending,
124041
124456
  depthTest: true,
124042
124457
  depthWrite: true,
124043
124458
  toneMapped: false
124044
124459
  });
124045
- var mesh = new _this14.THREE.Mesh(geometry, material);
124460
+ var mesh = new _this16.THREE.Mesh(geometry, material);
124046
124461
  mesh.frustumCulled = false;
124047
124462
  batch1 = occObjs.batch1 = {
124048
124463
  mesh: mesh,
@@ -124066,14 +124481,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124066
124481
  batch1.positions = _positions;
124067
124482
  batch1.colors = _colors;
124068
124483
  batch1.indices = _indices2;
124069
- var _posAttr = new _this14.THREE.BufferAttribute(_positions, 3);
124070
- var _colAttr = new _this14.THREE.BufferAttribute(_colors, 3);
124071
- _posAttr.setUsage(_this14.THREE.DynamicDrawUsage);
124072
- _colAttr.setUsage(_this14.THREE.DynamicDrawUsage);
124484
+ var _posAttr = new _this16.THREE.BufferAttribute(_positions, 3);
124485
+ var _colAttr = new _this16.THREE.BufferAttribute(_colors, 3);
124486
+ _posAttr.setUsage(_this16.THREE.DynamicDrawUsage);
124487
+ _colAttr.setUsage(_this16.THREE.DynamicDrawUsage);
124073
124488
  batch1.geometry.setAttribute('position', _posAttr);
124074
124489
  batch1.geometry.setAttribute('color', _colAttr);
124075
- var _idxAttr = new _this14.THREE.BufferAttribute(_indices2, 1);
124076
- _idxAttr.setUsage(_this14.THREE.DynamicDrawUsage);
124490
+ var _idxAttr = new _this16.THREE.BufferAttribute(_indices2, 1);
124491
+ _idxAttr.setUsage(_this16.THREE.DynamicDrawUsage);
124077
124492
  batch1.geometry.setIndex(_idxAttr);
124078
124493
  }
124079
124494
  var positions = batch1.positions;
@@ -124093,15 +124508,15 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124093
124508
  var _g = (_idx2 >> 8 & 255) / 255;
124094
124509
  var _b = (_idx2 >> 16 & 255) / 255;
124095
124510
  var vertexCount = _obbData2.length / 3 | 0;
124096
- var needTransform = matrixArr && matrixArr.length >= 16 || typeof _this14.bizToThreeMatrix !== 'undefined' && _this14.bizToThreeMatrix;
124511
+ var needTransform = matrixArr && matrixArr.length >= 16 || typeof _this16.bizToThreeMatrix !== 'undefined' && _this16.bizToThreeMatrix;
124097
124512
  if (needTransform) {
124098
124513
  if (matrixArr && matrixArr.length >= 16) {
124099
124514
  _tempMatA.fromArray(matrixArr);
124100
124515
  } else {
124101
124516
  _tempMatA.identity();
124102
124517
  }
124103
- if (typeof _this14.bizToThreeMatrix !== 'undefined' && _this14.bizToThreeMatrix) {
124104
- _tempMatA.premultiply(_this14.bizToThreeMatrix);
124518
+ if (typeof _this16.bizToThreeMatrix !== 'undefined' && _this16.bizToThreeMatrix) {
124519
+ _tempMatA.premultiply(_this16.bizToThreeMatrix);
124105
124520
  }
124106
124521
  }
124107
124522
  if (!needTransform && ArrayBuffer.isView(_obbData2)) {
@@ -124201,7 +124616,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124201
124616
  state._occMaxIdx = 0;
124202
124617
  activeIdIndexArr.length = 0;
124203
124618
  }
124204
- if (!state._occTransparentScene) state._occTransparentScene = new _this14.THREE.Scene();
124619
+ if (!state._occTransparentScene) state._occTransparentScene = new _this16.THREE.Scene();
124205
124620
  transparentMesh = state._occTransparentMesh;
124206
124621
  transparentCapacity = transparentMesh && transparentMesh.userData && typeof transparentMesh.userData.capacity === 'number' ? transparentMesh.userData.capacity : 0;
124207
124622
  if (!transparentMesh || transparentCapacity < transparentTotal) {
@@ -124211,16 +124626,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124211
124626
  state._occTransparentScene.remove(transparentMesh);
124212
124627
  }
124213
124628
  nextCap = Math.max(transparentTotal, transparentCapacity > 0 ? transparentCapacity * 2 : 256);
124214
- geometry = new _this14.THREE.BoxGeometry(1, 1, 1);
124215
- material = new _this14.THREE.MeshBasicMaterial({
124629
+ geometry = new _this16.THREE.BoxGeometry(1, 1, 1);
124630
+ material = new _this16.THREE.MeshBasicMaterial({
124216
124631
  color: 0xffffff,
124217
- side: _this14.THREE.DoubleSide,
124218
- blending: _this14.THREE.NoBlending,
124632
+ side: _this16.THREE.DoubleSide,
124633
+ blending: _this16.THREE.NoBlending,
124219
124634
  depthTest: true,
124220
124635
  depthWrite: false,
124221
124636
  toneMapped: false
124222
124637
  });
124223
- transparentMesh = new _this14.THREE.InstancedMesh(geometry, material, nextCap);
124638
+ transparentMesh = new _this16.THREE.InstancedMesh(geometry, material, nextCap);
124224
124639
  transparentMesh.frustumCulled = false;
124225
124640
  transparentMesh.matrixAutoUpdate = false;
124226
124641
  transparentMesh.userData.capacity = nextCap;
@@ -124230,15 +124645,15 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124230
124645
  state._occTransparentScene.add(transparentMesh);
124231
124646
  }
124232
124647
  if (transparentTotal > 0) {
124233
- tempMatrix = new _this14.THREE.Matrix4();
124234
- tempScale = new _this14.THREE.Vector3();
124235
- tempObj = new _this14.THREE.Object3D();
124236
- tempColor = new _this14.THREE.Color();
124648
+ tempMatrix = new _this16.THREE.Matrix4();
124649
+ tempScale = new _this16.THREE.Vector3();
124650
+ tempObj = new _this16.THREE.Object3D();
124651
+ tempColor = new _this16.THREE.Color();
124237
124652
  tIdx = 1;
124238
124653
  for (_i0 = 0; _i0 < transparentTotal; _i0++) {
124239
124654
  c = transparentCandidates[_i0];
124240
124655
  idx = tIdx++;
124241
- transparentIdIndexArr[idx] = _this14.formatModelId(c.modelId);
124656
+ transparentIdIndexArr[idx] = _this16.formatModelId(c.modelId);
124242
124657
  r = (idx & 255) / 255;
124243
124658
  g = (idx >> 8 & 255) / 255;
124244
124659
  b = (idx >> 16 & 255) / 255;
@@ -124248,8 +124663,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124248
124663
  tempMatrix.copy(matrix);
124249
124664
  tempScale.copy(halfSize).multiplyScalar(2);
124250
124665
  tempMatrix.scale(tempScale);
124251
- if (typeof _this14.bizToThreeMatrix !== 'undefined' && _this14.bizToThreeMatrix) {
124252
- tempMatrix.premultiply(_this14.bizToThreeMatrix);
124666
+ if (typeof _this16.bizToThreeMatrix !== 'undefined' && _this16.bizToThreeMatrix) {
124667
+ tempMatrix.premultiply(_this16.bizToThreeMatrix);
124253
124668
  }
124254
124669
  } else {
124255
124670
  c.box.getSize(tempScale);
@@ -124277,28 +124692,28 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124277
124692
  }
124278
124693
 
124279
124694
  // console.log('this.renderer', this.renderer)
124280
- prevToneMapping = _this14.renderer.toneMapping;
124281
- prevTarget = _this14.renderer.getRenderTarget ? _this14.renderer.getRenderTarget() : null;
124695
+ prevToneMapping = _this16.renderer.toneMapping;
124696
+ prevTarget = _this16.renderer.getRenderTarget ? _this16.renderer.getRenderTarget() : null;
124282
124697
  prevClearColorHex = 0x000000;
124283
124698
  prevClearAlpha = 0;
124284
124699
  try {
124285
- _c3 = _this14.renderer.getClearColor ? _this14.renderer.getClearColor() : null;
124700
+ _c3 = _this16.renderer.getClearColor ? _this16.renderer.getClearColor() : null;
124286
124701
  if (_c3 && _c3.isColor) prevClearColorHex = _c3.getHex();
124287
- prevClearAlpha = typeof _this14.renderer.getClearAlpha === 'function' ? _this14.renderer.getClearAlpha() : 0;
124702
+ prevClearAlpha = typeof _this16.renderer.getClearAlpha === 'function' ? _this16.renderer.getClearAlpha() : 0;
124288
124703
  } catch (_) {}
124289
- _this14.renderer.toneMapping = _this14.THREE.NoToneMapping;
124290
- _this14.renderer.setRenderTarget(rt);
124291
- _this14.renderer.setClearColor(new _this14.THREE.Color(0, 0, 0), 0);
124292
- _this14.renderer.clear(true, true, false);
124293
- _this14.camera.updateMatrixWorld(true);
124294
- _this14.renderer.render(state._occScene, _this14.camera);
124295
- _this14.updateGlobalSceneBoundingBox();
124704
+ _this16.renderer.toneMapping = _this16.THREE.NoToneMapping;
124705
+ _this16.renderer.setRenderTarget(rt);
124706
+ _this16.renderer.setClearColor(new _this16.THREE.Color(0, 0, 0), 0);
124707
+ _this16.renderer.clear(true, true, false);
124708
+ _this16.camera.updateMatrixWorld(true);
124709
+ _this16.renderer.render(state._occScene, _this16.camera);
124710
+ _this16.updateGlobalSceneBoundingBox();
124296
124711
  // const t1 = performance.now();
124297
124712
  // 从响应式对象读取 previewEnabled
124298
- _this14.$emit('updateBoundingBox');
124713
+ _this16.$emit('updateBoundingBox');
124299
124714
 
124300
124715
  // const tPreview0 = performance.now();
124301
- if (_this14.occlusionState.previewEnabled) {
124716
+ if (_this16.occlusionState.previewEnabled) {
124302
124717
  if (!state._previewCanvas) {
124303
124718
  cvs = document.createElement('canvas');
124304
124719
  cvs.style.position = 'fixed';
@@ -124316,11 +124731,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124316
124731
  }
124317
124732
  state._previewCanvas.width = sw;
124318
124733
  state._previewCanvas.height = sh;
124319
- cssW = Math.min(_this14.renderer.domElement.width / 5);
124320
- cssH = Math.min(_this14.renderer.domElement.height / 5);
124734
+ cssW = Math.min(_this16.renderer.domElement.width / 5);
124735
+ cssH = Math.min(_this16.renderer.domElement.height / 5);
124321
124736
  state._previewCanvas.style.width = cssW + 'px';
124322
124737
  state._previewCanvas.style.height = cssH + 'px';
124323
- _this14.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._previewBuffer);
124738
+ _this16.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._previewBuffer);
124324
124739
  if (!state._previewImageData || state._previewImageData.width !== sw || state._previewImageData.height !== sh) {
124325
124740
  state._previewImageData = state._previewCtx.createImageData(sw, sh);
124326
124741
  }
@@ -124343,17 +124758,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124343
124758
  }
124344
124759
  // const tPreview1 = performance.now();
124345
124760
  // _occRecordPerf('occ_preview_ms', tPreview1 - tPreview0, { sw, sh });
124346
- _this14.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._colorBuffer);
124761
+ _this16.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._colorBuffer);
124347
124762
  idIndexArr = activeIdIndexArr;
124348
124763
  maxIdx = typeof state._occMaxIdx === 'number' ? state._occMaxIdx : 0;
124349
124764
  totalPixels = sw * sh;
124350
124765
  targetSamples = totalPixels;
124351
124766
  baseStride = Math.max(1, Math.floor(Math.sqrt(totalPixels / Math.max(1, targetSamples))));
124352
- extraStride = _this14.occlusionState && _this14.occlusionState.sampleStride ? _this14.occlusionState.sampleStride : 1;
124767
+ extraStride = _this16.occlusionState && _this16.occlusionState.sampleStride ? _this16.occlusionState.sampleStride : 1;
124353
124768
  stride = Math.max(1, baseStride * Math.max(1, extraStride));
124354
- minSampleCount = _this14.occlusionState && _this14.occlusionState.minSampleCount ? _this14.occlusionState.minSampleCount : 1;
124769
+ minSampleCount = _this16.occlusionState && _this16.occlusionState.minSampleCount ? _this16.occlusionState.minSampleCount : 1;
124355
124770
  _context3.n = 11;
124356
- return _this14.scanOcclusionIndices(state._colorBuffer, sw, sh, stride, maxIdx, minSampleCount);
124771
+ return _this16.scanOcclusionIndices(state._colorBuffer, sw, sh, stride, maxIdx, minSampleCount);
124357
124772
  case 11:
124358
124773
  scanResult = _context3.v;
124359
124774
  if (scanResult && scanResult.buffer) {
@@ -124371,13 +124786,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124371
124786
  _context3.n = 13;
124372
124787
  break;
124373
124788
  }
124374
- _this14.renderer.setClearColor(new _this14.THREE.Color(0, 0, 0), 0);
124375
- _this14.renderer.clear(true, false, false);
124376
- _this14.renderer.render(state._occTransparentScene, _this14.camera);
124377
- _this14.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._colorBuffer);
124789
+ _this16.renderer.setClearColor(new _this16.THREE.Color(0, 0, 0), 0);
124790
+ _this16.renderer.clear(true, false, false);
124791
+ _this16.renderer.render(state._occTransparentScene, _this16.camera);
124792
+ _this16.renderer.readRenderTargetPixels(rt, 0, 0, sw, sh, state._colorBuffer);
124378
124793
  tIdIndexArr = transparentIdIndexArr;
124379
124794
  _context3.n = 12;
124380
- return _this14.scanOcclusionIndices(state._colorBuffer, sw, sh, stride, transparentMaxIdx, minSampleCount);
124795
+ return _this16.scanOcclusionIndices(state._colorBuffer, sw, sh, stride, transparentMaxIdx, minSampleCount);
124381
124796
  case 12:
124382
124797
  tScanResult = _context3.v;
124383
124798
  if (tScanResult && tScanResult.buffer) {
@@ -124391,23 +124806,23 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124391
124806
  }
124392
124807
  }
124393
124808
  case 13:
124394
- _this14.renderer.setRenderTarget(prevTarget);
124395
- _this14.renderer.setClearColor(prevClearColorHex, prevClearAlpha);
124396
- _this14.renderer.toneMapping = prevToneMapping;
124809
+ _this16.renderer.setRenderTarget(prevTarget);
124810
+ _this16.renderer.setClearColor(prevClearColorHex, prevClearAlpha);
124811
+ _this16.renderer.toneMapping = prevToneMapping;
124397
124812
  _context3.n = 15;
124398
124813
  break;
124399
124814
  case 14:
124400
124815
  _context3.p = 14;
124401
124816
  _t2 = _context3.v;
124402
124817
  for (_i11 = 0; _i11 < candidates.length; _i11++) {
124403
- visibleIdSet.add(candidates[_i11].modelId);
124818
+ visibleIdSet.add(_this16.formatModelId(candidates[_i11].modelId));
124404
124819
  }
124405
124820
  case 15:
124406
124821
  _context3.n = 17;
124407
124822
  break;
124408
124823
  case 16:
124409
124824
  for (_i12 = 0; _i12 < candidates.length; _i12++) {
124410
- visibleIdSet.add(candidates[_i12].modelId);
124825
+ visibleIdSet.add(_this16.formatModelId(candidates[_i12].modelId));
124411
124826
  }
124412
124827
  case 17:
124413
124828
  visibleIds.length = 0;
@@ -124416,41 +124831,47 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124416
124831
  });
124417
124832
  toLoadSet = new Set(visibleIdSet);
124418
124833
  parentsToCheck = new Set();
124419
- _this14.scene.traverse(function (child) {
124834
+ _this16.scene.traverse(function (child) {
124420
124835
  if (!child.isInstancedMesh) return;
124421
- // 如果复用数量等于大于2个,则跳过裁剪和剔除处理(始终保留)
124836
+ var instancesMap = child && child.userData && child.userData.instancesMap instanceof Map ? child.userData.instancesMap : child.parent && child.parent.userData && child.parent.userData.instancesMap instanceof Map ? child.parent.userData.instancesMap : null;
124837
+
124838
+ // 多实例复用同一个 InstancedMesh 时,仅在全部实例都不可见时整体卸载。
124422
124839
  if (child.count >= 2) {
124423
- var instancesMap = child && child.userData && child.userData.instancesMap instanceof Map ? child.userData.instancesMap : child.parent && child.parent.userData && child.parent.userData.instancesMap instanceof Map ? child.parent.userData.instancesMap : null;
124424
124840
  if (instancesMap) {
124425
124841
  var allInactive = true;
124426
124842
  var modelIds = Array.from(instancesMap.keys());
124843
+ var unloadModelId = null;
124427
124844
 
124428
124845
  // 第一遍遍历:检查是否有任何一个实例处于活跃状态(在视锥体内且可见)
124429
124846
  for (var _i13 = 0, _modelIds2 = modelIds; _i13 < _modelIds2.length; _i13++) {
124430
124847
  var _modelId = _modelIds2[_i13];
124431
124848
  // 检查已取消勾选模型进行卸载
124432
- var documentId = _modelId.split(':')[1];
124433
- if (!_this14.noObserver.documentModelIds.get(documentId)) {
124434
- toUnload.push({
124435
- modelId: _modelId,
124436
- child: child
124437
- });
124438
- return;
124849
+ var documentId = String(_modelId).split(':')[1];
124850
+ if (documentId && !_this16.noObserver.documentModelIds.get(documentId)) {
124851
+ if (!skipUnload) _this16.setInstanceCullingVisible(child, _modelId, false);
124852
+ unloadModelId = _modelId;
124853
+ continue;
124854
+ }
124855
+ var _formattedModelId = _this16.formatModelId(_modelId);
124856
+ if (bypassList && bypassList.size > 0 && (bypassList.has(_modelId) || bypassList.has(_formattedModelId))) {
124857
+ if (!skipUnload) _this16.setInstanceCullingVisible(child, _modelId, true);
124858
+ allInactive = false;
124859
+ continue;
124439
124860
  }
124440
- if (bypassList && bypassList.size > 0 && bypassList.has(_modelId)) return;
124441
- var instanceInfo = instancesMap.get(_modelId);
124442
- var instanceIndex = instanceInfo && typeof instanceInfo.instanceIndex === 'number' ? instanceInfo.instanceIndex : null;
124443
- var _box = _this14._boxIndex && _this14._boxIndex.has(String(_modelId)) ? _this14._boxIndex.get(String(_modelId)) : _this14._boxIndex && _this14._boxIndex.has(_modelId) ? _this14._boxIndex.get(_modelId) : null;
124444
- if (!_this14.shouldApplyOcclusionByBox(_box)) {
124861
+ var _box = _this16._boxIndex && _this16._boxIndex.has(String(_modelId)) ? _this16._boxIndex.get(String(_modelId)) : _this16._boxIndex && _this16._boxIndex.has(_modelId) ? _this16._boxIndex.get(_modelId) : null;
124862
+ if (!_this16.shouldApplyOcclusionByBox(_box)) {
124863
+ if (!skipUnload) _this16.setInstanceCullingVisible(child, _modelId, true);
124445
124864
  allInactive = false;
124865
+ toLoadSet.delete(_formattedModelId);
124446
124866
  continue;
124447
124867
  }
124448
- var _inFrustum = _this14.isModelInFrustum(child, instanceIndex, globalFrustum);
124449
- var _modelInVisible = toLoadSet.has(_modelId);
124450
- // console.log('modelId', modelId, 'inFrustum', inFrustum, 'modelInVisible', modelInVisible)
124868
+ var _modelInVisible = visibleIdSet.has(_formattedModelId);
124869
+ toLoadSet.delete(_formattedModelId);
124451
124870
 
124452
- // 只要有一个实例在视锥体内且在可见列表中,就不整体卸载
124453
- if (_inFrustum || _modelInVisible) {
124871
+ // 可见集合已经聚合了同一模型的全部图元,任一图元可见时都保留该模型实例。
124872
+ var isActive = _modelInVisible;
124873
+ if (!skipUnload) _this16.setInstanceCullingVisible(child, _modelId, isActive);
124874
+ if (isActive) {
124454
124875
  allInactive = false;
124455
124876
  }
124456
124877
  }
@@ -124458,25 +124879,22 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124458
124879
  // 第二遍遍历:同步状态并决定是否卸载
124459
124880
  for (var _i14 = 0, _modelIds3 = modelIds; _i14 < _modelIds3.length; _i14++) {
124460
124881
  var _modelId2 = _modelIds3[_i14];
124461
- var _box2 = _this14._boxIndex && _this14._boxIndex.has(String(_modelId2)) ? _this14._boxIndex.get(String(_modelId2)) : _this14._boxIndex && _this14._boxIndex.has(_modelId2) ? _this14._boxIndex.get(_modelId2) : null;
124462
- if (!_this14.shouldApplyOcclusionByBox(_box2)) {
124463
- if (toLoadSet.has(_modelId2)) {
124464
- toLoadSet.delete(_modelId2);
124465
- }
124882
+ var _box2 = _this16._boxIndex && _this16._boxIndex.has(String(_modelId2)) ? _this16._boxIndex.get(String(_modelId2)) : _this16._boxIndex && _this16._boxIndex.has(_modelId2) ? _this16._boxIndex.get(_modelId2) : null;
124883
+ if (!_this16.shouldApplyOcclusionByBox(_box2)) {
124884
+ toLoadSet.delete(_this16.formatModelId(_modelId2));
124466
124885
  continue;
124467
124886
  }
124468
124887
  // 无论是否卸载,只要模型已在场景中,就从待加载集合中移除
124469
- if (toLoadSet.has(_modelId2)) {
124470
- toLoadSet.delete(_modelId2);
124471
- }
124888
+ toLoadSet.delete(_this16.formatModelId(_modelId2));
124889
+ if (!unloadModelId) unloadModelId = _modelId2;
124890
+ }
124472
124891
 
124473
- // 仅当所有实例都不活跃时,才执行卸载
124474
- if (!_this14.firstPerSign && !_this14.roaming && allInactive) {
124475
- toUnload.push({
124476
- modelId: _modelId2,
124477
- child: child
124478
- });
124479
- }
124892
+ // 仅当所有实例都不活跃时,才整体卸载一次,避免重复释放同一网格。
124893
+ if (!skipUnload && !_this16.firstPerSign && !_this16.roaming && allInactive && unloadModelId !== null) {
124894
+ toUnload.push({
124895
+ modelId: unloadModelId,
124896
+ child: child
124897
+ });
124480
124898
  }
124481
124899
  }
124482
124900
  // if (toLoadSet.has(modelId)) {
@@ -124484,21 +124902,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124484
124902
  // }
124485
124903
  return;
124486
124904
  }
124487
- var modelId = child.parent && child.parent.userData && child.parent.userData.instanceId ? child.parent.userData.instanceId : child.uuid;
124488
- if (bypassList && bypassList.size > 0 && bypassList.has(modelId)) return;
124489
- var box = _this14._boxIndex && _this14._boxIndex.has(String(modelId)) ? _this14._boxIndex.get(String(modelId)) : _this14._boxIndex && _this14._boxIndex.has(modelId) ? _this14._boxIndex.get(modelId) : null;
124490
- if (!_this14.shouldApplyOcclusionByBox(box)) {
124491
- if (toLoadSet.has(modelId)) {
124492
- toLoadSet.delete(modelId);
124493
- }
124905
+ var modelId = instancesMap && instancesMap.size > 0 ? instancesMap.keys().next().value : child.parent && child.parent.userData && child.parent.userData.instanceId ? child.parent.userData.instanceId : child.uuid;
124906
+ var formattedModelId = _this16.formatModelId(modelId);
124907
+ if (bypassList && bypassList.size > 0 && (bypassList.has(modelId) || bypassList.has(formattedModelId))) return;
124908
+ var box = _this16._boxIndex && _this16._boxIndex.has(String(modelId)) ? _this16._boxIndex.get(String(modelId)) : _this16._boxIndex && _this16._boxIndex.has(modelId) ? _this16._boxIndex.get(modelId) : null;
124909
+ if (!_this16.shouldApplyOcclusionByBox(box)) {
124910
+ toLoadSet.delete(formattedModelId);
124494
124911
  return;
124495
124912
  }
124496
- var inFrustum = _this14.isModelInFrustum(child, null, globalFrustum);
124497
- var modelInVisible = toLoadSet.has(modelId);
124498
- if (modelInVisible) {
124499
- toLoadSet.delete(modelId);
124500
- }
124501
- if (!_this14.firstPerSign && !_this14.roaming && (!inFrustum || !modelInVisible)) {
124913
+ var modelInVisible = visibleIdSet.has(formattedModelId);
124914
+ toLoadSet.delete(formattedModelId);
124915
+ if (!skipUnload && !_this16.firstPerSign && !_this16.roaming && !modelInVisible) {
124502
124916
  toUnload.push({
124503
124917
  modelId: modelId,
124504
124918
  child: child
@@ -124508,16 +124922,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124508
124922
  for (_i15 = 0, _toUnload = toUnload; _i15 < _toUnload.length; _i15++) {
124509
124923
  _toUnload$_i = _toUnload[_i15], modelId = _toUnload$_i.modelId, child = _toUnload$_i.child;
124510
124924
  if (child && child.parent) parentsToCheck.add(child.parent);
124511
- _this14.unloadInstancedModel(modelId, child);
124925
+ _this16.unloadInstancedModel(modelId, child);
124512
124926
  }
124513
- if (_this14.scene) {
124927
+ if (_this16.scene) {
124514
124928
  parentsToCheck.forEach(function (group) {
124515
124929
  if (group && group.children && group.children.length === 0) {
124516
124930
  group.removeFromParent();
124517
124931
  }
124518
124932
  });
124519
124933
  }
124520
- _this14.modelStateManager.isloadedModelsIds = Object.freeze(Array.from(toLoadSet));
124934
+ _this16.modelStateManager.isloadedModelsIds = Object.freeze(Array.from(toLoadSet));
124521
124935
  case 18:
124522
124936
  return _context3.a(2);
124523
124937
  }
@@ -124544,8 +124958,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124544
124958
 
124545
124959
  // 卸载前内存快照
124546
124960
  // this.logRendererMemory(`before unload modelId=${modelId}`);
124547
- var _ref = instancedMesh.userData.instancesMap.get(modelId) || 0,
124548
- instanceIndex = _ref.instanceIndex;
124961
+ var _ref2 = instancedMesh.userData.instancesMap.get(modelId) || 0,
124962
+ instanceIndex = _ref2.instanceIndex;
124549
124963
  // const instanceIndex = instancedMesh.userData.instanceIndex || 0;
124550
124964
 
124551
124965
  this.removeOutlineInstanceProxy(instancedMesh, instanceIndex);
@@ -124612,10 +125026,16 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124612
125026
  * @param {Object} config - 配置项
124613
125027
  * @param {Object} config.modelApi - 模型API接口
124614
125028
  * @param {string} [config.projectId] - 项目ID
125029
+ * @param {Object} [config.cameraControlMoveObserver] - 普通视角运动中触发加载的配置
125030
+ * @param {boolean} [config.cameraControlMoveObserver.enabled=false] - 是否开启普通视角运动中加载
125031
+ * @param {number} [config.cameraControlMoveObserver.interval=500] - 触发间隔,单位毫秒
125032
+ * @param {boolean} [config.enableCameraControlMoveObserver=false] - 是否开启普通视角运动中加载
125033
+ * @param {number} [config.cameraControlMoveInterval=500] - 触发间隔,单位毫秒
124615
125034
  */
124616
125035
  init: function init() {
124617
125036
  var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
124618
125037
  console.log('init');
125038
+ this.setCameraControlMoveObserverConfig(config);
124619
125039
  this.initStreamLoader(config.modelApi, config);
124620
125040
  },
124621
125041
  /**
@@ -124625,11 +125045,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124625
125045
  * @param {string} [config.projectId] - 项目ID
124626
125046
  */
124627
125047
  initStreamLoader: function initStreamLoader(modelApi) {
124628
- var _this15 = this;
125048
+ var _this17 = this;
124629
125049
  var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
124630
- var _ref2 = config || {},
124631
- projectId = _ref2.projectId,
124632
- restConfig = _objectWithoutProperties(_ref2, _excluded);
125050
+ var _ref3 = config || {},
125051
+ projectId = _ref3.projectId,
125052
+ restConfig = _objectWithoutProperties(_ref3, _excluded);
124633
125053
  var streamLoader = new StreamLoader_StreamLoader(com_graphicsvue_type_script_lang_js_objectSpread({
124634
125054
  modelApi: modelApi,
124635
125055
  projectId: projectId,
@@ -124641,7 +125061,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124641
125061
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context4) {
124642
125062
  while (1) switch (_context4.n) {
124643
125063
  case 0:
124644
- if (!(_this15.userInteracting || _this15.noObserver.batchLoadingState.interactionState.isInteracting)) {
125064
+ if (!(_this17.userInteracting || _this17.noObserver.batchLoadingState.interactionState.isInteracting)) {
124645
125065
  _context4.n = 1;
124646
125066
  break;
124647
125067
  }
@@ -124691,9 +125111,9 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124691
125111
  this.noObserver.occlusionWorkerRequestMap = new Map();
124692
125112
  streamLoader.worker.addEventListener('message', function (e) {
124693
125113
  var payload = e.data || {};
124694
- var pending = _this15.noObserver.occlusionWorkerRequestMap.get(payload.id);
125114
+ var pending = _this17.noObserver.occlusionWorkerRequestMap.get(payload.id);
124695
125115
  if (!pending) return;
124696
- _this15.noObserver.occlusionWorkerRequestMap.delete(payload.id);
125116
+ _this17.noObserver.occlusionWorkerRequestMap.delete(payload.id);
124697
125117
  pending.resolve(payload);
124698
125118
  });
124699
125119
  }
@@ -124704,13 +125124,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124704
125124
  * @param {Object} materialData - 材质数据
124705
125125
  */
124706
125126
  setStreamModel: function setStreamModel(item, materialData) {
124707
- var _this16 = this;
125127
+ var _this18 = this;
124708
125128
  if (this.noObserver.streamLoader) {
124709
125129
  this.noObserver.streamLoader.setCurrentModel(item, materialData);
124710
125130
  // 设置完模型后,尝试触发一次范围加载以渲染初始视图
124711
125131
  // 使用 setTimeout 确保在下一帧执行,避免当前栈还在初始化中
124712
125132
  setTimeout(function () {
124713
- _this16.getRangeStream();
125133
+ _this18.getRangeStream();
124714
125134
  }, 0);
124715
125135
  } else {}
124716
125136
  },
@@ -124718,17 +125138,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124718
125138
  * 批量加载区域(供外部调用)
124719
125139
  */
124720
125140
  batchLoadRegions: function batchLoadRegions(item, divideData, materialData) {
124721
- var _this17 = this;
125141
+ var _this19 = this;
124722
125142
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee6() {
124723
125143
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context6) {
124724
125144
  while (1) switch (_context6.n) {
124725
125145
  case 0:
124726
- if (!_this17.noObserver.streamLoader) {
125146
+ if (!_this19.noObserver.streamLoader) {
124727
125147
  _context6.n = 1;
124728
125148
  break;
124729
125149
  }
124730
125150
  _context6.n = 1;
124731
- return _this17.noObserver.streamLoader.batchLoadRegions(item, divideData, materialData);
125151
+ return _this19.noObserver.streamLoader.batchLoadRegions(item, divideData, materialData);
124732
125152
  case 1:
124733
125153
  return _context6.a(2);
124734
125154
  }
@@ -124739,21 +125159,21 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124739
125159
  * 获取批量加载详情(供外部调用)
124740
125160
  */
124741
125161
  loadModelByIds: function loadModelByIds(options) {
124742
- var _this18 = this;
125162
+ var _this20 = this;
124743
125163
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee7() {
124744
- var _ref3, ids;
125164
+ var _ref4, ids;
124745
125165
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context7) {
124746
125166
  while (1) switch (_context7.n) {
124747
125167
  case 0:
124748
125168
  // 绕过剔除模型
124749
- _ref3 = options.params || {}, ids = _ref3.ids;
124750
- _this18.addBypassCullingModelIds(ids);
124751
- if (!_this18.noObserver.streamLoader) {
125169
+ _ref4 = options.params || {}, ids = _ref4.ids;
125170
+ _this20.addBypassCullingModelIds(ids);
125171
+ if (!_this20.noObserver.streamLoader) {
124752
125172
  _context7.n = 2;
124753
125173
  break;
124754
125174
  }
124755
125175
  _context7.n = 1;
124756
- return _this18.noObserver.streamLoader.loadModelByIds(options);
125176
+ return _this20.noObserver.streamLoader.loadModelByIds(options);
124757
125177
  case 1:
124758
125178
  return _context7.a(2, _context7.v);
124759
125179
  case 2:
@@ -124766,32 +125186,32 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124766
125186
  * 处理单个模型项加载(供外部调用)
124767
125187
  */
124768
125188
  processModelItem: function processModelItem(item) {
124769
- var _arguments = arguments,
124770
- _this19 = this;
125189
+ var _arguments2 = arguments,
125190
+ _this21 = this;
124771
125191
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee8() {
124772
125192
  var _options$onComplete;
124773
125193
  var options, res;
124774
125194
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context8) {
124775
125195
  while (1) switch (_context8.n) {
124776
125196
  case 0:
124777
- options = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : {};
125197
+ options = _arguments2.length > 1 && _arguments2[1] !== undefined ? _arguments2[1] : {};
124778
125198
  _context8.n = 1;
124779
- return _this19.noObserver.streamLoader.processModelItem(item, options);
125199
+ return _this21.noObserver.streamLoader.processModelItem(item, options);
124780
125200
  case 1:
124781
125201
  res = _context8.v;
124782
125202
  // item.id is the documentId
124783
125203
  if (item && item.id) {
124784
125204
  if (res && res.sceneBox) {
124785
- _this19.setSceneBox(res.sceneBox, item.id, true);
125205
+ _this21.setSceneBox(res.sceneBox, item.id, true);
124786
125206
  }
124787
125207
  if (res && res.boxIndex) {
124788
- _this19.setBoxIndex(res.boxIndex, item.id, true);
125208
+ _this21.setBoxIndex(res.boxIndex, item.id, true);
124789
125209
  }
124790
- _this19.tryInitialCenterAfterBoundsReady();
125210
+ _this21.tryInitialCenterAfterBoundsReady();
124791
125211
  // this.setBoxIndex(boxJson.data, item.id, true);
124792
125212
  }
124793
125213
  (_options$onComplete = options.onComplete) === null || _options$onComplete === void 0 || _options$onComplete.call(options);
124794
- _this19.notifyCameraChange(); // 触发场景更新
125214
+ _this21.notifyCameraChange(); // 触发场景更新
124795
125215
  case 2:
124796
125216
  return _context8.a(2);
124797
125217
  }
@@ -124845,7 +125265,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124845
125265
  * 内部渲染流式数据方法
124846
125266
  */
124847
125267
  renderModelData: function renderModelData(meshes, primitives, list, range, onComplete, immediateUpdate) {
124848
- var _this20 = this;
125268
+ var _this22 = this;
124849
125269
  var renderOptions = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
124850
125270
  // 构造 drawModel 需要的数据格式
124851
125271
  var modelRegistry = this.noObserver.streamLoader.modelRegistry;
@@ -124899,8 +125319,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124899
125319
  resolve(result || {});
124900
125320
  };
124901
125321
  options.onComplete = function (complete) {
124902
- if (_this20.sceneCommandService && typeof _this20.sceneCommandService.retryPendingOriginalModelSaveChanges === 'function') {
124903
- _this20.sceneCommandService.retryPendingOriginalModelSaveChanges();
125322
+ if (_this22.sceneCommandService && typeof _this22.sceneCommandService.retryPendingOriginalModelSaveChanges === 'function') {
125323
+ _this22.sceneCommandService.retryPendingOriginalModelSaveChanges();
124904
125324
  }
124905
125325
  onComplete === null || onComplete === void 0 || onComplete(complete);
124906
125326
  finish(complete);
@@ -124910,7 +125330,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124910
125330
  canceled: true
124911
125331
  }, cancelInfo || {}));
124912
125332
  };
124913
- _this20.drawModel(regionModelData, '', meshNameConfig, options);
125333
+ _this22.drawModel(regionModelData, '', meshNameConfig, options);
124914
125334
  });
124915
125335
  },
124916
125336
  waitNextRenderFrame: function waitNextRenderFrame() {
@@ -124925,18 +125345,18 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
124925
125345
  });
124926
125346
  },
124927
125347
  handleRangeStreamComplete: function handleRangeStreamComplete() {
124928
- var _arguments2 = arguments,
124929
- _this21 = this;
125348
+ var _arguments3 = arguments,
125349
+ _this23 = this;
124930
125350
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee9() {
124931
125351
  var payload;
124932
125352
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context9) {
124933
125353
  while (1) switch (_context9.n) {
124934
125354
  case 0:
124935
- payload = _arguments2.length > 0 && _arguments2[0] !== undefined ? _arguments2[0] : {};
125355
+ payload = _arguments3.length > 0 && _arguments3[0] !== undefined ? _arguments3[0] : {};
124936
125356
  _context9.n = 1;
124937
- return _this21.waitNextRenderFrame();
125357
+ return _this23.waitNextRenderFrame();
124938
125358
  case 1:
124939
- _this21.$emit('loadComplete', com_graphicsvue_type_script_lang_js_objectSpread({
125359
+ _this23.$emit('loadComplete', com_graphicsvue_type_script_lang_js_objectSpread({
124940
125360
  source: 'inRangeDis2'
124941
125361
  }, payload));
124942
125362
  case 2:
@@ -125100,43 +125520,135 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125100
125520
  setCameraObserverEnabled: function setCameraObserverEnabled(enabled) {
125101
125521
  this.noObserver.isObserverEnabled = enabled;
125102
125522
  },
125523
+ setCameraControlMoveObserverConfig: function setCameraControlMoveObserverConfig() {
125524
+ var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
125525
+ if (!this.noObserver) return;
125526
+ var nestedConfig = config.cameraControlMoveObserver || {};
125527
+ var enabled = typeof nestedConfig.enabled === 'boolean' ? nestedConfig.enabled : typeof config.enableCameraControlMoveObserver === 'boolean' ? config.enableCameraControlMoveObserver : false;
125528
+ var rawInterval = nestedConfig.interval !== undefined ? nestedConfig.interval : config.cameraControlMoveInterval;
125529
+ var interval = Number(rawInterval);
125530
+ var safeInterval = Number.isFinite(interval) && interval > 0 ? interval : 500;
125531
+ this.noObserver.cameraControlMoveObserver = {
125532
+ enabled: enabled,
125533
+ interval: safeInterval
125534
+ };
125535
+ this.resetCameraControlMoveSnapshot(false);
125536
+ },
125537
+ isCameraControlMoveObserverEnabled: function isCameraControlMoveObserverEnabled() {
125538
+ var config = this.noObserver && this.noObserver.cameraControlMoveObserver;
125539
+ return !!(config && config.enabled);
125540
+ },
125541
+ getCameraControlTarget: function getCameraControlTarget(target) {
125542
+ if (!target || !this.cameraControls) return false;
125543
+ if (typeof this.cameraControls.getTarget === 'function') {
125544
+ this.cameraControls.getTarget(target);
125545
+ return true;
125546
+ }
125547
+ if (this.cameraControls._target) {
125548
+ target.copy(this.cameraControls._target);
125549
+ return true;
125550
+ }
125551
+ return false;
125552
+ },
125553
+ resetCameraControlMoveSnapshot: function resetCameraControlMoveSnapshot() {
125554
+ var syncCurrent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
125555
+ if (!this.noObserver) return;
125556
+ if (!this.noObserver._cameraControlMoveState) {
125557
+ this.noObserver._cameraControlMoveState = {
125558
+ position: new this.THREE.Vector3(),
125559
+ quaternion: new this.THREE.Quaternion(),
125560
+ target: new this.THREE.Vector3(),
125561
+ currentTarget: new this.THREE.Vector3(),
125562
+ initialized: false,
125563
+ hasTarget: false
125564
+ };
125565
+ }
125566
+ var state = this.noObserver._cameraControlMoveState;
125567
+ if (!syncCurrent || !this.camera) {
125568
+ state.initialized = false;
125569
+ state.hasTarget = false;
125570
+ return;
125571
+ }
125572
+ this.camera.updateMatrixWorld(true);
125573
+ state.position.copy(this.camera.position);
125574
+ state.quaternion.copy(this.camera.quaternion);
125575
+ state.hasTarget = this.getCameraControlTarget(state.target);
125576
+ state.initialized = true;
125577
+ },
125578
+ observeCameraControlMove: function observeCameraControlMove() {
125579
+ if (!this.noObserver || !this.noObserver.isObserverEnabled || !this.isCameraControlMoveObserverEnabled() || !this.camera || !this.cameraControls || typeof this._cameraChangeObserver !== 'function') {
125580
+ return;
125581
+ }
125582
+ var loadingState = this.noObserver.batchLoadingState || {};
125583
+ var interactionState = loadingState.interactionState || {};
125584
+ var wheelActive = !!interactionState.wheelTimeout;
125585
+ var controlActive = !!this.noObserver.isControlActive;
125586
+ if (!controlActive && !wheelActive || this.firstPerSign) {
125587
+ this.resetCameraControlMoveSnapshot(false);
125588
+ return;
125589
+ }
125590
+ if (!this.noObserver._cameraControlMoveState) {
125591
+ this.resetCameraControlMoveSnapshot(true);
125592
+ return;
125593
+ }
125594
+ var state = this.noObserver._cameraControlMoveState;
125595
+ if (!state.initialized) {
125596
+ this.resetCameraControlMoveSnapshot(true);
125597
+ return;
125598
+ }
125599
+ this.camera.updateMatrixWorld(true);
125600
+ var hasTarget = this.getCameraControlTarget(state.currentTarget);
125601
+ var positionMoved = state.position.distanceToSquared(this.camera.position) > 1e-8;
125602
+ var quaternionMoved = 1 - Math.abs(state.quaternion.dot(this.camera.quaternion)) > 1e-10;
125603
+ var targetMoved = hasTarget !== state.hasTarget || hasTarget && state.target.distanceToSquared(state.currentTarget) > 1e-8;
125604
+ if (!positionMoved && !quaternionMoved && !targetMoved) return;
125605
+ state.position.copy(this.camera.position);
125606
+ state.quaternion.copy(this.camera.quaternion);
125607
+ state.hasTarget = hasTarget;
125608
+ if (hasTarget) {
125609
+ state.target.copy(state.currentTarget);
125610
+ }
125611
+ this._cameraChangeObserver('controlMove');
125612
+ },
125103
125613
  /**
125104
125614
  * 初始化相机变更观察者 (CameraChangeObserver)
125105
125615
  * 统一监听:用户交互(Wheel/Control)、程序化动画、API调用
125106
125616
  */
125107
125617
  initCameraChangeObserver: function initCameraChangeObserver() {
125108
- var _this22 = this;
125618
+ var _this24 = this;
125109
125619
  // 初始化 control 状态标志
125110
125620
  this.noObserver.isControlActive = false;
125111
125621
  var _this = this;
125112
125622
  // 1. 创建统一的响应触发器 (Debounced)
125113
125623
  this._cameraChangeObserver = this.debounce(/*#__PURE__*/function () {
125114
- var _ref4 = com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee0(source) {
125624
+ var _ref5 = com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee0(source) {
125115
125625
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context0) {
125116
125626
  while (1) switch (_context0.n) {
125117
125627
  case 0:
125118
- if (_this22.noObserver.isObserverEnabled) {
125628
+ if (_this24.noObserver.isObserverEnabled) {
125119
125629
  _context0.n = 1;
125120
125630
  break;
125121
125631
  }
125122
125632
  return _context0.a(2);
125123
125633
  case 1:
125124
- if (!(source === 'rest' && _this22.noObserver.isControlActive)) {
125634
+ if (!(source === 'rest' && _this24.noObserver.isControlActive)) {
125125
125635
  _context0.n = 2;
125126
125636
  break;
125127
125637
  }
125128
125638
  return _context0.a(2);
125129
125639
  case 2:
125130
- if (!_this22.modelStateManager.frustumCheckEnabled) {
125640
+ if (!_this24.modelStateManager.frustumCheckEnabled) {
125131
125641
  _context0.n = 3;
125132
125642
  break;
125133
125643
  }
125134
125644
  _context0.n = 3;
125135
- return _this22.performFrustumCulling();
125645
+ return _this24.performFrustumCulling({
125646
+ skipUnload: source === 'controlMove'
125647
+ });
125136
125648
  case 3:
125137
125649
  // 执行流式加载请求
125138
- if (_this22.modelStateManager.isloadedModelsIds && _this22.modelStateManager.isloadedModelsIds.length > 0) {
125139
- _this22.getRangeStream(false);
125650
+ if (_this24.modelStateManager.isloadedModelsIds && _this24.modelStateManager.isloadedModelsIds.length > 0) {
125651
+ _this24.getRangeStream(false);
125140
125652
  }
125141
125653
  case 4:
125142
125654
  return _context0.a(2);
@@ -125144,10 +125656,10 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125144
125656
  }, _callee0);
125145
125657
  }));
125146
125658
  return function (_x3) {
125147
- return _ref4.apply(this, arguments);
125659
+ return _ref5.apply(this, arguments);
125148
125660
  };
125149
125661
  }(), function (source) {
125150
- // 漫游模式下,或者第一人称移动时,使用节流策略(每300ms触发一次)
125662
+ // 漫游、第一人称移动、普通视角拖拽/缩放中,使用节流策略避免持续运动被防抖吞掉。
125151
125663
  // 避免在持续运动中因防抖重置定时器而无法触发
125152
125664
  if (source === 'roam' || source === 'firstPersonMove') {
125153
125665
  return {
@@ -125155,24 +125667,38 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125155
125667
  limit: 1000
125156
125668
  };
125157
125669
  }
125670
+ if (source === 'controlMove') {
125671
+ var config = _this24.noObserver && _this24.noObserver.cameraControlMoveObserver;
125672
+ var interval = config && Number.isFinite(config.interval) && config.interval > 0 ? config.interval : 500;
125673
+ return {
125674
+ type: 'throttle',
125675
+ limit: interval
125676
+ };
125677
+ }
125158
125678
  return 300; // 默认防抖 300ms
125159
125679
  });
125160
125680
 
125161
125681
  // 2. 公开API:允许外部或业务逻辑手动触发更新
125162
125682
  this.notifyCameraChange = function () {
125163
125683
  var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'api';
125164
- _this22._cameraChangeObserver(source);
125684
+ _this24._cameraChangeObserver(source);
125165
125685
  };
125166
125686
 
125167
125687
  // 3. 监听器 - Wheel (用户滚轮)
125168
125688
  this._wheelHandler = function (res) {
125169
- _this22.$emit('wheelStart', res);
125170
-
125171
- // 统一交互开始处理
125172
- _this22.beginInteraction('wheel');
125689
+ _this24.$emit('wheelStart', res);
125690
+ var cameraControlMoveEnabled = _this24.isCameraControlMoveObserverEnabled();
125691
+ var loadingState = _this24.noObserver ? _this24.noObserver.batchLoadingState : _this24.batchLoadingState;
125692
+ var wheelAlreadyActive = loadingState && loadingState.interactionState && loadingState.interactionState.wheelTimeout;
125693
+ if (cameraControlMoveEnabled && !wheelAlreadyActive) {
125694
+ _this24.resetCameraControlMoveSnapshot(true);
125695
+ } else if (!cameraControlMoveEnabled) {
125696
+ // 未开启普通视角运动加载时,保持原有交互中断流程。
125697
+ _this24.beginInteraction('wheel');
125698
+ }
125173
125699
 
125174
125700
  // 设置滚轮交互的结束检测
125175
- _this22.scheduleWheelInteractionEnd(res, 100);
125701
+ _this24.scheduleWheelInteractionEnd(res, 100);
125176
125702
 
125177
125703
  // 滚轮逻辑:infinityDolly 与 maxDollyDistance 控制
125178
125704
  var event = res;
@@ -125188,10 +125714,10 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125188
125714
 
125189
125715
  // dolly最大距离限制
125190
125716
  try {
125191
- if (_this22.sceneBoundingBox && isFinite(maxDollyDistance)) {
125717
+ if (_this24.sceneBoundingBox && isFinite(maxDollyDistance)) {
125192
125718
  if (isZoomOut) {
125193
- _this22.camera.updateMatrixWorld(true);
125194
- var currentDistance = _this22.camera.position.distanceTo(_this22.cameraControls._target);
125719
+ _this24.camera.updateMatrixWorld(true);
125720
+ var currentDistance = _this24.camera.position.distanceTo(_this24.cameraControls._target);
125195
125721
  if (currentDistance >= maxDollyDistance) {
125196
125722
  event.preventDefault && event.preventDefault();
125197
125723
  event.stopImmediatePropagation && event.stopImmediatePropagation();
@@ -125204,17 +125730,20 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125204
125730
  }
125205
125731
 
125206
125732
  // 触发观察者
125207
- _this22._cameraChangeObserver('wheel');
125733
+ _this24._cameraChangeObserver('wheel');
125208
125734
  };
125209
125735
  this.renderer.domElement.addEventListener('wheel', this._wheelHandler);
125210
125736
 
125211
125737
  // 4. 监听器 - Controls (用户拖拽/操作)
125212
125738
  this._onControlStart = function (res) {
125213
- _this22.noObserver.isControlActive = true;
125214
-
125215
- // 统一交互开始处理(相机)
125216
- _this22.beginInteraction('this.camera');
125217
- _this22.$emit('controlStart', res);
125739
+ _this24.noObserver.isControlActive = true;
125740
+ if (_this24.isCameraControlMoveObserverEnabled()) {
125741
+ _this24.resetCameraControlMoveSnapshot(true);
125742
+ } else {
125743
+ // 未开启普通视角运动加载时,保持原有交互中断流程。
125744
+ _this24.beginInteraction('this.camera');
125745
+ }
125746
+ _this24.$emit('controlStart', res);
125218
125747
 
125219
125748
  // 记录鼠标按下时的位置
125220
125749
  var event = res.originalEvent || window.event;
@@ -125226,12 +125755,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125226
125755
  };
125227
125756
  this._onControlEnd = function (res) {
125228
125757
  _this.noObserver.isControlActive = false;
125229
- _this22.$emit('controlEnd', res);
125230
-
125231
- // 统一交互结束处理(相机)
125232
- _this22.endInteraction('this.camera', res, {
125233
- immediateResume: false
125234
- });
125758
+ _this24.$emit('controlEnd', res);
125759
+ if (!_this24.isCameraControlMoveObserverEnabled()) {
125760
+ // 未开启普通视角运动加载时,保持原有交互中断流程。
125761
+ _this24.endInteraction('this.camera', res, {
125762
+ immediateResume: false
125763
+ });
125764
+ }
125235
125765
 
125236
125766
  // 记录鼠标抬起时的位置并计算是否发生了拖拽
125237
125767
  var event = res.originalEvent || window.event;
@@ -125258,7 +125788,10 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125258
125788
  // }
125259
125789
 
125260
125790
  // 触发观察者
125261
- _this22._cameraChangeObserver('control');
125791
+ _this24._cameraChangeObserver('control');
125792
+ }
125793
+ if (_this24.isCameraControlMoveObserverEnabled()) {
125794
+ _this24.resetCameraControlMoveSnapshot(false);
125262
125795
  }
125263
125796
  };
125264
125797
  this.cameraControls.addEventListener('controlstart', this._onControlStart);
@@ -125268,7 +125801,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125268
125801
  // 监听 rest 事件,捕获 this.cameraControls.setLookAt(..., true) 等动画结束(以及阻尼停止)
125269
125802
  // 注意:rest 事件在用户交互完全静止时也会触发,与 controlEnd 有部分重叠,但 Observer 有防抖,影响不大
125270
125803
  this._onRest = function () {
125271
- _this22._cameraChangeObserver('rest');
125804
+ _this24._cameraChangeObserver('rest');
125272
125805
  };
125273
125806
  this.cameraControls.addEventListener('rest', this._onRest);
125274
125807
  },
@@ -125295,7 +125828,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125295
125828
  meshNameConfig: {}
125296
125829
  */
125297
125830
  drawModel: function drawModel(data) {
125298
- var _this23 = this;
125831
+ var _this25 = this;
125299
125832
  var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
125300
125833
  var meshNameConfig = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
125301
125834
  var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
@@ -125304,25 +125837,46 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125304
125837
  // 使用新的分帧加载方法,提供进度回调
125305
125838
  return this.drawModelWithBatchLoading(data, color, meshNameConfig, options, function (progress) {
125306
125839
  // 触发原有的进度事件
125307
- _this23.$emit('loadProgress', _this23.progress);
125840
+ _this25.$emit('loadProgress', _this25.progress);
125308
125841
  }, function (complete) {
125309
125842
  var _options$onComplete2;
125310
125843
  options === null || options === void 0 || (_options$onComplete2 = options.onComplete) === null || _options$onComplete2 === void 0 || _options$onComplete2.call(options, complete);
125311
125844
  console.log('加载完成');
125312
125845
  // 触发原有的完成事件
125313
125846
  if (!(options !== null && options !== void 0 && options.suppressLoadComplete)) {
125314
- _this23.$emit('loadComplete');
125847
+ _this25.$emit('loadComplete');
125315
125848
  }
125316
125849
  });
125317
125850
  },
125318
125851
  // 动态设置视角滚轮的距离
125319
125852
  setCameraConfig: function setCameraConfig() {
125853
+ if (!this.sceneBoundingBox || !this.sceneBoundingBox.isBox3 || this.sceneBoundingBox.isEmpty()) {
125854
+ return;
125855
+ }
125320
125856
  // let box3 = new this.THREE.Box3().setFromObject(this.sceneBoundingBox);
125321
125857
  var size = new this.THREE.Vector3();
125322
125858
  this.sceneBoundingBox.getSize(size);
125323
125859
  var maxBorder = Math.max(size.x, size.y, size.z);
125860
+ if (isDebug) {
125861
+ var center = this.sceneBoundingBox.getCenter(new this.THREE.Vector3());
125862
+ console.log('sceneBoundingBox 调试信息', {
125863
+ size: {
125864
+ x: size.x,
125865
+ y: size.y,
125866
+ z: size.z
125867
+ },
125868
+ center: {
125869
+ x: center.x,
125870
+ y: center.y,
125871
+ z: center.z
125872
+ },
125873
+ maxBorder: maxBorder
125874
+ });
125875
+ this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
125876
+ }
125324
125877
  // this.cameraControls.this.camera.far = maxBorder * 10; // 设置相机的远裁剪面
125325
125878
  this.cameraControls.minDistance = maxBorder * 0.2; // 动态设置视角滚轮的距离
125879
+ // this.cameraControls.minDistance = 1000; // 动态设置视角滚轮的距离
125326
125880
  this.camera.updateProjectionMatrix();
125327
125881
  },
125328
125882
  // 获取mesh的中心点
@@ -125338,14 +125892,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125338
125892
  };
125339
125893
  },
125340
125894
  mouseDown: function mouseDown(event) {
125341
- var _this24 = this;
125895
+ var _this26 = this;
125342
125896
  // 在鼠标按下时启用渲染中断以提升响应性
125343
125897
  this.forceSkipRendering = true;
125344
125898
  this.skipNextRenderFrame = true;
125345
125899
  var intersects = this.getRaycasterObjects(event);
125346
125900
  console.log(intersects);
125347
125901
  var shouldBlockCamera = intersects.some(function (item) {
125348
- return _this24.isActiveTransformControlIntersection(item);
125902
+ return _this26.isActiveTransformControlIntersection(item);
125349
125903
  });
125350
125904
  if (shouldBlockCamera) {
125351
125905
  this.setPointerCameraGuard(true);
@@ -125427,19 +125981,19 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125427
125981
  return this.isTransformControlIntersection(intersection);
125428
125982
  },
125429
125983
  getPrimaryIntersection: function getPrimaryIntersection() {
125430
- var _this25 = this;
125984
+ var _this27 = this;
125431
125985
  var intersects = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
125432
125986
  if (!Array.isArray(intersects) || intersects.length === 0) {
125433
125987
  return null;
125434
125988
  }
125435
125989
  var validIntersects = intersects.filter(function (item) {
125436
- return item && item.object && !_this25.isTransformControlIntersection(item);
125990
+ return item && item.object && !_this27.isTransformControlIntersection(item);
125437
125991
  });
125438
125992
  if (validIntersects.length === 0) {
125439
125993
  return null;
125440
125994
  }
125441
125995
  var selectableIntersect = validIntersects.find(function (item) {
125442
- return _this25.getSelectableSceneObject(item.object);
125996
+ return _this27.getSelectableSceneObject(item.object);
125443
125997
  });
125444
125998
  return selectableIntersect || validIntersects[0] || null;
125445
125999
  },
@@ -125511,13 +126065,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125511
126065
  }
125512
126066
  },
125513
126067
  mouseClick: function mouseClick(event) {
125514
- var _this26 = this;
126068
+ var _this28 = this;
125515
126069
  // 鼠标抬起时重置渲染中断标记
125516
126070
  setTimeout(function () {
125517
- _this26.forceSkipRendering = false;
126071
+ _this28.forceSkipRendering = false;
125518
126072
  // interactionFrameCount = 0;
125519
126073
  // 恢复批次加载操作
125520
- _this26.resumeBatchLoading();
126074
+ _this28.resumeBatchLoading();
125521
126075
  }, 50); // 短暂延迟确保交互完成
125522
126076
 
125523
126077
  // 在测量模式下,不进行事件暴露
@@ -125576,21 +126130,21 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125576
126130
  this.setPointerCameraGuard(false);
125577
126131
  this.$emit('rightClick', params);
125578
126132
  onContextHandle(event, 'fl-model', '隐藏', this.isolateMode ? '取消隔离' : '隔离', function () {
125579
- _this26.updateProperty([{
126133
+ _this28.updateProperty([{
125580
126134
  name: params.instanceId,
125581
126135
  attr: {
125582
126136
  visible: false
125583
126137
  }
125584
126138
  }]);
125585
126139
  }, function () {
125586
- _this26.setAllModelVisible(_this26.isolateMode);
125587
- _this26.updateProperty([{
126140
+ _this28.setAllModelVisible(_this28.isolateMode);
126141
+ _this28.updateProperty([{
125588
126142
  name: params.instanceId,
125589
126143
  attr: {
125590
126144
  visible: true
125591
126145
  }
125592
126146
  }]);
125593
- _this26.isolateMode = !_this26.isolateMode;
126147
+ _this28.isolateMode = !_this28.isolateMode;
125594
126148
  });
125595
126149
  }
125596
126150
  } else if (event.button === 2) {
@@ -125598,21 +126152,21 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125598
126152
  this.setPointerCameraGuard(false);
125599
126153
  this.$emit('rightClick', params);
125600
126154
  onContextHandle(event, 'fl-model', '隐藏', this.isolateMode ? '取消隔离' : '隔离', function () {
125601
- _this26.updateProperty([{
126155
+ _this28.updateProperty([{
125602
126156
  name: params.instanceId,
125603
126157
  attr: {
125604
126158
  visible: false
125605
126159
  }
125606
126160
  }]);
125607
126161
  }, function () {
125608
- _this26.setAllModelVisible(_this26.isolateMode);
125609
- _this26.updateProperty([{
126162
+ _this28.setAllModelVisible(_this28.isolateMode);
126163
+ _this28.updateProperty([{
125610
126164
  name: params.instanceId,
125611
126165
  attr: {
125612
126166
  visible: true
125613
126167
  }
125614
126168
  }]);
125615
- _this26.isolateMode = !_this26.isolateMode;
126169
+ _this28.isolateMode = !_this28.isolateMode;
125616
126170
  });
125617
126171
  }
125618
126172
  }
@@ -125640,8 +126194,19 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125640
126194
  if (this.threeMeasure) {
125641
126195
  this.threeMeasure.updateParams(width, height);
125642
126196
  }
126197
+ this.updateMeshLineResolution(width, height);
125643
126198
  }
125644
126199
  },
126200
+ updateMeshLineResolution: function updateMeshLineResolution(width, height) {
126201
+ if (!this.modelGroup || !width || !height) return;
126202
+ this.modelGroup.traverse(function (child) {
126203
+ var material = child && child.material;
126204
+ if (material && material.type === 'MeshLineMaterial' && material.resolution) {
126205
+ material.resolution.set(width, height);
126206
+ material.needsUpdate = true;
126207
+ }
126208
+ });
126209
+ },
125645
126210
  setModelCenter: function setModelCenter(target) {
125646
126211
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
125647
126212
  // return
@@ -125692,7 +126257,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125692
126257
  },
125693
126258
  // 带防抖和用户交互检测的智能居中方法
125694
126259
  smartModelCenter: function smartModelCenter(mesh) {
125695
- var _this27 = this;
126260
+ var _this29 = this;
125696
126261
  var debounceDelay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
125697
126262
  // if (this.hasExecutedCentering) {
125698
126263
  // return;
@@ -125712,13 +126277,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125712
126277
  // 设置新的防抖定时器
125713
126278
  this.centeringDebounceTimer = setTimeout(function () {
125714
126279
  // 如果已经执行过居中操作,则不再执行
125715
- if (!_this27.userInteracting && !_this27.hasExecutedCentering && _this27.noObserver.documentModelIds.size > 0) {
125716
- _this27.setModelCenter(mesh, {
126280
+ if (!_this29.userInteracting && !_this29.hasExecutedCentering && _this29.noObserver.documentModelIds.size > 0) {
126281
+ _this29.setModelCenter(mesh, {
125717
126282
  enableTransition: false
125718
126283
  });
125719
- _this27.hasExecutedCentering = true;
126284
+ _this29.hasExecutedCentering = true;
125720
126285
  // 触发场景更新
125721
- _this27.notifyCameraChange();
126286
+ _this29.notifyCameraChange();
125722
126287
  }
125723
126288
  }, debounceDelay);
125724
126289
  },
@@ -125742,14 +126307,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125742
126307
  * }
125743
126308
  */
125744
126309
  updateProperty: function updateProperty(list) {
125745
- var _this28 = this;
126310
+ var _this30 = this;
125746
126311
  var hasOutline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
125747
126312
  var isUpdate = false;
125748
126313
  var _loop = function _loop() {
125749
126314
  var ele = list[index];
125750
126315
  var type = ele.type || 'mesh';
125751
126316
  var instanceId = ele.name;
125752
- var targetObj = _this28.getObjectByName(instanceId);
126317
+ var targetObj = _this30.getObjectByName(instanceId);
125753
126318
  var _loop2 = function _loop2(key) {
125754
126319
  switch (key) {
125755
126320
  case 'color':
@@ -125759,19 +126324,19 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125759
126324
  var instanceInfo = (_children$userData = children.userData) === null || _children$userData === void 0 || (_children$userData = _children$userData.instancesMap) === null || _children$userData === void 0 ? void 0 : _children$userData.get(instanceId);
125760
126325
  if (!instanceInfo) return;
125761
126326
  var instanceIndex = instanceInfo.instanceIndex;
125762
- children.setColorAt(instanceIndex, new _this28.THREE.Color(ele.attr[key]));
126327
+ children.setColorAt(instanceIndex, new _this30.THREE.Color(ele.attr[key]));
125763
126328
  children.instanceColor.needsUpdate = true;
125764
- if (!_this28.isCurrentVisible(instanceId, children)) {
125765
- _this28.removeOutlineObject(children, instanceIndex);
126329
+ if (!_this30.isCurrentVisible(instanceId, children)) {
126330
+ _this30.removeOutlineObject(children, instanceIndex);
125766
126331
  return;
125767
126332
  }
125768
126333
  if (hasOutline) {
125769
- if (_this28.outlinePass) {
126334
+ if (_this30.outlinePass) {
125770
126335
  if (children.isInstancedMesh) {
125771
- var proxy = _this28.ensureOutlineInstanceProxy(children, instanceIndex);
125772
- _this28.pushOutlineTarget(proxy);
125773
- } else if (!_this28.isSourceHiddenInstance(children, instanceId)) {
125774
- _this28.pushOutlineTarget(children);
126336
+ var proxy = _this30.ensureOutlineInstanceProxy(children, instanceIndex);
126337
+ _this30.pushOutlineTarget(proxy);
126338
+ } else if (!_this30.isSourceHiddenInstance(children, instanceId)) {
126339
+ _this30.pushOutlineTarget(children);
125775
126340
  }
125776
126341
  }
125777
126342
  }
@@ -125784,10 +126349,10 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125784
126349
  isUpdate = true;
125785
126350
  }
125786
126351
  var requestedVisible = Boolean(ele.attr[key]);
125787
- var nextBoxVisible = requestedVisible && _this28.isSourceVisible(instanceId);
125788
- var boxKey = _this28._boxIndex && _this28._boxIndex.has(String(instanceId)) ? String(instanceId) : instanceId;
125789
- if (_this28._boxIndex && _this28._boxIndex.has(boxKey)) {
125790
- var boxData = _this28._boxIndex.get(boxKey);
126352
+ var nextBoxVisible = requestedVisible && _this30.isSourceVisible(instanceId);
126353
+ var boxKey = _this30._boxIndex && _this30._boxIndex.has(String(instanceId)) ? String(instanceId) : instanceId;
126354
+ if (_this30._boxIndex && _this30._boxIndex.has(boxKey)) {
126355
+ var boxData = _this30._boxIndex.get(boxKey);
125791
126356
  if (boxData && boxData.userData) {
125792
126357
  boxData.userData.visible = nextBoxVisible;
125793
126358
  }
@@ -125797,22 +126362,23 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125797
126362
  if (!instanceInfo) return;
125798
126363
  var instanceIndex = instanceInfo.instanceIndex,
125799
126364
  copyMatrix = instanceInfo.copyMatrix;
125800
- var nextVisible = requestedVisible && _this28.isSourceVisible(instanceId, children);
126365
+ var nextVisible = requestedVisible && _this30.isSourceVisible(instanceId, children);
125801
126366
  instanceInfo.visible = nextVisible;
125802
126367
  if (nextVisible) {
125803
- var restoreMatrix = new _this28.THREE.Matrix4().copy(copyMatrix || children.userData.copyMatrix);
126368
+ var restoreMatrix = new _this30.THREE.Matrix4().copy(copyMatrix || children.userData.copyMatrix);
125804
126369
  children.setMatrixAt(instanceIndex, restoreMatrix);
125805
126370
  } else {
125806
- var _copyMatrix = _this28.getInstanceCopyMatrix(children, instanceId);
126371
+ var _copyMatrix = _this30.getInstanceCopyMatrix(children, instanceId);
125807
126372
  if (!_copyMatrix) return;
125808
- var offsetMatrix = new _this28.THREE.Matrix4().copy(_copyMatrix || children.userData.copyMatrix).makeTranslation(9999999, 9999999, 9999999);
126373
+ var offsetMatrix = new _this30.THREE.Matrix4().copy(_copyMatrix || children.userData.copyMatrix).makeTranslation(9999999, 9999999, 9999999);
125809
126374
  children.setMatrixAt(instanceIndex, offsetMatrix);
125810
- _this28.removeOutlineObject(children, instanceIndex);
126375
+ _this30.removeOutlineObject(children, instanceIndex);
125811
126376
  }
125812
126377
  children.instanceMatrix.needsUpdate = true;
125813
126378
  });
125814
- _this28.refreshCollisionObbDebug();
125815
- _this28.notifyCameraChange(); // 触发场景更新
126379
+ _this30.refreshCollisionObbDebug();
126380
+ _this30.refreshOcclusionBoundsDebug();
126381
+ _this30.notifyCameraChange(); // 触发场景更新
125816
126382
  break;
125817
126383
  }
125818
126384
  case 'opacity':
@@ -125863,13 +126429,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125863
126429
  }
125864
126430
  },
125865
126431
  setAllModelVisible: function setAllModelVisible(visible) {
125866
- var _this29 = this;
126432
+ var _this31 = this;
125867
126433
  var isVisible = Boolean(visible);
125868
126434
  var matrixCache = new this.THREE.Matrix4();
125869
126435
  if (this._boxIndex && this._boxIndex.size > 0) {
125870
126436
  this._boxIndex.forEach(function (box, modelId) {
125871
126437
  if (!box || !box.userData) return;
125872
- box.userData.visible = isVisible && _this29.isSourceVisible(modelId);
126438
+ box.userData.visible = isVisible && _this31.isSourceVisible(modelId);
125873
126439
  });
125874
126440
  }
125875
126441
  if (this.scene) {
@@ -125882,7 +126448,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125882
126448
  var instanceIndex = instanceInfo && typeof instanceInfo.instanceIndex === 'number' ? instanceInfo.instanceIndex : null;
125883
126449
  if (instanceIndex === null) return;
125884
126450
  var copyMatrix = instanceInfo.copyMatrix || userData.copyMatrix;
125885
- if (isVisible && _this29.isSourceVisible(instanceId, child)) {
126451
+ if (isVisible && _this31.isSourceVisible(instanceId, child)) {
125886
126452
  instanceInfo.visible = true;
125887
126453
  matrixCache.copy(copyMatrix);
125888
126454
  child.setMatrixAt(instanceIndex, matrixCache);
@@ -125890,7 +126456,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125890
126456
  instanceInfo.visible = false;
125891
126457
  matrixCache.copy(copyMatrix).makeTranslation(9999999, 9999999, 9999999);
125892
126458
  child.setMatrixAt(instanceIndex, matrixCache);
125893
- _this29.removeOutlineObject(child, instanceIndex);
126459
+ _this31.removeOutlineObject(child, instanceIndex);
125894
126460
  }
125895
126461
  });
125896
126462
  child.instanceMatrix.needsUpdate = true;
@@ -125913,9 +126479,10 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125913
126479
  this.buildOctreeFromBoxIndex();
125914
126480
  }
125915
126481
  this.refreshCollisionObbDebug();
126482
+ this.refreshOcclusionBoundsDebug();
125916
126483
  },
125917
126484
  showOutlinePass: function showOutlinePass(instanceId) {
125918
- var _this30 = this;
126485
+ var _this32 = this;
125919
126486
  var targetObj = this.getObjectByName(instanceId);
125920
126487
  targetObj.forEach(function (children) {
125921
126488
  if (children.isMesh) {
@@ -125923,27 +126490,27 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125923
126490
  var instanceInfo = (_children$userData3 = children.userData) === null || _children$userData3 === void 0 || (_children$userData3 = _children$userData3.instancesMap) === null || _children$userData3 === void 0 ? void 0 : _children$userData3.get(instanceId);
125924
126491
  if (!instanceInfo) return;
125925
126492
  var instanceIndex = instanceInfo.instanceIndex;
125926
- if (!_this30.isSourceVisible(instanceId, children)) {
125927
- _this30.removeOutlineObject(children, instanceIndex);
126493
+ if (!_this32.isSourceVisible(instanceId, children)) {
126494
+ _this32.removeOutlineObject(children, instanceIndex);
125928
126495
  return;
125929
126496
  }
125930
- if (!_this30.isCurrentVisible(instanceId, children)) {
125931
- _this30.removeOutlineObject(children, instanceIndex);
126497
+ if (!_this32.isCurrentVisible(instanceId, children)) {
126498
+ _this32.removeOutlineObject(children, instanceIndex);
125932
126499
  return;
125933
126500
  }
125934
- if (_this30.outlinePass) {
126501
+ if (_this32.outlinePass) {
125935
126502
  if (children.isInstancedMesh) {
125936
- var proxy = _this30.ensureOutlineInstanceProxy(children, instanceIndex);
125937
- _this30.pushOutlineTarget(proxy);
126503
+ var proxy = _this32.ensureOutlineInstanceProxy(children, instanceIndex);
126504
+ _this32.pushOutlineTarget(proxy);
125938
126505
  } else {
125939
- _this30.pushOutlineTarget(children);
126506
+ _this32.pushOutlineTarget(children);
125940
126507
  }
125941
126508
  }
125942
126509
  }
125943
126510
  });
125944
126511
  },
125945
126512
  hideOutlinePass: function hideOutlinePass(instanceId) {
125946
- var _this31 = this;
126513
+ var _this33 = this;
125947
126514
  var targetObj = this.getObjectByName(instanceId);
125948
126515
  targetObj.forEach(function (children) {
125949
126516
  if (children.isMesh) {
@@ -125951,7 +126518,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125951
126518
  var instanceInfo = (_children$userData4 = children.userData) === null || _children$userData4 === void 0 || (_children$userData4 = _children$userData4.instancesMap) === null || _children$userData4 === void 0 ? void 0 : _children$userData4.get(instanceId);
125952
126519
  if (!instanceInfo) return;
125953
126520
  var instanceIndex = instanceInfo.instanceIndex;
125954
- _this31.removeOutlineObject(children, instanceIndex);
126521
+ _this33.removeOutlineObject(children, instanceIndex);
125955
126522
  }
125956
126523
  });
125957
126524
  },
@@ -125974,17 +126541,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
125974
126541
  },
125975
126542
  // 修改材质的自定义数据
125976
126543
  updateMaterialUserData: function updateMaterialUserData(list) {
125977
- var _this32 = this;
126544
+ var _this34 = this;
125978
126545
  var _loop3 = function _loop3() {
125979
126546
  var ele = list[index];
125980
126547
  var instanceId = ele.name;
125981
- var targetObj = _this32.getObjectByName(instanceId);
126548
+ var targetObj = _this34.getObjectByName(instanceId);
125982
126549
  var _loop4 = function _loop4(key) {
125983
126550
  switch (key) {
125984
126551
  case 'nColor':
125985
126552
  targetObj.forEach(function (children) {
125986
126553
  if (children.isMesh) {
125987
- children.material.userData[key] = new _this32.THREE.Color(ele.attr[key]);
126554
+ children.material.userData[key] = new _this34.THREE.Color(ele.attr[key]);
125988
126555
  }
125989
126556
  });
125990
126557
  break;
@@ -126000,12 +126567,12 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126000
126567
  },
126001
126568
  // 重置
126002
126569
  resetMaterialUserData: function resetMaterialUserData(list) {
126003
- var _this33 = this;
126570
+ var _this35 = this;
126004
126571
  console.log('resetMaterialUserData');
126005
126572
  var _loop5 = function _loop5() {
126006
126573
  var ele = list[index];
126007
126574
  var instanceId = ele.name;
126008
- var targetObj = _this33.getObjectByName(instanceId);
126575
+ var targetObj = _this35.getObjectByName(instanceId);
126009
126576
  var _loop6 = function _loop6(key) {
126010
126577
  switch (key) {
126011
126578
  case 'nColor':
@@ -126033,11 +126600,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126033
126600
  },
126034
126601
  // 清除上一次的属性修改操作 为了方便业务平台参数跟updateProperty方法的参数一样
126035
126602
  resetProperty: function resetProperty(list) {
126036
- var _this34 = this;
126603
+ var _this36 = this;
126037
126604
  var _loop7 = function _loop7() {
126038
126605
  var ele = list[index];
126039
126606
  var instanceId = ele.name;
126040
- var obj = _this34.getObjectByName(instanceId);
126607
+ var obj = _this36.getObjectByName(instanceId);
126041
126608
  if (obj) {
126042
126609
  for (var key in ele.attr) {
126043
126610
  switch (key) {
@@ -126050,12 +126617,12 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126050
126617
  var instanceIndex = instanceInfo.instanceIndex;
126051
126618
  children.setColorAt(instanceIndex, children.material.userData.nColor);
126052
126619
  children.instanceColor.needsUpdate = true;
126053
- if (_this34.outlinePass) {
126620
+ if (_this36.outlinePass) {
126054
126621
  if (children.isInstancedMesh) {
126055
- _this34.removeOutlineInstanceProxy(children, instanceIndex);
126622
+ _this36.removeOutlineInstanceProxy(children, instanceIndex);
126056
126623
  } else {
126057
- var idx = _this34.outlinePass.selectedObjects.indexOf(children);
126058
- if (idx !== -1) _this34.outlinePass.selectedObjects.splice(idx, 1);
126624
+ var idx = _this36.outlinePass.selectedObjects.indexOf(children);
126625
+ if (idx !== -1) _this36.outlinePass.selectedObjects.splice(idx, 1);
126059
126626
  }
126060
126627
  }
126061
126628
  }
@@ -126068,19 +126635,20 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126068
126635
  if (!instanceInfo) return;
126069
126636
  var instanceIndex = instanceInfo.instanceIndex,
126070
126637
  copyMatrix = instanceInfo.copyMatrix;
126071
- if (_this34.isSourceVisible(instanceId, children)) {
126638
+ if (_this36.isSourceVisible(instanceId, children)) {
126072
126639
  instanceInfo.visible = true;
126073
- var restoreMatrix = new _this34.THREE.Matrix4().copy(copyMatrix);
126640
+ var restoreMatrix = new _this36.THREE.Matrix4().copy(copyMatrix);
126074
126641
  children.setMatrixAt(instanceIndex, restoreMatrix);
126075
126642
  } else {
126076
126643
  instanceInfo.visible = false;
126077
- var offsetMatrix = new _this34.THREE.Matrix4().copy(copyMatrix).makeTranslation(9999999, 9999999, 9999999);
126644
+ var offsetMatrix = new _this36.THREE.Matrix4().copy(copyMatrix).makeTranslation(9999999, 9999999, 9999999);
126078
126645
  children.setMatrixAt(instanceIndex, offsetMatrix);
126079
- _this34.removeOutlineObject(children, instanceIndex);
126646
+ _this36.removeOutlineObject(children, instanceIndex);
126080
126647
  }
126081
126648
  children.instanceMatrix.needsUpdate = true;
126082
126649
  });
126083
- _this34.refreshCollisionObbDebug();
126650
+ _this36.refreshCollisionObbDebug();
126651
+ _this36.refreshOcclusionBoundsDebug();
126084
126652
  break;
126085
126653
  }
126086
126654
  case 'opacity':
@@ -126130,19 +126698,19 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126130
126698
  // 定位到模型
126131
126699
  // name 模型名称或运行态 uuid,可以是数组
126132
126700
  locateModel: function locateModel(name) {
126133
- var _this35 = this;
126701
+ var _this37 = this;
126134
126702
  if (!this.scene) return false;
126135
126703
  if (Array.isArray(name)) {
126136
126704
  var box3 = new this.THREE.Box3();
126137
126705
  name.forEach(function (n) {
126138
- var objectByUuid = _this35.getObjectByUuid(n);
126706
+ var objectByUuid = _this37.getObjectByUuid(n);
126139
126707
  if (objectByUuid) {
126140
- _this35.expandLocateBoxByObject(box3, objectByUuid);
126708
+ _this37.expandLocateBoxByObject(box3, objectByUuid);
126141
126709
  return;
126142
126710
  }
126143
- var arr = _this35.getObjectByName(n);
126711
+ var arr = _this37.getObjectByName(n);
126144
126712
  arr.forEach(function (o) {
126145
- _this35.expandLocateBoxByObject(box3, o);
126713
+ _this37.expandLocateBoxByObject(box3, o);
126146
126714
  });
126147
126715
  });
126148
126716
  if (!box3.isEmpty()) {
@@ -126187,14 +126755,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126187
126755
  }
126188
126756
  */
126189
126757
  updatePropertyByCustom: function updatePropertyByCustom(params) {
126190
- var _this36 = this;
126758
+ var _this38 = this;
126191
126759
  if (!this.scene) return;
126192
126760
  this.scene.traverse(function (child) {
126193
126761
  if (child.isMesh && child.userData[params.customName] === params.customValue) {
126194
126762
  for (var key in params.attr) {
126195
126763
  switch (key) {
126196
126764
  case 'color':
126197
- child.setColorAt(obj.userData.instanceIndex, new _this36.THREE.Color(params.attr[key]));
126765
+ child.setColorAt(obj.userData.instanceIndex, new _this38.THREE.Color(params.attr[key]));
126198
126766
  child.instanceColor.needsUpdate = true;
126199
126767
  break;
126200
126768
  case 'visible':
@@ -126277,14 +126845,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126277
126845
  passType: 要过滤的类型,默认是group,不返回group类型的实体
126278
126846
  */
126279
126847
  getObjectByName: function getObjectByName(name) {
126280
- var _this37 = this;
126848
+ var _this39 = this;
126281
126849
  var passType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'group';
126282
126850
  if (!this.scene) return [];
126283
126851
  if (Array.isArray(name)) {
126284
126852
  var result = [];
126285
126853
  var exist = new Set();
126286
126854
  name.forEach(function (item) {
126287
- _this37.getObjectByName(item, passType).forEach(function (obj) {
126855
+ _this39.getObjectByName(item, passType).forEach(function (obj) {
126288
126856
  if (!obj || exist.has(obj.uuid)) return;
126289
126857
  exist.add(obj.uuid);
126290
126858
  result.push(obj);
@@ -126322,12 +126890,12 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126322
126890
  return modelState.colorConfig;
126323
126891
  },
126324
126892
  addBypassCullingModelIds: function addBypassCullingModelIds(modelIds) {
126325
- var _this38 = this;
126893
+ var _this40 = this;
126326
126894
  var modelState = this.noObserver ? this.noObserver.modelStateManager : this.modelStateManager;
126327
126895
  if (!modelIds) return;
126328
126896
  if (Array.isArray(modelIds)) {
126329
126897
  modelIds.forEach(function (id) {
126330
- var modelId = _this38.formatModelId(id);
126898
+ var modelId = _this40.formatModelId(id);
126331
126899
  modelState.bypassCullingModelIds.add(modelId);
126332
126900
  });
126333
126901
  } else {
@@ -126340,12 +126908,12 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126340
126908
  return com_graphicsvue_type_script_lang_js_toConsumableArray(modelState.bypassCullingModelIds);
126341
126909
  },
126342
126910
  removeBypassCullingModelIds: function removeBypassCullingModelIds(modelIds) {
126343
- var _this39 = this;
126911
+ var _this41 = this;
126344
126912
  var modelState = this.noObserver ? this.noObserver.modelStateManager : this.modelStateManager;
126345
126913
  if (!modelIds) return;
126346
126914
  if (Array.isArray(modelIds)) {
126347
126915
  modelIds.forEach(function (id) {
126348
- var modelId = _this39.formatModelId(id);
126916
+ var modelId = _this41.formatModelId(id);
126349
126917
  modelState.bypassCullingModelIds.delete(modelId);
126350
126918
  });
126351
126919
  } else {
@@ -126359,7 +126927,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126359
126927
  },
126360
126928
  // 通过id删除对象
126361
126929
  removeObjectById: function removeObjectById(id) {
126362
- var _this40 = this;
126930
+ var _this42 = this;
126363
126931
  if (!this.scene) return;
126364
126932
  var array = this.getObjectByName(id);
126365
126933
  array.forEach(function (item) {
@@ -126369,13 +126937,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126369
126937
  if (item.isMesh) {
126370
126938
  item.clear();
126371
126939
  }
126372
- _this40.scene.remove(item);
126940
+ _this42.scene.remove(item);
126373
126941
  }
126374
126942
  });
126375
126943
  },
126376
126944
  // 通过名称删除对象
126377
126945
  removeObjectByName: function removeObjectByName(name) {
126378
- var _this41 = this;
126946
+ var _this43 = this;
126379
126947
  if (!this.scene) return;
126380
126948
  var array = this.getObjectByName(name);
126381
126949
  array.forEach(function (item) {
@@ -126384,17 +126952,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126384
126952
  if (item.isMesh) {
126385
126953
  item.clear();
126386
126954
  }
126387
- if (_this41.scene) _this41.scene.remove(item);
126955
+ if (_this43.scene) _this43.scene.remove(item);
126388
126956
  });
126389
126957
  },
126390
126958
  // 删除场景中所有的实体
126391
126959
  removeAll: function removeAll() {
126392
- var _this42 = this;
126960
+ var _this44 = this;
126393
126961
  return new Promise(function (resolve) {
126394
- if (_this42.scene) {
126395
- _this42.removeAllCustomElements();
126396
- _this42.removeTraverse();
126397
- _this42.removeModelByDocumentId();
126962
+ if (_this44.scene) {
126963
+ _this44.removeAllCustomElements();
126964
+ _this44.removeTraverse();
126965
+ _this44.removeModelByDocumentId();
126398
126966
  resolve();
126399
126967
  } else {
126400
126968
  resolve();
@@ -126402,7 +126970,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126402
126970
  });
126403
126971
  },
126404
126972
  removeTraverse: function removeTraverse() {
126405
- var _this43 = this;
126973
+ var _this45 = this;
126406
126974
  if (!this.modelGroup) return;
126407
126975
  var length = this.modelGroup.children.length;
126408
126976
  if (length > 0) {
@@ -126415,7 +126983,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126415
126983
  item.clear();
126416
126984
  item.material = null;
126417
126985
  item.geometry = null;
126418
- _this43.modelGroup && _this43.modelGroup.remove(item);
126986
+ _this45.modelGroup && _this45.modelGroup.remove(item);
126419
126987
  item = null;
126420
126988
  }
126421
126989
  });
@@ -126432,7 +127000,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126432
127000
  },
126433
127001
  // 销毁场景 释放内存
126434
127002
  destroyScene: function destroyScene() {
126435
- var _this44 = this;
127003
+ var _this46 = this;
126436
127004
  cancelAnimationFrame(this.animateId);
126437
127005
  this.disposeTransformControls();
126438
127006
  if (this.sceneCommandEventDisposers.length > 0) {
@@ -126447,11 +127015,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126447
127015
  }
126448
127016
  if (this.noObserver && this.noObserver.outlineInstanceProxyMap) {
126449
127017
  this.noObserver.outlineInstanceProxyMap.forEach(function (proxy) {
126450
- if (_this44.outlinePass) {
126451
- var idx = _this44.outlinePass.selectedObjects.indexOf(proxy);
126452
- if (idx !== -1) _this44.outlinePass.selectedObjects.splice(idx, 1);
127018
+ if (_this46.outlinePass) {
127019
+ var idx = _this46.outlinePass.selectedObjects.indexOf(proxy);
127020
+ if (idx !== -1) _this46.outlinePass.selectedObjects.splice(idx, 1);
126453
127021
  }
126454
- if (_this44.scene) _this44.scene.remove(proxy);
127022
+ if (_this46.scene) _this46.scene.remove(proxy);
126455
127023
  if (proxy && proxy.material && proxy.material.dispose) proxy.material.dispose();
126456
127024
  });
126457
127025
  this.noObserver.outlineInstanceProxyMap.clear();
@@ -126489,6 +127057,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126489
127057
  }
126490
127058
  this.clearBypassCullingModelIds();
126491
127059
  this.hideCollisionObbDebug();
127060
+ this.hideOcclusionBoundsDebug();
126492
127061
  if (this.scene) {
126493
127062
  this.removeTraverse();
126494
127063
  this.scene.clear();
@@ -126566,11 +127135,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126566
127135
  }
126567
127136
  */
126568
127137
  drawCurve: function drawCurve(params) {
126569
- var _this45 = this;
127138
+ var _this47 = this;
126570
127139
  this.removeObjectByName(params.name);
126571
127140
  var route = [];
126572
127141
  params.path.forEach(function (element) {
126573
- route.push(new _this45.THREE.Vector3(element.x, element.y, element.z));
127142
+ route.push(new _this47.THREE.Vector3(element.x, element.y, element.z));
126574
127143
  });
126575
127144
  if (route.length > 1) {
126576
127145
  this.curve = new this.THREE.CatmullRomCurve3(route);
@@ -126594,11 +127163,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126594
127163
  }
126595
127164
  */
126596
127165
  drawTextureCurve: function drawTextureCurve(params) {
126597
- var _this46 = this;
127166
+ var _this48 = this;
126598
127167
  this.removeObjectByName(params.name);
126599
127168
  var route = [];
126600
127169
  params.path.forEach(function (element) {
126601
- route.push(new _this46.THREE.Vector3(element.x, element.y, element.z));
127170
+ route.push(new _this48.THREE.Vector3(element.x, element.y, element.z));
126602
127171
  });
126603
127172
  // 画曲线
126604
127173
  if (route.length > 1) {
@@ -126703,14 +127272,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126703
127272
  * 参数val: 爆炸的值
126704
127273
  */
126705
127274
  globalBomb: function globalBomb(val) {
126706
- var _this47 = this;
127275
+ var _this49 = this;
126707
127276
  if (this.scene.children.length === 0) return;
126708
127277
  for (var i = 0; i < this.scene.children.length; i++) {
126709
127278
  console.log('this.scene', this.scene);
126710
127279
  this.scene.children[i].traverse(function (item) {
126711
127280
  if (!item.isMesh || !item.worldDir) return;
126712
127281
  // 爆炸公式
126713
- _this47.computedBomb(item, val);
127282
+ _this49.computedBomb(item, val);
126714
127283
  });
126715
127284
  }
126716
127285
  // this.timeRender();
@@ -126748,18 +127317,19 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126748
127317
  if (nodeType === 'custom-root') return true;
126749
127318
  if (userData.transformControlHelper === true) return true;
126750
127319
  if (userData.collisionObbDebugHelper === true) return true;
127320
+ if (userData.occlusionBoundsDebugHelper === true) return true;
126751
127321
  if (object.isCamera || object.isLight) return true;
126752
127322
  if (typeof object.type === 'string' && /Helper$/i.test(object.type)) return true;
126753
127323
  return object.type === 'CSS2DObject' || object.type === 'TransformControlsRoot';
126754
127324
  },
126755
127325
  getGlobalClippingRoots: function getGlobalClippingRoots() {
126756
- var _this48 = this;
127326
+ var _this50 = this;
126757
127327
  if (this.modelGroup && this.modelGroup.children && this.modelGroup.children.length) {
126758
127328
  return [this.modelGroup];
126759
127329
  }
126760
127330
  if (!this.scene || !this.scene.children || this.scene.children.length === 0) return [];
126761
127331
  return this.scene.children.filter(function (child) {
126762
- return !_this48.isGlobalClippingExcludedNode(child);
127332
+ return !_this50.isGlobalClippingExcludedNode(child);
126763
127333
  });
126764
127334
  },
126765
127335
  getGlobalClippingBox: function getGlobalClippingBox() {
@@ -126990,11 +127560,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
126990
127560
  },
126991
127561
  // 开启第一视角
126992
127562
  startFirstPer: function startFirstPer(options) {
126993
- var _ref5 = options || {},
126994
- _ref5$moveSpeed = _ref5.moveSpeed,
126995
- moveSpeed = _ref5$moveSpeed === void 0 ? 200 : _ref5$moveSpeed,
126996
- _ref5$jumpSpeed = _ref5.jumpSpeed,
126997
- jumpSpeed = _ref5$jumpSpeed === void 0 ? 200 : _ref5$jumpSpeed;
127563
+ var _ref6 = options || {},
127564
+ _ref6$moveSpeed = _ref6.moveSpeed,
127565
+ moveSpeed = _ref6$moveSpeed === void 0 ? 200 : _ref6$moveSpeed,
127566
+ _ref6$jumpSpeed = _ref6.jumpSpeed,
127567
+ jumpSpeed = _ref6$jumpSpeed === void 0 ? 200 : _ref6$jumpSpeed;
126998
127568
  this.removeSpeed = this.getFirstPersonMoveSpeed(moveSpeed);
126999
127569
  var jumpConfig = this.getFirstPersonJumpConfig(jumpSpeed);
127000
127570
  this.upSpeed = jumpConfig.jumpSpeed;
@@ -127008,71 +127578,71 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127008
127578
  },
127009
127579
  // 页面是否锁定
127010
127580
  initPointerLock: function initPointerLock() {
127011
- var _this49 = this;
127581
+ var _this51 = this;
127012
127582
  this.home();
127013
127583
  setTimeout(function () {
127014
127584
  // 开启第一视角时,将相机与水平面保持水平
127015
- _this49.camera.rotation.x = 0;
127016
- _this49.camera.rotation.z = 0;
127017
- _this49.pointControls = new PointerLockControls(_this49.camera, _this49.renderer.domElement);
127018
- _this49.pointControls.lock();
127019
- if (!_this49._onFirstPersonChange) {
127020
- _this49._onFirstPersonChange = function () {
127021
- if (typeof _this49._cameraChangeObserver === 'function') {
127022
- _this49._cameraChangeObserver('firstPerson');
127585
+ _this51.camera.rotation.x = 0;
127586
+ _this51.camera.rotation.z = 0;
127587
+ _this51.pointControls = new PointerLockControls(_this51.camera, _this51.renderer.domElement);
127588
+ _this51.pointControls.lock();
127589
+ if (!_this51._onFirstPersonChange) {
127590
+ _this51._onFirstPersonChange = function () {
127591
+ if (typeof _this51._cameraChangeObserver === 'function') {
127592
+ _this51._cameraChangeObserver('firstPerson');
127023
127593
  }
127024
127594
  };
127025
127595
  }
127026
127596
  try {
127027
- _this49.pointControls.addEventListener('change', _this49._onFirstPersonChange);
127597
+ _this51.pointControls.addEventListener('change', _this51._onFirstPersonChange);
127028
127598
  } catch (e) {}
127029
127599
  // 锁定
127030
- _this49.pointControls.addEventListener('lock', function () {
127031
- _this49.detachTransformControls();
127032
- if (_this49.cameraControls) {
127033
- _this49.cameraControls.enabled = false;
127600
+ _this51.pointControls.addEventListener('lock', function () {
127601
+ _this51.detachTransformControls();
127602
+ if (_this51.cameraControls) {
127603
+ _this51.cameraControls.enabled = false;
127034
127604
  }
127035
- window.addEventListener('keydown', _this49.onKeyDown, false);
127036
- window.addEventListener('keyup', _this49.onKeyUp, false);
127037
- _this49.unbindScenePointerEvents();
127038
- if (typeof _this49._cameraChangeObserver === 'function') {
127039
- _this49._cameraChangeObserver('firstPersonLock');
127605
+ window.addEventListener('keydown', _this51.onKeyDown, false);
127606
+ window.addEventListener('keyup', _this51.onKeyUp, false);
127607
+ _this51.unbindScenePointerEvents();
127608
+ if (typeof _this51._cameraChangeObserver === 'function') {
127609
+ _this51._cameraChangeObserver('firstPersonLock');
127040
127610
  }
127041
127611
  });
127042
127612
  // 解锁
127043
- _this49.pointControls.addEventListener('unlock', function () {
127044
- _this49.firstPerSign = false;
127045
- if (_this49.cameraControls) {
127046
- _this49.cameraControls.enabled = true;
127613
+ _this51.pointControls.addEventListener('unlock', function () {
127614
+ _this51.firstPerSign = false;
127615
+ if (_this51.cameraControls) {
127616
+ _this51.cameraControls.enabled = true;
127047
127617
  }
127048
127618
  // 返回初始视角
127049
- if (_this49.cameraControls && _this49.camera && _this49.sceneBoundingBox) {
127050
- _this49.home();
127619
+ if (_this51.cameraControls && _this51.camera && _this51.sceneBoundingBox) {
127620
+ _this51.home();
127051
127621
  }
127052
127622
  try {
127053
- if (_this49._onFirstPersonChange && _this49.pointControls) {
127054
- _this49.pointControls.removeEventListener('change', _this49._onFirstPersonChange);
127623
+ if (_this51._onFirstPersonChange && _this51.pointControls) {
127624
+ _this51.pointControls.removeEventListener('change', _this51._onFirstPersonChange);
127055
127625
  }
127056
127626
  } catch (e) {}
127057
- if (_this49.noObserver) {
127058
- _this49.noObserver._firstPersonLastPos = null;
127627
+ if (_this51.noObserver) {
127628
+ _this51.noObserver._firstPersonLastPos = null;
127059
127629
  }
127060
127630
  setTimeout(function () {
127061
- window.removeEventListener('keydown', _this49.onKeyDown);
127062
- window.removeEventListener('keyup', _this49.onKeyUp);
127063
- if (_this49.renderer && _this49.renderer.domElement) {
127064
- _this49.bindScenePointerEvents();
127631
+ window.removeEventListener('keydown', _this51.onKeyDown);
127632
+ window.removeEventListener('keyup', _this51.onKeyUp);
127633
+ if (_this51.renderer && _this51.renderer.domElement) {
127634
+ _this51.bindScenePointerEvents();
127065
127635
  }
127066
- if (_this49.scene) {
127067
- _this49.ensureTransformSelectionValid();
127636
+ if (_this51.scene) {
127637
+ _this51.ensureTransformSelectionValid();
127068
127638
  }
127069
127639
  // this.timeRender()
127070
127640
  }, 0);
127071
- if (typeof _this49._cameraChangeObserver === 'function') {
127072
- _this49._cameraChangeObserver('firstPersonUnlock');
127641
+ if (typeof _this51._cameraChangeObserver === 'function') {
127642
+ _this51._cameraChangeObserver('firstPersonUnlock');
127073
127643
  }
127074
127644
  });
127075
- if (_this49.scene) _this49.scene.add(_this49.pointControls.object);
127645
+ if (_this51.scene) _this51.scene.add(_this51.pointControls.object);
127076
127646
  }, 10);
127077
127647
  },
127078
127648
  // 第一视角运动
@@ -127227,7 +127797,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127227
127797
  return this.scene && this.scene.children ? this.scene.children : [];
127228
127798
  },
127229
127799
  openMeasure: function openMeasure(type) {
127230
- var _this50 = this;
127800
+ var _this52 = this;
127231
127801
  var isClear = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
127232
127802
  if (this.threeMeasure) {
127233
127803
  this.threeMeasure.close(isClear);
@@ -127239,7 +127809,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127239
127809
  case 'distance':
127240
127810
  this.threeMeasure = new measure_distance.MeasureDistance(this.renderer, this.scene, this.camera, this.instructions.offsetWidth, this.instructions.offsetHeight, {
127241
127811
  pickRoots: function pickRoots() {
127242
- return _this50.getMeasurePickRoots();
127812
+ return _this52.getMeasurePickRoots();
127243
127813
  }
127244
127814
  });
127245
127815
  this.threeMeasure.start();
@@ -127247,7 +127817,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127247
127817
  case 'area':
127248
127818
  this.threeMeasure = new measure_area.MeasureArea(this.renderer, this.scene, this.camera, this.instructions.offsetWidth, this.instructions.offsetHeight, {
127249
127819
  pickRoots: function pickRoots() {
127250
- return _this50.getMeasurePickRoots();
127820
+ return _this52.getMeasurePickRoots();
127251
127821
  }
127252
127822
  });
127253
127823
  this.threeMeasure.start();
@@ -127255,7 +127825,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127255
127825
  case 'angle':
127256
127826
  this.threeMeasure = new measure_angle.MeasureAngle(this.renderer, this.scene, this.camera, this.instructions.offsetWidth, this.instructions.offsetHeight, {
127257
127827
  pickRoots: function pickRoots() {
127258
- return _this50.getMeasurePickRoots();
127828
+ return _this52.getMeasurePickRoots();
127259
127829
  }
127260
127830
  });
127261
127831
  this.threeMeasure.start();
@@ -127263,7 +127833,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127263
127833
  case 'height':
127264
127834
  this.threeMeasure = new measure_height.MeasureHeight(this.renderer, this.scene, this.camera, this.instructions.offsetWidth, this.instructions.offsetHeight, {
127265
127835
  pickRoots: function pickRoots() {
127266
- return _this50.getMeasurePickRoots();
127836
+ return _this52.getMeasurePickRoots();
127267
127837
  }
127268
127838
  });
127269
127839
  this.threeMeasure.start();
@@ -127309,11 +127879,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127309
127879
  return object.name === 'measureObj' || userData.isMeasureObject === true;
127310
127880
  },
127311
127881
  removeMeasureObjectsFromScene: function removeMeasureObjectsFromScene() {
127312
- var _this51 = this;
127882
+ var _this53 = this;
127313
127883
  if (!this.scene) return;
127314
127884
  var measureObjects = [];
127315
127885
  this.scene.traverse(function (object) {
127316
- if (_this51.isMeasureObject(object)) {
127886
+ if (_this53.isMeasureObject(object)) {
127317
127887
  measureObjects.push(object);
127318
127888
  }
127319
127889
  });
@@ -127321,9 +127891,9 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127321
127891
  if (object.parent) {
127322
127892
  object.parent.remove(object);
127323
127893
  } else {
127324
- _this51.scene.remove(object);
127894
+ _this53.scene.remove(object);
127325
127895
  }
127326
- _this51.disposeMeasureObject(object);
127896
+ _this53.disposeMeasureObject(object);
127327
127897
  });
127328
127898
  },
127329
127899
  // 增加一个清除所有测量结果的方法,清理历史测量实例遗留的对象
@@ -127396,12 +127966,12 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127396
127966
  参数: object, 目标实体,
127397
127967
  */
127398
127968
  isolate: function isolate(object) {
127399
- var _this52 = this;
127969
+ var _this54 = this;
127400
127970
  if (!this.scene) return;
127401
127971
  // 隔离 将目标实体以外的实体隐藏掉
127402
127972
  this.scene.traverse(function (item) {
127403
127973
  if (item.isMesh && item.name !== object.name) {
127404
- var offsetMatrix = new _this52.THREE.Matrix4().copy(item.userData.copyMatrix).makeTranslation(9999999, 9999999, 9999999);
127974
+ var offsetMatrix = new _this54.THREE.Matrix4().copy(item.userData.copyMatrix).makeTranslation(9999999, 9999999, 9999999);
127405
127975
  item.setMatrixAt(item.userData.instanceIndex, offsetMatrix);
127406
127976
  item.instanceMatrix.needsUpdate = true;
127407
127977
  }
@@ -127409,7 +127979,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127409
127979
  },
127410
127980
  // 还原操作 将修改过的实体进行恢复
127411
127981
  restore: function restore() {
127412
- var _this53 = this;
127982
+ var _this55 = this;
127413
127983
  if (!this.scene) return;
127414
127984
  this.scene.traverse(function (item) {
127415
127985
  if (item.isMesh) {
@@ -127431,20 +128001,20 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127431
128001
  item.userData.translateMatrixInvert = null;
127432
128002
  }
127433
128003
  if (item.userData.combineMatrixInvert) {
127434
- _this53.rotateMesh(item, {
128004
+ _this55.rotateMesh(item, {
127435
128005
  x: 0,
127436
128006
  y: 0,
127437
128007
  z: 0
127438
128008
  });
127439
128009
  item.userData.combineMatrixInvert = null;
127440
128010
  }
127441
- var copyMatrix = _this53.getInstanceCopyMatrix(item, instanceId);
128011
+ var copyMatrix = _this55.getInstanceCopyMatrix(item, instanceId);
127442
128012
  if (!copyMatrix) return;
127443
- var sourceHidden = _this53.isSourceHiddenInstance(item, instanceId);
127444
- var offsetMatrix = new _this53.THREE.Matrix4().copy(copyMatrix);
128013
+ var sourceHidden = _this55.isSourceHiddenInstance(item, instanceId);
128014
+ var offsetMatrix = new _this55.THREE.Matrix4().copy(copyMatrix);
127445
128015
  if (sourceHidden) {
127446
128016
  offsetMatrix.makeTranslation(9999999, 9999999, 9999999);
127447
- _this53.removeOutlineInstanceProxy(item, item.userData.instanceIndex);
128017
+ _this55.removeOutlineInstanceProxy(item, item.userData.instanceIndex);
127448
128018
  }
127449
128019
  item.setMatrixAt(item.userData.instanceIndex, offsetMatrix);
127450
128020
  item.instanceMatrix.needsUpdate = true;
@@ -127453,7 +128023,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127453
128023
  },
127454
128024
  // 添加自定义模型, 暂时只支持glb、gltf格式
127455
128025
  addCustomModel: function addCustomModel(name, position, url) {
127456
- var _this54 = this;
128026
+ var _this56 = this;
127457
128027
  var scale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
127458
128028
  var immediately = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
127459
128029
  var callback = arguments.length > 5 ? arguments[5] : undefined;
@@ -127464,41 +128034,41 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127464
128034
  locationModel.scale.set(scale, scale, scale);
127465
128035
  locationModel.updateMatrixWorld();
127466
128036
  if (immediately) {
127467
- _this54.cameraControls.fitToSphere(gltf.this.scene, true);
128037
+ _this56.cameraControls.fitToSphere(gltf.this.scene, true);
127468
128038
  }
127469
128039
  // 动画混合器
127470
128040
  // 不参与裁剪
127471
128041
  locationModel.userData.cull = false;
127472
128042
  locationModel.name = name;
127473
- if (_this54.scene) _this54.scene.add(locationModel);
127474
- locationModel.position.copy(new _this54.THREE.Vector3(position.x, position.y, position.z));
128043
+ if (_this56.scene) _this56.scene.add(locationModel);
128044
+ locationModel.position.copy(new _this56.THREE.Vector3(position.x, position.y, position.z));
127475
128045
  if (gltf.animations.length > 0) {
127476
- var actionMixer = new _this54.THREE.AnimationMixer(gltf.this.scene);
128046
+ var actionMixer = new _this56.THREE.AnimationMixer(gltf.this.scene);
127477
128047
  var walkActive = actionMixer.clipAction(gltf.animations[0]);
127478
128048
  walkActive.play();
127479
- _this54.modelActive.push(walkActive);
127480
- _this54.modelActions.push(actionMixer);
128049
+ _this56.modelActive.push(walkActive);
128050
+ _this56.modelActions.push(actionMixer);
127481
128051
  }
127482
128052
  callback && callback();
127483
128053
  });
127484
128054
  },
127485
128055
  // 删除添加的自定义模型
127486
128056
  removeCustomModel: function removeCustomModel(name) {
127487
- var _this55 = this;
128057
+ var _this57 = this;
127488
128058
  var obj = this.getObjectByName(name);
127489
128059
  obj.forEach(function (item, index) {
127490
128060
  if (item.animations > 0) {
127491
128061
  item.removeFromParent();
127492
- _this55.modelActions[index].uncacheRoot(item);
127493
- _this55.modelActions[index].uncacheRoot(_this55.modelActive[index]);
128062
+ _this57.modelActions[index].uncacheRoot(item);
128063
+ _this57.modelActions[index].uncacheRoot(_this57.modelActive[index]);
127494
128064
  }
127495
128065
  item.traverse(function (child) {
127496
- if (child instanceof _this55.THREE.Mesh) {
128066
+ if (child instanceof _this57.THREE.Mesh) {
127497
128067
  child.geometry.dispose();
127498
128068
  child.material.dispose();
127499
128069
  }
127500
128070
  });
127501
- if (_this55.scene) _this55.scene.remove(item);
128071
+ if (_this57.scene) _this57.scene.remove(item);
127502
128072
  });
127503
128073
  this.modelActions.splice(0);
127504
128074
  this.modelActive.splice(0);
@@ -127560,7 +128130,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127560
128130
  return size;
127561
128131
  },
127562
128132
  animate: function animate() {
127563
- var _this56 = this;
128133
+ var _this58 = this;
127564
128134
  if (isDebug) {
127565
128135
  this.stats && this.stats.begin(); // 开始帧率统计
127566
128136
  }
@@ -127574,10 +128144,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127574
128144
  if (this.timeStamp > singleFrameTime) {
127575
128145
  if (this.modelActions.length > 0) {
127576
128146
  this.modelActions.forEach(function (item) {
127577
- item.update(_this56.timeStamp);
128147
+ item.update(_this58.timeStamp);
127578
128148
  });
127579
128149
  }
127580
128150
  this.cameraControls.enabled && this.cameraControls.update(this.timeStamp);
128151
+ this.observeCameraControlMove();
127581
128152
  // 计算相机近裁面到包围盒当前面的距离
127582
128153
  this.cameraTrack();
127583
128154
  this.firstPerspective();
@@ -127701,6 +128272,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127701
128272
  if (!this.isSourceVisible(instanceId, object)) return false;
127702
128273
  var instanceInfo = object && object.userData && object.userData.instancesMap instanceof Map && object.userData.instancesMap.get(instanceId);
127703
128274
  if (instanceInfo && instanceInfo.visible === false) return false;
128275
+ if (instanceInfo && instanceInfo.cullingVisible === false) return false;
127704
128276
  var box = this._boxIndex && this._boxIndex.has(String(instanceId)) ? this._boxIndex.get(String(instanceId)) : this._boxIndex && this._boxIndex.has(instanceId) ? this._boxIndex.get(instanceId) : null;
127705
128277
  if (box && box.userData && box.userData.visible === false) return false;
127706
128278
  return true;
@@ -127751,6 +128323,14 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127751
128323
  var onProgress = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
127752
128324
  var onComplete = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;
127753
128325
  var loadingState = this.noObserver ? this.noObserver.batchLoadingState : this.batchLoadingState;
128326
+ var rect = this.renderer ? this.renderer.domElement.getBoundingClientRect() : {
128327
+ width: window.innerWidth,
128328
+ height: window.innerHeight
128329
+ };
128330
+ options.meshLineResolution = {
128331
+ width: rect.width || window.innerWidth || 1,
128332
+ height: rect.height || window.innerHeight || 1
128333
+ };
127754
128334
  // 如果已经在加载中,先停止之前的加载
127755
128335
  if (loadingState.isLoading) {
127756
128336
  this.stopBatchLoading('restart');
@@ -127932,25 +128512,25 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127932
128512
  * 加载下一批数据
127933
128513
  */
127934
128514
  loadNextBatch: function loadNextBatch() {
127935
- var _this57 = this;
128515
+ var _this59 = this;
127936
128516
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee1() {
127937
128517
  var loadingState, batch, _t3;
127938
128518
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context1) {
127939
128519
  while (1) switch (_context1.p = _context1.n) {
127940
128520
  case 0:
127941
- loadingState = _this57.noObserver ? _this57.noObserver.batchLoadingState : _this57.batchLoadingState;
127942
- if (_this57.isBatchLoadingSceneReady()) {
128521
+ loadingState = _this59.noObserver ? _this59.noObserver.batchLoadingState : _this59.batchLoadingState;
128522
+ if (_this59.isBatchLoadingSceneReady()) {
127943
128523
  _context1.n = 1;
127944
128524
  break;
127945
128525
  }
127946
- _this57.stopBatchLoading('scene_unavailable');
128526
+ _this59.stopBatchLoading('scene_unavailable');
127947
128527
  return _context1.a(2);
127948
128528
  case 1:
127949
128529
  if (!(!loadingState.isLoading || loadingState.currentBatch >= loadingState.pendingData.length)) {
127950
128530
  _context1.n = 2;
127951
128531
  break;
127952
128532
  }
127953
- _this57.completeBatchLoading();
128533
+ _this59.completeBatchLoading();
127954
128534
  return _context1.a(2);
127955
128535
  case 2:
127956
128536
  if (!loadingState.isPaused) {
@@ -127959,7 +128539,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127959
128539
  }
127960
128540
  // 如果暂停,延迟一段时间后再次检查
127961
128541
  loadingState.animationFrameId = requestAnimationFrame(function () {
127962
- _this57.loadNextBatch();
128542
+ _this59.loadNextBatch();
127963
128543
  });
127964
128544
  return _context1.a(2);
127965
128545
  case 3:
@@ -127969,7 +128549,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127969
128549
  }
127970
128550
  // 如果正在交互,延迟一段时间后再次检查
127971
128551
  loadingState.animationFrameId = requestAnimationFrame(function () {
127972
- _this57.loadNextBatch();
128552
+ _this59.loadNextBatch();
127973
128553
  });
127974
128554
  return _context1.a(2);
127975
128555
  case 4:
@@ -127978,13 +128558,13 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127978
128558
  _context1.n = 5;
127979
128559
  break;
127980
128560
  }
127981
- _this57.completeBatchLoading();
128561
+ _this59.completeBatchLoading();
127982
128562
  return _context1.a(2);
127983
128563
  case 5:
127984
128564
  _context1.p = 5;
127985
128565
  console.log('加载批次:', loadingState.currentBatch);
127986
128566
  _context1.n = 6;
127987
- return _this57.processWithMainThread(batch);
128567
+ return _this59.processWithMainThread(batch);
127988
128568
  case 6:
127989
128569
  if (loadingState.isLoading) {
127990
128570
  _context1.n = 7;
@@ -127992,11 +128572,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
127992
128572
  }
127993
128573
  return _context1.a(2);
127994
128574
  case 7:
127995
- if (_this57.isBatchLoadingSceneReady()) {
128575
+ if (_this59.isBatchLoadingSceneReady()) {
127996
128576
  _context1.n = 8;
127997
128577
  break;
127998
128578
  }
127999
- _this57.stopBatchLoading('scene_unavailable');
128579
+ _this59.stopBatchLoading('scene_unavailable');
128000
128580
  return _context1.a(2);
128001
128581
  case 8:
128002
128582
  // 更新进度
@@ -128004,8 +128584,8 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128004
128584
  loadingState.currentBatch++;
128005
128585
 
128006
128586
  // 同步到响应式状态
128007
- _this57.batchLoadingState.loadedCount = loadingState.loadedCount;
128008
- _this57.batchLoadingState.currentBatch = loadingState.currentBatch;
128587
+ _this59.batchLoadingState.loadedCount = loadingState.loadedCount;
128588
+ _this59.batchLoadingState.currentBatch = loadingState.currentBatch;
128009
128589
 
128010
128590
  // 调用进度回调
128011
128591
  if (loadingState.onProgress) {
@@ -128019,7 +128599,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128019
128599
 
128020
128600
  // 使用 requestAnimationFrame 在下一帧继续加载
128021
128601
  loadingState.animationFrameId = requestAnimationFrame(function () {
128022
- _this57.loadNextBatch();
128602
+ _this59.loadNextBatch();
128023
128603
  });
128024
128604
  _context1.n = 10;
128025
128605
  break;
@@ -128030,7 +128610,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128030
128610
 
128031
128611
  // 继续下一批次
128032
128612
  loadingState.animationFrameId = requestAnimationFrame(function () {
128033
- _this57.loadNextBatch();
128613
+ _this59.loadNextBatch();
128034
128614
  });
128035
128615
  case 10:
128036
128616
  return _context1.a(2);
@@ -128042,20 +128622,20 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128042
128622
  * 使用主线程处理批次数据
128043
128623
  */
128044
128624
  processWithMainThread: function processWithMainThread(batch) {
128045
- var _this58 = this;
128625
+ var _this60 = this;
128046
128626
  return com_graphicsvue_type_script_lang_js_asyncToGenerator(/*#__PURE__*/com_graphicsvue_type_script_lang_js_regenerator().m(function _callee10() {
128047
128627
  var loadingState;
128048
128628
  return com_graphicsvue_type_script_lang_js_regenerator().w(function (_context10) {
128049
128629
  while (1) switch (_context10.n) {
128050
128630
  case 0:
128051
- loadingState = _this58.noObserver ? _this58.noObserver.batchLoadingState : _this58.batchLoadingState;
128631
+ loadingState = _this60.noObserver ? _this60.noObserver.batchLoadingState : _this60.batchLoadingState;
128052
128632
  loadingState.options.batchSize = loadingState.batchSize;
128053
128633
  loadingState.options.resetState = loadingState.currentBatch === 0;
128054
128634
  // 使用原始的handleInstancedMeshModel方法
128055
128635
 
128056
128636
  isDebug && performance.mark('handleInstancedMeshModel-start');
128057
128637
  _context10.n = 1;
128058
- return handleInstancedMeshModel(_this58.modelGroup, batch.instances, batch.drawObjs, '', _this58.scene, loadingState.color, loadingState.meshNameConfig, '', loadingState.options);
128638
+ return handleInstancedMeshModel(_this60.modelGroup, batch.instances, batch.drawObjs, '', _this60.scene, loadingState.color, loadingState.meshNameConfig, '', loadingState.options);
128059
128639
  case 1:
128060
128640
  isDebug && performance.mark('handleInstancedMeshModel-end');
128061
128641
  isDebug && performance.measure('handleInstancedMeshModel', 'handleInstancedMeshModel-start', 'handleInstancedMeshModel-end');
@@ -128069,7 +128649,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128069
128649
  * 完成批量加载
128070
128650
  */
128071
128651
  completeBatchLoading: function completeBatchLoading() {
128072
- var _this59 = this;
128652
+ var _this61 = this;
128073
128653
  var loadingState = this.noObserver ? this.noObserver.batchLoadingState : this.batchLoadingState;
128074
128654
  if (!loadingState.isLoading) return;
128075
128655
  if (!this.isBatchLoadingSceneReady()) {
@@ -128102,17 +128682,17 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128102
128682
  this.modelGroup.traverse(function (child) {
128103
128683
  if (child.isMesh && !child.userData.batchInitDone) {
128104
128684
  markRendered(child);
128105
- var json = _this59.getMeshCenterAndVolume(child);
128106
- var meshBox3 = new _this59.THREE.Box3();
128685
+ var json = _this61.getMeshCenterAndVolume(child);
128686
+ var meshBox3 = new _this61.THREE.Box3();
128107
128687
  meshBox3.setFromObject(child);
128108
- var worldPs = new _this59.THREE.Vector3().addVectors(meshBox3.max, meshBox3.min).multiplyScalar(0.5);
128688
+ var worldPs = new _this61.THREE.Vector3().addVectors(meshBox3.max, meshBox3.min).multiplyScalar(0.5);
128109
128689
  if (isNaN(worldPs.x)) return;
128110
- child.worldDir = new _this59.THREE.Vector3().subVectors(worldPs, modelWorldPs).normalize();
128690
+ child.worldDir = new _this61.THREE.Vector3().subVectors(worldPs, modelWorldPs).normalize();
128111
128691
  child.userData.center = json.center;
128112
128692
  child.userData.worldPs = worldPs;
128113
- child.userData.oldPs = child.getWorldPosition(new _this59.THREE.Vector3());
128693
+ child.userData.oldPs = child.getWorldPosition(new _this61.THREE.Vector3());
128114
128694
  child.userData.box = json.box;
128115
- child.userData.position = new _this59.THREE.Vector3().copy(child.position);
128695
+ child.userData.position = new _this61.THREE.Vector3().copy(child.position);
128116
128696
  child.userData.translate = {
128117
128697
  x: 0,
128118
128698
  y: 0,
@@ -128204,7 +128784,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128204
128784
  * @param {Object} options - 配置项 { immediate: boolean }
128205
128785
  */
128206
128786
  setSystemInterruption: function setSystemInterruption(active) {
128207
- var _this60 = this;
128787
+ var _this62 = this;
128208
128788
  var reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'user_interaction';
128209
128789
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
128210
128790
  var loadingState = this.noObserver ? this.noObserver.batchLoadingState : this.batchLoadingState;
@@ -128270,7 +128850,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128270
128850
  if (loadingState.interactionState.wheelTimeout) return;
128271
128851
 
128272
128852
  // 2. 如果是 wheel 结束,但 this.userInteracting (this.camera) 还在进行,则不恢复
128273
- if (reason === 'wheel' && _this60.userInteracting) return;
128853
+ if (reason === 'wheel' && _this62.userInteracting) return;
128274
128854
 
128275
128855
  // 3. 检查是否有强制跳过标记 (可能由其他逻辑触发)
128276
128856
  // if (this.forceSkipRendering && reason !== 'user_interaction') return; // 视情况而定
@@ -128281,15 +128861,15 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128281
128861
  loadingState.pauseReason = '';
128282
128862
  loadingState.interactionState.isInteracting = false;
128283
128863
  loadingState.interactionState.interactionType = '';
128284
- _this60.forceSkipRendering = false;
128864
+ _this62.forceSkipRendering = false;
128285
128865
 
128286
128866
  // 恢复本地批量加载 (如果未完成)
128287
128867
  if (loadingState.isLoading && loadingState.currentBatch < loadingState.totalBatches) {
128288
- _this60.loadNextBatch();
128868
+ _this62.loadNextBatch();
128289
128869
  }
128290
128870
 
128291
128871
  // 恢复 StreamLoader
128292
- var streamLoader = _this60.noObserver.streamLoader;
128872
+ var streamLoader = _this62.noObserver.streamLoader;
128293
128873
  if (streamLoader && typeof streamLoader.handleControlEnd === 'function') {
128294
128874
  // StreamLoader 内部通常有防抖或延迟,这里直接通知结束即可
128295
128875
  streamLoader.handleControlEnd();
@@ -128342,7 +128922,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128342
128922
  * 滚轮交互结束的定时检测
128343
128923
  */
128344
128924
  scheduleWheelInteractionEnd: function scheduleWheelInteractionEnd(event) {
128345
- var _this61 = this;
128925
+ var _this63 = this;
128346
128926
  var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
128347
128927
  var loadingState = this.noObserver ? this.noObserver.batchLoadingState : this.batchLoadingState;
128348
128928
  if (loadingState.interactionState.wheelTimeout) {
@@ -128350,11 +128930,18 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128350
128930
  loadingState.interactionState.wheelTimeout = null;
128351
128931
  }
128352
128932
  loadingState.interactionState.wheelTimeout = setTimeout(function () {
128353
- _this61.$emit('wheelEnd', event);
128354
- _this61.endInteraction('wheel', event, {
128355
- immediateResume: false
128356
- });
128933
+ _this63.$emit('wheelEnd', event);
128357
128934
  loadingState.interactionState.wheelTimeout = null;
128935
+ if (_this63.isCameraControlMoveObserverEnabled()) {
128936
+ _this63.resetCameraControlMoveSnapshot(false);
128937
+ if (typeof _this63._cameraChangeObserver === 'function') {
128938
+ _this63._cameraChangeObserver('wheel');
128939
+ }
128940
+ } else {
128941
+ _this63.endInteraction('wheel', event, {
128942
+ immediateResume: false
128943
+ });
128944
+ }
128358
128945
  }, delay);
128359
128946
  },
128360
128947
  /**
@@ -128382,9 +128969,71 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128382
128969
  /**
128383
128970
  * 隐藏场景包围盒
128384
128971
  */
128972
+ refreshSceneBoundingBoxHelper: function refreshSceneBoundingBoxHelper() {
128973
+ var forceVisible = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.boundingBoxVisible;
128974
+ if (this.sceneBoundingBoxHelper && this.scene) {
128975
+ this.scene.remove(this.sceneBoundingBoxHelper);
128976
+ this.sceneBoundingBoxHelper.geometry && this.sceneBoundingBoxHelper.geometry.dispose();
128977
+ if (Array.isArray(this.sceneBoundingBoxHelper.material)) {
128978
+ this.sceneBoundingBoxHelper.material.forEach(function (material) {
128979
+ material && material.dispose && material.dispose();
128980
+ });
128981
+ } else if (this.sceneBoundingBoxHelper.material && this.sceneBoundingBoxHelper.material.dispose) {
128982
+ this.sceneBoundingBoxHelper.material.dispose();
128983
+ }
128984
+ this.sceneBoundingBoxHelper = null;
128985
+ }
128986
+ if (!forceVisible || !this.scene || !this.sceneBoundingBox || !this.sceneBoundingBox.isBox3 || this.sceneBoundingBox.isEmpty()) {
128987
+ this.boundingBoxVisible = false;
128988
+ return false;
128989
+ }
128990
+ var helper = new this.THREE.Box3Helper(this.sceneBoundingBox, 0x00ff88);
128991
+ helper.name = 'sceneBoundingBoxHelper';
128992
+ helper.renderOrder = 999;
128993
+ if (helper.material) {
128994
+ helper.material.depthTest = false;
128995
+ helper.material.transparent = true;
128996
+ helper.material.opacity = 0.9;
128997
+ }
128998
+ this.scene.add(helper);
128999
+ this.sceneBoundingBoxHelper = helper;
129000
+ this.boundingBoxVisible = true;
129001
+ return true;
129002
+ },
129003
+ showSceneBoundingBox: function showSceneBoundingBox() {
129004
+ this.sceneBoundingBoxDebugEnabled = true;
129005
+ var shown = this.refreshSceneBoundingBoxHelper(true);
129006
+ if (!shown) {
129007
+ console.warn('sceneBoundingBox 无有效范围,无法绘制调试线框');
129008
+ return;
129009
+ }
129010
+ var size = this.sceneBoundingBox.getSize(new this.THREE.Vector3());
129011
+ var center = this.sceneBoundingBox.getCenter(new this.THREE.Vector3());
129012
+ console.log('sceneBoundingBox 线框已绘制', {
129013
+ size: {
129014
+ x: size.x,
129015
+ y: size.y,
129016
+ z: size.z
129017
+ },
129018
+ center: {
129019
+ x: center.x,
129020
+ y: center.y,
129021
+ z: center.z
129022
+ }
129023
+ });
129024
+ },
128385
129025
  hideSceneBoundingBox: function hideSceneBoundingBox() {
129026
+ this.sceneBoundingBoxDebugEnabled = false;
128386
129027
  if (this.sceneBoundingBoxHelper && this.scene) {
128387
129028
  this.scene.remove(this.sceneBoundingBoxHelper);
129029
+ this.sceneBoundingBoxHelper.geometry && this.sceneBoundingBoxHelper.geometry.dispose();
129030
+ if (Array.isArray(this.sceneBoundingBoxHelper.material)) {
129031
+ this.sceneBoundingBoxHelper.material.forEach(function (material) {
129032
+ material && material.dispose && material.dispose();
129033
+ });
129034
+ } else if (this.sceneBoundingBoxHelper.material && this.sceneBoundingBoxHelper.material.dispose) {
129035
+ this.sceneBoundingBoxHelper.material.dispose();
129036
+ }
128388
129037
  this.sceneBoundingBoxHelper = null;
128389
129038
  this.boundingBoxVisible = false;
128390
129039
  console.log('场景包围盒已隐藏');
@@ -128394,7 +129043,7 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128394
129043
  * 切换场景包围盒显示状态
128395
129044
  */
128396
129045
  toggleSceneBoundingBox: function toggleSceneBoundingBox() {
128397
- if (this.boundingBoxVisible) {
129046
+ if (this.sceneBoundingBoxDebugEnabled) {
128398
129047
  this.hideSceneBoundingBox();
128399
129048
  } else {
128400
129049
  this.showSceneBoundingBox();
@@ -128404,11 +129053,11 @@ var COLLISION_DEBUG_GROUP_NAME = '__collision_obb_debug_group__';
128404
129053
  });
128405
129054
  // CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=script&lang=js
128406
129055
  /* harmony default export */ var components_com_graphicsvue_type_script_lang_js = (com_graphicsvue_type_script_lang_js);
128407
- // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=0&id=d40d4870&prod&lang=scss&scoped=true
128408
- var com_graphicsvue_type_style_index_0_id_d40d4870_prod_lang_scss_scoped_true = __webpack_require__("5144");
129056
+ // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=0&id=43473926&prod&lang=scss&scoped=true
129057
+ var com_graphicsvue_type_style_index_0_id_43473926_prod_lang_scss_scoped_true = __webpack_require__("3d44");
128409
129058
 
128410
- // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=1&id=d40d4870&prod&lang=css
128411
- var com_graphicsvue_type_style_index_1_id_d40d4870_prod_lang_css = __webpack_require__("1160");
129059
+ // EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=1&id=43473926&prod&lang=css
129060
+ var com_graphicsvue_type_style_index_1_id_43473926_prod_lang_css = __webpack_require__("d447");
128412
129061
 
128413
129062
  // CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
128414
129063
  /* globals __VUE_SSR_CONTEXT__ */
@@ -128520,18 +129169,18 @@ function normalizeComponent(
128520
129169
 
128521
129170
  var component = normalizeComponent(
128522
129171
  components_com_graphicsvue_type_script_lang_js,
128523
- com_graphicsvue_type_template_id_d40d4870_scoped_true_render,
129172
+ com_graphicsvue_type_template_id_43473926_scoped_true_render,
128524
129173
  staticRenderFns,
128525
129174
  false,
128526
129175
  null,
128527
- "d40d4870",
129176
+ "43473926",
128528
129177
  null
128529
129178
 
128530
129179
  )
128531
129180
 
128532
129181
  /* harmony default export */ var com_graphics = (component.exports);
128533
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b074442e-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-flcanvas/index.vue?vue&type=template&id=e2de7752&scoped=true
128534
- var com_flcanvasvue_type_template_id_e2de7752_scoped_true_render = function render() {
129182
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"d898cbea-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-flcanvas/index.vue?vue&type=template&id=41b98e1a&scoped=true
129183
+ var com_flcanvasvue_type_template_id_41b98e1a_scoped_true_render = function render() {
128535
129184
  var _vm = this,
128536
129185
  _c = _vm._self._c;
128537
129186
  return _c('div', {
@@ -128544,9 +129193,9 @@ var com_flcanvasvue_type_template_id_e2de7752_scoped_true_render = function rend
128544
129193
  }
128545
129194
  });
128546
129195
  };
128547
- var com_flcanvasvue_type_template_id_e2de7752_scoped_true_staticRenderFns = [];
129196
+ var com_flcanvasvue_type_template_id_41b98e1a_scoped_true_staticRenderFns = [];
128548
129197
 
128549
- // CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=template&id=e2de7752&scoped=true
129198
+ // CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=template&id=41b98e1a&scoped=true
128550
129199
 
128551
129200
  // EXTERNAL MODULE: ./node_modules/konva/lib/index.js
128552
129201
  var lib = __webpack_require__("362d");
@@ -133593,7 +134242,6 @@ function decimalToRGBHex(decimalValue) {
133593
134242
  };
133594
134243
  }
133595
134244
  function handleFn(functionName, recordDxf, entity, group, key, configParams, konvaLayer) {
133596
- console.log(functionName);
133597
134245
  switch (functionName) {
133598
134246
  case 'LINE':
133599
134247
  drawLine(recordDxf, entity, group, key, configParams);
@@ -133764,9 +134412,11 @@ function mtextContentAndFormattingToTextAndStyle(textAndControlChars, entity, co
133764
134412
  function drawArc(recordDxf, entity, group, key, configParams) {
133765
134413
  var color = entity.color;
133766
134414
  var rgb = decimalToRGBHex(color);
133767
- console.log(rgb);
133768
134415
  var hex = rgb.hex;
133769
134416
  var startAngle, endAngle;
134417
+ if (hex == '#FFFFFF') {
134418
+ hex = '#000';
134419
+ }
133770
134420
  if (entity.type === 'CIRCLE') {
133771
134421
  startAngle = entity.startAngle || 0;
133772
134422
  endAngle = startAngle + 2 * Math.PI;
@@ -133788,10 +134438,11 @@ function drawArc(recordDxf, entity, group, key, configParams) {
133788
134438
  name: key.replace(/\s*/g, ''),
133789
134439
  entityId: key,
133790
134440
  stroke: hex,
133791
- customColor: configParams ? configParams.color : '',
134441
+ customColor: configParams ? configParams.color : hex,
133792
134442
  strokeWidth: width,
133793
134443
  visible: configParams ? configParams.visible : true,
133794
- oldstrokeLength: width
134444
+ oldstrokeLength: width,
134445
+ isGroup: false
133795
134446
  });
133796
134447
  // if(group.attrs.isBlock){
133797
134448
  // let scale=group.scale();
@@ -133816,8 +134467,6 @@ function drawEllpse(recordDxf, entity, group, key, configParams) {
133816
134467
  var xrad = Math.sqrt(Math.pow(parseFloat(entity.majorAxisEndPoint.x), 2) + Math.pow(parseFloat(entity.majorAxisEndPoint.y), 2));
133817
134468
  var yrad = xrad * parseFloat(entity.axisRatio);
133818
134469
  var rotation = Math.atan2(parseFloat(entity.majorAxisEndPoint.y), parseFloat(entity.majorAxisEndPoint.x));
133819
- console.log(entity.startAngle);
133820
- console.log(entity.endAngle);
133821
134470
  var curve = new EllipseCurve(parseFloat(entity.center.x), parseFloat(entity.center.y), xrad, yrad, parseFloat(entity.startAngle), parseFloat(entity.endAngle), false,
133822
134471
  // Always counterclockwise
133823
134472
  rotation);
@@ -133834,10 +134483,11 @@ function drawEllpse(recordDxf, entity, group, key, configParams) {
133834
134483
  name: key.replace(/\s*/g, ''),
133835
134484
  entityId: key,
133836
134485
  stroke: configParams ? configParams.color : '#000',
133837
- customColor: configParams ? configParams.color : '',
134486
+ customColor: configParams ? configParams.color : '#000',
133838
134487
  strokeWidth: width,
133839
134488
  visible: configParams ? configParams.visible : true,
133840
- oldstrokeLength: width
134489
+ oldstrokeLength: width,
134490
+ isGroup: false
133841
134491
  });
133842
134492
  // let line = new Konva.Line({
133843
134493
  // name: key.replace(/\s*/g, ""),
@@ -133858,7 +134508,6 @@ function drawEllpse(recordDxf, entity, group, key, configParams) {
133858
134508
  function drawLine(recordDxf, entity, group, key, configParams) {
133859
134509
  var color = entity.color;
133860
134510
  var rgb = decimalToRGBHex(color);
133861
- console.log(rgb);
133862
134511
  var hex = rgb.hex;
133863
134512
  var x1 = entity.vertices[0].x;
133864
134513
  var y1 = entity.vertices[0].y;
@@ -133875,7 +134524,7 @@ function drawLine(recordDxf, entity, group, key, configParams) {
133875
134524
  entityId: key,
133876
134525
  isGroup: false,
133877
134526
  stroke: hex,
133878
- customColor: configParams ? configParams.color : '',
134527
+ customColor: configParams ? configParams.color : hex,
133879
134528
  strokeWidth: width,
133880
134529
  visible: configParams ? configParams.visible : true,
133881
134530
  oldstrokeLength: width
@@ -133905,7 +134554,6 @@ function drawLine(recordDxf, entity, group, key, configParams) {
133905
134554
  function entityFormatting_drawText(recordDxf, entity, group, key, configParams) {
133906
134555
  var color = entity.color;
133907
134556
  var rgb = decimalToRGBHex(color);
133908
- console.log(rgb);
133909
134557
  var hex = rgb.hex;
133910
134558
  if (hex == '#FFFFFF') {
133911
134559
  hex = '#000';
@@ -133923,13 +134571,14 @@ function entityFormatting_drawText(recordDxf, entity, group, key, configParams)
133923
134571
  align: 'left',
133924
134572
  verticalAlign: 'top',
133925
134573
  fill: hex,
133926
- customColor: configParams ? configParams.color : '',
134574
+ customColor: configParams ? configParams.color : hex,
133927
134575
  name: key.replace(/\s*/g, ''),
133928
134576
  entityId: key,
133929
134577
  fontFamily: 'SimSun',
133930
134578
  visible: configParams ? configParams.visible : true,
133931
134579
  stroke: hex,
133932
- strokeWidth: 0.1
134580
+ strokeWidth: 0.1,
134581
+ shapeType: 'text'
133933
134582
  });
133934
134583
  if (entity.xScale) {
133935
134584
  dim.scaleX(entity.xScale);
@@ -133982,7 +134631,8 @@ function entityFormatting_drawText(recordDxf, entity, group, key, configParams)
133982
134631
  name: key.replace(/\s*/g, ''),
133983
134632
  entityId: key,
133984
134633
  visible: configParams ? configParams.visible : true,
133985
- customColor: configParams ? configParams.color : ''
134634
+ customColor: configParams ? configParams.color : '',
134635
+ isGroup: true
133986
134636
  });
133987
134637
  g.add(dim);
133988
134638
  group.push({
@@ -133991,13 +134641,10 @@ function entityFormatting_drawText(recordDxf, entity, group, key, configParams)
133991
134641
  });
133992
134642
  // group.add(dim);
133993
134643
  }
133994
- function drawHatch(recordDxf, entity, group, key, configParams) {
133995
- console.log('hatch');
133996
- }
134644
+ function drawHatch(recordDxf, entity, group, key, configParams) {}
133997
134645
  function drawLwLine(recordDxf, entity, group, key, configParams) {
133998
134646
  var color = entity.color;
133999
134647
  var rgb = decimalToRGBHex(color);
134000
- console.log(rgb);
134001
134648
  var hex = rgb.hex;
134002
134649
  if (hex == '#FFFFFF') {
134003
134650
  hex = '#000';
@@ -134019,9 +134666,10 @@ function drawLwLine(recordDxf, entity, group, key, configParams) {
134019
134666
  points: list,
134020
134667
  closed: closed,
134021
134668
  name: key.replace(/\s*/g, ''),
134669
+ isGroup: false,
134022
134670
  entityId: key,
134023
134671
  stroke: hex,
134024
- customColor: configParams ? configParams.color : '',
134672
+ customColor: configParams ? configParams.color : hex,
134025
134673
  strokeWidth: width,
134026
134674
  visible: configParams ? configParams.visible : true,
134027
134675
  oldstrokeLength: width
@@ -134057,7 +134705,7 @@ function drawSpline(recordDxf, entity, group, key, configParams) {
134057
134705
  entityId: key,
134058
134706
  isGroup: false,
134059
134707
  stroke: configParams ? configParams : '#000',
134060
- customColor: configParams ? configParams.color : '',
134708
+ customColor: configParams ? configParams.color : '#000',
134061
134709
  strokeWidth: width,
134062
134710
  visible: configParams ? configParams.visible : true,
134063
134711
  oldstrokeLength: width
@@ -134847,6 +135495,7 @@ function downloadPDF(base64, fileName) {
134847
135495
  }
134848
135496
  });
134849
135497
  this.$nextTick(function () {
135498
+ console.log(_this2.$refs.svgDraw.clientHeight);
134850
135499
  _this2.konvaStage = new lib_default.a.Stage({
134851
135500
  className: 'stage',
134852
135501
  container: 'konva-container',
@@ -134867,7 +135516,6 @@ function downloadPDF(base64, fileName) {
134867
135516
  var scaleBy = 1.1;
134868
135517
  //初始化缩放方法
134869
135518
  _this2.konvaStage.on('wheel', function (e) {
134870
- console.log(e);
134871
135519
  e.evt.preventDefault();
134872
135520
  var oldScale = _this2.konvaStage.scaleX();
134873
135521
  var pointer = _this2.konvaStage.getPointerPosition();
@@ -134920,20 +135568,18 @@ function downloadPDF(base64, fileName) {
134920
135568
  this.konvaStage.setY(y2); // 750
134921
135569
  */
134922
135570
 
134923
- var _this2$calculateScale = _this2.calculateScaleAndPosition(_this2.bounds, _this2.konvaStage.width(), _this2.konvaStage.height(), 0.05 // 5% 边距
134924
- ),
134925
- scale = _this2$calculateScale.scale,
134926
- x = _this2$calculateScale.x,
134927
- y = _this2$calculateScale.y;
134928
- _this2.konvaStage.position({
134929
- x: x,
134930
- y: y
134931
- });
134932
- _this2.konvaStage.scale({
134933
- x: scale,
134934
- y: scale
134935
- });
134936
- _this2.konvaStage.batchDraw();
135571
+ // const { scale, x, y } = this.calculateScaleAndPosition(
135572
+ // this.bounds,
135573
+ // this.konvaStage.width(),
135574
+ // this.konvaStage.height(),
135575
+ // 0.05 // 5% 边距
135576
+ // );
135577
+
135578
+ // this.konvaStage.position({ x: x, y: y });
135579
+ // this.konvaStage.scale({ x: scale, y: scale });
135580
+
135581
+ // this.konvaStage.batchDraw();
135582
+ _this2.centerDraw();
134937
135583
  });
134938
135584
  _this2.konvaStage.on('click', function (e) {
134939
135585
  var target = _this2.konvaStage.mouseClickEndShape;
@@ -134944,6 +135590,23 @@ function downloadPDF(base64, fileName) {
134944
135590
  //销毁方法
134945
135591
 
134946
135592
  methods: {
135593
+ // 图纸居中展示
135594
+ centerDraw: function centerDraw() {
135595
+ var _this$calculateScaleA = this.calculateScaleAndPosition(this.bounds, this.konvaStage.width(), this.konvaStage.height(), 0.05 // 5% 边距
135596
+ ),
135597
+ scale = _this$calculateScaleA.scale,
135598
+ x = _this$calculateScaleA.x,
135599
+ y = _this$calculateScaleA.y;
135600
+ this.konvaStage.position({
135601
+ x: x,
135602
+ y: y
135603
+ });
135604
+ this.konvaStage.scale({
135605
+ x: scale,
135606
+ y: scale
135607
+ });
135608
+ this.konvaStage.batchDraw();
135609
+ },
134947
135610
  calculateScaleAndPosition: function calculateScaleAndPosition(contentBounds, stageWidth, stageHeight) {
134948
135611
  var padding = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.1;
134949
135612
  // 1. 计算内容的实际宽高
@@ -135045,7 +135708,7 @@ function downloadPDF(base64, fileName) {
135045
135708
  nodes[i].destroy();
135046
135709
  }
135047
135710
  }*/
135048
-
135711
+ this.bounds = null;
135049
135712
  this.konvaLayer.destroyChildren();
135050
135713
  var parser = new dxf_parser_dist();
135051
135714
  var dxf = parser.parse(data);
@@ -135057,10 +135720,10 @@ function downloadPDF(base64, fileName) {
135057
135720
  var entity = hatchEntitys[i];
135058
135721
  var layerConfig = this.recordLayerConfig[entity.layer];
135059
135722
  var configParams = layerConfig && Object.keys(layerConfig).length > 0 ? layerConfig : null;
135060
- var color = configParams ? configParams.color : "#000";
135723
+ var color = configParams ? configParams.color : '#000';
135061
135724
  var visible = configParams ? configParams.visible : true;
135062
- var name = entity.layer.replace(/\s*/g, "");
135063
- if (entity.type == "HATCH") {
135725
+ var name = entity.layer.replace(/\s*/g, '');
135726
+ if (entity.type == 'HATCH') {
135064
135727
  var boundaryLoops = entity.boundaryLoops;
135065
135728
  for (var j = 0; j < boundaryLoops.length; j++) {
135066
135729
  var list = [];
@@ -135197,75 +135860,78 @@ function downloadPDF(base64, fileName) {
135197
135860
  if (_this3.konvaLayer) _this3.konvaLayer.add(_entity2.obj);
135198
135861
  }
135199
135862
  }
135200
- if (group[0].stroke == undefined) {
135201
- console.log(group);
135202
- group[0].stroke = '#000';
135203
- }
135204
- var customShape = new lib_default.a.Shape({
135205
- x: 0,
135206
- y: 0,
135207
- strokeWidth: 0.2,
135208
- name: key.replace(/\s*/g, ''),
135209
- entityId: key,
135210
- stroke: group[0].stroke,
135211
- customColor: _configParams ? _configParams.color : '',
135212
- //visible: configParams ? configParams.visible :true,
135213
- sceneFunc: function sceneFunc(context, shape) {
135214
- context.beginPath();
135215
- for (var _i5 = 0; _i5 < group.length; _i5++) {
135216
- var _entity3 = group[_i5];
135217
- if (_entity3.type === 'line') {
135218
- context.strokeStyle = _entity3.stroke;
135219
- var x1 = _entity3.x1;
135220
- var y1 = _entity3.y1;
135221
- var x2 = _entity3.x2;
135222
- var y2 = _entity3.y2;
135223
- if (x1 != undefined && y1 != undefined && x2 != undefined && y2 != undefined) {
135224
- context.moveTo(x1, -parseFloat(y1));
135225
- context.lineTo(x2, -parseFloat(y2));
135863
+ if (group.length > 0) {
135864
+ var _group$;
135865
+ if ((_group$ = group[0]) !== null && _group$ !== void 0 && _group$.stroke) {
135866
+ group[0].stroke = '#000';
135867
+ }
135868
+ var customShape = new lib_default.a.Shape({
135869
+ x: 0,
135870
+ y: 0,
135871
+ strokeWidth: 0.2,
135872
+ name: key.replace(/\s*/g, ''),
135873
+ entityId: key,
135874
+ stroke: group[0].stroke,
135875
+ customColor: _configParams ? _configParams.color : group[0].stroke,
135876
+ //visible: configParams ? configParams.visible :true,
135877
+ sceneFunc: function sceneFunc(context, shape) {
135878
+ context.beginPath();
135879
+ for (var _i5 = 0; _i5 < group.length; _i5++) {
135880
+ var _entity3 = group[_i5];
135881
+ if (_entity3.type === 'line') {
135882
+ context.strokeStyle = _entity3.stroke;
135883
+ var x1 = _entity3.x1;
135884
+ var y1 = _entity3.y1;
135885
+ var x2 = _entity3.x2;
135886
+ var y2 = _entity3.y2;
135887
+ if (x1 != undefined && y1 != undefined && x2 != undefined && y2 != undefined) {
135888
+ context.moveTo(x1, -parseFloat(y1));
135889
+ context.lineTo(x2, -parseFloat(y2));
135890
+ }
135891
+ var v1 = {};
135892
+ v1.x = x1;
135893
+ v1.y = y1;
135894
+ var v2 = {};
135895
+ v2.x = x2;
135896
+ v2.y = y2;
135897
+ _this.updateBounds(v1);
135898
+ _this.updateBounds(v2);
135226
135899
  }
135227
- var v1 = {};
135228
- v1.x = x1;
135229
- v1.y = y1;
135230
- var v2 = {};
135231
- v2.x = x2;
135232
- v2.y = y2;
135233
- _this.updateBounds(v1);
135234
- _this.updateBounds(v2);
135235
- }
135236
- if (_entity3.type === 'polyline') {
135237
- context.strokeStyle = _entity3.stroke;
135238
- var flag = false;
135239
- var points = _entity3.points;
135240
- var closed = _entity3.closed;
135241
- for (var _j = 0; _j < points.length; _j++) {
135242
- var index = _j % 2;
135243
- if (index === 0) {
135244
- var _x = points[_j];
135245
- var _y = points[_j + 1];
135246
- var point = {};
135247
- point.x = _x;
135248
- point.y = _y;
135249
- _this.updateBounds(point);
135250
- if (_j === 0) {
135251
- context.moveTo(_x, _y);
135252
- } else {
135253
- context.lineTo(_x, _y);
135900
+ if (_entity3.type === 'polyline') {
135901
+ context.strokeStyle = _entity3.stroke;
135902
+ var flag = false;
135903
+ var points = _entity3.points;
135904
+ var closed = _entity3.closed;
135905
+ for (var _j = 0; _j < points.length; _j++) {
135906
+ var index = _j % 2;
135907
+ if (index === 0) {
135908
+ var _x = points[_j];
135909
+ var _y = points[_j + 1];
135910
+ var point = {};
135911
+ point.x = _x;
135912
+ point.y = _y;
135913
+ _this.updateBounds(point);
135914
+ if (_j === 0) {
135915
+ context.moveTo(_x, _y);
135916
+ } else {
135917
+ context.lineTo(_x, _y);
135918
+ }
135254
135919
  }
135255
- }
135256
- if (closed) {
135257
- if (_j === points.length - 1) {
135258
- context.lineTo(points[0], points[1]);
135920
+ if (closed) {
135921
+ if (_j === points.length - 1) {
135922
+ context.lineTo(points[0], points[1]);
135923
+ }
135259
135924
  }
135260
135925
  }
135261
135926
  }
135262
135927
  }
135263
- }
135264
- // context.closePath();
135265
- context.fillStrokeShape(shape);
135266
- }
135267
- });
135268
- if (_this3.konvaLayer) _this3.konvaLayer.add(customShape);
135928
+ // context.closePath();
135929
+ context.fillStrokeShape(shape);
135930
+ },
135931
+ shapeType: 'shape'
135932
+ });
135933
+ if (_this3.konvaLayer) _this3.konvaLayer.add(customShape);
135934
+ }
135269
135935
  }
135270
135936
  },
135271
135937
  _ret;
@@ -135289,18 +135955,20 @@ function downloadPDF(base64, fileName) {
135289
135955
  //平移视口
135290
135956
  var x = ((_this$$refs$svgDraw2 = this.$refs.svgDraw) === null || _this$$refs$svgDraw2 === void 0 ? void 0 : _this$$refs$svgDraw2.clientWidth) / 2 - (Math.ceil(boundingScale.width) / 2 + boundingScale.x / 2);
135291
135957
  var y = this.$refs.svgDraw.clientHeight / 2 - (Math.ceil(boundingScale.height) / 2 + boundingScale.y);
135292
- this.konvaStage.scale({
135293
- x: 2,
135294
- y: 2
135295
- });
135296
- this.konvaStage.setX(0);
135297
- this.konvaStage.setY(750); // 750
135298
135958
 
135299
- this.activedSvgPan.zoom.x = 0;
135300
- this.activedSvgPan.zoom.y = 750;
135301
- this.activedSvgPan.x = x;
135302
- this.activedSvgPan.y = x;
135959
+ // this.konvaStage.scale({
135960
+ // x: 2,
135961
+ // y: 2,
135962
+ // });
135963
+ // this.konvaStage.setX(0);
135964
+ // this.konvaStage.setY(750); // 750
135965
+
135966
+ // this.activedSvgPan.zoom.x = 0;
135967
+ // this.activedSvgPan.zoom.y = 750;
135968
+ // this.activedSvgPan.x = x;
135969
+ // this.activedSvgPan.y = x;
135303
135970
  setTimeout(function () {
135971
+ _this3.centerDraw();
135304
135972
  _this3.$emit('loaded');
135305
135973
  }, 100);
135306
135974
  },
@@ -135335,180 +136003,187 @@ function downloadPDF(base64, fileName) {
135335
136003
  toPdfs: function toPdfs(list) {
135336
136004
  var _this4 = this;
135337
136005
  var _this = this;
135338
- var pdf = new jspdf_es_min["a" /* default */]('l', 'px', [this.konvaStage.width(), this.konvaStage.height()]);
135339
- var exportPixelRatio = 2; // 可以 2/3/4 自己调
135340
-
135341
- for (var pageIdx = 0; pageIdx < list.length; pageIdx++) {
135342
- var data = list[pageIdx];
135343
- //先绘制图面
135344
- this.konvaLayer.destroyChildren();
135345
- var parser = new dxf_parser_dist();
135346
- var dxf = parser.parse(data);
135347
- var entities = formatEntity(dxf.entities);
135348
- var layers = dxf.tables.layer.layers;
135349
-
135350
- //先计算包围
135351
- for (var key in entities) {
135352
- if (entities[key]) {
135353
- var group = [];
135354
- var l = entities[key].length;
135355
- var layerConfig = this.recordLayerConfig[key];
135356
- var configParams = layerConfig && Object.keys(layerConfig).length > 0 ? layerConfig : null;
135357
- for (var i = 0; i < l; i++) {
135358
- var type = entities[key][i].type;
135359
- handleFn(type, dxf, entities[key][i], group, key, configParams, this.konvaLayer, this.recordLayerConfig);
135360
- }
135361
- for (var _i6 = 0; _i6 < group.length; _i6++) {
135362
- var entity = group[_i6];
135363
- if (entity.type === 'line') {
135364
- var x1 = entity.x1;
135365
- var y1 = entity.y1;
135366
- var x2 = entity.x2;
135367
- var y2 = entity.y2;
135368
- var v1 = {};
135369
- v1.x = x1;
135370
- v1.y = y1;
135371
- var v2 = {};
135372
- v2.x = x2;
135373
- v2.y = y2;
135374
- _this.updateBounds1(v1);
135375
- _this.updateBounds1(v2);
135376
- }
135377
- if (entity.type === 'polyline') {
135378
- var flag = false;
135379
- var points = entity.points;
135380
- var closed = entity.closed;
135381
- for (var j = 0; j < points.length; j++) {
135382
- var index = j % 2;
135383
- if (index === 0) {
135384
- var _x2 = points[j];
135385
- var _y2 = points[j + 1];
135386
- var point = {};
135387
- point.x = _x2;
135388
- point.y = _y2;
135389
- _this.updateBounds1(point);
136006
+ return new Promise(function (resolve, reject) {
136007
+ var pdf = new jspdf_es_min["a" /* default */]('l', 'px', [_this4.konvaStage.width(), _this4.konvaStage.height()]);
136008
+ var exportPixelRatio = 2; // 可以 2/3/4 自己调
136009
+ var index = 0;
136010
+ for (var pageIdx = 0; pageIdx < list.length; pageIdx++) {
136011
+ var data = list[pageIdx];
136012
+ //先绘制图面
136013
+ _this4.konvaLayer.destroyChildren();
136014
+ var parser = new dxf_parser_dist();
136015
+ var dxf = parser.parse(data);
136016
+ if (dxf.entities.length > 0) {
136017
+ var entities = formatEntity(dxf.entities);
136018
+ var layers = dxf.tables.layer.layers;
136019
+ //先计算包围
136020
+ for (var key in entities) {
136021
+ if (entities[key]) {
136022
+ var group = [];
136023
+ var l = entities[key].length;
136024
+ var layerConfig = _this4.recordLayerConfig[key];
136025
+ var configParams = layerConfig && Object.keys(layerConfig).length > 0 ? layerConfig : null;
136026
+ for (var i = 0; i < l; i++) {
136027
+ var type = entities[key][i].type;
136028
+ handleFn(type, dxf, entities[key][i], group, key, configParams, _this4.konvaLayer, _this4.recordLayerConfig);
136029
+ }
136030
+ for (var _i6 = 0; _i6 < group.length; _i6++) {
136031
+ var entity = group[_i6];
136032
+ if (entity.type === 'line') {
136033
+ var x1 = entity.x1;
136034
+ var y1 = entity.y1;
136035
+ var x2 = entity.x2;
136036
+ var y2 = entity.y2;
136037
+ var v1 = {};
136038
+ v1.x = x1;
136039
+ v1.y = y1;
136040
+ var v2 = {};
136041
+ v2.x = x2;
136042
+ v2.y = y2;
136043
+ _this.updateBounds1(v1);
136044
+ _this.updateBounds1(v2);
136045
+ }
136046
+ if (entity.type === 'polyline') {
136047
+ var flag = false;
136048
+ var points = entity.points;
136049
+ var closed = entity.closed;
136050
+ for (var j = 0; j < points.length; j++) {
136051
+ var _index = j % 2;
136052
+ if (_index === 0) {
136053
+ var _x2 = points[j];
136054
+ var _y2 = points[j + 1];
136055
+ var point = {};
136056
+ point.x = _x2;
136057
+ point.y = _y2;
136058
+ _this.updateBounds1(point);
136059
+ }
136060
+ }
135390
136061
  }
135391
136062
  }
135392
136063
  }
135393
136064
  }
135394
- }
135395
- }
135396
- console.log('bounds1');
135397
- console.log(_this.bounds1);
135398
- var _loop2 = function _loop2() {
135399
- if (entities[_key]) {
135400
- var _group = [];
135401
- var _l = entities[_key].length;
135402
- var _layerConfig2 = _this4.recordLayerConfig[_key];
135403
- var _configParams2 = _layerConfig2 && Object.keys(_layerConfig2).length > 0 ? _layerConfig2 : null;
135404
- for (var _i7 = 0; _i7 < _l; _i7++) {
135405
- var _type = entities[_key][_i7].type;
135406
- handleFn(_type, dxf, entities[_key][_i7], _group, _key, _configParams2, _this4.konvaLayer, _this4.recordLayerConfig);
135407
- }
135408
- if (!_this4.konvaLayer) return {
135409
- v: void 0
135410
- };
135411
- for (var _i8 = 0; _i8 < _group.length; _i8++) {
135412
- var _entity4 = _group[_i8];
135413
- if (_entity4.type === 'text') {
135414
- if (_this4.konvaLayer) _this4.konvaLayer.add(_entity4.obj);
135415
- }
135416
- }
135417
- if (_group[0].stroke == undefined) {
135418
- console.log(_group);
135419
- _group[0].stroke = '#000';
135420
- }
135421
- var customShape = new lib_default.a.Shape({
135422
- x: 0,
135423
- y: 0,
135424
- strokeWidth: 0.2,
135425
- name: _key.replace(/\s*/g, ''),
135426
- entityId: _key,
135427
- stroke: _group[0].stroke,
135428
- customColor: _configParams2 ? _configParams2.color : '',
135429
- //visible: configParams ? configParams.visible :true,
135430
- sceneFunc: function sceneFunc(context, shape) {
135431
- context.beginPath();
135432
- for (var _i9 = 0; _i9 < _group.length; _i9++) {
135433
- var _entity5 = _group[_i9];
135434
- if (_entity5.type === 'line') {
135435
- context.strokeStyle = _entity5.stroke;
135436
- var _x3 = _entity5.x1;
135437
- var _y3 = _entity5.y1;
135438
- var _x4 = _entity5.x2;
135439
- var _y4 = _entity5.y2;
135440
- if (_x3 != undefined && _y3 != undefined && _x4 != undefined && _y4 != undefined) {
135441
- context.moveTo(_x3, -parseFloat(_y3));
135442
- context.lineTo(_x4, -parseFloat(_y4));
135443
- }
136065
+ var _loop2 = function _loop2() {
136066
+ if (entities[_key]) {
136067
+ var _group = [];
136068
+ var _l = entities[_key].length;
136069
+ var _layerConfig2 = _this4.recordLayerConfig[_key];
136070
+ var _configParams2 = _layerConfig2 && Object.keys(_layerConfig2).length > 0 ? _layerConfig2 : null;
136071
+ for (var _i7 = 0; _i7 < _l; _i7++) {
136072
+ var _type = entities[_key][_i7].type;
136073
+ handleFn(_type, dxf, entities[_key][_i7], _group, _key, _configParams2, _this4.konvaLayer, _this4.recordLayerConfig);
136074
+ }
136075
+ if (!_this4.konvaLayer) return {
136076
+ v: void 0
136077
+ };
136078
+ for (var _i8 = 0; _i8 < _group.length; _i8++) {
136079
+ var _entity4 = _group[_i8];
136080
+ if (_entity4.type === 'text') {
136081
+ if (_this4.konvaLayer) _this4.konvaLayer.add(_entity4.obj);
135444
136082
  }
135445
- if (_entity5.type === 'polyline') {
135446
- context.strokeStyle = _entity5.stroke;
135447
- var _flag = false;
135448
- var _points = _entity5.points;
135449
- var _closed = _entity5.closed;
135450
- for (var _j2 = 0; _j2 < _points.length; _j2++) {
135451
- var _index = _j2 % 2;
135452
- if (_index === 0) {
135453
- var _x5 = _points[_j2];
135454
- var _y5 = _points[_j2 + 1];
135455
- if (_j2 === 0) {
135456
- context.moveTo(_x5, _y5);
135457
- } else {
135458
- context.lineTo(_x5, _y5);
136083
+ }
136084
+ if (_group.length > 0) {
136085
+ var _group$2;
136086
+ if ((_group$2 = _group[0]) !== null && _group$2 !== void 0 && _group$2.stroke) {
136087
+ _group[0].stroke = '#000';
136088
+ }
136089
+ var customShape = new lib_default.a.Shape({
136090
+ x: 0,
136091
+ y: 0,
136092
+ strokeWidth: 0.2,
136093
+ name: _key.replace(/\s*/g, ''),
136094
+ entityId: _key,
136095
+ stroke: _group[0].stroke,
136096
+ customColor: _configParams2 ? _configParams2.color : '',
136097
+ //visible: configParams ? configParams.visible :true,
136098
+ sceneFunc: function sceneFunc(context, shape) {
136099
+ context.beginPath();
136100
+ for (var _i9 = 0; _i9 < _group.length; _i9++) {
136101
+ var _entity5 = _group[_i9];
136102
+ if (_entity5.type === 'line') {
136103
+ context.strokeStyle = _entity5.stroke;
136104
+ var _x3 = _entity5.x1;
136105
+ var _y3 = _entity5.y1;
136106
+ var _x4 = _entity5.x2;
136107
+ var _y4 = _entity5.y2;
136108
+ if (_x3 != undefined && _y3 != undefined && _x4 != undefined && _y4 != undefined) {
136109
+ context.moveTo(_x3, -parseFloat(_y3));
136110
+ context.lineTo(_x4, -parseFloat(_y4));
136111
+ }
135459
136112
  }
135460
- }
135461
- if (_closed) {
135462
- if (_j2 === _points.length - 1) {
135463
- context.lineTo(_points[0], _points[1]);
136113
+ if (_entity5.type === 'polyline') {
136114
+ context.strokeStyle = _entity5.stroke;
136115
+ var _flag = false;
136116
+ var _points = _entity5.points;
136117
+ var _closed = _entity5.closed;
136118
+ for (var _j2 = 0; _j2 < _points.length; _j2++) {
136119
+ var _index2 = _j2 % 2;
136120
+ if (_index2 === 0) {
136121
+ var _x5 = _points[_j2];
136122
+ var _y5 = _points[_j2 + 1];
136123
+ if (_j2 === 0) {
136124
+ context.moveTo(_x5, _y5);
136125
+ } else {
136126
+ context.lineTo(_x5, _y5);
136127
+ }
136128
+ }
136129
+ if (_closed) {
136130
+ if (_j2 === _points.length - 1) {
136131
+ context.lineTo(_points[0], _points[1]);
136132
+ }
136133
+ }
136134
+ }
135464
136135
  }
135465
136136
  }
136137
+ // context.closePath();
136138
+ context.fillStrokeShape(shape);
135466
136139
  }
135467
- }
136140
+ });
136141
+ if (_this4.konvaLayer) _this4.konvaLayer.add(customShape);
135468
136142
  }
135469
- // context.closePath();
135470
- context.fillStrokeShape(shape);
135471
136143
  }
135472
- });
135473
- if (_this4.konvaLayer) _this4.konvaLayer.add(customShape);
136144
+ },
136145
+ _ret2;
136146
+ for (var _key in entities) {
136147
+ _ret2 = _loop2();
136148
+ if (_ret2) return _ret2.v;
135474
136149
  }
135475
- },
135476
- _ret2;
135477
- for (var _key in entities) {
135478
- _ret2 = _loop2();
135479
- if (_ret2) return _ret2.v;
135480
- }
135481
- var _this$calculateScaleA = this.calculateScaleAndPosition(_this.bounds1, this.konvaStage.width(), this.konvaStage.height(), 0.05 // 5% 边距
135482
- ),
135483
- scale = _this$calculateScaleA.scale,
135484
- x = _this$calculateScaleA.x,
135485
- y = _this$calculateScaleA.y;
135486
- console.log('test1:');
135487
- console.log(this.bounds1);
135488
- _this.bounds1 = null;
135489
- this.konvaStage.position({
135490
- x: x,
135491
- y: y
135492
- });
135493
- this.konvaStage.scale({
135494
- x: scale,
135495
- y: scale
135496
- });
135497
- this.konvaStage.batchDraw();
135498
- //添加成功移动视口位置
136150
+ var _this4$calculateScale = _this4.calculateScaleAndPosition(_this.bounds1, _this4.konvaStage.width(), _this4.konvaStage.height(), 0.05 // 5% 边距
136151
+ ),
136152
+ scale = _this4$calculateScale.scale,
136153
+ x = _this4$calculateScale.x,
136154
+ y = _this4$calculateScale.y;
136155
+ _this.bounds1 = null;
136156
+ _this4.konvaStage.position({
136157
+ x: x,
136158
+ y: y
136159
+ });
136160
+ _this4.konvaStage.scale({
136161
+ x: scale,
136162
+ y: scale
136163
+ });
136164
+ _this4.konvaStage.batchDraw();
136165
+ //添加成功移动视口位置 pageIdx === 0
135499
136166
 
135500
- if (pageIdx == 0) {
135501
- pdf.addImage(this.konvaStage.toDataURL({
135502
- pixelRatio: 2
135503
- }), 0, 0, this.konvaStage.width(), this.konvaStage.height());
136167
+ if (index === 0) {
136168
+ pdf.addImage(_this4.konvaStage.toDataURL({
136169
+ pixelRatio: 2
136170
+ }), 0, 0, _this4.konvaStage.width(), _this4.konvaStage.height());
136171
+ } else {
136172
+ pdf.addPage();
136173
+ pdf.addImage(_this4.konvaStage.toDataURL({
136174
+ pixelRatio: 2
136175
+ }), 0, 0, _this4.konvaStage.width(), _this4.konvaStage.height());
136176
+ }
136177
+ index++;
136178
+ }
136179
+ }
136180
+ if (index > 0) {
136181
+ pdf.save('批量导出.pdf');
136182
+ resolve();
135504
136183
  } else {
135505
- pdf.addPage();
135506
- pdf.addImage(this.konvaStage.toDataURL({
135507
- pixelRatio: 2
135508
- }), 0, 0, this.konvaStage.width(), this.konvaStage.height());
136184
+ reject('解析数据为空, 请检查数据再进行下载');
135509
136185
  }
135510
- }
135511
- pdf.save('批量导出.pdf');
136186
+ });
135512
136187
 
135513
136188
  // var imgData = canvas.toDataURL('image/png');
135514
136189
  //doc.text("Hello world!", 10, 10);
@@ -135523,15 +136198,49 @@ function downloadPDF(base64, fileName) {
135523
136198
  this.konvaLayer = null;
135524
136199
  this.konvaStage = null;
135525
136200
  },
135526
- beforeDestroy: function beforeDestroy() {
135527
- this.clearCache();
136201
+ // 更改图纸的色系 区分明暗两种 darkness 暗色系 bright 明亮
136202
+ setColorScheme: function setColorScheme(colorType) {
136203
+ var _this5 = this;
136204
+ // const backgroundColor = colorType === "darkness" ? "#000" : "transparent";
136205
+ var color = colorType === 'darkness' ? '#fff' : '#000';
136206
+ // konvaStage.container().style.background = backgroundColor;
136207
+ this.konvaLayer.children.forEach(function (item) {
136208
+ _this5.traverseLayer(item, color);
136209
+ });
136210
+ },
136211
+ traverseLayer: function traverseLayer(obj, color) {
136212
+ var _this6 = this;
136213
+ if (!obj.attrs.isGroup) {
136214
+ if (color === '#fff') {
136215
+ var setColor = obj.attrs.customColor === '#000' || obj.attrs.customColor === '#000000' || obj.attrs.customColor === 'rgb(0, 0, 0)' || obj.attrs.customColor === 'rgba(0, 0, 0, 1)' ? color : obj.attrs.customColor;
136216
+ if (obj.attrs.shapeType === 'hatch' || obj.attrs.shapeType === 'text') {
136217
+ obj.setFill(setColor);
136218
+ }
136219
+ obj.setStroke(setColor);
136220
+ obj.attrs.oldCustomColor = obj.attrs.customColor;
136221
+ obj.attrs.customColor = setColor;
136222
+ } else {
136223
+ obj.attrs.customColor = obj.attrs.oldCustomColor;
136224
+ if (obj.attrs.shapeType === 'hatch' || obj.attrs.shapeType === 'text') {
136225
+ obj.setFill(obj.attrs.customColor);
136226
+ }
136227
+ obj.setStroke(obj.attrs.customColor);
136228
+ }
136229
+ } else {
136230
+ obj.children.forEach(function (item) {
136231
+ _this6.traverseLayer(item, color);
136232
+ });
136233
+ }
135528
136234
  }
136235
+ },
136236
+ beforeDestroy: function beforeDestroy() {
136237
+ this.clearCache();
135529
136238
  }
135530
136239
  });
135531
136240
  // CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=script&lang=js
135532
136241
  /* harmony default export */ var components_com_flcanvasvue_type_script_lang_js = (com_flcanvasvue_type_script_lang_js);
135533
- // EXTERNAL MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=style&index=0&id=e2de7752&prod&lang=scss&scoped=true
135534
- var com_flcanvasvue_type_style_index_0_id_e2de7752_prod_lang_scss_scoped_true = __webpack_require__("affa");
136242
+ // EXTERNAL MODULE: ./packages/components/com-flcanvas/index.vue?vue&type=style&index=0&id=41b98e1a&prod&lang=scss&scoped=true
136243
+ var com_flcanvasvue_type_style_index_0_id_41b98e1a_prod_lang_scss_scoped_true = __webpack_require__("c89b");
135535
136244
 
135536
136245
  // CONCATENATED MODULE: ./packages/components/com-flcanvas/index.vue
135537
136246
 
@@ -135544,17 +136253,17 @@ var com_flcanvasvue_type_style_index_0_id_e2de7752_prod_lang_scss_scoped_true =
135544
136253
 
135545
136254
  var com_flcanvas_component = normalizeComponent(
135546
136255
  components_com_flcanvasvue_type_script_lang_js,
135547
- com_flcanvasvue_type_template_id_e2de7752_scoped_true_render,
135548
- com_flcanvasvue_type_template_id_e2de7752_scoped_true_staticRenderFns,
136256
+ com_flcanvasvue_type_template_id_41b98e1a_scoped_true_render,
136257
+ com_flcanvasvue_type_template_id_41b98e1a_scoped_true_staticRenderFns,
135549
136258
  false,
135550
136259
  null,
135551
- "e2de7752",
136260
+ "41b98e1a",
135552
136261
  null
135553
136262
 
135554
136263
  )
135555
136264
 
135556
136265
  /* harmony default export */ var com_flcanvas = (com_flcanvas_component.exports);
135557
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b074442e-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/per-control.vue?vue&type=template&id=f547d5c6&scoped=true
136266
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"d898cbea-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/per-control.vue?vue&type=template&id=f547d5c6&scoped=true
135558
136267
  var per_controlvue_type_template_id_f547d5c6_scoped_true_render = function render() {
135559
136268
  var _vm = this,
135560
136269
  _c = _vm._self._c;
@@ -135662,7 +136371,7 @@ var per_control_component = normalizeComponent(
135662
136371
  )
135663
136372
 
135664
136373
  /* harmony default export */ var per_control = (per_control_component.exports);
135665
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b074442e-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/pid.vue?vue&type=template&id=2572c0e2&scoped=true
136374
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"d898cbea-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/pid.vue?vue&type=template&id=2572c0e2&scoped=true
135666
136375
  var pidvue_type_template_id_2572c0e2_scoped_true_render = function render() {
135667
136376
  var _vm = this,
135668
136377
  _c = _vm._self._c;
@@ -135709,7 +136418,7 @@ var browserify_default = /*#__PURE__*/__webpack_require__.n(browserify);
135709
136418
  var html2canvas = __webpack_require__("c0e9");
135710
136419
  var html2canvas_default = /*#__PURE__*/__webpack_require__.n(html2canvas);
135711
136420
 
135712
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b074442e-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/component/ann-tool.vue?vue&type=template&id=4b17bce0&scoped=true
136421
+ // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"d898cbea-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/com-graphics/component/ann-tool.vue?vue&type=template&id=4b17bce0&scoped=true
135713
136422
  var ann_toolvue_type_template_id_4b17bce0_scoped_true_render = function render() {
135714
136423
  var _vm = this,
135715
136424
  _c = _vm._self._c;