Defines available camera apis This abstraction was added to avoid mocking CameraComponent, Transform, etc in other classes that are being tested

interface default {
    attachSceneObject(sceneObject: SceneObject): void;
    back(): vec3;
    enableClearColor(color: vec4): void;
    forward(): vec3;
    getClearColor(): vec4;
    getComponent(): Camera;
    getLocalScale(): vec3;
    getTransform(): Transform;
    getWorldPosition(): vec3;
    getWorldTransform(): mat4;
    inFoV(worldPosition: vec3): boolean;
    renderLayer(): LayerSet;
    right(): vec3;
    screenSpaceToWorldSpace(x: number, y: number, absoluteDepth: number): vec3;
    up(): vec3;
    worldSpaceToScreenSpace(x: number, y: number, z: number): vec2;
}

Implemented by

Methods

  • Add SceneObject as a child of the camera's SceneObject

    Parameters

    Returns void

  • Returns the back vector of the camera. This is actually the front vector because the camera is reversed in Lens Studio.

    Returns vec3

  • Clears the renderTarget with the provided color before drawing to it

    Parameters

    • color: vec4

      the color to clear the renderTarget with

    Returns void

  • Returns the forward vector of the camera. This is actually the back vector because the camera is reversed in Lens Studio.

    Returns vec3

  • Returns the clear color applied to the camera

    Returns vec4

  • Returns the camera component

    Returns Camera

  • Returns the camera's local scale

    Returns vec3

  • Returns the camera's world position

    Returns vec3

  • Returns the camera's world transform

    Returns mat4

  • Parameters

    • worldPosition: vec3

      vec3 representing the position in world space

    Returns boolean

    whether a position is in camera FoV or not

  • Returns the layer set to which this camera is rendering to

    Returns LayerSet

  • Returns the right vector of the camera.

    Returns vec3

  • Returns the camera's world position projected from screen space coordinates at a given z depth

    Parameters

    • x: number
    • y: number
    • absoluteDepth: number

    Returns vec3

  • Returns the up vector of the camera.

    Returns vec3

  • Parameters

    • x: number
    • y: number
    • z: number

    Returns vec2