bill 8 mesiacov pred
rodič
commit
55a8fb5f9a
2 zmenil súbory, kde vykonal 3 pridanie a 16 odobranie
  1. 2 12
      src/components/path/sign.vue
  2. 1 4
      src/sdk/sdk.ts

+ 2 - 12
src/components/path/sign.vue

@@ -49,18 +49,9 @@ path.changeCanEdit(false);
 
 watchEffect(() => path.visibilityName(props.path.showName));
 
-const toCameraDistance = ref(path.toCameraDistance);
-path.bus.on("toCameraDistanceChange", (v) => (toCameraDistance.value = v));
-const show = computed(
-  () =>
-    !props.path.points.length ||
-    props.path.globalVisibility ||
-    toCameraDistance.value <= Math.pow(props.path.visibilityRange, 2)
-);
 watchEffect(() => {
-  console.log(props.path);
-  console.error("globalVisibility", show.value);
-  // path.visibility(show.value);
+  const range = props.path.globalVisibility ? -1 : props.path.visibilityRange;
+  path.changeVisibilityRange(range);
 });
 
 let currentPoints = props.path.points;
@@ -72,7 +63,6 @@ path.bus.on("changePoints", (points) => {
     position: { ...p.position },
     modelId: p.modelId,
   }));
-  console.log("updatePoints", currentPoints);
   emit("updatePoints", currentPoints);
 });
 watchEffect(() => {

+ 1 - 4
src/sdk/sdk.ts

@@ -243,9 +243,8 @@ export type Path = {
     }
     // 路径点位置变更
     changePoints: PathProps['points']
-    // 距离相机位置变更
-    toCameraDistanceChange: number
   }>;
+  changeVisibilityRange: (range: number) => void
   changePointName: (index: number, name: string) => void
   // 飞向路径
   fly: () => void,
@@ -265,8 +264,6 @@ export type Path = {
   changeLine: (props: Partial<PathProps['line']>) => void
   // 更改标题气泡属性
   changeName: (name: string) => void
-  // 距离相机位置
-  toCameraDistance: number
   // 线段销毁
   destroy: () => void
 }