如视 Five SDK
    Preparing search index...

    Function useFiveWorks

    • Function

      Five Vue Hooks: 获取/设置当前的 Work

      Returns [
          works: Readonly<
              Ref<
                  {
                      initial: {
                          distance?: number;
                          fov?: number;
                          latitude?: number;
                          longitude?: number;
                          mode?: Mode;
                          offset?: {};
                          panoIndex?: number;
                          work: {
                              allowHosts: readonly string[];
                              baseURL: string;
                              expire: Date;
                              initial: { readonly work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; }; ... 6 more ...; readonly distance?: number; };
                              issuer: string;
                              jsonp: boolean;
                              model?: {
                                  file?: string;
                                  layers: readonly {
                                      name: string;
                                      tileset: string;
                                      type: "point_cloud"
                                      | "mesh";
                                      upAxis: string;
                                      work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                                  }[];
                                  textureBase?: string;
                                  textures?: readonly string[];
                                  work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                              };
                              name: string;
                              observerBox: {};
                              observers: readonly {
                                  accessibleNodes: readonly number[];
                                  active: boolean;
                                  derivedId?: number;
                                  derivedIdStr?: string;
                                  floorIndex: number;
                                  images: {
                                      back: string;
                                      down: string;
                                      front: string;
                                      left: string;
                                      right: string;
                                      sizeList: readonly number[];
                                      tiles: readonly {
                                          back: ...;
                                          down: ...;
                                          front: ...;
                                          left: ...;
                                          level: ...;
                                          right: ...;
                                          scale: ...;
                                          size: ...;
                                          up: ...;
                                          work: ...;
                                      }[];
                                      up: string;
                                      work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                                  };
                                  index: number;
                                  loadable: boolean;
                                  matrix: {};
                                  panoId: string;
                                  panoIndex: number;
                                  position: {};
                                  quaternion: {};
                                  standingPosition: {};
                                  video?: {
                                      matrix: {};
                                      size: {};
                                      source: string;
                                      work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                                  };
                                  visibleNodes: readonly number[];
                                  work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                              }[];
                              options: { transform: {} };
                              projectId?: string;
                              raw: { works: readonly string[] };
                              shortPath: boolean;
                              transform: {};
                              workCode: string;
                              getURL(source: string): string;
                              toJSON(): any;
                              verifyURL(source: string): boolean;
                          };
                      };
                      getObserver(pano: number | Pano | `${string}[${number}]`): WorkObserver;
                      getResolvedObserver(
                          pano: number | Pano | `${string}[${number}]`,
                      ): WorkResolvedObserver;
                      getWork(workCode: string): Work;
                      readonly [key: number]: {
                          allowHosts: readonly string[];
                          baseURL: string;
                          expire: Date;
                          initial: {
                              distance?: number;
                              fov?: number;
                              latitude?: number;
                              longitude?: number;
                              mode?: Mode;
                              offset?: {};
                              panoIndex?: number;
                              work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                          };
                          issuer: string;
                          jsonp: boolean;
                          model?: {
                              file?: string;
                              layers: readonly {
                                  name: string;
                                  tileset: string;
                                  type: "point_cloud"
                                  | "mesh";
                                  upAxis: string;
                                  work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                              }[];
                              textureBase?: string;
                              textures?: readonly string[];
                              work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                          };
                          name: string;
                          observerBox: {};
                          observers: readonly {
                              accessibleNodes: readonly number[];
                              active: boolean;
                              derivedId?: number;
                              derivedIdStr?: string;
                              floorIndex: number;
                              images: {
                                  back: string;
                                  down: string;
                                  front: string;
                                  left: string;
                                  right: string;
                                  sizeList: readonly number[];
                                  tiles: readonly {
                                      back: string;
                                      down: string;
                                      front: string;
                                      left: string;
                                      level: number;
                                      right: string;
                                      scale: number;
                                      size: number;
                                      up: string;
                                      work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                                  }[];
                                  up: string;
                                  work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                              };
                              index: number;
                              loadable: boolean;
                              matrix: {};
                              panoId: string;
                              panoIndex: number;
                              position: {};
                              quaternion: {};
                              standingPosition: {};
                              video?: {
                                  matrix: {};
                                  size: {};
                                  source: string;
                                  work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                              };
                              visibleNodes: readonly number[];
                              work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                          }[];
                          options: { transform: {} };
                          projectId?: string;
                          raw: { works: readonly string[] };
                          shortPath: boolean;
                          transform: {};
                          workCode: string;
                          getURL(source: string): string;
                          toJSON(): any;
                          verifyURL(source: string): boolean;
                      };
                  },
                  {
                      initial: {
                          distance?: number;
                          fov?: number;
                          latitude?: number;
                          longitude?: number;
                          mode?: Mode;
                          offset?: {};
                          panoIndex?: number;
                          work: {
                              allowHosts: readonly string[];
                              baseURL: string;
                              expire: Date;
                              initial: { readonly work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; }; ... 6 more ...; readonly distance?: number; };
                              issuer: string;
                              jsonp: boolean;
                              model?: {
                                  file?: string;
                                  layers: readonly {
                                      name: string;
                                      tileset: string;
                                      type: "point_cloud"
                                      | "mesh";
                                      upAxis: string;
                                      work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                                  }[];
                                  textureBase?: string;
                                  textures?: readonly string[];
                                  work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                              };
                              name: string;
                              observerBox: {};
                              observers: readonly {
                                  accessibleNodes: readonly number[];
                                  active: boolean;
                                  derivedId?: number;
                                  derivedIdStr?: string;
                                  floorIndex: number;
                                  images: {
                                      back: string;
                                      down: string;
                                      front: string;
                                      left: string;
                                      right: string;
                                      sizeList: readonly number[];
                                      tiles: readonly {
                                          back: ...;
                                          down: ...;
                                          front: ...;
                                          left: ...;
                                          level: ...;
                                          right: ...;
                                          scale: ...;
                                          size: ...;
                                          up: ...;
                                          work: ...;
                                      }[];
                                      up: string;
                                      work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                                  };
                                  index: number;
                                  loadable: boolean;
                                  matrix: {};
                                  panoId: string;
                                  panoIndex: number;
                                  position: {};
                                  quaternion: {};
                                  standingPosition: {};
                                  video?: {
                                      matrix: {};
                                      size: {};
                                      source: string;
                                      work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                                  };
                                  visibleNodes: readonly number[];
                                  work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                              }[];
                              options: { transform: {} };
                              projectId?: string;
                              raw: { works: readonly string[] };
                              shortPath: boolean;
                              transform: {};
                              workCode: string;
                              getURL(source: string): string;
                              toJSON(): any;
                              verifyURL(source: string): boolean;
                          };
                      };
                      getObserver(pano: number | Pano | `${string}[${number}]`): WorkObserver;
                      getResolvedObserver(
                          pano: number | Pano | `${string}[${number}]`,
                      ): WorkResolvedObserver;
                      getWork(workCode: string): Work;
                      readonly [key: number]: {
                          allowHosts: readonly string[];
                          baseURL: string;
                          expire: Date;
                          initial: {
                              distance?: number;
                              fov?: number;
                              latitude?: number;
                              longitude?: number;
                              mode?: Mode;
                              offset?: {};
                              panoIndex?: number;
                              work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                          };
                          issuer: string;
                          jsonp: boolean;
                          model?: {
                              file?: string;
                              layers: readonly {
                                  name: string;
                                  tileset: string;
                                  type: "point_cloud"
                                  | "mesh";
                                  upAxis: string;
                                  work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                              }[];
                              textureBase?: string;
                              textures?: readonly string[];
                              work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                          };
                          name: string;
                          observerBox: {};
                          observers: readonly {
                              accessibleNodes: readonly number[];
                              active: boolean;
                              derivedId?: number;
                              derivedIdStr?: string;
                              floorIndex: number;
                              images: {
                                  back: string;
                                  down: string;
                                  front: string;
                                  left: string;
                                  right: string;
                                  sizeList: readonly number[];
                                  tiles: readonly {
                                      back: string;
                                      down: string;
                                      front: string;
                                      left: string;
                                      level: number;
                                      right: string;
                                      scale: number;
                                      size: number;
                                      up: string;
                                      work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                                  }[];
                                  up: string;
                                  work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                              };
                              index: number;
                              loadable: boolean;
                              matrix: {};
                              panoId: string;
                              panoIndex: number;
                              position: {};
                              quaternion: {};
                              standingPosition: {};
                              video?: {
                                  matrix: {};
                                  size: {};
                                  source: string;
                                  work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                              };
                              visibleNodes: readonly number[];
                              work: { readonly issuer: string; readonly workCode: string; readonly projectId?: string; readonly allowHosts: readonly string[]; readonly expire: Date; readonly name: string; readonly baseURL: string; ... 11 more ...; readonly toJSON: () => any; };
                          }[];
                          options: { transform: {} };
                          projectId?: string;
                          raw: { works: readonly string[] };
                          shortPath: boolean;
                          transform: {};
                          workCode: string;
                          getURL(source: string): string;
                          toJSON(): any;
                          verifyURL(source: string): boolean;
                      };
                  },
              >,
          >,
          loadWorks: (
              work: Work | Work[],
              state?: "initial" | "inherit" | Partial<Omit<State, "offset">>,
              duration?: number,
              userAction?: boolean,
          ) => Promise<void>,
      ]

      [ work: 获取当前的 Work, loadWork: 设置 Work ]

      loadWork

      加载 Work 数据
      // param work Work 数据
      // param state 初始化姿态
      // - "inherit" 使用当前姿态
      // - "initial" 使用 Work 数据中的 initial 姿态
      // - State 自定义姿态
      // param duration 切换时间
      (work: Work, state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, duration?: number) => void
      const [ works, loadWorks ] = useFiveWorks;