API

Type Alias Model

Model: IDisposable & {
    assetContainer: AssetContainer;
    materialVariantsController: Nullable<MaterialVariantsController>;
    selectedAnimation: number;
    selectedMaterialVariant: Nullable<string>;
    getHotSpotToRef(query: any, result: ViewerHotSpotResult): boolean;
    getWorldBounds(animationIndex?: number): Nullable<ViewerBoundingInfo>;
    makeActive(
        options?: Partial<{ source: string | File | ArrayBufferView }>,
    ): void;
    resetWorldBounds(): void;
}

Type Declaration

  • ReadonlyassetContainer: AssetContainer

    The asset container representing the model.

  • ReadonlymaterialVariantsController: Nullable<MaterialVariantsController>

    The material variants controller for the model.

  • selectedAnimation: number

    The current animation.

  • selectedMaterialVariant: Nullable<string>

    The selected material variant.

  • getHotSpotToRef: function
  • getWorldBounds: function
    • Compute and return the world bounds of the model. The minimum and maximum extents, the size and the center.

      Parameters

      • OptionalanimationIndex: number

        The index of the animation group to use for computation. If omitted, the current selected animation is used.

      Returns Nullable<ViewerBoundingInfo>

      The computed bounding info for the model or null if no meshes are present in the asset container.

  • makeActive: function
    • Makes the model the current active model in the viewer.

      Parameters

      • Optionaloptions: Partial<{ source: string | File | ArrayBufferView }>

        Options for activating the model.

      Returns void

  • resetWorldBounds: function