人生啊人生 3 weeks ago
parent
commit
6d27dae314

+ 69 - 0
user_web/src/components/student/event/TypeViewEvent.ts

@@ -3508,5 +3508,74 @@ export class TypeViewEvent {
     }
 
 
+    
+
+
+    /**
+     * 将指定的物体列表,控制可见度,以及 是否可选中
+     * meshList         物体列表
+     * visibility       可见度
+     * isPickable       是否可选中
+     */
+    public meshVisibilityUpdate = (meshList : any, visibility : any, isPickable : any) => {
+
+        for (let i = 0; i < meshList.length; i++) {
+
+            let thisMeshId = meshList[i];
+            let objNode = this.ChengGuangYuanJing.CommonVal.find().objScene.getNodeById(thisMeshId);
+            let objMesh = this.ChengGuangYuanJing.CommonVal.find().objScene.getMeshById(thisMeshId);
+            
+            if (objNode != null && objNode != undefined) {
+
+                if (objNode._children != null && objNode._children != undefined) {
+
+                    for (let j = 0; j < objNode._children.length; j++) {
+
+                        let thisChildren = objNode._children[j];
+
+                        if (thisChildren.getClassName() == "Mesh") {
+                            
+                            // 可见度没效果,改成缩放的方式
+                            thisChildren.scaling.x = visibility;
+                            thisChildren.scaling.y = visibility;
+                            thisChildren.scaling.z = visibility;
+                                
+                            if (isPickable == false) {
+                                thisChildren.isPickable = isPickable;
+                            }
+                            
+                        }
+                        
+                    }
+
+                }
+                
+            }
+
+            if (objMesh != null && objMesh != undefined) {
+                
+                if (objMesh.getClassName() == "Mesh") {
+
+                    // 可见度没效果,改成缩放的方式
+                    objMesh.scaling.x = visibility;
+                    objMesh.scaling.y = visibility;
+                    objMesh.scaling.z = visibility;
+                    
+                    if (isPickable == false) {
+                        objMesh.isPickable = isPickable;
+                    }
+                    
+                }
+                
+            }
+
+        }
+        
+        return this;
+        
+    }
+
+
+
 
 }

+ 1 - 1
user_web/src/stores/threeWorld.ts

@@ -516,7 +516,7 @@ export const threeWorld = defineStore('threeWorld', () => {
                     "exhibition_html_1757570581989_盒01_primitive1",
                     "exhibition_html_1757570581989_盖01_primitive0",
                     "exhibition_html_1757570581989_盖01_primitive1",
-                    
+
                     "exhibition_html_1757570554448_盒01_primitive0",
                     "exhibition_html_1757570554448_盒01_primitive1",
                     "exhibition_html_1757570554448_盖01_primitive0",