fl-web-component 2.1.1-beta.5 → 2.1.1-beta.7
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.js +234 -220
- package/dist/fl-web-component.common.js.map +1 -1
- package/dist/fl-web-component.css +1 -1
- package/package.json +1 -1
- package/packages/components/com-flcanvas/components/entityFormatting.js +8 -8
- package/packages/components/com-flcanvas/index.vue +245 -233
- package/packages/components/com-graphics/index.vue +34 -34
- package/src/utils/instance-parser.js +16 -16
|
@@ -213,27 +213,27 @@ export default {
|
|
|
213
213
|
loadedCount: 0,
|
|
214
214
|
totalCount: 0,
|
|
215
215
|
isPaused: false,
|
|
216
|
-
},
|
|
217
|
-
isolateMode: false,
|
|
218
|
-
sceneBoundingBoxDebugEnabled: false,
|
|
219
|
-
// collisionObbDebugEnabled: isDebug,
|
|
220
|
-
collisionObbDebugEnabled: false,
|
|
221
|
-
};
|
|
216
|
+
},
|
|
217
|
+
isolateMode: false,
|
|
218
|
+
sceneBoundingBoxDebugEnabled: false,
|
|
219
|
+
// collisionObbDebugEnabled: isDebug,
|
|
220
|
+
collisionObbDebugEnabled: false,
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
watch: {
|
|
224
|
+
transformEditDisabled(val) {
|
|
225
|
+
if (val) {
|
|
226
|
+
this.detachTransformControls();
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
sceneBoundingBoxDebugEnabled(val) {
|
|
230
|
+
if (val) {
|
|
231
|
+
this.refreshSceneBoundingBoxHelper(true);
|
|
232
|
+
} else {
|
|
233
|
+
this.hideSceneBoundingBox();
|
|
234
|
+
}
|
|
235
|
+
},
|
|
222
236
|
},
|
|
223
|
-
watch: {
|
|
224
|
-
transformEditDisabled(val) {
|
|
225
|
-
if (val) {
|
|
226
|
-
this.detachTransformControls();
|
|
227
|
-
}
|
|
228
|
-
},
|
|
229
|
-
sceneBoundingBoxDebugEnabled(val) {
|
|
230
|
-
if (val) {
|
|
231
|
-
this.refreshSceneBoundingBoxHelper(true);
|
|
232
|
-
} else {
|
|
233
|
-
this.hideSceneBoundingBox();
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
237
|
beforeCreate() {
|
|
238
238
|
this.spaceUp = true;
|
|
239
239
|
let arr = [
|
|
@@ -1513,12 +1513,12 @@ export default {
|
|
|
1513
1513
|
|
|
1514
1514
|
if (hasValidBox) {
|
|
1515
1515
|
this.sceneBoundingBox = mergedBox;
|
|
1516
|
-
this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
|
|
1516
|
+
this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
|
|
1517
1517
|
return this.sceneBoundingBox;
|
|
1518
1518
|
}
|
|
1519
1519
|
|
|
1520
1520
|
this.sceneBoundingBox = new this.THREE.Box3();
|
|
1521
|
-
this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
|
|
1521
|
+
this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
|
|
1522
1522
|
return this.sceneBoundingBox;
|
|
1523
1523
|
},
|
|
1524
1524
|
upsertIndexedBox(indexMap, modelId, box) {
|
|
@@ -4353,7 +4353,7 @@ export default {
|
|
|
4353
4353
|
},
|
|
4354
4354
|
maxBorder,
|
|
4355
4355
|
});
|
|
4356
|
-
this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
|
|
4356
|
+
this.refreshSceneBoundingBoxHelper(this.sceneBoundingBoxDebugEnabled);
|
|
4357
4357
|
}
|
|
4358
4358
|
// this.cameraControls.this.camera.far = maxBorder * 10; // 设置相机的远裁剪面
|
|
4359
4359
|
this.cameraControls.minDistance = maxBorder * 0.2; // 动态设置视角滚轮的距离
|
|
@@ -7623,9 +7623,9 @@ export default {
|
|
|
7623
7623
|
return true;
|
|
7624
7624
|
},
|
|
7625
7625
|
|
|
7626
|
-
showSceneBoundingBox() {
|
|
7627
|
-
this.sceneBoundingBoxDebugEnabled = true;
|
|
7628
|
-
const shown = this.refreshSceneBoundingBoxHelper(true);
|
|
7626
|
+
showSceneBoundingBox() {
|
|
7627
|
+
this.sceneBoundingBoxDebugEnabled = true;
|
|
7628
|
+
const shown = this.refreshSceneBoundingBoxHelper(true);
|
|
7629
7629
|
if (!shown) {
|
|
7630
7630
|
console.warn('sceneBoundingBox 无有效范围,无法绘制调试线框');
|
|
7631
7631
|
return;
|
|
@@ -7647,9 +7647,9 @@ export default {
|
|
|
7647
7647
|
});
|
|
7648
7648
|
},
|
|
7649
7649
|
|
|
7650
|
-
hideSceneBoundingBox() {
|
|
7651
|
-
this.sceneBoundingBoxDebugEnabled = false;
|
|
7652
|
-
if (this.sceneBoundingBoxHelper && this.scene) {
|
|
7650
|
+
hideSceneBoundingBox() {
|
|
7651
|
+
this.sceneBoundingBoxDebugEnabled = false;
|
|
7652
|
+
if (this.sceneBoundingBoxHelper && this.scene) {
|
|
7653
7653
|
this.scene.remove(this.sceneBoundingBoxHelper);
|
|
7654
7654
|
this.sceneBoundingBoxHelper.geometry && this.sceneBoundingBoxHelper.geometry.dispose();
|
|
7655
7655
|
if (Array.isArray(this.sceneBoundingBoxHelper.material)) {
|
|
@@ -7671,11 +7671,11 @@ export default {
|
|
|
7671
7671
|
/**
|
|
7672
7672
|
* 切换场景包围盒显示状态
|
|
7673
7673
|
*/
|
|
7674
|
-
toggleSceneBoundingBox() {
|
|
7675
|
-
if (this.sceneBoundingBoxDebugEnabled) {
|
|
7676
|
-
this.hideSceneBoundingBox();
|
|
7677
|
-
} else {
|
|
7678
|
-
this.showSceneBoundingBox();
|
|
7674
|
+
toggleSceneBoundingBox() {
|
|
7675
|
+
if (this.sceneBoundingBoxDebugEnabled) {
|
|
7676
|
+
this.hideSceneBoundingBox();
|
|
7677
|
+
} else {
|
|
7678
|
+
this.showSceneBoundingBox();
|
|
7679
7679
|
}
|
|
7680
7680
|
},
|
|
7681
7681
|
},
|
|
@@ -1068,10 +1068,10 @@ function draw3Dmodel(
|
|
|
1068
1068
|
* @param {String} instanceName - 模型实例的名称
|
|
1069
1069
|
* @returns {Object} - 包含所有 2D 模型的组对象
|
|
1070
1070
|
*/
|
|
1071
|
-
function draw2Dmodel(geom, instanceName, instanceCount, nColor, nOpacity, options = {}) {
|
|
1072
|
-
const points = geom.points;
|
|
1073
|
-
const normals = geom.normals;
|
|
1074
|
-
const geometry = new THREE.BufferGeometry();
|
|
1071
|
+
function draw2Dmodel(geom, instanceName, instanceCount, nColor, nOpacity, options = {}) {
|
|
1072
|
+
const points = geom.points;
|
|
1073
|
+
const normals = geom.normals;
|
|
1074
|
+
const geometry = new THREE.BufferGeometry();
|
|
1075
1075
|
|
|
1076
1076
|
if (points && points.length) {
|
|
1077
1077
|
const position = new Float32Array(points);
|
|
@@ -1082,18 +1082,18 @@ function draw2Dmodel(geom, instanceName, instanceCount, nColor, nOpacity, option
|
|
|
1082
1082
|
const normal = new Float32Array(normals);
|
|
1083
1083
|
geometry.setAttribute('normal', new THREE.BufferAttribute(normal, 3));
|
|
1084
1084
|
}
|
|
1085
|
-
|
|
1086
|
-
const { color, linewidth } = geom.prop;
|
|
1087
|
-
const formatLinewidth = (linewidth < 1 ? linewidth * 50 : linewidth) || 5;
|
|
1088
|
-
const meshLineResolution = options.meshLineResolution || {};
|
|
1089
|
-
const resolutionWidth = meshLineResolution.width || window.innerWidth || 1;
|
|
1090
|
-
const resolutionHeight = meshLineResolution.height || window.innerHeight || 1;
|
|
1091
|
-
const material = new MeshLineMaterial({
|
|
1092
|
-
color: new THREE.Color(`rgb(${color[0]}, ${color[1]}, ${color[2]})`),
|
|
1093
|
-
lineWidth: formatLinewidth,
|
|
1094
|
-
resolution: new THREE.Vector2(resolutionWidth, resolutionHeight),
|
|
1095
|
-
sizeAttenuation: 0,
|
|
1096
|
-
});
|
|
1085
|
+
|
|
1086
|
+
const { color, linewidth } = geom.prop;
|
|
1087
|
+
const formatLinewidth = (linewidth < 1 ? linewidth * 50 : linewidth) || 5;
|
|
1088
|
+
const meshLineResolution = options.meshLineResolution || {};
|
|
1089
|
+
const resolutionWidth = meshLineResolution.width || window.innerWidth || 1;
|
|
1090
|
+
const resolutionHeight = meshLineResolution.height || window.innerHeight || 1;
|
|
1091
|
+
const material = new MeshLineMaterial({
|
|
1092
|
+
color: new THREE.Color(`rgb(${color[0]}, ${color[1]}, ${color[2]})`),
|
|
1093
|
+
lineWidth: formatLinewidth,
|
|
1094
|
+
resolution: new THREE.Vector2(resolutionWidth, resolutionHeight),
|
|
1095
|
+
sizeAttenuation: 0,
|
|
1096
|
+
});
|
|
1097
1097
|
|
|
1098
1098
|
const lineGeometry = new MeshLineGeometry();
|
|
1099
1099
|
lineGeometry.setPoints(geometry);
|