fl-web-component 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fl-web-component.common.1.js +3626 -3626
- package/dist/fl-web-component.common.js +1255 -154
- package/dist/fl-web-component.css +1 -1
- package/dist/fl-web-component.umd.1.js +3626 -3626
- package/dist/fl-web-component.umd.js +1255 -154
- package/dist/fl-web-component.umd.min.1.js +2 -2
- package/dist/fl-web-component.umd.min.js +29 -22
- package/package.json +3 -2
- package/packages/components/com-graphics/index.vue +197 -31
- package/packages/components/com-graphics/per-control.vue +1 -1
- package/src/main.js +5 -2
- package/src/static/arrow/arrow-right.png +0 -0
- package/src/utils/instance-parser.js +52 -59
|
@@ -1202,13 +1202,6 @@ Factory_1.Factory.addGetterSetter(Arrow, 'pointerAtBeginning', false);
|
|
|
1202
1202
|
Factory_1.Factory.addGetterSetter(Arrow, 'pointerAtEnding', true);
|
|
1203
1203
|
|
|
1204
1204
|
|
|
1205
|
-
/***/ }),
|
|
1206
|
-
|
|
1207
|
-
/***/ "1c33":
|
|
1208
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1209
|
-
|
|
1210
|
-
// extracted by mini-css-extract-plugin
|
|
1211
|
-
|
|
1212
1205
|
/***/ }),
|
|
1213
1206
|
|
|
1214
1207
|
/***/ "1c49":
|
|
@@ -4637,6 +4630,17 @@ function _setPrototypeOf(t, e) {
|
|
|
4637
4630
|
}
|
|
4638
4631
|
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
4639
4632
|
|
|
4633
|
+
/***/ }),
|
|
4634
|
+
|
|
4635
|
+
/***/ "52b4":
|
|
4636
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4637
|
+
|
|
4638
|
+
"use strict";
|
|
4639
|
+
/* 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_6e37e043_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("acad");
|
|
4640
|
+
/* 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_6e37e043_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_6e37e043_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
|
|
4641
|
+
/* unused harmony reexport * */
|
|
4642
|
+
|
|
4643
|
+
|
|
4640
4644
|
/***/ }),
|
|
4641
4645
|
|
|
4642
4646
|
/***/ "5414":
|
|
@@ -11174,14 +11178,10 @@ module.exports = toPropertyKey, module.exports.__esModule = true, module.exports
|
|
|
11174
11178
|
|
|
11175
11179
|
/***/ }),
|
|
11176
11180
|
|
|
11177
|
-
/***/ "
|
|
11178
|
-
/***/ (function(module,
|
|
11179
|
-
|
|
11180
|
-
"use strict";
|
|
11181
|
-
/* 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_5b13dc9d_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("1c33");
|
|
11182
|
-
/* 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_5b13dc9d_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_5b13dc9d_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
|
|
11183
|
-
/* unused harmony reexport * */
|
|
11181
|
+
/***/ "acad":
|
|
11182
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
11184
11183
|
|
|
11184
|
+
// extracted by mini-css-extract-plugin
|
|
11185
11185
|
|
|
11186
11186
|
/***/ }),
|
|
11187
11187
|
|
|
@@ -11199,6 +11199,17 @@ function _construct(t, e, r) {
|
|
|
11199
11199
|
}
|
|
11200
11200
|
module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
11201
11201
|
|
|
11202
|
+
/***/ }),
|
|
11203
|
+
|
|
11204
|
+
/***/ "b2fd":
|
|
11205
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
11206
|
+
|
|
11207
|
+
"use strict";
|
|
11208
|
+
/* 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_per_control_vue_vue_type_style_index_0_id_f547d5c6_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("e24a");
|
|
11209
|
+
/* 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_per_control_vue_vue_type_style_index_0_id_f547d5c6_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_per_control_vue_vue_type_style_index_0_id_f547d5c6_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
|
|
11210
|
+
/* unused harmony reexport * */
|
|
11211
|
+
|
|
11212
|
+
|
|
11202
11213
|
/***/ }),
|
|
11203
11214
|
|
|
11204
11215
|
/***/ "b33b":
|
|
@@ -13802,6 +13813,13 @@ if (Global_1.Konva.isBrowser) {
|
|
|
13802
13813
|
}
|
|
13803
13814
|
|
|
13804
13815
|
|
|
13816
|
+
/***/ }),
|
|
13817
|
+
|
|
13818
|
+
/***/ "e24a":
|
|
13819
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
13820
|
+
|
|
13821
|
+
// extracted by mini-css-extract-plugin
|
|
13822
|
+
|
|
13805
13823
|
/***/ }),
|
|
13806
13824
|
|
|
13807
13825
|
/***/ "e3af":
|
|
@@ -16109,19 +16127,19 @@ if (typeof window !== 'undefined') {
|
|
|
16109
16127
|
// Indicate to webpack that this file can be concatenated
|
|
16110
16128
|
/* harmony default export */ var setPublicPath = (null);
|
|
16111
16129
|
|
|
16112
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
16113
|
-
var
|
|
16130
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4217f59c-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=6e37e043&scoped=true
|
|
16131
|
+
var com_graphicsvue_type_template_id_6e37e043_scoped_true_render = function render() {
|
|
16114
16132
|
var _vm = this,
|
|
16115
16133
|
_c = _vm._self._c;
|
|
16116
16134
|
return _c('div', {
|
|
16117
16135
|
attrs: {
|
|
16118
|
-
"id": "
|
|
16136
|
+
"id": "fl-model"
|
|
16119
16137
|
}
|
|
16120
16138
|
});
|
|
16121
16139
|
};
|
|
16122
16140
|
var staticRenderFns = [];
|
|
16123
16141
|
|
|
16124
|
-
// CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=template&id=
|
|
16142
|
+
// CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=template&id=6e37e043&scoped=true
|
|
16125
16143
|
|
|
16126
16144
|
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/slicedToArray.js
|
|
16127
16145
|
var slicedToArray = __webpack_require__("278c");
|
|
@@ -38143,6 +38161,755 @@ function onPointerlockError() {
|
|
|
38143
38161
|
console.error('THREE.PointerLockControls: Unable to use Pointer Lock API');
|
|
38144
38162
|
}
|
|
38145
38163
|
|
|
38164
|
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/typeof.js
|
|
38165
|
+
var helpers_typeof = __webpack_require__("7037");
|
|
38166
|
+
var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
|
|
38167
|
+
|
|
38168
|
+
// CONCATENATED MODULE: ./node_modules/three/examples/jsm/libs/lil-gui.module.min.js
|
|
38169
|
+
|
|
38170
|
+
|
|
38171
|
+
|
|
38172
|
+
|
|
38173
|
+
|
|
38174
|
+
|
|
38175
|
+
|
|
38176
|
+
function lil_gui_module_min_callSuper(t, o, e) { return o = getPrototypeOf_default()(o), possibleConstructorReturn_default()(t, lil_gui_module_min_isNativeReflectConstruct() ? Reflect.construct(o, e || [], getPrototypeOf_default()(t).constructor) : o.apply(t, e)); }
|
|
38177
|
+
function lil_gui_module_min_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (lil_gui_module_min_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
38178
|
+
/**
|
|
38179
|
+
* lil-gui
|
|
38180
|
+
* https://lil-gui.georgealways.com
|
|
38181
|
+
* @version 0.17.0
|
|
38182
|
+
* @author George Michael Brower
|
|
38183
|
+
* @license MIT
|
|
38184
|
+
*/
|
|
38185
|
+
var lil_gui_module_min_t = /*#__PURE__*/function () {
|
|
38186
|
+
function t(i, e, s, n) {
|
|
38187
|
+
var l = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : "div";
|
|
38188
|
+
classCallCheck_default()(this, t);
|
|
38189
|
+
this.parent = i, this.object = e, this.property = s, this._disabled = !1, this._hidden = !1, this.initialValue = this.getValue(), this.domElement = document.createElement("div"), this.domElement.classList.add("controller"), this.domElement.classList.add(n), this.$name = document.createElement("div"), this.$name.classList.add("name"), t.nextNameID = t.nextNameID || 0, this.$name.id = "lil-gui-name-" + ++t.nextNameID, this.$widget = document.createElement(l), this.$widget.classList.add("widget"), this.$disable = this.$widget, this.domElement.appendChild(this.$name), this.domElement.appendChild(this.$widget), this.parent.children.push(this), this.parent.controllers.push(this), this.parent.$children.appendChild(this.domElement), this._listenCallback = this._listenCallback.bind(this), this.name(s);
|
|
38190
|
+
}
|
|
38191
|
+
return createClass_default()(t, [{
|
|
38192
|
+
key: "name",
|
|
38193
|
+
value: function name(_t) {
|
|
38194
|
+
return this._name = _t, this.$name.innerHTML = _t, this;
|
|
38195
|
+
}
|
|
38196
|
+
}, {
|
|
38197
|
+
key: "onChange",
|
|
38198
|
+
value: function onChange(_t2) {
|
|
38199
|
+
return this._onChange = _t2, this;
|
|
38200
|
+
}
|
|
38201
|
+
}, {
|
|
38202
|
+
key: "_callOnChange",
|
|
38203
|
+
value: function _callOnChange() {
|
|
38204
|
+
this.parent._callOnChange(this), void 0 !== this._onChange && this._onChange.call(this, this.getValue()), this._changed = !0;
|
|
38205
|
+
}
|
|
38206
|
+
}, {
|
|
38207
|
+
key: "onFinishChange",
|
|
38208
|
+
value: function onFinishChange(_t3) {
|
|
38209
|
+
return this._onFinishChange = _t3, this;
|
|
38210
|
+
}
|
|
38211
|
+
}, {
|
|
38212
|
+
key: "_callOnFinishChange",
|
|
38213
|
+
value: function _callOnFinishChange() {
|
|
38214
|
+
this._changed && (this.parent._callOnFinishChange(this), void 0 !== this._onFinishChange && this._onFinishChange.call(this, this.getValue())), this._changed = !1;
|
|
38215
|
+
}
|
|
38216
|
+
}, {
|
|
38217
|
+
key: "reset",
|
|
38218
|
+
value: function reset() {
|
|
38219
|
+
return this.setValue(this.initialValue), this._callOnFinishChange(), this;
|
|
38220
|
+
}
|
|
38221
|
+
}, {
|
|
38222
|
+
key: "enable",
|
|
38223
|
+
value: function enable() {
|
|
38224
|
+
var _t4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
38225
|
+
return this.disable(!_t4);
|
|
38226
|
+
}
|
|
38227
|
+
}, {
|
|
38228
|
+
key: "disable",
|
|
38229
|
+
value: function disable() {
|
|
38230
|
+
var _t5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
38231
|
+
return _t5 === this._disabled || (this._disabled = _t5, this.domElement.classList.toggle("disabled", _t5), this.$disable.toggleAttribute("disabled", _t5)), this;
|
|
38232
|
+
}
|
|
38233
|
+
}, {
|
|
38234
|
+
key: "show",
|
|
38235
|
+
value: function show() {
|
|
38236
|
+
var _t6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
38237
|
+
return this._hidden = !_t6, this.domElement.style.display = this._hidden ? "none" : "", this;
|
|
38238
|
+
}
|
|
38239
|
+
}, {
|
|
38240
|
+
key: "hide",
|
|
38241
|
+
value: function hide() {
|
|
38242
|
+
return this.show(!1);
|
|
38243
|
+
}
|
|
38244
|
+
}, {
|
|
38245
|
+
key: "options",
|
|
38246
|
+
value: function options(_t7) {
|
|
38247
|
+
var i = this.parent.add(this.object, this.property, _t7);
|
|
38248
|
+
return i.name(this._name), this.destroy(), i;
|
|
38249
|
+
}
|
|
38250
|
+
}, {
|
|
38251
|
+
key: "min",
|
|
38252
|
+
value: function min(_t8) {
|
|
38253
|
+
return this;
|
|
38254
|
+
}
|
|
38255
|
+
}, {
|
|
38256
|
+
key: "max",
|
|
38257
|
+
value: function max(_t9) {
|
|
38258
|
+
return this;
|
|
38259
|
+
}
|
|
38260
|
+
}, {
|
|
38261
|
+
key: "step",
|
|
38262
|
+
value: function step(_t0) {
|
|
38263
|
+
return this;
|
|
38264
|
+
}
|
|
38265
|
+
}, {
|
|
38266
|
+
key: "decimals",
|
|
38267
|
+
value: function decimals(_t1) {
|
|
38268
|
+
return this;
|
|
38269
|
+
}
|
|
38270
|
+
}, {
|
|
38271
|
+
key: "listen",
|
|
38272
|
+
value: function listen() {
|
|
38273
|
+
var _t10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
38274
|
+
return this._listening = _t10, void 0 !== this._listenCallbackID && (cancelAnimationFrame(this._listenCallbackID), this._listenCallbackID = void 0), this._listening && this._listenCallback(), this;
|
|
38275
|
+
}
|
|
38276
|
+
}, {
|
|
38277
|
+
key: "_listenCallback",
|
|
38278
|
+
value: function _listenCallback() {
|
|
38279
|
+
this._listenCallbackID = requestAnimationFrame(this._listenCallback);
|
|
38280
|
+
var _t11 = this.save();
|
|
38281
|
+
_t11 !== this._listenPrevValue && this.updateDisplay(), this._listenPrevValue = _t11;
|
|
38282
|
+
}
|
|
38283
|
+
}, {
|
|
38284
|
+
key: "getValue",
|
|
38285
|
+
value: function getValue() {
|
|
38286
|
+
return this.object[this.property];
|
|
38287
|
+
}
|
|
38288
|
+
}, {
|
|
38289
|
+
key: "setValue",
|
|
38290
|
+
value: function setValue(_t12) {
|
|
38291
|
+
return this.object[this.property] = _t12, this._callOnChange(), this.updateDisplay(), this;
|
|
38292
|
+
}
|
|
38293
|
+
}, {
|
|
38294
|
+
key: "updateDisplay",
|
|
38295
|
+
value: function updateDisplay() {
|
|
38296
|
+
return this;
|
|
38297
|
+
}
|
|
38298
|
+
}, {
|
|
38299
|
+
key: "load",
|
|
38300
|
+
value: function load(_t13) {
|
|
38301
|
+
return this.setValue(_t13), this._callOnFinishChange(), this;
|
|
38302
|
+
}
|
|
38303
|
+
}, {
|
|
38304
|
+
key: "save",
|
|
38305
|
+
value: function save() {
|
|
38306
|
+
return this.getValue();
|
|
38307
|
+
}
|
|
38308
|
+
}, {
|
|
38309
|
+
key: "destroy",
|
|
38310
|
+
value: function destroy() {
|
|
38311
|
+
this.listen(!1), this.parent.children.splice(this.parent.children.indexOf(this), 1), this.parent.controllers.splice(this.parent.controllers.indexOf(this), 1), this.parent.$children.removeChild(this.domElement);
|
|
38312
|
+
}
|
|
38313
|
+
}]);
|
|
38314
|
+
}();
|
|
38315
|
+
var lil_gui_module_min_i = /*#__PURE__*/function (_t14) {
|
|
38316
|
+
function i(t, _i, e) {
|
|
38317
|
+
var _this;
|
|
38318
|
+
classCallCheck_default()(this, i);
|
|
38319
|
+
_this = lil_gui_module_min_callSuper(this, i, [t, _i, e, "boolean", "label"]), _this.$input = document.createElement("input"), _this.$input.setAttribute("type", "checkbox"), _this.$input.setAttribute("aria-labelledby", _this.$name.id), _this.$widget.appendChild(_this.$input), _this.$input.addEventListener("change", function () {
|
|
38320
|
+
_this.setValue(_this.$input.checked), _this._callOnFinishChange();
|
|
38321
|
+
}), _this.$disable = _this.$input, _this.updateDisplay();
|
|
38322
|
+
return _this;
|
|
38323
|
+
}
|
|
38324
|
+
inherits_default()(i, _t14);
|
|
38325
|
+
return createClass_default()(i, [{
|
|
38326
|
+
key: "updateDisplay",
|
|
38327
|
+
value: function updateDisplay() {
|
|
38328
|
+
return this.$input.checked = this.getValue(), this;
|
|
38329
|
+
}
|
|
38330
|
+
}]);
|
|
38331
|
+
}(lil_gui_module_min_t);
|
|
38332
|
+
function lil_gui_module_min_e(t) {
|
|
38333
|
+
var i, e;
|
|
38334
|
+
return (i = t.match(/(#|0x)?([a-f0-9]{6})/i)) ? e = i[2] : (i = t.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/)) ? e = parseInt(i[1]).toString(16).padStart(2, 0) + parseInt(i[2]).toString(16).padStart(2, 0) + parseInt(i[3]).toString(16).padStart(2, 0) : (i = t.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i)) && (e = i[1] + i[1] + i[2] + i[2] + i[3] + i[3]), !!e && "#" + e;
|
|
38335
|
+
}
|
|
38336
|
+
var lil_gui_module_min_s = {
|
|
38337
|
+
isPrimitive: !0,
|
|
38338
|
+
match: function match(t) {
|
|
38339
|
+
return "string" == typeof t;
|
|
38340
|
+
},
|
|
38341
|
+
fromHexString: lil_gui_module_min_e,
|
|
38342
|
+
toHexString: lil_gui_module_min_e
|
|
38343
|
+
},
|
|
38344
|
+
lil_gui_module_min_n = {
|
|
38345
|
+
isPrimitive: !0,
|
|
38346
|
+
match: function match(t) {
|
|
38347
|
+
return "number" == typeof t;
|
|
38348
|
+
},
|
|
38349
|
+
fromHexString: function fromHexString(t) {
|
|
38350
|
+
return parseInt(t.substring(1), 16);
|
|
38351
|
+
},
|
|
38352
|
+
toHexString: function toHexString(t) {
|
|
38353
|
+
return "#" + t.toString(16).padStart(6, 0);
|
|
38354
|
+
}
|
|
38355
|
+
},
|
|
38356
|
+
lil_gui_module_min_l = {
|
|
38357
|
+
isPrimitive: !1,
|
|
38358
|
+
match: Array.isArray,
|
|
38359
|
+
fromHexString: function fromHexString(t, i) {
|
|
38360
|
+
var e = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
38361
|
+
var s = lil_gui_module_min_n.fromHexString(t);
|
|
38362
|
+
i[0] = (s >> 16 & 255) / 255 * e, i[1] = (s >> 8 & 255) / 255 * e, i[2] = (255 & s) / 255 * e;
|
|
38363
|
+
},
|
|
38364
|
+
toHexString: function toHexString(_ref) {
|
|
38365
|
+
var _ref2 = slicedToArray_default()(_ref, 3),
|
|
38366
|
+
t = _ref2[0],
|
|
38367
|
+
i = _ref2[1],
|
|
38368
|
+
e = _ref2[2];
|
|
38369
|
+
var s = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
38370
|
+
return lil_gui_module_min_n.toHexString(t * (s = 255 / s) << 16 ^ i * s << 8 ^ e * s << 0);
|
|
38371
|
+
}
|
|
38372
|
+
},
|
|
38373
|
+
lil_gui_module_min_r = {
|
|
38374
|
+
isPrimitive: !1,
|
|
38375
|
+
match: function match(t) {
|
|
38376
|
+
return Object(t) === t;
|
|
38377
|
+
},
|
|
38378
|
+
fromHexString: function fromHexString(t, i) {
|
|
38379
|
+
var e = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
38380
|
+
var s = lil_gui_module_min_n.fromHexString(t);
|
|
38381
|
+
i.r = (s >> 16 & 255) / 255 * e, i.g = (s >> 8 & 255) / 255 * e, i.b = (255 & s) / 255 * e;
|
|
38382
|
+
},
|
|
38383
|
+
toHexString: function toHexString(_ref3) {
|
|
38384
|
+
var t = _ref3.r,
|
|
38385
|
+
i = _ref3.g,
|
|
38386
|
+
e = _ref3.b;
|
|
38387
|
+
var s = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
38388
|
+
return lil_gui_module_min_n.toHexString(t * (s = 255 / s) << 16 ^ i * s << 8 ^ e * s << 0);
|
|
38389
|
+
}
|
|
38390
|
+
},
|
|
38391
|
+
lil_gui_module_min_o = [lil_gui_module_min_s, lil_gui_module_min_n, lil_gui_module_min_l, lil_gui_module_min_r];
|
|
38392
|
+
var lil_gui_module_min_a = /*#__PURE__*/function (_t15) {
|
|
38393
|
+
function a(t, i, s, n) {
|
|
38394
|
+
var _this2;
|
|
38395
|
+
classCallCheck_default()(this, a);
|
|
38396
|
+
var l;
|
|
38397
|
+
_this2 = lil_gui_module_min_callSuper(this, a, [t, i, s, "color"]), _this2.$input = document.createElement("input"), _this2.$input.setAttribute("type", "color"), _this2.$input.setAttribute("tabindex", -1), _this2.$input.setAttribute("aria-labelledby", _this2.$name.id), _this2.$text = document.createElement("input"), _this2.$text.setAttribute("type", "text"), _this2.$text.setAttribute("spellcheck", "false"), _this2.$text.setAttribute("aria-labelledby", _this2.$name.id), _this2.$display = document.createElement("div"), _this2.$display.classList.add("display"), _this2.$display.appendChild(_this2.$input), _this2.$widget.appendChild(_this2.$display), _this2.$widget.appendChild(_this2.$text), _this2._format = (l = _this2.initialValue, lil_gui_module_min_o.find(function (t) {
|
|
38398
|
+
return t.match(l);
|
|
38399
|
+
})), _this2._rgbScale = n, _this2._initialValueHexString = _this2.save(), _this2._textFocused = !1, _this2.$input.addEventListener("input", function () {
|
|
38400
|
+
_this2._setValueFromHexString(_this2.$input.value);
|
|
38401
|
+
}), _this2.$input.addEventListener("blur", function () {
|
|
38402
|
+
_this2._callOnFinishChange();
|
|
38403
|
+
}), _this2.$text.addEventListener("input", function () {
|
|
38404
|
+
var t = lil_gui_module_min_e(_this2.$text.value);
|
|
38405
|
+
t && _this2._setValueFromHexString(t);
|
|
38406
|
+
}), _this2.$text.addEventListener("focus", function () {
|
|
38407
|
+
_this2._textFocused = !0, _this2.$text.select();
|
|
38408
|
+
}), _this2.$text.addEventListener("blur", function () {
|
|
38409
|
+
_this2._textFocused = !1, _this2.updateDisplay(), _this2._callOnFinishChange();
|
|
38410
|
+
}), _this2.$disable = _this2.$text, _this2.updateDisplay();
|
|
38411
|
+
return _this2;
|
|
38412
|
+
}
|
|
38413
|
+
inherits_default()(a, _t15);
|
|
38414
|
+
return createClass_default()(a, [{
|
|
38415
|
+
key: "reset",
|
|
38416
|
+
value: function reset() {
|
|
38417
|
+
return this._setValueFromHexString(this._initialValueHexString), this;
|
|
38418
|
+
}
|
|
38419
|
+
}, {
|
|
38420
|
+
key: "_setValueFromHexString",
|
|
38421
|
+
value: function _setValueFromHexString(t) {
|
|
38422
|
+
if (this._format.isPrimitive) {
|
|
38423
|
+
var _i2 = this._format.fromHexString(t);
|
|
38424
|
+
this.setValue(_i2);
|
|
38425
|
+
} else this._format.fromHexString(t, this.getValue(), this._rgbScale), this._callOnChange(), this.updateDisplay();
|
|
38426
|
+
}
|
|
38427
|
+
}, {
|
|
38428
|
+
key: "save",
|
|
38429
|
+
value: function save() {
|
|
38430
|
+
return this._format.toHexString(this.getValue(), this._rgbScale);
|
|
38431
|
+
}
|
|
38432
|
+
}, {
|
|
38433
|
+
key: "load",
|
|
38434
|
+
value: function load(t) {
|
|
38435
|
+
return this._setValueFromHexString(t), this._callOnFinishChange(), this;
|
|
38436
|
+
}
|
|
38437
|
+
}, {
|
|
38438
|
+
key: "updateDisplay",
|
|
38439
|
+
value: function updateDisplay() {
|
|
38440
|
+
return this.$input.value = this._format.toHexString(this.getValue(), this._rgbScale), this._textFocused || (this.$text.value = this.$input.value.substring(1)), this.$display.style.backgroundColor = this.$input.value, this;
|
|
38441
|
+
}
|
|
38442
|
+
}]);
|
|
38443
|
+
}(lil_gui_module_min_t);
|
|
38444
|
+
var lil_gui_module_min_h = /*#__PURE__*/function (_t16) {
|
|
38445
|
+
function h(t, i, e) {
|
|
38446
|
+
var _this3;
|
|
38447
|
+
classCallCheck_default()(this, h);
|
|
38448
|
+
_this3 = lil_gui_module_min_callSuper(this, h, [t, i, e, "function"]), _this3.$button = document.createElement("button"), _this3.$button.appendChild(_this3.$name), _this3.$widget.appendChild(_this3.$button), _this3.$button.addEventListener("click", function (t) {
|
|
38449
|
+
t.preventDefault(), _this3.getValue().call(_this3.object);
|
|
38450
|
+
}), _this3.$button.addEventListener("touchstart", function () {}, {
|
|
38451
|
+
passive: !0
|
|
38452
|
+
}), _this3.$disable = _this3.$button;
|
|
38453
|
+
return _this3;
|
|
38454
|
+
}
|
|
38455
|
+
inherits_default()(h, _t16);
|
|
38456
|
+
return createClass_default()(h);
|
|
38457
|
+
}(lil_gui_module_min_t);
|
|
38458
|
+
var lil_gui_module_min_d = /*#__PURE__*/function (_t17) {
|
|
38459
|
+
function d(t, i, e, s, n, l) {
|
|
38460
|
+
var _this4;
|
|
38461
|
+
classCallCheck_default()(this, d);
|
|
38462
|
+
_this4 = lil_gui_module_min_callSuper(this, d, [t, i, e, "number"]), _this4._initInput(), _this4.min(s), _this4.max(n);
|
|
38463
|
+
var r = void 0 !== l;
|
|
38464
|
+
_this4.step(r ? l : _this4._getImplicitStep(), r), _this4.updateDisplay();
|
|
38465
|
+
return _this4;
|
|
38466
|
+
}
|
|
38467
|
+
inherits_default()(d, _t17);
|
|
38468
|
+
return createClass_default()(d, [{
|
|
38469
|
+
key: "decimals",
|
|
38470
|
+
value: function decimals(t) {
|
|
38471
|
+
return this._decimals = t, this.updateDisplay(), this;
|
|
38472
|
+
}
|
|
38473
|
+
}, {
|
|
38474
|
+
key: "min",
|
|
38475
|
+
value: function min(t) {
|
|
38476
|
+
return this._min = t, this._onUpdateMinMax(), this;
|
|
38477
|
+
}
|
|
38478
|
+
}, {
|
|
38479
|
+
key: "max",
|
|
38480
|
+
value: function max(t) {
|
|
38481
|
+
return this._max = t, this._onUpdateMinMax(), this;
|
|
38482
|
+
}
|
|
38483
|
+
}, {
|
|
38484
|
+
key: "step",
|
|
38485
|
+
value: function step(t) {
|
|
38486
|
+
var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
38487
|
+
return this._step = t, this._stepExplicit = i, this;
|
|
38488
|
+
}
|
|
38489
|
+
}, {
|
|
38490
|
+
key: "updateDisplay",
|
|
38491
|
+
value: function updateDisplay() {
|
|
38492
|
+
var t = this.getValue();
|
|
38493
|
+
if (this._hasSlider) {
|
|
38494
|
+
var _i3 = (t - this._min) / (this._max - this._min);
|
|
38495
|
+
_i3 = Math.max(0, Math.min(_i3, 1)), this.$fill.style.width = 100 * _i3 + "%";
|
|
38496
|
+
}
|
|
38497
|
+
return this._inputFocused || (this.$input.value = void 0 === this._decimals ? t : t.toFixed(this._decimals)), this;
|
|
38498
|
+
}
|
|
38499
|
+
}, {
|
|
38500
|
+
key: "_initInput",
|
|
38501
|
+
value: function _initInput() {
|
|
38502
|
+
var _this5 = this;
|
|
38503
|
+
this.$input = document.createElement("input"), this.$input.setAttribute("type", "number"), this.$input.setAttribute("step", "any"), this.$input.setAttribute("aria-labelledby", this.$name.id), this.$widget.appendChild(this.$input), this.$disable = this.$input;
|
|
38504
|
+
var t = function t(_t18) {
|
|
38505
|
+
var i = parseFloat(_this5.$input.value);
|
|
38506
|
+
isNaN(i) || (_this5._snapClampSetValue(i + _t18), _this5.$input.value = _this5.getValue());
|
|
38507
|
+
};
|
|
38508
|
+
var i,
|
|
38509
|
+
e,
|
|
38510
|
+
s,
|
|
38511
|
+
n,
|
|
38512
|
+
l,
|
|
38513
|
+
r = !1;
|
|
38514
|
+
var o = function o(t) {
|
|
38515
|
+
if (r) {
|
|
38516
|
+
var _s = t.clientX - i,
|
|
38517
|
+
_n = t.clientY - e;
|
|
38518
|
+
Math.abs(_n) > 5 ? (t.preventDefault(), _this5.$input.blur(), r = !1, _this5._setDraggingStyle(!0, "vertical")) : Math.abs(_s) > 5 && _a();
|
|
38519
|
+
}
|
|
38520
|
+
if (!r) {
|
|
38521
|
+
var _i4 = t.clientY - s;
|
|
38522
|
+
l -= _i4 * _this5._step * _this5._arrowKeyMultiplier(t), n + l > _this5._max ? l = _this5._max - n : n + l < _this5._min && (l = _this5._min - n), _this5._snapClampSetValue(n + l);
|
|
38523
|
+
}
|
|
38524
|
+
s = t.clientY;
|
|
38525
|
+
},
|
|
38526
|
+
_a = function a() {
|
|
38527
|
+
_this5._setDraggingStyle(!1, "vertical"), _this5._callOnFinishChange(), window.removeEventListener("mousemove", o), window.removeEventListener("mouseup", _a);
|
|
38528
|
+
};
|
|
38529
|
+
this.$input.addEventListener("input", function () {
|
|
38530
|
+
var t = parseFloat(_this5.$input.value);
|
|
38531
|
+
isNaN(t) || (_this5._stepExplicit && (t = _this5._snap(t)), _this5.setValue(_this5._clamp(t)));
|
|
38532
|
+
}), this.$input.addEventListener("keydown", function (i) {
|
|
38533
|
+
"Enter" === i.code && _this5.$input.blur(), "ArrowUp" === i.code && (i.preventDefault(), t(_this5._step * _this5._arrowKeyMultiplier(i))), "ArrowDown" === i.code && (i.preventDefault(), t(_this5._step * _this5._arrowKeyMultiplier(i) * -1));
|
|
38534
|
+
}), this.$input.addEventListener("wheel", function (i) {
|
|
38535
|
+
_this5._inputFocused && (i.preventDefault(), t(_this5._step * _this5._normalizeMouseWheel(i)));
|
|
38536
|
+
}, {
|
|
38537
|
+
passive: !1
|
|
38538
|
+
}), this.$input.addEventListener("mousedown", function (t) {
|
|
38539
|
+
i = t.clientX, e = s = t.clientY, r = !0, n = _this5.getValue(), l = 0, window.addEventListener("mousemove", o), window.addEventListener("mouseup", _a);
|
|
38540
|
+
}), this.$input.addEventListener("focus", function () {
|
|
38541
|
+
_this5._inputFocused = !0;
|
|
38542
|
+
}), this.$input.addEventListener("blur", function () {
|
|
38543
|
+
_this5._inputFocused = !1, _this5.updateDisplay(), _this5._callOnFinishChange();
|
|
38544
|
+
});
|
|
38545
|
+
}
|
|
38546
|
+
}, {
|
|
38547
|
+
key: "_initSlider",
|
|
38548
|
+
value: function _initSlider() {
|
|
38549
|
+
var _this6 = this;
|
|
38550
|
+
this._hasSlider = !0, this.$slider = document.createElement("div"), this.$slider.classList.add("slider"), this.$fill = document.createElement("div"), this.$fill.classList.add("fill"), this.$slider.appendChild(this.$fill), this.$widget.insertBefore(this.$slider, this.$input), this.domElement.classList.add("hasSlider");
|
|
38551
|
+
var t = function t(_t19) {
|
|
38552
|
+
var i = _this6.$slider.getBoundingClientRect();
|
|
38553
|
+
var e = (s = _t19, n = i.left, l = i.right, r = _this6._min, o = _this6._max, (s - n) / (l - n) * (o - r) + r);
|
|
38554
|
+
var s, n, l, r, o;
|
|
38555
|
+
_this6._snapClampSetValue(e);
|
|
38556
|
+
},
|
|
38557
|
+
i = function i(_i5) {
|
|
38558
|
+
t(_i5.clientX);
|
|
38559
|
+
},
|
|
38560
|
+
_e = function e() {
|
|
38561
|
+
_this6._callOnFinishChange(), _this6._setDraggingStyle(!1), window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", _e);
|
|
38562
|
+
};
|
|
38563
|
+
var s,
|
|
38564
|
+
n,
|
|
38565
|
+
l = !1;
|
|
38566
|
+
var r = function r(i) {
|
|
38567
|
+
i.preventDefault(), _this6._setDraggingStyle(!0), t(i.touches[0].clientX), l = !1;
|
|
38568
|
+
},
|
|
38569
|
+
_o = function o(i) {
|
|
38570
|
+
if (l) {
|
|
38571
|
+
var _t20 = i.touches[0].clientX - s,
|
|
38572
|
+
_e2 = i.touches[0].clientY - n;
|
|
38573
|
+
Math.abs(_t20) > Math.abs(_e2) ? r(i) : (window.removeEventListener("touchmove", _o), window.removeEventListener("touchend", _a2));
|
|
38574
|
+
} else i.preventDefault(), t(i.touches[0].clientX);
|
|
38575
|
+
},
|
|
38576
|
+
_a2 = function a() {
|
|
38577
|
+
_this6._callOnFinishChange(), _this6._setDraggingStyle(!1), window.removeEventListener("touchmove", _o), window.removeEventListener("touchend", _a2);
|
|
38578
|
+
},
|
|
38579
|
+
h = this._callOnFinishChange.bind(this);
|
|
38580
|
+
var _d;
|
|
38581
|
+
this.$slider.addEventListener("mousedown", function (s) {
|
|
38582
|
+
_this6._setDraggingStyle(!0), t(s.clientX), window.addEventListener("mousemove", i), window.addEventListener("mouseup", _e);
|
|
38583
|
+
}), this.$slider.addEventListener("touchstart", function (t) {
|
|
38584
|
+
t.touches.length > 1 || (_this6._hasScrollBar ? (s = t.touches[0].clientX, n = t.touches[0].clientY, l = !0) : r(t), window.addEventListener("touchmove", _o, {
|
|
38585
|
+
passive: !1
|
|
38586
|
+
}), window.addEventListener("touchend", _a2));
|
|
38587
|
+
}, {
|
|
38588
|
+
passive: !1
|
|
38589
|
+
}), this.$slider.addEventListener("wheel", function (t) {
|
|
38590
|
+
if (Math.abs(t.deltaX) < Math.abs(t.deltaY) && _this6._hasScrollBar) return;
|
|
38591
|
+
t.preventDefault();
|
|
38592
|
+
var i = _this6._normalizeMouseWheel(t) * _this6._step;
|
|
38593
|
+
_this6._snapClampSetValue(_this6.getValue() + i), _this6.$input.value = _this6.getValue(), clearTimeout(_d), _d = setTimeout(h, 400);
|
|
38594
|
+
}, {
|
|
38595
|
+
passive: !1
|
|
38596
|
+
});
|
|
38597
|
+
}
|
|
38598
|
+
}, {
|
|
38599
|
+
key: "_setDraggingStyle",
|
|
38600
|
+
value: function _setDraggingStyle(t) {
|
|
38601
|
+
var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "horizontal";
|
|
38602
|
+
this.$slider && this.$slider.classList.toggle("active", t), document.body.classList.toggle("lil-gui-dragging", t), document.body.classList.toggle("lil-gui-" + i, t);
|
|
38603
|
+
}
|
|
38604
|
+
}, {
|
|
38605
|
+
key: "_getImplicitStep",
|
|
38606
|
+
value: function _getImplicitStep() {
|
|
38607
|
+
return this._hasMin && this._hasMax ? (this._max - this._min) / 1e3 : .1;
|
|
38608
|
+
}
|
|
38609
|
+
}, {
|
|
38610
|
+
key: "_onUpdateMinMax",
|
|
38611
|
+
value: function _onUpdateMinMax() {
|
|
38612
|
+
!this._hasSlider && this._hasMin && this._hasMax && (this._stepExplicit || this.step(this._getImplicitStep(), !1), this._initSlider(), this.updateDisplay());
|
|
38613
|
+
}
|
|
38614
|
+
}, {
|
|
38615
|
+
key: "_normalizeMouseWheel",
|
|
38616
|
+
value: function _normalizeMouseWheel(t) {
|
|
38617
|
+
var i = t.deltaX,
|
|
38618
|
+
e = t.deltaY;
|
|
38619
|
+
Math.floor(t.deltaY) !== t.deltaY && t.wheelDelta && (i = 0, e = -t.wheelDelta / 120, e *= this._stepExplicit ? 1 : 10);
|
|
38620
|
+
return i + -e;
|
|
38621
|
+
}
|
|
38622
|
+
}, {
|
|
38623
|
+
key: "_arrowKeyMultiplier",
|
|
38624
|
+
value: function _arrowKeyMultiplier(t) {
|
|
38625
|
+
var i = this._stepExplicit ? 1 : 10;
|
|
38626
|
+
return t.shiftKey ? i *= 10 : t.altKey && (i /= 10), i;
|
|
38627
|
+
}
|
|
38628
|
+
}, {
|
|
38629
|
+
key: "_snap",
|
|
38630
|
+
value: function _snap(t) {
|
|
38631
|
+
var i = Math.round(t / this._step) * this._step;
|
|
38632
|
+
return parseFloat(i.toPrecision(15));
|
|
38633
|
+
}
|
|
38634
|
+
}, {
|
|
38635
|
+
key: "_clamp",
|
|
38636
|
+
value: function _clamp(t) {
|
|
38637
|
+
return t < this._min && (t = this._min), t > this._max && (t = this._max), t;
|
|
38638
|
+
}
|
|
38639
|
+
}, {
|
|
38640
|
+
key: "_snapClampSetValue",
|
|
38641
|
+
value: function _snapClampSetValue(t) {
|
|
38642
|
+
this.setValue(this._clamp(this._snap(t)));
|
|
38643
|
+
}
|
|
38644
|
+
}, {
|
|
38645
|
+
key: "_hasScrollBar",
|
|
38646
|
+
get: function get() {
|
|
38647
|
+
var t = this.parent.root.$children;
|
|
38648
|
+
return t.scrollHeight > t.clientHeight;
|
|
38649
|
+
}
|
|
38650
|
+
}, {
|
|
38651
|
+
key: "_hasMin",
|
|
38652
|
+
get: function get() {
|
|
38653
|
+
return void 0 !== this._min;
|
|
38654
|
+
}
|
|
38655
|
+
}, {
|
|
38656
|
+
key: "_hasMax",
|
|
38657
|
+
get: function get() {
|
|
38658
|
+
return void 0 !== this._max;
|
|
38659
|
+
}
|
|
38660
|
+
}]);
|
|
38661
|
+
}(lil_gui_module_min_t);
|
|
38662
|
+
var lil_gui_module_min_c = /*#__PURE__*/function (_t21) {
|
|
38663
|
+
function c(t, i, e, s) {
|
|
38664
|
+
var _this7;
|
|
38665
|
+
classCallCheck_default()(this, c);
|
|
38666
|
+
_this7 = lil_gui_module_min_callSuper(this, c, [t, i, e, "option"]), _this7.$select = document.createElement("select"), _this7.$select.setAttribute("aria-labelledby", _this7.$name.id), _this7.$display = document.createElement("div"), _this7.$display.classList.add("display"), _this7._values = Array.isArray(s) ? s : Object.values(s), _this7._names = Array.isArray(s) ? s : Object.keys(s), _this7._names.forEach(function (t) {
|
|
38667
|
+
var i = document.createElement("option");
|
|
38668
|
+
i.innerHTML = t, _this7.$select.appendChild(i);
|
|
38669
|
+
}), _this7.$select.addEventListener("change", function () {
|
|
38670
|
+
_this7.setValue(_this7._values[_this7.$select.selectedIndex]), _this7._callOnFinishChange();
|
|
38671
|
+
}), _this7.$select.addEventListener("focus", function () {
|
|
38672
|
+
_this7.$display.classList.add("focus");
|
|
38673
|
+
}), _this7.$select.addEventListener("blur", function () {
|
|
38674
|
+
_this7.$display.classList.remove("focus");
|
|
38675
|
+
}), _this7.$widget.appendChild(_this7.$select), _this7.$widget.appendChild(_this7.$display), _this7.$disable = _this7.$select, _this7.updateDisplay();
|
|
38676
|
+
return _this7;
|
|
38677
|
+
}
|
|
38678
|
+
inherits_default()(c, _t21);
|
|
38679
|
+
return createClass_default()(c, [{
|
|
38680
|
+
key: "updateDisplay",
|
|
38681
|
+
value: function updateDisplay() {
|
|
38682
|
+
var t = this.getValue(),
|
|
38683
|
+
i = this._values.indexOf(t);
|
|
38684
|
+
return this.$select.selectedIndex = i, this.$display.innerHTML = -1 === i ? t : this._names[i], this;
|
|
38685
|
+
}
|
|
38686
|
+
}]);
|
|
38687
|
+
}(lil_gui_module_min_t);
|
|
38688
|
+
var lil_gui_module_min_u = /*#__PURE__*/function (_t22) {
|
|
38689
|
+
function u(t, i, e) {
|
|
38690
|
+
var _this8;
|
|
38691
|
+
classCallCheck_default()(this, u);
|
|
38692
|
+
_this8 = lil_gui_module_min_callSuper(this, u, [t, i, e, "string"]), _this8.$input = document.createElement("input"), _this8.$input.setAttribute("type", "text"), _this8.$input.setAttribute("aria-labelledby", _this8.$name.id), _this8.$input.addEventListener("input", function () {
|
|
38693
|
+
_this8.setValue(_this8.$input.value);
|
|
38694
|
+
}), _this8.$input.addEventListener("keydown", function (t) {
|
|
38695
|
+
"Enter" === t.code && _this8.$input.blur();
|
|
38696
|
+
}), _this8.$input.addEventListener("blur", function () {
|
|
38697
|
+
_this8._callOnFinishChange();
|
|
38698
|
+
}), _this8.$widget.appendChild(_this8.$input), _this8.$disable = _this8.$input, _this8.updateDisplay();
|
|
38699
|
+
return _this8;
|
|
38700
|
+
}
|
|
38701
|
+
inherits_default()(u, _t22);
|
|
38702
|
+
return createClass_default()(u, [{
|
|
38703
|
+
key: "updateDisplay",
|
|
38704
|
+
value: function updateDisplay() {
|
|
38705
|
+
return this.$input.value = this.getValue(), this;
|
|
38706
|
+
}
|
|
38707
|
+
}]);
|
|
38708
|
+
}(lil_gui_module_min_t);
|
|
38709
|
+
var lil_gui_module_min_p = !1;
|
|
38710
|
+
var lil_gui_module_min_g = /*#__PURE__*/function () {
|
|
38711
|
+
function g() {
|
|
38712
|
+
var _this9 = this;
|
|
38713
|
+
var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
38714
|
+
t = _ref4.parent,
|
|
38715
|
+
_ref4$autoPlace = _ref4.autoPlace,
|
|
38716
|
+
i = _ref4$autoPlace === void 0 ? void 0 === t : _ref4$autoPlace,
|
|
38717
|
+
e = _ref4.container,
|
|
38718
|
+
s = _ref4.width,
|
|
38719
|
+
_ref4$title = _ref4.title,
|
|
38720
|
+
n = _ref4$title === void 0 ? "Controls" : _ref4$title,
|
|
38721
|
+
_ref4$injectStyles = _ref4.injectStyles,
|
|
38722
|
+
l = _ref4$injectStyles === void 0 ? !0 : _ref4$injectStyles,
|
|
38723
|
+
_ref4$touchStyles = _ref4.touchStyles,
|
|
38724
|
+
r = _ref4$touchStyles === void 0 ? !0 : _ref4$touchStyles;
|
|
38725
|
+
classCallCheck_default()(this, g);
|
|
38726
|
+
if (this.parent = t, this.root = t ? t.root : this, this.children = [], this.controllers = [], this.folders = [], this._closed = !1, this._hidden = !1, this.domElement = document.createElement("div"), this.domElement.classList.add("lil-gui"), this.$title = document.createElement("div"), this.$title.classList.add("title"), this.$title.setAttribute("role", "button"), this.$title.setAttribute("aria-expanded", !0), this.$title.setAttribute("tabindex", 0), this.$title.addEventListener("click", function () {
|
|
38727
|
+
return _this9.openAnimated(_this9._closed);
|
|
38728
|
+
}), this.$title.addEventListener("keydown", function (t) {
|
|
38729
|
+
"Enter" !== t.code && "Space" !== t.code || (t.preventDefault(), _this9.$title.click());
|
|
38730
|
+
}), this.$title.addEventListener("touchstart", function () {}, {
|
|
38731
|
+
passive: !0
|
|
38732
|
+
}), this.$children = document.createElement("div"), this.$children.classList.add("children"), this.domElement.appendChild(this.$title), this.domElement.appendChild(this.$children), this.title(n), r && this.domElement.classList.add("allow-touch-styles"), this.parent) return this.parent.children.push(this), this.parent.folders.push(this), void this.parent.$children.appendChild(this.domElement);
|
|
38733
|
+
this.domElement.classList.add("root"), !lil_gui_module_min_p && l && (!function (t) {
|
|
38734
|
+
var i = document.createElement("style");
|
|
38735
|
+
i.innerHTML = t;
|
|
38736
|
+
var e = document.querySelector("head link[rel=stylesheet], head style");
|
|
38737
|
+
e ? document.head.insertBefore(i, e) : document.head.appendChild(i);
|
|
38738
|
+
}('.lil-gui{--background-color:#1f1f1f;--text-color:#ebebeb;--title-background-color:#111;--title-text-color:#ebebeb;--widget-color:#424242;--hover-color:#4f4f4f;--focus-color:#595959;--number-color:#2cc9ff;--string-color:#a2db3c;--font-size:11px;--input-font-size:11px;--font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;--font-family-mono:Menlo,Monaco,Consolas,"Droid Sans Mono",monospace;--padding:4px;--spacing:4px;--widget-height:20px;--name-width:45%;--slider-knob-width:2px;--slider-input-width:27%;--color-input-width:27%;--slider-input-min-width:45px;--color-input-min-width:45px;--folder-indent:7px;--widget-padding:0 0 0 3px;--widget-border-radius:2px;--checkbox-size:calc(var(--widget-height)*0.75);--scrollbar-width:5px;background-color:var(--background-color);color:var(--text-color);font-family:var(--font-family);font-size:var(--font-size);font-style:normal;font-weight:400;line-height:1;text-align:left;touch-action:manipulation;user-select:none;-webkit-user-select:none}.lil-gui,.lil-gui *{box-sizing:border-box;margin:0;padding:0}.lil-gui.root{display:flex;flex-direction:column;width:var(--width,245px)}.lil-gui.root>.title{background:var(--title-background-color);color:var(--title-text-color)}.lil-gui.root>.children{overflow-x:hidden;overflow-y:auto}.lil-gui.root>.children::-webkit-scrollbar{background:var(--background-color);height:var(--scrollbar-width);width:var(--scrollbar-width)}.lil-gui.root>.children::-webkit-scrollbar-thumb{background:var(--focus-color);border-radius:var(--scrollbar-width)}.lil-gui.force-touch-styles{--widget-height:28px;--padding:6px;--spacing:6px;--font-size:13px;--input-font-size:16px;--folder-indent:10px;--scrollbar-width:7px;--slider-input-min-width:50px;--color-input-min-width:65px}.lil-gui.autoPlace{max-height:100%;position:fixed;right:15px;top:0;z-index:1001}.lil-gui .controller{align-items:center;display:flex;margin:var(--spacing) 0;padding:0 var(--padding)}.lil-gui .controller.disabled{opacity:.5}.lil-gui .controller.disabled,.lil-gui .controller.disabled *{pointer-events:none!important}.lil-gui .controller>.name{flex-shrink:0;line-height:var(--widget-height);min-width:var(--name-width);padding-right:var(--spacing);white-space:pre}.lil-gui .controller .widget{align-items:center;display:flex;min-height:var(--widget-height);position:relative;width:100%}.lil-gui .controller.string input{color:var(--string-color)}.lil-gui .controller.boolean .widget{cursor:pointer}.lil-gui .controller.color .display{border-radius:var(--widget-border-radius);height:var(--widget-height);position:relative;width:100%}.lil-gui .controller.color input[type=color]{cursor:pointer;height:100%;opacity:0;width:100%}.lil-gui .controller.color input[type=text]{flex-shrink:0;font-family:var(--font-family-mono);margin-left:var(--spacing);min-width:var(--color-input-min-width);width:var(--color-input-width)}.lil-gui .controller.option select{max-width:100%;opacity:0;position:absolute;width:100%}.lil-gui .controller.option .display{background:var(--widget-color);border-radius:var(--widget-border-radius);height:var(--widget-height);line-height:var(--widget-height);max-width:100%;overflow:hidden;padding-left:.55em;padding-right:1.75em;pointer-events:none;position:relative;word-break:break-all}.lil-gui .controller.option .display.active{background:var(--focus-color)}.lil-gui .controller.option .display:after{bottom:0;content:"↕";font-family:lil-gui;padding-right:.375em;position:absolute;right:0;top:0}.lil-gui .controller.option .widget,.lil-gui .controller.option select{cursor:pointer}.lil-gui .controller.number input{color:var(--number-color)}.lil-gui .controller.number.hasSlider input{flex-shrink:0;margin-left:var(--spacing);min-width:var(--slider-input-min-width);width:var(--slider-input-width)}.lil-gui .controller.number .slider{background-color:var(--widget-color);border-radius:var(--widget-border-radius);cursor:ew-resize;height:var(--widget-height);overflow:hidden;padding-right:var(--slider-knob-width);touch-action:pan-y;width:100%}.lil-gui .controller.number .slider.active{background-color:var(--focus-color)}.lil-gui .controller.number .slider.active .fill{opacity:.95}.lil-gui .controller.number .fill{border-right:var(--slider-knob-width) solid var(--number-color);box-sizing:content-box;height:100%}.lil-gui-dragging .lil-gui{--hover-color:var(--widget-color)}.lil-gui-dragging *{cursor:ew-resize!important}.lil-gui-dragging.lil-gui-vertical *{cursor:ns-resize!important}.lil-gui .title{--title-height:calc(var(--widget-height) + var(--spacing)*1.25);-webkit-tap-highlight-color:transparent;text-decoration-skip:objects;cursor:pointer;font-weight:600;height:var(--title-height);line-height:calc(var(--title-height) - 4px);outline:none;padding:0 var(--padding)}.lil-gui .title:before{content:"▾";display:inline-block;font-family:lil-gui;padding-right:2px}.lil-gui .title:active{background:var(--title-background-color);opacity:.75}.lil-gui.root>.title:focus{text-decoration:none!important}.lil-gui.closed>.title:before{content:"▸"}.lil-gui.closed>.children{opacity:0;transform:translateY(-7px)}.lil-gui.closed:not(.transition)>.children{display:none}.lil-gui.transition>.children{overflow:hidden;pointer-events:none;transition-duration:.3s;transition-property:height,opacity,transform;transition-timing-function:cubic-bezier(.2,.6,.35,1)}.lil-gui .children:empty:before{content:"Empty";display:block;font-style:italic;height:var(--widget-height);line-height:var(--widget-height);margin:var(--spacing) 0;opacity:.5;padding:0 var(--padding)}.lil-gui.root>.children>.lil-gui>.title{border-width:0;border-bottom:1px solid var(--widget-color);border-left:0 solid var(--widget-color);border-right:0 solid var(--widget-color);border-top:1px solid var(--widget-color);transition:border-color .3s}.lil-gui.root>.children>.lil-gui.closed>.title{border-bottom-color:transparent}.lil-gui+.controller{border-top:1px solid var(--widget-color);margin-top:0;padding-top:var(--spacing)}.lil-gui .lil-gui .lil-gui>.title{border:none}.lil-gui .lil-gui .lil-gui>.children{border:none;border-left:2px solid var(--widget-color);margin-left:var(--folder-indent)}.lil-gui .lil-gui .controller{border:none}.lil-gui input{-webkit-tap-highlight-color:transparent;background:var(--widget-color);border:0;border-radius:var(--widget-border-radius);color:var(--text-color);font-family:var(--font-family);font-size:var(--input-font-size);height:var(--widget-height);outline:none;width:100%}.lil-gui input:disabled{opacity:1}.lil-gui input[type=number],.lil-gui input[type=text]{padding:var(--widget-padding)}.lil-gui input[type=number]:focus,.lil-gui input[type=text]:focus{background:var(--focus-color)}.lil-gui input::-webkit-inner-spin-button,.lil-gui input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.lil-gui input[type=number]{-moz-appearance:textfield}.lil-gui input[type=checkbox]{appearance:none;-webkit-appearance:none;border-radius:var(--widget-border-radius);cursor:pointer;height:var(--checkbox-size);text-align:center;width:var(--checkbox-size)}.lil-gui input[type=checkbox]:checked:before{content:"✓";font-family:lil-gui;font-size:var(--checkbox-size);line-height:var(--checkbox-size)}.lil-gui button{-webkit-tap-highlight-color:transparent;background:var(--widget-color);border:1px solid var(--widget-color);border-radius:var(--widget-border-radius);color:var(--text-color);cursor:pointer;font-family:var(--font-family);font-size:var(--font-size);height:var(--widget-height);line-height:calc(var(--widget-height) - 4px);outline:none;text-align:center;text-transform:none;width:100%}.lil-gui button:active{background:var(--focus-color)}@font-face{font-family:lil-gui;src:url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff")}@media (pointer:coarse){.lil-gui.allow-touch-styles{--widget-height:28px;--padding:6px;--spacing:6px;--font-size:13px;--input-font-size:16px;--folder-indent:10px;--scrollbar-width:7px;--slider-input-min-width:50px;--color-input-min-width:65px}}@media (hover:hover){.lil-gui .controller.color .display:hover:before{border:1px solid #fff9;border-radius:var(--widget-border-radius);bottom:0;content:" ";display:block;left:0;position:absolute;right:0;top:0}.lil-gui .controller.option .display.focus{background:var(--focus-color)}.lil-gui .controller.option .widget:hover .display{background:var(--hover-color)}.lil-gui .controller.number .slider:hover{background-color:var(--hover-color)}body:not(.lil-gui-dragging) .lil-gui .title:hover{background:var(--title-background-color);opacity:.85}.lil-gui .title:focus{text-decoration:underline var(--focus-color)}.lil-gui input:hover{background:var(--hover-color)}.lil-gui input:active{background:var(--focus-color)}.lil-gui input[type=checkbox]:focus{box-shadow:inset 0 0 0 1px var(--focus-color)}.lil-gui button:hover{background:var(--hover-color);border-color:var(--hover-color)}.lil-gui button:focus{border-color:var(--focus-color)}}'), lil_gui_module_min_p = !0), e ? e.appendChild(this.domElement) : i && (this.domElement.classList.add("autoPlace"), document.body.appendChild(this.domElement)), s && this.domElement.style.setProperty("--width", s + "px"), this.domElement.addEventListener("keydown", function (t) {
|
|
38739
|
+
return t.stopPropagation();
|
|
38740
|
+
}), this.domElement.addEventListener("keyup", function (t) {
|
|
38741
|
+
return t.stopPropagation();
|
|
38742
|
+
});
|
|
38743
|
+
}
|
|
38744
|
+
return createClass_default()(g, [{
|
|
38745
|
+
key: "add",
|
|
38746
|
+
value: function add(t, e, s, n, l) {
|
|
38747
|
+
if (Object(s) === s) return new lil_gui_module_min_c(this, t, e, s);
|
|
38748
|
+
var r = t[e];
|
|
38749
|
+
switch (typeof_default()(r)) {
|
|
38750
|
+
case "number":
|
|
38751
|
+
return new lil_gui_module_min_d(this, t, e, s, n, l);
|
|
38752
|
+
case "boolean":
|
|
38753
|
+
return new lil_gui_module_min_i(this, t, e);
|
|
38754
|
+
case "string":
|
|
38755
|
+
return new lil_gui_module_min_u(this, t, e);
|
|
38756
|
+
case "function":
|
|
38757
|
+
return new lil_gui_module_min_h(this, t, e);
|
|
38758
|
+
}
|
|
38759
|
+
console.error("gui.add failed\n\tproperty:", e, "\n\tobject:", t, "\n\tvalue:", r);
|
|
38760
|
+
}
|
|
38761
|
+
}, {
|
|
38762
|
+
key: "addColor",
|
|
38763
|
+
value: function addColor(t, i) {
|
|
38764
|
+
var e = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
38765
|
+
return new lil_gui_module_min_a(this, t, i, e);
|
|
38766
|
+
}
|
|
38767
|
+
}, {
|
|
38768
|
+
key: "addFolder",
|
|
38769
|
+
value: function addFolder(t) {
|
|
38770
|
+
return new g({
|
|
38771
|
+
parent: this,
|
|
38772
|
+
title: t
|
|
38773
|
+
});
|
|
38774
|
+
}
|
|
38775
|
+
}, {
|
|
38776
|
+
key: "load",
|
|
38777
|
+
value: function load(t) {
|
|
38778
|
+
var i = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
|
|
38779
|
+
return t.controllers && this.controllers.forEach(function (i) {
|
|
38780
|
+
i instanceof lil_gui_module_min_h || i._name in t.controllers && i.load(t.controllers[i._name]);
|
|
38781
|
+
}), i && t.folders && this.folders.forEach(function (i) {
|
|
38782
|
+
i._title in t.folders && i.load(t.folders[i._title]);
|
|
38783
|
+
}), this;
|
|
38784
|
+
}
|
|
38785
|
+
}, {
|
|
38786
|
+
key: "save",
|
|
38787
|
+
value: function save() {
|
|
38788
|
+
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
38789
|
+
var i = {
|
|
38790
|
+
controllers: {},
|
|
38791
|
+
folders: {}
|
|
38792
|
+
};
|
|
38793
|
+
return this.controllers.forEach(function (t) {
|
|
38794
|
+
if (!(t instanceof lil_gui_module_min_h)) {
|
|
38795
|
+
if (t._name in i.controllers) throw new Error("Cannot save GUI with duplicate property \"".concat(t._name, "\""));
|
|
38796
|
+
i.controllers[t._name] = t.save();
|
|
38797
|
+
}
|
|
38798
|
+
}), t && this.folders.forEach(function (t) {
|
|
38799
|
+
if (t._title in i.folders) throw new Error("Cannot save GUI with duplicate folder \"".concat(t._title, "\""));
|
|
38800
|
+
i.folders[t._title] = t.save();
|
|
38801
|
+
}), i;
|
|
38802
|
+
}
|
|
38803
|
+
}, {
|
|
38804
|
+
key: "open",
|
|
38805
|
+
value: function open() {
|
|
38806
|
+
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
38807
|
+
return this._closed = !t, this.$title.setAttribute("aria-expanded", !this._closed), this.domElement.classList.toggle("closed", this._closed), this;
|
|
38808
|
+
}
|
|
38809
|
+
}, {
|
|
38810
|
+
key: "close",
|
|
38811
|
+
value: function close() {
|
|
38812
|
+
return this.open(!1);
|
|
38813
|
+
}
|
|
38814
|
+
}, {
|
|
38815
|
+
key: "show",
|
|
38816
|
+
value: function show() {
|
|
38817
|
+
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
38818
|
+
return this._hidden = !t, this.domElement.style.display = this._hidden ? "none" : "", this;
|
|
38819
|
+
}
|
|
38820
|
+
}, {
|
|
38821
|
+
key: "hide",
|
|
38822
|
+
value: function hide() {
|
|
38823
|
+
return this.show(!1);
|
|
38824
|
+
}
|
|
38825
|
+
}, {
|
|
38826
|
+
key: "openAnimated",
|
|
38827
|
+
value: function openAnimated() {
|
|
38828
|
+
var _this0 = this;
|
|
38829
|
+
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
38830
|
+
return this._closed = !t, this.$title.setAttribute("aria-expanded", !this._closed), requestAnimationFrame(function () {
|
|
38831
|
+
var i = _this0.$children.clientHeight;
|
|
38832
|
+
_this0.$children.style.height = i + "px", _this0.domElement.classList.add("transition");
|
|
38833
|
+
var _e3 = function e(t) {
|
|
38834
|
+
t.target === _this0.$children && (_this0.$children.style.height = "", _this0.domElement.classList.remove("transition"), _this0.$children.removeEventListener("transitionend", _e3));
|
|
38835
|
+
};
|
|
38836
|
+
_this0.$children.addEventListener("transitionend", _e3);
|
|
38837
|
+
var s = t ? _this0.$children.scrollHeight : 0;
|
|
38838
|
+
_this0.domElement.classList.toggle("closed", !t), requestAnimationFrame(function () {
|
|
38839
|
+
_this0.$children.style.height = s + "px";
|
|
38840
|
+
});
|
|
38841
|
+
}), this;
|
|
38842
|
+
}
|
|
38843
|
+
}, {
|
|
38844
|
+
key: "title",
|
|
38845
|
+
value: function title(t) {
|
|
38846
|
+
return this._title = t, this.$title.innerHTML = t, this;
|
|
38847
|
+
}
|
|
38848
|
+
}, {
|
|
38849
|
+
key: "reset",
|
|
38850
|
+
value: function reset() {
|
|
38851
|
+
var t = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !0;
|
|
38852
|
+
return (t ? this.controllersRecursive() : this.controllers).forEach(function (t) {
|
|
38853
|
+
return t.reset();
|
|
38854
|
+
}), this;
|
|
38855
|
+
}
|
|
38856
|
+
}, {
|
|
38857
|
+
key: "onChange",
|
|
38858
|
+
value: function onChange(t) {
|
|
38859
|
+
return this._onChange = t, this;
|
|
38860
|
+
}
|
|
38861
|
+
}, {
|
|
38862
|
+
key: "_callOnChange",
|
|
38863
|
+
value: function _callOnChange(t) {
|
|
38864
|
+
this.parent && this.parent._callOnChange(t), void 0 !== this._onChange && this._onChange.call(this, {
|
|
38865
|
+
object: t.object,
|
|
38866
|
+
property: t.property,
|
|
38867
|
+
value: t.getValue(),
|
|
38868
|
+
controller: t
|
|
38869
|
+
});
|
|
38870
|
+
}
|
|
38871
|
+
}, {
|
|
38872
|
+
key: "onFinishChange",
|
|
38873
|
+
value: function onFinishChange(t) {
|
|
38874
|
+
return this._onFinishChange = t, this;
|
|
38875
|
+
}
|
|
38876
|
+
}, {
|
|
38877
|
+
key: "_callOnFinishChange",
|
|
38878
|
+
value: function _callOnFinishChange(t) {
|
|
38879
|
+
this.parent && this.parent._callOnFinishChange(t), void 0 !== this._onFinishChange && this._onFinishChange.call(this, {
|
|
38880
|
+
object: t.object,
|
|
38881
|
+
property: t.property,
|
|
38882
|
+
value: t.getValue(),
|
|
38883
|
+
controller: t
|
|
38884
|
+
});
|
|
38885
|
+
}
|
|
38886
|
+
}, {
|
|
38887
|
+
key: "destroy",
|
|
38888
|
+
value: function destroy() {
|
|
38889
|
+
this.parent && (this.parent.children.splice(this.parent.children.indexOf(this), 1), this.parent.folders.splice(this.parent.folders.indexOf(this), 1)), this.domElement.parentElement && this.domElement.parentElement.removeChild(this.domElement), Array.from(this.children).forEach(function (t) {
|
|
38890
|
+
return t.destroy();
|
|
38891
|
+
});
|
|
38892
|
+
}
|
|
38893
|
+
}, {
|
|
38894
|
+
key: "controllersRecursive",
|
|
38895
|
+
value: function controllersRecursive() {
|
|
38896
|
+
var t = Array.from(this.controllers);
|
|
38897
|
+
return this.folders.forEach(function (i) {
|
|
38898
|
+
t = t.concat(i.controllersRecursive());
|
|
38899
|
+
}), t;
|
|
38900
|
+
}
|
|
38901
|
+
}, {
|
|
38902
|
+
key: "foldersRecursive",
|
|
38903
|
+
value: function foldersRecursive() {
|
|
38904
|
+
var t = Array.from(this.folders);
|
|
38905
|
+
return this.folders.forEach(function (i) {
|
|
38906
|
+
t = t.concat(i.foldersRecursive());
|
|
38907
|
+
}), t;
|
|
38908
|
+
}
|
|
38909
|
+
}]);
|
|
38910
|
+
}();
|
|
38911
|
+
/* harmony default export */ var lil_gui_module_min = (lil_gui_module_min_g);
|
|
38912
|
+
|
|
38146
38913
|
// CONCATENATED MODULE: ./src/utils/threejs/measure-distance.js
|
|
38147
38914
|
|
|
38148
38915
|
|
|
@@ -41219,70 +41986,69 @@ var drawObjMapInstance = {};
|
|
|
41219
41986
|
* @param {Object} instance - 实例对象,包含绘制对象ID和实例ID等数据
|
|
41220
41987
|
* @param {Array} drawObjs - 绘制对象数组,包含几何数据
|
|
41221
41988
|
*/
|
|
41222
|
-
function handleInstancedMeshModel(instances, drawObjs, type, scene, customColor) {
|
|
41989
|
+
function handleInstancedMeshModel(instances, drawObjs, type, scene, customColor, meshNameConfig) {
|
|
41223
41990
|
// 第一阶段:构建实例映射表
|
|
41224
41991
|
var modelGroup = new three_core_Group();
|
|
41225
41992
|
for (var i = 0; i < instances.length; i++) {
|
|
41226
41993
|
formatInstancedMap(instances[i], drawObjs);
|
|
41227
41994
|
}
|
|
41228
|
-
console.log('drawObjMapInstance', drawObjMapInstance);
|
|
41229
41995
|
// 第二阶段:遍历所有实例进行处理
|
|
41230
41996
|
var _loop = function _loop(_i) {
|
|
41231
41997
|
var targetGroup, instancedMeshIndex, drawObjectName;
|
|
41232
|
-
// for (let drawObjectId in drawObjMapInstance) {
|
|
41233
|
-
// const drawObj = drawObjMapInstance[drawObjectId];
|
|
41234
|
-
// drawObj.MapInstance.forEach((instance, index) => {
|
|
41235
|
-
// if (instance.instanceId == instances[i].instanceId) {
|
|
41236
|
-
// instancedMeshIndex = index;
|
|
41237
|
-
// drawObjectName = drawObjectId;
|
|
41238
|
-
// }
|
|
41239
|
-
// });
|
|
41240
|
-
// }
|
|
41241
|
-
|
|
41242
41998
|
var drawObjInstance = drawObjMapInstance[instances[_i].drawObject];
|
|
41243
|
-
drawObjInstance.
|
|
41244
|
-
|
|
41245
|
-
|
|
41246
|
-
|
|
41999
|
+
if (drawObjInstance.MapMesh.length > 0) {
|
|
42000
|
+
drawObjInstance.MapInstance.forEach(function (instance, index) {
|
|
42001
|
+
if (instance.instanceId == instances[_i].instanceId) {
|
|
42002
|
+
instancedMeshIndex = index;
|
|
42003
|
+
drawObjectName = instances[_i].drawObject;
|
|
42004
|
+
}
|
|
42005
|
+
});
|
|
42006
|
+
if (drawObjectName) {
|
|
42007
|
+
targetGroup = scene.getObjectByName(drawObjectName);
|
|
41247
42008
|
}
|
|
41248
|
-
|
|
41249
|
-
|
|
41250
|
-
|
|
41251
|
-
|
|
41252
|
-
|
|
41253
|
-
|
|
41254
|
-
|
|
41255
|
-
|
|
41256
|
-
|
|
41257
|
-
|
|
41258
|
-
|
|
41259
|
-
|
|
41260
|
-
|
|
41261
|
-
|
|
41262
|
-
|
|
41263
|
-
|
|
41264
|
-
drawObj.MapInstance.forEach(function (instance, index) {
|
|
41265
|
-
if (instance.instanceId == instances[_i].instanceId) {
|
|
41266
|
-
var _instance$matrix;
|
|
41267
|
-
model.userData.instanceIndex = index;
|
|
41268
|
-
model.name = instances[_i].instanceId;
|
|
41269
|
-
var matrixVal = (_instance$matrix = instance.matrix) === null || _instance$matrix === void 0 ? void 0 : _instance$matrix.val;
|
|
41270
|
-
if (matrixVal) {
|
|
41271
|
-
var m4 = new three_core_Matrix4();
|
|
41272
|
-
// m4.setPosition(new THREE.Vector3(9999999, 9999999, 9999999)); // TODO 临时隐藏方案
|
|
41273
|
-
m4.elements = instance.matrix.val;
|
|
41274
|
-
model.setMatrixAt(index, m4);
|
|
41275
|
-
}
|
|
41276
|
-
// 需要先设置全部实例颜色,否则后续设置颜色无效
|
|
41277
|
-
var color = mesh.prop.color;
|
|
41278
|
-
var meshColor = customColor ? new three_core_Color(customColor) : new three_core_Color("rgb(".concat(color[0], ", ").concat(color[1], ", ").concat(color[2], ")"));
|
|
41279
|
-
model.setColorAt(index, meshColor);
|
|
42009
|
+
if (!targetGroup) {
|
|
42010
|
+
var _drawObj$MapMesh;
|
|
42011
|
+
var drawObj = drawObjMapInstance[instances[_i].drawObject];
|
|
42012
|
+
var group = new three_core_Group();
|
|
42013
|
+
group.name = instances[_i].drawObject;
|
|
42014
|
+
group.userData.isInstancedMeshGroup = true;
|
|
42015
|
+
var instanceCount = drawObj.MapInstance.length;
|
|
42016
|
+
(_drawObj$MapMesh = drawObj.MapMesh) === null || _drawObj$MapMesh === void 0 ? void 0 : _drawObj$MapMesh.forEach(function (mesh) {
|
|
42017
|
+
var model = instance_parser_drawModel(mesh, group.name, instanceCount, customColor);
|
|
42018
|
+
if (!model) {
|
|
42019
|
+
return;
|
|
42020
|
+
}
|
|
42021
|
+
var meshName = '';
|
|
42022
|
+
for (var key in meshNameConfig) {
|
|
42023
|
+
model.userData[key] = meshNameConfig[key];
|
|
42024
|
+
meshName += ':' + meshNameConfig[key];
|
|
41280
42025
|
}
|
|
42026
|
+
drawObj.MapInstance.forEach(function (item, index) {
|
|
42027
|
+
if (item.instanceId == instances[_i].instanceId) {
|
|
42028
|
+
var _item$matrix;
|
|
42029
|
+
model.userData.instanceIndex = index;
|
|
42030
|
+
model.userData.instanceId = instances[_i].instanceId;
|
|
42031
|
+
model.name = meshName !== '' ? instances[_i].instanceId + meshName : instances[_i].instanceId;
|
|
42032
|
+
var matrixVal = (_item$matrix = item.matrix) === null || _item$matrix === void 0 ? void 0 : _item$matrix.val;
|
|
42033
|
+
if (matrixVal) {
|
|
42034
|
+
var m4 = new three_core_Matrix4();
|
|
42035
|
+
// m4.setPosition(new THREE.Vector3(9999999, 9999999, 9999999)); // TODO 临时隐藏方案
|
|
42036
|
+
m4.elements = item.matrix.val;
|
|
42037
|
+
model.setMatrixAt(index, m4);
|
|
42038
|
+
var copyMatrix = new three_core_Matrix4().copy(m4);
|
|
42039
|
+
model.userData.copyMatrix = copyMatrix;
|
|
42040
|
+
}
|
|
42041
|
+
// 需要先设置全部实例颜色,否则后续设置颜色无效
|
|
42042
|
+
var color = mesh.prop.color;
|
|
42043
|
+
var meshColor = customColor ? new three_core_Color(customColor) : new three_core_Color("rgb(".concat(color[0], ", ").concat(color[1], ", ").concat(color[2], ")"));
|
|
42044
|
+
model.setColorAt(index, meshColor);
|
|
42045
|
+
}
|
|
42046
|
+
});
|
|
42047
|
+
// model.instanceColor.needsUpdate = true;
|
|
42048
|
+
group.add(model);
|
|
41281
42049
|
});
|
|
41282
|
-
|
|
41283
|
-
|
|
41284
|
-
});
|
|
41285
|
-
modelGroup.add(group);
|
|
42050
|
+
modelGroup.add(group);
|
|
42051
|
+
}
|
|
41286
42052
|
}
|
|
41287
42053
|
};
|
|
41288
42054
|
for (var _i = 0; _i < instances.length; _i++) {
|
|
@@ -41593,7 +42359,7 @@ var com_graphicsvue_type_script_lang_js_ref = /*#__PURE__*/regenerator_default.a
|
|
|
41593
42359
|
}
|
|
41594
42360
|
}, _callee);
|
|
41595
42361
|
})(null),
|
|
41596
|
-
com_graphicsvue_type_script_lang_js_ref2 = slicedToArray_default()(com_graphicsvue_type_script_lang_js_ref,
|
|
42362
|
+
com_graphicsvue_type_script_lang_js_ref2 = slicedToArray_default()(com_graphicsvue_type_script_lang_js_ref, 19),
|
|
41597
42363
|
com_graphicsvue_type_script_lang_js_renderer = com_graphicsvue_type_script_lang_js_ref2[0],
|
|
41598
42364
|
com_graphicsvue_type_script_lang_js_scene = com_graphicsvue_type_script_lang_js_ref2[1],
|
|
41599
42365
|
com_graphicsvue_type_script_lang_js_camera = com_graphicsvue_type_script_lang_js_ref2[2],
|
|
@@ -41610,7 +42376,9 @@ var com_graphicsvue_type_script_lang_js_ref = /*#__PURE__*/regenerator_default.a
|
|
|
41610
42376
|
clock = com_graphicsvue_type_script_lang_js_ref2[13],
|
|
41611
42377
|
pointControls = com_graphicsvue_type_script_lang_js_ref2[14],
|
|
41612
42378
|
threeMeasure = com_graphicsvue_type_script_lang_js_ref2[15],
|
|
41613
|
-
com_graphicsvue_type_script_lang_js_modelGroup = com_graphicsvue_type_script_lang_js_ref2[16]
|
|
42379
|
+
com_graphicsvue_type_script_lang_js_modelGroup = com_graphicsvue_type_script_lang_js_ref2[16],
|
|
42380
|
+
gui = com_graphicsvue_type_script_lang_js_ref2[17],
|
|
42381
|
+
animateId = com_graphicsvue_type_script_lang_js_ref2[18];
|
|
41614
42382
|
var _ref3 = /*#__PURE__*/regenerator_default.a.mark(function _callee2(v) {
|
|
41615
42383
|
return regenerator_default.a.wrap(function _callee2$(_context2) {
|
|
41616
42384
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -41627,12 +42395,12 @@ var _ref3 = /*#__PURE__*/regenerator_default.a.mark(function _callee2(v) {
|
|
|
41627
42395
|
}
|
|
41628
42396
|
}, _callee2);
|
|
41629
42397
|
})(0),
|
|
41630
|
-
|
|
41631
|
-
lastTime =
|
|
41632
|
-
firstTime =
|
|
41633
|
-
fpsClock =
|
|
41634
|
-
timeStamp =
|
|
41635
|
-
progress =
|
|
42398
|
+
com_graphicsvue_type_script_lang_js_ref4 = slicedToArray_default()(_ref3, 5),
|
|
42399
|
+
lastTime = com_graphicsvue_type_script_lang_js_ref4[0],
|
|
42400
|
+
firstTime = com_graphicsvue_type_script_lang_js_ref4[1],
|
|
42401
|
+
fpsClock = com_graphicsvue_type_script_lang_js_ref4[2],
|
|
42402
|
+
timeStamp = com_graphicsvue_type_script_lang_js_ref4[3],
|
|
42403
|
+
progress = com_graphicsvue_type_script_lang_js_ref4[4];
|
|
41636
42404
|
var _ref5 = /*#__PURE__*/regenerator_default.a.mark(function _callee3(v) {
|
|
41637
42405
|
return regenerator_default.a.wrap(function _callee3$(_context3) {
|
|
41638
42406
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -41676,13 +42444,22 @@ var _ref7 = /*#__PURE__*/regenerator_default.a.mark(function _callee4(v) {
|
|
|
41676
42444
|
})(true),
|
|
41677
42445
|
_ref8 = slicedToArray_default()(_ref7, 1),
|
|
41678
42446
|
spaceUp = _ref8[0];
|
|
41679
|
-
var
|
|
42447
|
+
var clippingMesh = [];
|
|
41680
42448
|
var removeSpeed = 200,
|
|
41681
42449
|
upSpeed = 200; //控制器移动速度 , //控制跳起时的速度
|
|
41682
|
-
var
|
|
41683
|
-
|
|
42450
|
+
var roamConfig = {
|
|
42451
|
+
loop: false,
|
|
42452
|
+
speed: 0,
|
|
42453
|
+
// 最大值为3
|
|
42454
|
+
name: ''
|
|
42455
|
+
};
|
|
42456
|
+
var guiParams = {
|
|
42457
|
+
'x轴': 0,
|
|
42458
|
+
'y轴': 0,
|
|
42459
|
+
'z轴': 0
|
|
42460
|
+
};
|
|
41684
42461
|
// 绘制对象映射实例表
|
|
41685
|
-
|
|
42462
|
+
|
|
41686
42463
|
|
|
41687
42464
|
|
|
41688
42465
|
|
|
@@ -41704,12 +42481,7 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
41704
42481
|
}
|
|
41705
42482
|
},
|
|
41706
42483
|
data: function data() {
|
|
41707
|
-
return {
|
|
41708
|
-
roamConfig: {
|
|
41709
|
-
loop: false,
|
|
41710
|
-
speed: 0 // 最大值为3
|
|
41711
|
-
}
|
|
41712
|
-
};
|
|
42484
|
+
return {};
|
|
41713
42485
|
},
|
|
41714
42486
|
created: function created() {
|
|
41715
42487
|
CameraControls.install({
|
|
@@ -41720,7 +42492,7 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
41720
42492
|
com_graphicsvue_type_script_lang_js_mouse = new this.THREE.Vector2();
|
|
41721
42493
|
},
|
|
41722
42494
|
mounted: function mounted() {
|
|
41723
|
-
instructions = document.getElementById('
|
|
42495
|
+
instructions = document.getElementById('fl-model');
|
|
41724
42496
|
this.initRender();
|
|
41725
42497
|
this.initScene();
|
|
41726
42498
|
this.initCamera();
|
|
@@ -41792,9 +42564,12 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
41792
42564
|
/*
|
|
41793
42565
|
参数:data 模型数据
|
|
41794
42566
|
color: '' 初始化模型的颜色 在业务方 有这个需求
|
|
42567
|
+
meshNameConfig: {}
|
|
41795
42568
|
*/
|
|
41796
42569
|
drawModel: function drawModel(data) {
|
|
42570
|
+
var _this = this;
|
|
41797
42571
|
var color = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
42572
|
+
var meshNameConfig = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
41798
42573
|
if (Object.keys(data).length === 0) {
|
|
41799
42574
|
return;
|
|
41800
42575
|
}
|
|
@@ -41802,14 +42577,58 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
41802
42577
|
instances = _parseData.instances,
|
|
41803
42578
|
drawObjs = _parseData.drawObjs;
|
|
41804
42579
|
if (instances.length > 0) {
|
|
41805
|
-
com_graphicsvue_type_script_lang_js_modelGroup = handleInstancedMeshModel(instances, drawObjs, '', com_graphicsvue_type_script_lang_js_scene, color);
|
|
42580
|
+
com_graphicsvue_type_script_lang_js_modelGroup = handleInstancedMeshModel(instances, drawObjs, '', com_graphicsvue_type_script_lang_js_scene, color, meshNameConfig);
|
|
42581
|
+
var modelBox3 = new this.THREE.Box3();
|
|
42582
|
+
modelBox3.expandByObject(com_graphicsvue_type_script_lang_js_modelGroup);
|
|
42583
|
+
var modelWorldPs = new this.THREE.Vector3().addVectors(modelBox3.max, modelBox3.min).multiplyScalar(0.5);
|
|
41806
42584
|
com_graphicsvue_type_script_lang_js_scene.add(com_graphicsvue_type_script_lang_js_modelGroup);
|
|
42585
|
+
com_graphicsvue_type_script_lang_js_modelGroup.traverse(function (child) {
|
|
42586
|
+
if (child.isMesh) {
|
|
42587
|
+
var json = _this.getMeshCenterAndVolume(child);
|
|
42588
|
+
var meshBox3 = new _this.THREE.Box3();
|
|
42589
|
+
meshBox3.setFromObject(child);
|
|
42590
|
+
// 获取每个mesh的中心点,爆炸方向为爆炸中心点指向mesh中心点
|
|
42591
|
+
var worldPs = new _this.THREE.Vector3().addVectors(meshBox3.max, meshBox3.min).multiplyScalar(0.5);
|
|
42592
|
+
if (isNaN(worldPs.x)) return;
|
|
42593
|
+
// 计算爆炸方向
|
|
42594
|
+
child.worldDir = new _this.THREE.Vector3().subVectors(worldPs, modelWorldPs).normalize();
|
|
42595
|
+
// 保存初始坐标
|
|
42596
|
+
child.userData.center = json.center;
|
|
42597
|
+
child.userData.worldPs = worldPs;
|
|
42598
|
+
child.userData.oldPs = child.getWorldPosition(new _this.THREE.Vector3());
|
|
42599
|
+
child.userData.box = json.box;
|
|
42600
|
+
child.userData.position = new _this.THREE.Vector3().copy(child.position);
|
|
42601
|
+
child.userData.translate = {
|
|
42602
|
+
x: 0,
|
|
42603
|
+
y: 0,
|
|
42604
|
+
z: 0
|
|
42605
|
+
};
|
|
42606
|
+
child.userData.rotate = {
|
|
42607
|
+
x: 0,
|
|
42608
|
+
y: 0,
|
|
42609
|
+
z: 0
|
|
42610
|
+
};
|
|
42611
|
+
child.userData.modelWorldPs = modelWorldPs;
|
|
42612
|
+
}
|
|
42613
|
+
});
|
|
41807
42614
|
// this.compileShader();
|
|
41808
42615
|
// cameraControls.fitToSphere(scene, true); // TODO 待处理,先用 setModelCenter 进行定位
|
|
41809
42616
|
this.setModelCenter(com_graphicsvue_type_script_lang_js_modelGroup);
|
|
41810
42617
|
// cameraControls.saveState();
|
|
41811
42618
|
}
|
|
41812
42619
|
},
|
|
42620
|
+
// 获取mesh的中心点
|
|
42621
|
+
getMeshCenterAndVolume: function getMeshCenterAndVolume(mesh) {
|
|
42622
|
+
var box = new this.THREE.Box3().setFromObject(mesh);
|
|
42623
|
+
var volume = box.getSize(new this.THREE.Vector3());
|
|
42624
|
+
var geometry = mesh.geometry;
|
|
42625
|
+
geometry.computeBoundingBox();
|
|
42626
|
+
var center = geometry.boundingBox.getCenter(new this.THREE.Vector3());
|
|
42627
|
+
return {
|
|
42628
|
+
'center': center,
|
|
42629
|
+
'box': volume
|
|
42630
|
+
};
|
|
42631
|
+
},
|
|
41813
42632
|
compileShader: function compileShader() {
|
|
41814
42633
|
com_graphicsvue_type_script_lang_js_scene.traverse(function (child) {
|
|
41815
42634
|
if (child.isMesh) {
|
|
@@ -41933,16 +42752,16 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
41933
42752
|
* }
|
|
41934
42753
|
*/
|
|
41935
42754
|
updateProperty: function updateProperty(list) {
|
|
41936
|
-
var
|
|
42755
|
+
var _this2 = this;
|
|
41937
42756
|
var _loop = function _loop() {
|
|
41938
42757
|
var ele = list[index];
|
|
41939
|
-
var targetObj =
|
|
42758
|
+
var targetObj = _this2.getObjectByName(ele.name);
|
|
41940
42759
|
var _loop2 = function _loop2(key) {
|
|
41941
42760
|
switch (key) {
|
|
41942
42761
|
case 'color':
|
|
41943
42762
|
targetObj.forEach(function (children) {
|
|
41944
42763
|
if (children.isMesh) {
|
|
41945
|
-
children.setColorAt(children.userData.instanceIndex, new
|
|
42764
|
+
children.setColorAt(children.userData.instanceIndex, new _this2.THREE.Color(ele.attr[key]));
|
|
41946
42765
|
children.instanceColor.needsUpdate = true;
|
|
41947
42766
|
}
|
|
41948
42767
|
});
|
|
@@ -41950,14 +42769,25 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
41950
42769
|
case 'visible':
|
|
41951
42770
|
targetObj.forEach(function (children) {
|
|
41952
42771
|
var index = children.userData.instanceIndex;
|
|
41953
|
-
|
|
41954
|
-
|
|
42772
|
+
if (ele.attr[key]) {
|
|
42773
|
+
var restoreMatrix = new _this2.THREE.Matrix4().copy(children.userData.copyMatrix);
|
|
42774
|
+
children.setMatrixAt(index, restoreMatrix);
|
|
42775
|
+
} else {
|
|
42776
|
+
var offsetMatrix = new _this2.THREE.Matrix4().copy(children.userData.copyMatrix).makeTranslation(9999999, 9999999, 9999999);
|
|
42777
|
+
children.setMatrixAt(index, offsetMatrix);
|
|
42778
|
+
}
|
|
42779
|
+
children.instanceMatrix.needsUpdate = true;
|
|
41955
42780
|
});
|
|
41956
42781
|
break;
|
|
41957
42782
|
case 'opacity':
|
|
41958
42783
|
obj.material.opacity = ele.attr[key];
|
|
41959
42784
|
obj.material.transparent = true;
|
|
41960
42785
|
break;
|
|
42786
|
+
case 'position':
|
|
42787
|
+
targetObj.forEach(function (children) {
|
|
42788
|
+
children.position.set(ele.attr[key].x, ele.attr[key].y, ele.attr[key].z);
|
|
42789
|
+
});
|
|
42790
|
+
break;
|
|
41961
42791
|
}
|
|
41962
42792
|
};
|
|
41963
42793
|
for (var key in ele.attr) {
|
|
@@ -41969,7 +42799,7 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
41969
42799
|
_loop();
|
|
41970
42800
|
}
|
|
41971
42801
|
},
|
|
41972
|
-
//
|
|
42802
|
+
// 修改整个场景中模型实体的属性
|
|
41973
42803
|
/*
|
|
41974
42804
|
{
|
|
41975
42805
|
attr: '', 需要修改属性名(color、visible(true / false)、opacity(0-1),
|
|
@@ -41977,13 +42807,14 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
41977
42807
|
}
|
|
41978
42808
|
*/
|
|
41979
42809
|
updateWholeProperty: function updateWholeProperty(params) {
|
|
41980
|
-
var
|
|
42810
|
+
var _this3 = this;
|
|
41981
42811
|
if (com_graphicsvue_type_script_lang_js_scene) {
|
|
41982
42812
|
com_graphicsvue_type_script_lang_js_scene.traverse(function (obj) {
|
|
41983
|
-
if (obj instanceof
|
|
42813
|
+
if (obj instanceof _this3.THREE.Mesh) {
|
|
41984
42814
|
switch (params.attr) {
|
|
41985
42815
|
case 'color':
|
|
41986
|
-
obj.
|
|
42816
|
+
obj.setColorAt(obj.userData.instanceIndex, new _this3.THREE.Color(params.value));
|
|
42817
|
+
obj.instanceColor.needsUpdate = true;
|
|
41987
42818
|
break;
|
|
41988
42819
|
case 'visible':
|
|
41989
42820
|
obj.material.visible = params.value;
|
|
@@ -42000,6 +42831,7 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42000
42831
|
},
|
|
42001
42832
|
// 清除上一次的属性修改操作 为了方便业务平台参数跟updateProperty方法的参数一样
|
|
42002
42833
|
resetProperty: function resetProperty(list) {
|
|
42834
|
+
var _this4 = this;
|
|
42003
42835
|
for (var index = 0; index < list.length; index++) {
|
|
42004
42836
|
var ele = list[index];
|
|
42005
42837
|
var _obj = this.getObjectByName(ele.name);
|
|
@@ -42014,20 +42846,64 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42014
42846
|
}
|
|
42015
42847
|
});
|
|
42016
42848
|
break;
|
|
42849
|
+
case 'visible':
|
|
42850
|
+
_obj.forEach(function (children) {
|
|
42851
|
+
var index = children.userData.instanceIndex;
|
|
42852
|
+
var restoreMatrix = new _this4.THREE.Matrix4().copy(children.userData.copyMatrix);
|
|
42853
|
+
children.setMatrixAt(index, restoreMatrix);
|
|
42854
|
+
children.instanceMatrix.needsUpdate = true;
|
|
42855
|
+
});
|
|
42856
|
+
break;
|
|
42017
42857
|
}
|
|
42018
42858
|
}
|
|
42019
42859
|
}
|
|
42020
42860
|
}
|
|
42021
42861
|
},
|
|
42022
42862
|
// 定位到模型
|
|
42023
|
-
locateModel: function locateModel(
|
|
42024
|
-
var obj = com_graphicsvue_type_script_lang_js_scene.getObjectByName(
|
|
42863
|
+
locateModel: function locateModel(name) {
|
|
42864
|
+
var obj = com_graphicsvue_type_script_lang_js_scene.getObjectByName(name);
|
|
42025
42865
|
if (obj) {
|
|
42026
42866
|
// cameraControls.fitToSphere(obj.parent, true); // TODO 待处理,先用 setModelCenter 进行定位
|
|
42027
42867
|
this.setModelCenter(obj.parent);
|
|
42028
42868
|
// cameraControls.fitToBox( obj, true);
|
|
42029
42869
|
}
|
|
42030
42870
|
},
|
|
42871
|
+
// 根据自定义参数修改模型
|
|
42872
|
+
/*
|
|
42873
|
+
自定义参数指的是在调用drawModel时配置的meshNameConfig里面的字段来修改某一类模型实体的属性
|
|
42874
|
+
{
|
|
42875
|
+
customName: '', 自定义字段名称
|
|
42876
|
+
customValue: '' 自定义字段的值
|
|
42877
|
+
attr: {
|
|
42878
|
+
color: '',
|
|
42879
|
+
opacity: 0 -1,
|
|
42880
|
+
visiable: true/false
|
|
42881
|
+
}
|
|
42882
|
+
}
|
|
42883
|
+
*/
|
|
42884
|
+
updatePropertyByCustom: function updatePropertyByCustom(params) {
|
|
42885
|
+
var _this5 = this;
|
|
42886
|
+
com_graphicsvue_type_script_lang_js_scene.traverse(function (child) {
|
|
42887
|
+
if (child.isMesh && child.userData[params.customName] === params.customValue) {
|
|
42888
|
+
for (var key in params.attr) {
|
|
42889
|
+
switch (key) {
|
|
42890
|
+
case 'color':
|
|
42891
|
+
child.setColorAt(obj.userData.instanceIndex, new _this5.THREE.Color(params.attr[key]));
|
|
42892
|
+
child.instanceColor.needsUpdate = true;
|
|
42893
|
+
break;
|
|
42894
|
+
case 'visible':
|
|
42895
|
+
child.material.visible = params.attr[key];
|
|
42896
|
+
break;
|
|
42897
|
+
case 'opacity':
|
|
42898
|
+
child.material.opacity = params.attr[key];
|
|
42899
|
+
child.material.transparent = true;
|
|
42900
|
+
break;
|
|
42901
|
+
}
|
|
42902
|
+
child.material.needsUpdate = true;
|
|
42903
|
+
}
|
|
42904
|
+
}
|
|
42905
|
+
});
|
|
42906
|
+
},
|
|
42031
42907
|
// 相机定位
|
|
42032
42908
|
/*
|
|
42033
42909
|
定位参数:x: 相机的x位置, y: 相机的y位置, z: 相机的z位置
|
|
@@ -42096,6 +42972,40 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42096
42972
|
}
|
|
42097
42973
|
});
|
|
42098
42974
|
},
|
|
42975
|
+
// 删除场景中所有的实体
|
|
42976
|
+
removeAll: function removeAll() {
|
|
42977
|
+
var _this6 = this;
|
|
42978
|
+
if (com_graphicsvue_type_script_lang_js_scene) {
|
|
42979
|
+
com_graphicsvue_type_script_lang_js_scene.traverse(function (item) {
|
|
42980
|
+
item.material && item.material.dispose();
|
|
42981
|
+
item.geometry && item.geometry.dispose();
|
|
42982
|
+
if (item instanceof _this6.THREE.Mesh) {
|
|
42983
|
+
item.clear();
|
|
42984
|
+
}
|
|
42985
|
+
com_graphicsvue_type_script_lang_js_scene.remove(item);
|
|
42986
|
+
});
|
|
42987
|
+
com_graphicsvue_type_script_lang_js_scene.clear();
|
|
42988
|
+
}
|
|
42989
|
+
},
|
|
42990
|
+
// 销毁场景 释放内存
|
|
42991
|
+
destroyScene: function destroyScene() {
|
|
42992
|
+
cancelAnimationFrame(animateId);
|
|
42993
|
+
if (com_graphicsvue_type_script_lang_js_scene) {
|
|
42994
|
+
com_graphicsvue_type_script_lang_js_scene.traverse(function (child) {
|
|
42995
|
+
child.material && child.material.dispose();
|
|
42996
|
+
child.geometry && child.geometry.dispose();
|
|
42997
|
+
child = null;
|
|
42998
|
+
});
|
|
42999
|
+
com_graphicsvue_type_script_lang_js_scene.clear();
|
|
43000
|
+
com_graphicsvue_type_script_lang_js_scene = null;
|
|
43001
|
+
}
|
|
43002
|
+
com_graphicsvue_type_script_lang_js_renderer.forceContextLoss();
|
|
43003
|
+
com_graphicsvue_type_script_lang_js_renderer.dispose();
|
|
43004
|
+
com_graphicsvue_type_script_lang_js_camera = null;
|
|
43005
|
+
cameraControls = null;
|
|
43006
|
+
com_graphicsvue_type_script_lang_js_renderer.domElement = null;
|
|
43007
|
+
com_graphicsvue_type_script_lang_js_renderer = null;
|
|
43008
|
+
},
|
|
42099
43009
|
// 绘制曲线
|
|
42100
43010
|
/*
|
|
42101
43011
|
参数声明:Object
|
|
@@ -42106,11 +43016,11 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42106
43016
|
}
|
|
42107
43017
|
*/
|
|
42108
43018
|
drawCurve: function drawCurve(params) {
|
|
42109
|
-
var
|
|
43019
|
+
var _this7 = this;
|
|
42110
43020
|
this.removeObjectByName(params.name);
|
|
42111
43021
|
var route = [];
|
|
42112
43022
|
params.path.forEach(function (element) {
|
|
42113
|
-
route.push(new
|
|
43023
|
+
route.push(new _this7.THREE.Vector3(element.x, element.y, element.z));
|
|
42114
43024
|
});
|
|
42115
43025
|
if (route.length > 1) {
|
|
42116
43026
|
com_graphicsvue_type_script_lang_js_curve = new this.THREE.CatmullRomCurve3(route);
|
|
@@ -42126,12 +43036,19 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42126
43036
|
}
|
|
42127
43037
|
},
|
|
42128
43038
|
// 绘制贴图曲线
|
|
43039
|
+
/*
|
|
43040
|
+
参数声明:Object
|
|
43041
|
+
{
|
|
43042
|
+
path: [{x:0, y: 0, z: 0}], 坐标点信息
|
|
43043
|
+
name: '', // 线条的名字, 用来清除时使用的
|
|
43044
|
+
}
|
|
43045
|
+
*/
|
|
42129
43046
|
drawTextureCurve: function drawTextureCurve(params) {
|
|
42130
|
-
var
|
|
43047
|
+
var _this8 = this;
|
|
42131
43048
|
this.removeObjectByName(params.name);
|
|
42132
43049
|
var route = [];
|
|
42133
43050
|
params.path.forEach(function (element) {
|
|
42134
|
-
route.push(new
|
|
43051
|
+
route.push(new _this8.THREE.Vector3(element.x, element.y, element.z));
|
|
42135
43052
|
});
|
|
42136
43053
|
// 画曲线
|
|
42137
43054
|
if (route.length > 1) {
|
|
@@ -42154,8 +43071,10 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42154
43071
|
var line = new this.THREE.Line(geometry, material);
|
|
42155
43072
|
line.name = params.name;
|
|
42156
43073
|
com_graphicsvue_type_script_lang_js_scene.add(line);
|
|
43074
|
+
clock = new this.THREE.Clock();
|
|
42157
43075
|
}
|
|
42158
43076
|
},
|
|
43077
|
+
//
|
|
42159
43078
|
// 开启漫游
|
|
42160
43079
|
/*
|
|
42161
43080
|
参数为Object
|
|
@@ -42166,31 +43085,38 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42166
43085
|
*/
|
|
42167
43086
|
startRoam: function startRoam(params) {
|
|
42168
43087
|
progress = 0;
|
|
42169
|
-
|
|
43088
|
+
roamConfig = {
|
|
42170
43089
|
loop: params.loop,
|
|
42171
|
-
speed: params.speed
|
|
42172
|
-
|
|
42173
|
-
});
|
|
43090
|
+
speed: params.speed
|
|
43091
|
+
};
|
|
42174
43092
|
this.drawTextureCurve({
|
|
42175
43093
|
name: params.name,
|
|
42176
43094
|
path: params.path
|
|
42177
43095
|
});
|
|
42178
|
-
|
|
43096
|
+
roaming = true;
|
|
43097
|
+
// clock = new this.THREE.Clock();
|
|
42179
43098
|
},
|
|
42180
|
-
//
|
|
42181
|
-
|
|
42182
|
-
|
|
43099
|
+
// 更新漫游的配置
|
|
43100
|
+
/*
|
|
43101
|
+
参数为Object
|
|
43102
|
+
*/
|
|
43103
|
+
updateRoamConfig: function updateRoamConfig(params) {
|
|
43104
|
+
for (var key in params) {
|
|
43105
|
+
roamConfig[key] = params[key];
|
|
43106
|
+
}
|
|
42183
43107
|
},
|
|
42184
43108
|
// 结束/退出漫游
|
|
42185
43109
|
endRoam: function endRoam() {
|
|
42186
43110
|
roaming = false;
|
|
42187
43111
|
progress = 0;
|
|
42188
|
-
this.removeObjectByName(
|
|
42189
|
-
|
|
43112
|
+
this.removeObjectByName(roamConfig.name);
|
|
43113
|
+
roamConfig = {
|
|
42190
43114
|
loop: false,
|
|
42191
43115
|
speed: 0,
|
|
42192
|
-
|
|
42193
|
-
}
|
|
43116
|
+
name: ''
|
|
43117
|
+
};
|
|
43118
|
+
roaming = false;
|
|
43119
|
+
lineTexture = null;
|
|
42194
43120
|
},
|
|
42195
43121
|
// 相机跟随轨道
|
|
42196
43122
|
cameraTrack: function cameraTrack() {
|
|
@@ -42207,16 +43133,16 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42207
43133
|
com_graphicsvue_type_script_lang_js_camera.lookAt(pointBox.x, pointBox.y + 5, pointBox.z);
|
|
42208
43134
|
cameraControls.setPosition(point.x, point.y + 5, point.z, false);
|
|
42209
43135
|
cameraControls.setTarget(pointBox.x, pointBox.y + 5, pointBox.z, false);
|
|
42210
|
-
progress +=
|
|
43136
|
+
progress += roamConfig.speed / 300;
|
|
42211
43137
|
} else {
|
|
42212
43138
|
// 循环漫游
|
|
42213
|
-
if (
|
|
43139
|
+
if (roamConfig.loop) {
|
|
42214
43140
|
progress = 0;
|
|
42215
43141
|
}
|
|
42216
43142
|
}
|
|
42217
43143
|
} else {
|
|
42218
43144
|
lineTexture = null;
|
|
42219
|
-
|
|
43145
|
+
progress = 0;
|
|
42220
43146
|
}
|
|
42221
43147
|
},
|
|
42222
43148
|
// 全局整体炸开
|
|
@@ -42224,16 +43150,16 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42224
43150
|
* 参数val: 爆炸的值
|
|
42225
43151
|
*/
|
|
42226
43152
|
globalBomb: function globalBomb(val) {
|
|
42227
|
-
var
|
|
43153
|
+
var _this9 = this;
|
|
42228
43154
|
if (com_graphicsvue_type_script_lang_js_scene.children.length === 0) return;
|
|
42229
43155
|
for (var i = 0; i < com_graphicsvue_type_script_lang_js_scene.children.length; i++) {
|
|
42230
43156
|
com_graphicsvue_type_script_lang_js_scene.children[i].traverse(function (item) {
|
|
42231
43157
|
if (!item.isMesh || !item.worldDir) return;
|
|
42232
43158
|
// 爆炸公式
|
|
42233
|
-
|
|
43159
|
+
_this9.computedBomb(item, val);
|
|
42234
43160
|
});
|
|
42235
43161
|
}
|
|
42236
|
-
this.timeRender();
|
|
43162
|
+
// this.timeRender();
|
|
42237
43163
|
},
|
|
42238
43164
|
// 单个实体模型炸开
|
|
42239
43165
|
/*
|
|
@@ -42257,11 +43183,24 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42257
43183
|
剖切值变换时, 使用
|
|
42258
43184
|
*/
|
|
42259
43185
|
setGlobalClipping: function setGlobalClipping() {
|
|
43186
|
+
var flag = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
42260
43187
|
var box3 = new this.THREE.Box3().setFromObject(com_graphicsvue_type_script_lang_js_scene.children[0]);
|
|
42261
43188
|
var max = box3.max;
|
|
42262
43189
|
var min = box3.min;
|
|
42263
43190
|
var clippingPlanes = [new this.THREE.Plane(new this.THREE.Vector3(-1, 0, 0), max.x), new this.THREE.Plane(new this.THREE.Vector3(0, -1, 0), max.y), new this.THREE.Plane(new this.THREE.Vector3(0, 0, -1), max.z)];
|
|
42264
43191
|
com_graphicsvue_type_script_lang_js_renderer.clippingPlanes = clippingPlanes;
|
|
43192
|
+
if (flag) {
|
|
43193
|
+
guiParams = {
|
|
43194
|
+
'x轴': clippingPlanes[0].constant,
|
|
43195
|
+
'y轴': clippingPlanes[2].constant,
|
|
43196
|
+
'z轴': clippingPlanes[1].constant
|
|
43197
|
+
};
|
|
43198
|
+
this.addClippingGui('全局剖切', {
|
|
43199
|
+
x: min.x,
|
|
43200
|
+
y: min.z,
|
|
43201
|
+
z: min.y
|
|
43202
|
+
}, clippingPlanes);
|
|
43203
|
+
}
|
|
42265
43204
|
return {
|
|
42266
43205
|
min: min,
|
|
42267
43206
|
max: max
|
|
@@ -42285,18 +43224,45 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42285
43224
|
},
|
|
42286
43225
|
// 取消全局剖切
|
|
42287
43226
|
cancelGlobalClipping: function cancelGlobalClipping() {
|
|
43227
|
+
guiParams = {
|
|
43228
|
+
'x轴': 0,
|
|
43229
|
+
'y轴': 0,
|
|
43230
|
+
'z轴': 0
|
|
43231
|
+
};
|
|
42288
43232
|
com_graphicsvue_type_script_lang_js_renderer.clippingPlanes = Object.freeze([]);
|
|
43233
|
+
gui && gui.destroy();
|
|
42289
43234
|
},
|
|
42290
|
-
// 单个实体的剖切/ 局部剖切 obj 实体对象
|
|
43235
|
+
// 单个实体的剖切/ 局部剖切 obj 实体对象 flag 代表是否使用图形组件自带的剖切面板 默认为true
|
|
42291
43236
|
setLocalClipping: function setLocalClipping(obj) {
|
|
43237
|
+
var flag = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
43238
|
+
clippingMesh.splice(0);
|
|
43239
|
+
clippingMesh.push(obj);
|
|
42292
43240
|
com_graphicsvue_type_script_lang_js_renderer.localClippingEnabled = true;
|
|
42293
43241
|
// mesh的boundingBox 可以获取到该对象位置的最大最小值 但是在这里我们需要把y、z轴互换
|
|
42294
|
-
var boundingBox = new this.THREE.Box3().copy(obj.
|
|
43242
|
+
var boundingBox = new this.THREE.Box3().copy(obj.boundingBox);
|
|
42295
43243
|
boundingBox.applyMatrix4(obj.matrixWorld);
|
|
42296
|
-
clippingPlanes = [new this.THREE.Plane(new this.THREE.Vector3(-1, 0, 0), Math.ceil(boundingBox.max.x)), new this.THREE.Plane(new this.THREE.Vector3(0, -1, 0), Math.ceil(boundingBox.max.y)), new this.THREE.Plane(new this.THREE.Vector3(0, 0, -1), Math.ceil(boundingBox.max.z))];
|
|
43244
|
+
var clippingPlanes = [new this.THREE.Plane(new this.THREE.Vector3(-1, 0, 0), Math.ceil(boundingBox.max.x)), new this.THREE.Plane(new this.THREE.Vector3(0, -1, 0), Math.ceil(boundingBox.max.y)), new this.THREE.Plane(new this.THREE.Vector3(0, 0, -1), Math.ceil(boundingBox.max.z))];
|
|
42297
43245
|
obj.material.clippingPlanes = clippingPlanes;
|
|
42298
43246
|
obj.material.needsUpdate = true;
|
|
42299
43247
|
// 将局部剖切的对象记录下来
|
|
43248
|
+
if (flag) {
|
|
43249
|
+
guiParams = {
|
|
43250
|
+
'x轴': clippingPlanes[0].constant,
|
|
43251
|
+
'y轴': clippingPlanes[2].constant,
|
|
43252
|
+
'z轴': clippingPlanes[1].constant
|
|
43253
|
+
};
|
|
43254
|
+
this.addClippingGui('局部剖切', {
|
|
43255
|
+
x: Math.floor(boundingBox.min.x),
|
|
43256
|
+
y: Math.floor(boundingBox.min.z),
|
|
43257
|
+
z: Math.floor(boundingBox.min.y)
|
|
43258
|
+
}, obj.material.clippingPlanes);
|
|
43259
|
+
// cube.material.clippingPlanes
|
|
43260
|
+
}
|
|
43261
|
+
;
|
|
43262
|
+
return {
|
|
43263
|
+
min: boundingBox.min,
|
|
43264
|
+
max: boundingBox.max
|
|
43265
|
+
};
|
|
42300
43266
|
},
|
|
42301
43267
|
// 更新局部剖切的值
|
|
42302
43268
|
/*
|
|
@@ -42309,14 +43275,43 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42309
43275
|
y: 1,
|
|
42310
43276
|
z: 2
|
|
42311
43277
|
};
|
|
43278
|
+
var obj = clippingMesh[clippingMesh.length - 1];
|
|
42312
43279
|
for (var key in params) {
|
|
42313
|
-
clippingPlanes[axis[key]].constant = params[key];
|
|
43280
|
+
obj.material.clippingPlanes[axis[key]].constant = params[key];
|
|
43281
|
+
obj.material.needsUpdate = true;
|
|
42314
43282
|
}
|
|
42315
43283
|
// this.timeRender()
|
|
42316
43284
|
},
|
|
42317
43285
|
// 取消局部/单个实体的剖切
|
|
42318
43286
|
cancelLocalClipping: function cancelLocalClipping() {
|
|
42319
|
-
|
|
43287
|
+
guiParams = {
|
|
43288
|
+
'x轴': 0,
|
|
43289
|
+
'y轴': 0,
|
|
43290
|
+
'z轴': 0
|
|
43291
|
+
};
|
|
43292
|
+
gui && gui.destroy();
|
|
43293
|
+
clippingMesh.forEach(function (item) {
|
|
43294
|
+
item.material.clippingPlanes = Object.freeze([]);
|
|
43295
|
+
item.material.needsUpdate = true;
|
|
43296
|
+
});
|
|
43297
|
+
clippingMesh.splice(0);
|
|
43298
|
+
},
|
|
43299
|
+
// 添加剖切轴工具
|
|
43300
|
+
addClippingGui: function addClippingGui(title, minValue, objClipp1, objClipp2) {
|
|
43301
|
+
gui = new lil_gui_module_min_g({
|
|
43302
|
+
title: title
|
|
43303
|
+
});
|
|
43304
|
+
gui.add(guiParams, 'x轴').min(minValue.x).max(Math.abs(guiParams['x轴'])).onChange(function (d) {
|
|
43305
|
+
objClipp1[0].constant = d;
|
|
43306
|
+
objClipp2 && (objClipp2[0].constant = d);
|
|
43307
|
+
});
|
|
43308
|
+
gui.add(guiParams, 'y轴').min(minValue.y).max(Math.abs(guiParams['y轴'])).onChange(function (d) {
|
|
43309
|
+
objClipp1[2].constant = d;
|
|
43310
|
+
objClipp2 && (objClipp2[2].constant = d);
|
|
43311
|
+
});
|
|
43312
|
+
gui.add(guiParams, 'z轴').min(minValue.z).max(Math.abs(guiParams['z轴'])).onChange(function (d) {
|
|
43313
|
+
objClipp1[1].constant = d;
|
|
43314
|
+
});
|
|
42320
43315
|
},
|
|
42321
43316
|
// 开启第一视角
|
|
42322
43317
|
startFirstPer: function startFirstPer() {
|
|
@@ -42329,7 +43324,7 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42329
43324
|
},
|
|
42330
43325
|
// 页面是否锁定
|
|
42331
43326
|
initPointerLock: function initPointerLock() {
|
|
42332
|
-
var
|
|
43327
|
+
var _this0 = this;
|
|
42333
43328
|
this.home();
|
|
42334
43329
|
setTimeout(function () {
|
|
42335
43330
|
pointControls = new PointerLockControls_PointerLockControls(com_graphicsvue_type_script_lang_js_camera, com_graphicsvue_type_script_lang_js_renderer.domElement);
|
|
@@ -42337,10 +43332,10 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42337
43332
|
// 锁定
|
|
42338
43333
|
pointControls.addEventListener('lock', function () {
|
|
42339
43334
|
cameraControls.enabled = false;
|
|
42340
|
-
window.addEventListener('keydown',
|
|
42341
|
-
window.addEventListener('keyup',
|
|
42342
|
-
com_graphicsvue_type_script_lang_js_renderer.domElement.removeEventListener('mouseup',
|
|
42343
|
-
com_graphicsvue_type_script_lang_js_renderer.domElement.removeEventListener('mousedown',
|
|
43335
|
+
window.addEventListener('keydown', _this0.onKeyDown, false);
|
|
43336
|
+
window.addEventListener('keyup', _this0.onKeyUp, false);
|
|
43337
|
+
com_graphicsvue_type_script_lang_js_renderer.domElement.removeEventListener('mouseup', _this0.mouseClick, false);
|
|
43338
|
+
com_graphicsvue_type_script_lang_js_renderer.domElement.removeEventListener('mousedown', _this0.mouseDown, false);
|
|
42344
43339
|
});
|
|
42345
43340
|
// 解锁
|
|
42346
43341
|
pointControls.addEventListener('unlock', function () {
|
|
@@ -42350,10 +43345,10 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42350
43345
|
cameraControls.reset(true);
|
|
42351
43346
|
cameraControls.update(0);
|
|
42352
43347
|
setTimeout(function () {
|
|
42353
|
-
window.removeEventListener('keydown',
|
|
42354
|
-
window.removeEventListener('keyup',
|
|
42355
|
-
com_graphicsvue_type_script_lang_js_renderer.domElement.addEventListener('mouseup',
|
|
42356
|
-
com_graphicsvue_type_script_lang_js_renderer.domElement.addEventListener('mousedown',
|
|
43348
|
+
window.removeEventListener('keydown', _this0.onKeyDown);
|
|
43349
|
+
window.removeEventListener('keyup', _this0.onKeyUp);
|
|
43350
|
+
com_graphicsvue_type_script_lang_js_renderer.domElement.addEventListener('mouseup', _this0.mouseClick, false);
|
|
43351
|
+
com_graphicsvue_type_script_lang_js_renderer.domElement.addEventListener('mousedown', _this0.mouseDown, false);
|
|
42357
43352
|
// this.timeRender()
|
|
42358
43353
|
}, 0);
|
|
42359
43354
|
});
|
|
@@ -42468,9 +43463,9 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42468
43463
|
},
|
|
42469
43464
|
// 返回主视角/恢复相机初始状态
|
|
42470
43465
|
home: function home() {
|
|
42471
|
-
|
|
42472
|
-
|
|
42473
|
-
|
|
43466
|
+
if (roaming) {
|
|
43467
|
+
this.endRoam();
|
|
43468
|
+
}
|
|
42474
43469
|
cameraControls.reset(true);
|
|
42475
43470
|
cameraControls.update(0);
|
|
42476
43471
|
// this.timeRender()
|
|
@@ -42576,7 +43571,7 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42576
43571
|
},
|
|
42577
43572
|
// 还原操作 将修改过的实体进行恢复
|
|
42578
43573
|
restore: function restore() {
|
|
42579
|
-
var
|
|
43574
|
+
var _this1 = this;
|
|
42580
43575
|
com_graphicsvue_type_script_lang_js_scene.traverse(function (item) {
|
|
42581
43576
|
if (item.isMesh) {
|
|
42582
43577
|
item.material.opacity = 1.0;
|
|
@@ -42599,7 +43594,7 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42599
43594
|
item.userData.translateMatrixInvert = null;
|
|
42600
43595
|
}
|
|
42601
43596
|
if (item.userData.combineMatrixInvert) {
|
|
42602
|
-
|
|
43597
|
+
_this1.rotateMesh(item, {
|
|
42603
43598
|
x: 0,
|
|
42604
43599
|
y: 0,
|
|
42605
43600
|
z: 0
|
|
@@ -42612,7 +43607,7 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42612
43607
|
animate: function animate() {
|
|
42613
43608
|
var delta = fpsClock.getDelta();
|
|
42614
43609
|
timeStamp += delta;
|
|
42615
|
-
requestAnimationFrame(this.animate);
|
|
43610
|
+
animateId = requestAnimationFrame(this.animate);
|
|
42616
43611
|
cameraControls.enabled && cameraControls.update(timeStamp);
|
|
42617
43612
|
this.cameraTrack();
|
|
42618
43613
|
this.firstPerspective();
|
|
@@ -42623,8 +43618,8 @@ var com_graphicsvue_type_script_lang_js_drawObjMapInstance = {};
|
|
|
42623
43618
|
});
|
|
42624
43619
|
// CONCATENATED MODULE: ./packages/components/com-graphics/index.vue?vue&type=script&lang=js
|
|
42625
43620
|
/* harmony default export */ var components_com_graphicsvue_type_script_lang_js = (com_graphicsvue_type_script_lang_js);
|
|
42626
|
-
// EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=0&id=
|
|
42627
|
-
var
|
|
43621
|
+
// EXTERNAL MODULE: ./packages/components/com-graphics/index.vue?vue&type=style&index=0&id=6e37e043&prod&lang=scss&scoped=true
|
|
43622
|
+
var com_graphicsvue_type_style_index_0_id_6e37e043_prod_lang_scss_scoped_true = __webpack_require__("52b4");
|
|
42628
43623
|
|
|
42629
43624
|
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
42630
43625
|
/* globals __VUE_SSR_CONTEXT__ */
|
|
@@ -42735,17 +43730,17 @@ function normalizeComponent(
|
|
|
42735
43730
|
|
|
42736
43731
|
var component = normalizeComponent(
|
|
42737
43732
|
components_com_graphicsvue_type_script_lang_js,
|
|
42738
|
-
|
|
43733
|
+
com_graphicsvue_type_template_id_6e37e043_scoped_true_render,
|
|
42739
43734
|
staticRenderFns,
|
|
42740
43735
|
false,
|
|
42741
43736
|
null,
|
|
42742
|
-
"
|
|
43737
|
+
"6e37e043",
|
|
42743
43738
|
null
|
|
42744
43739
|
|
|
42745
43740
|
)
|
|
42746
43741
|
|
|
42747
43742
|
/* harmony default export */ var com_graphics = (component.exports);
|
|
42748
|
-
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"
|
|
43743
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4217f59c-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=83d38700&scoped=true
|
|
42749
43744
|
var com_flcanvasvue_type_template_id_83d38700_scoped_true_render = function render() {
|
|
42750
43745
|
var _vm = this,
|
|
42751
43746
|
_c = _vm._self._c;
|
|
@@ -44990,10 +45985,6 @@ function DxfParser_getAcadColor(index) {
|
|
|
44990
45985
|
// EXTERNAL MODULE: ./node_modules/jspdf/dist/jspdf.es.min.js
|
|
44991
45986
|
var jspdf_es_min = __webpack_require__("8baf");
|
|
44992
45987
|
|
|
44993
|
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/typeof.js
|
|
44994
|
-
var helpers_typeof = __webpack_require__("7037");
|
|
44995
|
-
var typeof_default = /*#__PURE__*/__webpack_require__.n(helpers_typeof);
|
|
44996
|
-
|
|
44997
45988
|
// CONCATENATED MODULE: ./packages/components/com-flcanvas/components/round10.js
|
|
44998
45989
|
// This is based on the example code found from:
|
|
44999
45990
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor
|
|
@@ -45845,11 +46836,120 @@ var com_flcanvas_component = normalizeComponent(
|
|
|
45845
46836
|
)
|
|
45846
46837
|
|
|
45847
46838
|
/* harmony default export */ var com_flcanvas = (com_flcanvas_component.exports);
|
|
46839
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"4217f59c-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
|
|
46840
|
+
var per_controlvue_type_template_id_f547d5c6_scoped_true_render = function render() {
|
|
46841
|
+
var _vm = this,
|
|
46842
|
+
_c = _vm._self._c;
|
|
46843
|
+
return _c('div', [_vm._m(0), _c('div', {
|
|
46844
|
+
staticClass: "line"
|
|
46845
|
+
}), _vm._m(1), _c('div', {
|
|
46846
|
+
staticClass: "line"
|
|
46847
|
+
}), _vm._m(2), _c('div', {
|
|
46848
|
+
staticClass: "button"
|
|
46849
|
+
}, [_c('el-button', {
|
|
46850
|
+
on: {
|
|
46851
|
+
"click": function click($event) {
|
|
46852
|
+
return _vm.start(false);
|
|
46853
|
+
}
|
|
46854
|
+
}
|
|
46855
|
+
}, [_vm._v("好的,知道了")]), _c('el-button', {
|
|
46856
|
+
attrs: {
|
|
46857
|
+
"type": "primary"
|
|
46858
|
+
},
|
|
46859
|
+
on: {
|
|
46860
|
+
"click": function click($event) {
|
|
46861
|
+
return _vm.start(true);
|
|
46862
|
+
}
|
|
46863
|
+
}
|
|
46864
|
+
}, [_vm._v("不再提示")])], 1)]);
|
|
46865
|
+
};
|
|
46866
|
+
var per_controlvue_type_template_id_f547d5c6_scoped_true_staticRenderFns = [function () {
|
|
46867
|
+
var _vm = this,
|
|
46868
|
+
_c = _vm._self._c;
|
|
46869
|
+
return _c('div', {
|
|
46870
|
+
staticClass: "key"
|
|
46871
|
+
}, [_c('span', [_vm._v("漫游")]), _c('div', {
|
|
46872
|
+
staticClass: "center"
|
|
46873
|
+
}, [_c('div', {
|
|
46874
|
+
staticClass: "top"
|
|
46875
|
+
}, [_c('span', [_vm._v("W")])]), _c('div', {
|
|
46876
|
+
staticClass: "cen"
|
|
46877
|
+
}, [_c('span', [_vm._v("A")]), _c('span', [_vm._v("S")]), _c('span', [_vm._v("D")])]), _c('span', {
|
|
46878
|
+
staticClass: "text"
|
|
46879
|
+
}, [_vm._v("W向前移动、S向后移动、A向左移动、D向右移动")])])]);
|
|
46880
|
+
}, function () {
|
|
46881
|
+
var _vm = this,
|
|
46882
|
+
_c = _vm._self._c;
|
|
46883
|
+
return _c('div', {
|
|
46884
|
+
staticClass: "mouse"
|
|
46885
|
+
}, [_c('span', [_vm._v("环视")]), _c('div', {
|
|
46886
|
+
staticClass: "center"
|
|
46887
|
+
}, [_c('i', {
|
|
46888
|
+
staticClass: "iconfont icon-shubiao"
|
|
46889
|
+
}), _c('span', {
|
|
46890
|
+
staticClass: "text"
|
|
46891
|
+
}, [_vm._v("鼠标控制方向")])])]);
|
|
46892
|
+
}, function () {
|
|
46893
|
+
var _vm = this,
|
|
46894
|
+
_c = _vm._self._c;
|
|
46895
|
+
return _c('div', {
|
|
46896
|
+
staticClass: "quit"
|
|
46897
|
+
}, [_c('span', [_vm._v("退出")]), _c('div', {
|
|
46898
|
+
staticClass: "center"
|
|
46899
|
+
}, [_c('div', {
|
|
46900
|
+
staticClass: "cen"
|
|
46901
|
+
}, [_c('span', [_vm._v("Esc")])]), _c('span', {
|
|
46902
|
+
staticClass: "text"
|
|
46903
|
+
}, [_vm._v("使用Esc键退出漫游")])])]);
|
|
46904
|
+
}];
|
|
46905
|
+
|
|
46906
|
+
// CONCATENATED MODULE: ./packages/components/com-graphics/per-control.vue?vue&type=template&id=f547d5c6&scoped=true
|
|
46907
|
+
|
|
46908
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./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=script&lang=js
|
|
46909
|
+
/* harmony default export */ var per_controlvue_type_script_lang_js = ({
|
|
46910
|
+
name: 'FLPerControl',
|
|
46911
|
+
data: function data() {
|
|
46912
|
+
return {};
|
|
46913
|
+
},
|
|
46914
|
+
created: function created() {},
|
|
46915
|
+
methods: {
|
|
46916
|
+
start: function start(val) {
|
|
46917
|
+
this.$emit('start', val);
|
|
46918
|
+
}
|
|
46919
|
+
}
|
|
46920
|
+
});
|
|
46921
|
+
// CONCATENATED MODULE: ./packages/components/com-graphics/per-control.vue?vue&type=script&lang=js
|
|
46922
|
+
/* harmony default export */ var com_graphics_per_controlvue_type_script_lang_js = (per_controlvue_type_script_lang_js);
|
|
46923
|
+
// EXTERNAL MODULE: ./packages/components/com-graphics/per-control.vue?vue&type=style&index=0&id=f547d5c6&prod&lang=scss&scoped=true
|
|
46924
|
+
var per_controlvue_type_style_index_0_id_f547d5c6_prod_lang_scss_scoped_true = __webpack_require__("b2fd");
|
|
46925
|
+
|
|
46926
|
+
// CONCATENATED MODULE: ./packages/components/com-graphics/per-control.vue
|
|
46927
|
+
|
|
46928
|
+
|
|
46929
|
+
|
|
46930
|
+
|
|
46931
|
+
|
|
46932
|
+
|
|
46933
|
+
/* normalize component */
|
|
46934
|
+
|
|
46935
|
+
var per_control_component = normalizeComponent(
|
|
46936
|
+
com_graphics_per_controlvue_type_script_lang_js,
|
|
46937
|
+
per_controlvue_type_template_id_f547d5c6_scoped_true_render,
|
|
46938
|
+
per_controlvue_type_template_id_f547d5c6_scoped_true_staticRenderFns,
|
|
46939
|
+
false,
|
|
46940
|
+
null,
|
|
46941
|
+
"f547d5c6",
|
|
46942
|
+
null
|
|
46943
|
+
|
|
46944
|
+
)
|
|
46945
|
+
|
|
46946
|
+
/* harmony default export */ var per_control = (per_control_component.exports);
|
|
45848
46947
|
// CONCATENATED MODULE: ./src/main.js
|
|
45849
46948
|
|
|
45850
46949
|
|
|
45851
46950
|
|
|
45852
|
-
|
|
46951
|
+
|
|
46952
|
+
var components = [com_graphics, com_flcanvas, per_control];
|
|
45853
46953
|
var main_install = function install(Vue) {
|
|
45854
46954
|
Vue.prototype.THREE = three_module_namespaceObject;
|
|
45855
46955
|
components.forEach(function (component) {
|
|
@@ -45864,7 +46964,8 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
45864
46964
|
/* harmony default export */ var main = ({
|
|
45865
46965
|
install: main_install,
|
|
45866
46966
|
FlModel: com_graphics,
|
|
45867
|
-
Fl2dcanvas: com_flcanvas
|
|
46967
|
+
Fl2dcanvas: com_flcanvas,
|
|
46968
|
+
FLPerControl: per_control
|
|
45868
46969
|
});
|
|
45869
46970
|
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
45870
46971
|
|