PerspectiveProjection projection configuration for a Camera .

Summary

Hierarchy

  • Component
    • PerspectiveProjection

Implements

Properties

camera: Camera

The Camera this PerspectiveProjection belongs to.

destroyed: boolean

True once this Component has been destroyed.

Don't use this Component if this is true.

dirty: boolean
id: string

Unique ID of this Component.

type: number = PerspectiveProjectionType

The type of this projection.

Accessors

  • get far(): number
  • Gets the position of this PerspectiveProjection's far plane on the positive View-space Z-axis.

    Returns number

    The PerspectiveProjection's far plane position.

  • set far(value): void
  • Sets the position of this PerspectiveProjection's far plane on the positive View-space Z-axis.

    Parameters

    • value: number

      New PerspectiveProjection far plane position.

    Returns void

  • get fov(): number
  • Gets the PerspectiveProjection's field-of-view angle (FOV).

    Default value is 60.0.

    Returns number

    Current field-of-view.

  • set fov(value): void
  • Sets the PerspectiveProjection's field-of-view angle (FOV).

    Default value is 60.0.

    Parameters

    • value: number

      New field-of-view.

    Returns void

  • get fovAxis(): string
  • Gets the PerspectiveProjection's FOV axis.

    Options are "x", "y" or "min", to use the minimum axis.

    Default value is "min".

    Returns string

    The current FOV axis value.

  • set fovAxis(value): void
  • Sets the PerspectiveProjection's FOV axis.

    Options are "x", "y" or "min", to use the minimum axis.

    Default value "min".

    Parameters

    • value: string

      New FOV axis value.

    Returns void

  • get near(): number
  • Gets the position of the PerspectiveProjection's near plane on the positive View-space Z-axis.

    Default value is 0.1.

    Returns number

    The PerspectiveProjection's near plane position.

  • set near(value): void
  • Sets the position of the PerspectiveProjection's near plane on the positive View-space Z-axis.

    Default value is 0.1.

    Parameters

    • value: number

      New PerspectiveProjection near plane position.

    Returns void

  • get projMatrix(): FloatArrayParam
  • Gets the PerspectiveProjection's projection transform matrix.

    Default value is [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1].

    Returns FloatArrayParam

    The PerspectiveProjection's projection matrix.

Methods

  • Gives this component an opportunity to action any defered state updates.

    Returns void

  • Protected

    Logs an error for this component to the JavaScript console.

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

    Parameters

    • message: string

      The error message to log

    Returns void

  • Protected

    Logs a message for this component.

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

    Parameters

    • message: string

      The message to log

    Returns void

  • Flags this component as having a defered state updates it needs to perform.

    Returns void

  • Un-projects the given View-space coordinates and Screen-space depth, using this PerspectiveProjection projection.

    Parameters

    • canvasPos: FloatArrayParam

      Inputs 2D View-space coordinates.

    • screenZ: number

      Inputs Screen-space Z coordinate.

    • screenPos: FloatArrayParam

      Outputs 3D Screen/Clip-space coordinates.

    • viewPos: FloatArrayParam

      Outputs un-projected 3D View-space coordinates.

    • worldPos: FloatArrayParam

      Outputs un-projected 3D World-space coordinates.

    Returns FloatArrayParam

  • Protected

    Logs a warning for this component to the JavaScript console.

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

    Parameters

    • message: string

      The warning message to log

    Returns void

Events

onDestroyed: EventEmitter<Component, null>

Emits an event when the Component has been destroyed.

onProjMatrix: EventEmitter<PerspectiveProjection, FloatArrayParam>

Emits an event each time PerspectiveProjection.projMatrix updates.