Lens Scripting API

    Class LookAtComponent

    Orients a SceneObject towards a target SceneObject.

    // Switches through LookAt targets in a list on each tap
    //@input Component.LookAtComponent lookAt
    //@input SceneObject[] targets

    var targetIndex = 0;

    script.createEvent("TapEvent").bind(function(eventData)
    {
    if(script.targets.length > 0)
    {
    targetIndex = (targetIndex + 1) % script.targets.length;
    script.lookAt.target = script.targets[targetIndex];
    }
    });
    // Set aimVectors to [-Z Aim, Y Up]
    // (Useful for aiming the camera since it faces towards -Z)
    //@input Component.LookAtComponent lookAt
    script.lookAt.aimVectors = LookAtComponent.AimVectors.NegativeZAimYUp;

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    aimVectors: AimVectors

    The "aim" and "up" vectors used when determining rotation. LookAtComponent will try to point the Aim axis of the SceneObject towards the target, while keeping the Up axis of the SceneObject pointing towards worldUpVector.

    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    lookAtMode: LookAtMode

    Controls the method of rotation being used.

    offsetRotation: quat

    Adds an additional rotation offset.

    sceneObject: SceneObject

    The scene object this component is on.

    target: SceneObject

    The SceneObject this LookAtComponent targets.

    uniqueIdentifier: string
    worldUpVector: WorldUpVector

    The vector to be considered the "up" vector when determining rotation.

    Methods

    • Destroys the component.

      Returns void

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean

    MMNEPVFCICPMFPCPTTAAATR