Lens Scripting API
    Preparing search index...

    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;
        getForwardPosition(x: number, parallelToGround: false): vec3;
        getForwardPositionParallelToGround(x: number): vec3;
        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

    Index

    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

    • Parameters

      • x: number

        the magnitude to multiply the camera's forward direction by

      • parallelToGround: false

        if the camera's forward direction should be projected to be parallel to ground

      Returns vec3

      a position in world space in front of the camera by x units

    • Parameters

      • x: number

        the magnitude to multiply the camera's forward direction by

      Returns vec3

      a position in world space in front of the camera (parallel to ground)

    • 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

    MMNEPVFCICPMFPCPTTAAATR