Lens Scripting API

    Class MarkerTrackingComponent

    Used to track images in the camera.

    Moves the containing object's transform to match the detected image.

    Marker Tracking guide.

    //@input Component.MarkerTrackingComponent markerTrackingComponent

    // Get whether or not the marker image is being tracked
    var isMarkerTracking = script.markerTrackingComponent.isTracking();

    // Print current status.
    if (isMarkerTracking) {
    print("Image is in Camera feed.");
    } else {
    print("Image is NOT in Camera feed.");
    }

    Hierarchy (View Summary, Expand)

    Index

    Constructors

    Properties

    autoEnableWhenTracking: boolean

    If true, child objects of this Component's SceneObject will be disabled when the marker image is not being tracked.

    enabled: boolean

    If disabled, the Component will stop enacting its behavior.

    marker: MarkerAsset

    The marker asset describing the tracking target.

    onMarkerFound: () => void

    A function that gets called when marker tracking begins.

    onMarkerLost: () => void

    A function that gets called when marker tracking is lost.

    sceneObject: SceneObject

    The scene object this component is on.

    uniqueIdentifier: string

    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

    • Returns whether the marker image is currently being tracked in camera.

      Returns boolean

    MMNEPVFCICPMFPCPTTAAATR