Documentation
    Preparing search index...

    Class AssetCameraRenderPlugin

    A plugin that manages interactions and operations related to the asset camera.

    Hierarchy

    • RendererPlugin & DisposableManaged & EventBus<Events, this>
      • AssetCameraRenderPlugin

    Implements

    • AssetRendererPlugin
    Index

    Constructors

    Methods

    • Adds the given Disposable to be owned by this plugin.

      Parameters

      • disposable: Disposable

      Returns void

    • Adds an event listener for a specific event.

      Type Parameters

      • K extends "cameraMoved"

        The type of the event key.

      Parameters

      • event: K

        The event to listen to.

      • listener: (eventData: Events[K]) => void

        The callback function to be invoked when the event is emitted.

      Returns EventHandle

      An EventHandle with a remove method to unsubscribe the listener.

    • Animates the camera to the home position. Home position is either computed based on the asset's bounds or set explicitly by setDefaultAssetHome.

      Parameters

      • duration: number

      Returns Promise<void>

    • Animates the camera to the specified look-at position.

      Parameters

      • lookAt: LookAt
      • onlyOrientation: boolean
      • duration: number = 1000

      Returns Promise<void>

    • Animates the camera to look at the center of the asset with a certain pitch, yaw and roll

      Parameters

      • lookAt: Partial<Exclude<LookAt, "ref" | "distance">> = {}
      • duration: number = 1000

      Returns Promise<void>

    • Called by the plugin system is initialized.

      Parameters

      • context: unknown

        The context provided to the plugin.

      Returns void

    • Called when the plugin is registered in the system. The result of this hook determines whether the plugin is enabled.

      Parameters

      • context: unknown

        The context provided to the plugin.

      Returns boolean

      Whether the plugin should be enabled.

    • Called when the plugin system is manually torn down. This should be used to clean up resources.

      Parameters

      • context: unknown

        The context provided to the plugin.

      Returns void

    • Sets the default camera state (home position & orientation).

      If no default state is explicitly set, it will be computed based on the asset's bounds. The camera state that is passed should be in the reference of the asset.

      Parameters

      • OptionalcameraState: CameraState | null

        The new default camera state to set. If null is provided, the computed camera state will be used as the home position.

      Returns void