Lens Scripting API

    Base class that provides camera related apis

    Hierarchy (View Summary, Expand)

    Implements

    Index

    Constructors

    Properties

    cameraComponent: Camera
    cameraTransform: Transform

    Methods

    • 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

    • Parameters

      • x: number

        the magnitude to multiply the camera's forward direction by

      • parallelToGround: boolean = 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 mat4

    • Parameters

      • worldPosition: vec3

        vec3 representing the position in world space

      Returns boolean

      whether a position is in camera FoV or not

    • 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

    MMNEPVFCICPMFPCPTTAAATR