Lens Scripting API

    Class ManipulateComponent

    Handles input information from user touch input via the InteractionComponent to control the Scale, Rotation, and Translation of objects.

    // Disables the scale functionality on a manipulate component when a user taps
    //@input Component.ManipulateComponent manip

    function onTap(eventData)
    {
    script.manip.enableManipulateType(ManipulateType.Scale, false);
    }
    var tapEvent = script.createEvent("TapEvent");
    tapEvent.bind(onTap);

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    isContextualSwivel: boolean

    Changes swivel behavior based on the object's height relative to the camera.

    isManipulating: boolean

    Returns whether the object that the Manipulate Component is on is currently being manipulated

    maxDistance: number

    The maximum distance the object can travel from the user.

    maxHeight: number

    The maximum height of the object.

    maxScale: number

    The maximum size the object can scale to.

    minDistance: number

    The minimum distance the object can be from the user.

    minHeight: number

    The minimum height of the object.

    minScale: number

    The minimum size the object can shrink to.

    onManipulateEnd: event1<ManipulateEndEventArgs, void>

    Event fired when manipulation ends.

    onManipulateStart: event1<ManipulateStartEventArgs, void>

    Event fired when manipulation starts.

    rotationScale: number

    Multiplier for swivel rotation speed. For example, a value of 0.5 will cut rotation speed in half, and a value of 2.0 will double rotation speed.

    sceneObject: SceneObject

    The scene object this component is on.

    uniqueIdentifier: string

    Methods

    • Repositions the object to be within the bounds of minDistance, maxDistance.

      Returns void

    • Destroys the component.

      Returns void

    • Enables or disables the specified ManipulateType for this ManipulateComponent.

      Parameters

      Returns void

    • Returns the name of this object's type.

      Returns string

    • Checks for an intersection point between the manipulation plane and a line extending from the camera through the specified screen space point. The screen point is passed in as (x, y) with both values ranging from ([0-1], [0-1]), (0,0) being left-top and (1,1) being right-bottom. The result is returned as a ManipulateFrameIntersectResult object.

      Parameters

      • screenSpacePoint: vec2

      Returns ManipulateFrameIntersectResult

    • Returns whether the specified ManipulateType is enabled for this ManipulateComponent.

      Parameters

      Returns boolean

    • 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