Class PerspectiveProjection

PerspectiveProjection projection configuration for a Camera .

Implements

Properties

camera: Camera

The Camera this PerspectiveProjection belongs to.

Emits an event each time PerspectiveProjection.projMatrix updates.

type: number = PerspectiveProjectionType

The type of this projection.

Accessors

  • 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: number): 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

Methods

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

    Parameters

    • canvasPos: Vec2

      Inputs 2D View-space coordinates.

    • screenZ: number

      Inputs Screen-space Z coordinate.

    • screenPos: Vec3

      Outputs 3D Screen/Clip-space coordinates.

    • viewPos: Vec3

      Outputs un-projected 3D View-space coordinates.

    • worldPos: Vec3

      Outputs un-projected 3D World-space coordinates.

    Returns Vec3