123456789101112131415161718192021222324252627 |
- import { setting } from "@/store";
- import { nextTick, watchEffect } from "vue";
- import { SDK } from "../sdk";
- import { analysisPoseInfo } from ".";
- export const associationSetting = (sdk: SDK, mountEl: HTMLDivElement) => {
- watchEffect(() => {
- setting.value?.fov && sdk.setCameraFov(setting.value.fov);
- });
- const stopWatchPose = watchEffect(() => {
- if (!setting.value?.pose) return;
- if (sdk.setPose) {
- sdk.setPose(analysisPoseInfo(setting.value.pose))
- } else {
- sdk.comeTo(setting.value.pose);
- }
- nextTick(() => stopWatchPose());
- });
- watchEffect(() => {
- if (setting.value) {
- const direEl = document.querySelector("#direction") as HTMLDivElement;
- direEl.style.display = setting.value.openCompass ? "block" : "none";
- }
- });
- };
|