Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CameraFlightAnimation

Jumps or flies the Scene's Camera to a given target.

Hierarchy

Index

Constructors

Properties

id: string

ID of this Component, unique within the Scene.

Components are mapped by this ID in {@link Scene.components}.

property

id

meta: any

Arbitrary, user-defined metadata on this component.

property

metadata

scene: Scene

The parent Scene that contains this Component.

property

scene

final
viewer: Viewer

The viewer that contains this Scene.

property

viewer

Accessors

  • get duration(): number
  • set duration(arg: number): void
  • get fit(): boolean
  • set fit(arg: boolean): void
  • Gets if, when CameraFlightAnimation is flying to a boundary, it will always adjust the distance between the Camera.eye and Camera.look so as to ensure that the target boundary is always filling the view volume.

    When false, the eye will remain at its current distance from the look position.

    Default value is true.

    Returns boolean

    value Set true to activate this behaviour.

  • Sets if, when CameraFlightAnimation is flying to a boundary, it will always adjust the distance between the Camera.eye and Camera.look so as to ensure that the target boundary is always filling the view volume.

    When false, the eye will remain at its current distance from the look position.

    Default value is true.

    Parameters

    • arg: boolean

    Returns void

  • get fitFOV(): number
  • set fitFOV(arg: number): void
  • The Component that owns the lifecycle of this Component, if any.

    When that component is destroyed, this component will be automatically destroyed also.

    Will be null if this Component has no owner.

    property

    owner

    Returns Component

  • get trail(): boolean
  • set trail(arg: boolean): void

Methods

  • cancel(): void
  • clear(): void
  • destroy(): void
  • error(message: string): void
  • Logs an error for this component to the JavaScript console.

    The console message will have this format: [ERROR] [<component type> =<component id>: <message>

    Also fires the message as an "error" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

  • fire(event: string, value: any, forget?: boolean): void
  • Fires an event on this component.

    Notifies existing subscribers to the event, optionally retains the event to give to any subsequent notifications on the event as they are made.

    Parameters

    • event: string

      The event type name

    • value: any

      The event parameters

    • Optional forget: boolean

    Returns void

  • flyTo(params?: Component | { aabb?: number[]; arc?: number; component?: string | number | Component; duration?: number; eye?: number[]; fit?: boolean; fitFOV?: number; look?: number[]; orthoScale?: number; projection?: string; up?: number[] }, callback?: () => void, scope?: any): void
  • Flies the Camera to a target.

    • When the target is a boundary, the Camera will fly towards the target and stop when the target fills most of the canvas.
    • When the target is an explicit Camera position, given as eye, look and up, then CameraFlightAnimation will interpolate the Camera to that target and stop there.

    Parameters

    • Optional params: Component | { aabb?: number[]; arc?: number; component?: string | number | Component; duration?: number; eye?: number[]; fit?: boolean; fitFOV?: number; look?: number[]; orthoScale?: number; projection?: string; up?: number[] }
    • Optional callback: () => void
        • (): void
        • Returns void

    • Optional scope: any

    Returns void

  • hasSubs(event: string): boolean
  • Returns true if there are any subscribers to the given event on this component.

    Parameters

    • event: string

      The event

    Returns boolean

    True if there are any subscribers to the given event on this component.

  • isType(type: any): boolean
  • jumpTo(params: Component | { aabb?: number[]; arc?: number; component?: string | number | Component; eye?: number[]; fit?: boolean; fitFOV?: number; look?: number[]; projection?: "perspective" | "ortho" | "frustum" | "customProjection"; up?: number[] }): void
  • Jumps the Scene's Camera to the given target.

    • When the target is a boundary, this CameraFlightAnimation will position the Camera at where the target fills most of the canvas.
    • When the target is an explicit Camera position, given as eye, look and up vectors, then this CameraFlightAnimation will jump the Camera to that target.

    Parameters

    • params: Component | { aabb?: number[]; arc?: number; component?: string | number | Component; eye?: number[]; fit?: boolean; fitFOV?: number; look?: number[]; projection?: "perspective" | "ortho" | "frustum" | "customProjection"; up?: number[] }

      Either a parameters object or a Component subtype that has a World-space AABB.

    Returns void

  • log(message: string): void
  • Logs a console debugging message for this component.

    The console message will have this format: [LOG] [<component type> <component id>: <message>

    Also fires the message as a "log" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

  • off(subId: string): void
  • on(event: string, callback: Function, scope?: any): string
  • Subscribes to an event on this component.

    The callback is be called with this component as scope.

    Parameters

    • event: string

      The event

    • callback: Function

      Called fired on the event

    • Optional scope: any

    Returns string

    Handle to the subscription, which may be used to unsubscribe with .off.

  • once(event: string, callback: Function, scope?: any): void
  • Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd.

    This is equivalent to calling Component.on, and then calling Component.off inside the callback function.

    Parameters

    • event: string

      Data event to listen to

    • callback: Function

      Called when fresh data is available at the event

    • Optional scope: any

    Returns void

  • stop(): void
  • warn(message: string): void
  • Logs a warning for this component to the JavaScript console.

    The console message will have this format: [WARN] [<component type> =<component id>: <message>

    Also fires the message as a "warn" event on the parent Scene.

    Parameters

    • message: string

      The message to log

    Returns void

Generated using TypeDoc