fl-web-component 1.2.4 → 1.2.5
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/README.md +2 -0
- package/dist/fl-web-component.common.1.js +137 -191
- package/dist/fl-web-component.common.2.js +21 -26
- package/dist/fl-web-component.common.js +134 -118
- package/dist/fl-web-component.css +1 -1
- package/package.json +1 -1
- package/packages/components/com-graphics/index.vue +26 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";#fl-model[data-v-
|
|
1
|
+
@charset "UTF-8";#fl-model[data-v-0134be08],#konva-container[data-v-1eba8e28]{width:100%;height:100%;cursor:pointer}#konva-container[data-v-1eba8e28]{z-index:3;overflow:hidden}span[data-v-f547d5c6]{font-weight:bolder}.text[data-v-f547d5c6]{margin-top:20px}.line[data-v-f547d5c6]{border-bottom:1px solid #dcdfe6;margin:20px 0}.center[data-v-f547d5c6]{display:flex;flex-direction:column;align-items:center}.center .cen span[data-v-f547d5c6],.center .top span[data-v-f547d5c6]{color:"#53a8ff";display:inline-block;width:30px;height:30px;text-align:center;line-height:30px;border:1px solid;padding:5px;margin-bottom:10px;background-color:#e9f3ff}.center .cen span[data-v-f547d5c6]{margin:10px}.button[data-v-f547d5c6]{display:flex;justify-content:end;margin-top:20px}@font-face{font-family:iconfont;src:url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff2?t=1646635700216) format("woff2"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.woff?t=1646635700216) format("woff"),url(//at.alicdn.com/t/font_3226805_qqvo3ag3r8.ttf?t=1646635700216) format("truetype")}.iconfont[data-v-f547d5c6]{font-family:iconfont!important;font-size:50px;font-style:normal;color:"#53a8ff";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-shubiao[data-v-f547d5c6]:before{content:""}#svg-tigger[data-v-0ec35ee4]{cursor:pointer;height:100%;width:100%}
|
package/package.json
CHANGED
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
renderer.autoClearStencil = false;
|
|
169
169
|
},
|
|
170
170
|
initScene() {
|
|
171
|
-
modelGroup = new this.THREE.Group();
|
|
171
|
+
// modelGroup = new this.THREE.Group();
|
|
172
172
|
scene = new this.THREE.Scene();
|
|
173
173
|
},
|
|
174
174
|
initCamera() {
|
|
@@ -216,6 +216,7 @@
|
|
|
216
216
|
}
|
|
217
217
|
const { instances, drawObjs } = parseData(data);
|
|
218
218
|
if (instances.length > 0) {
|
|
219
|
+
modelGroup = new this.THREE.Group();
|
|
219
220
|
modelGroup = handleInstancedMeshModel(
|
|
220
221
|
instances,
|
|
221
222
|
drawObjs,
|
|
@@ -669,26 +670,39 @@
|
|
|
669
670
|
// 删除场景中所有的实体
|
|
670
671
|
removeAll() {
|
|
671
672
|
if (scene) {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
673
|
+
this.removeTraverse()
|
|
674
|
+
}
|
|
675
|
+
},
|
|
676
|
+
removeTraverse() {
|
|
677
|
+
let length = modelGroup.children.length
|
|
678
|
+
if (length > 0) {
|
|
679
|
+
let list = modelGroup.children[0]
|
|
680
|
+
list.traverse(item => {
|
|
681
|
+
if (item.isMesh) {
|
|
682
|
+
item.material.dispose();
|
|
683
|
+
item.geometry.dispose();
|
|
676
684
|
item.clear();
|
|
685
|
+
modelGroup.remove(item);
|
|
677
686
|
}
|
|
678
|
-
scene.remove(item);
|
|
679
687
|
});
|
|
680
|
-
|
|
688
|
+
modelGroup.remove(list);
|
|
689
|
+
this.removeTraverse();
|
|
690
|
+
} else {
|
|
691
|
+
// 在这里清除一些标记之类的
|
|
692
|
+
scene.traverse(item => {
|
|
693
|
+
scene.remove(item)
|
|
694
|
+
})
|
|
695
|
+
scene.remove(modelGroup);
|
|
696
|
+
renderer.clear();
|
|
697
|
+
modelGroup = null
|
|
681
698
|
}
|
|
699
|
+
|
|
682
700
|
},
|
|
683
701
|
// 销毁场景 释放内存
|
|
684
702
|
destroyScene() {
|
|
685
703
|
cancelAnimationFrame(animateId);
|
|
686
704
|
if (scene) {
|
|
687
|
-
|
|
688
|
-
child.material && child.material.dispose();
|
|
689
|
-
child.geometry && child.geometry.dispose();
|
|
690
|
-
child = null;
|
|
691
|
-
});
|
|
705
|
+
this.removeTraverse();
|
|
692
706
|
scene.clear();
|
|
693
707
|
scene = null;
|
|
694
708
|
}
|