Preparing search index...

    Class AnchorModule

    Entry point to the anchoring system. Open an AnchorSession to create, save, discover, and track anchors. Spectacles only.

    Lens Scripting Version 376

    const anchorModule = require('LensStudio:AnchorModule');
    const session = await anchorModule.openSession();
    const object = script.getSceneObject();
    const anchor = session.createWorldAnchor(object.getTransform().getWorldTransform());
    // Track the anchor by assigning it to an AnchorComponent on the object you want anchored.
    const tracker = object.createComponent(AnchorComponent.getTypeName());
    tracker.anchor = anchor;
    // Persist it so it can be found again in a later session.
    await session.saveAnchor(anchor, { scope: AnchorModule.AnchorScope.Private });

    Hierarchy (View Summary)

    Index

    Properties

    name: string

    The name of the Asset in Lens Studio.

    ""
    
    uniqueIdentifier: string

    Lens Scripting Version 176

    Methods

    • Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

      Returns string

      Lens Scripting Version 376

    • 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