FirstModulAR 0.1.0
Loading...
Searching...
No Matches
MLAnchorProvider Class Reference

Anchor Provider for Magic Leap 2, allows for the creation and management of anchors. More...

Inheritance diagram for MLAnchorProvider:
AnchorProvider

Public Member Functions

override void CreateAnchor (Pose pose, Action< string > OnCompleted)
 Creates an anchor at the given pose.
 
override void DestroyAnchor (string id)
 Destroys the anchor with the given id.
 
void Update ()
 Updates the anchors every updateIntervalSeconds seconds.
 
void UpdateAnchors ()
 Updates the anchors to match the anchors in the Magic Leap system.
 
override bool TryGetAnchor (string id, out FMARAnchor anchor)
 Tries to get the anchor with the given id.
 
override FMARAnchor[] GetAllAnchors ()
 Gets all anchors.
 
override bool TryGetClosestAnchor (Vector3 position, float radius, out FMARAnchor anchor)
 Tries to get the closest anchor to the given position within the given radius.
 
- Public Member Functions inherited from AnchorProvider
void CreateAnchor (Pose pose, Action< string > OnCompleted=null)
 Creates an anchor at the specified pose.
 
void DestroyAnchor (string id)
 Destroys the anchor with the specified ID.
 
bool TryGetAnchor (string id, out FMARAnchor anchor)
 Tries to get the anchor with the specified ID.
 
bool TryGetClosestAnchor (Vector3 position, float radius, out FMARAnchor anchor)
 Tries to get the closest anchor to the specified position within a given radius.
 
FMARAnchor[] GetAllAnchors ()
 Gets all anchors managed by the provider.
 
virtual void Awake ()
 Initializes the singleton instance of the anchor provider.
 
virtual void OnDestroy ()
 Cleans up the singleton instance when the provider is destroyed.
 

Properties

override bool Ready [get]
 
- Properties inherited from AnchorProvider
static AnchorProvider Instance [get]
 
bool Ready [get]
 Gets a value indicating whether the provider is ready to create and manage anchors.
 

Additional Inherited Members

- Static Public Attributes inherited from AnchorProvider
static Action OnAnchorsUpdated
 
static Action OnAnchorAdded
 
static Action OnAnchorRemoved
 

Detailed Description

Anchor Provider for Magic Leap 2, allows for the creation and management of anchors.

Member Function Documentation

◆ CreateAnchor()

override void MLAnchorProvider.CreateAnchor ( Pose pose,
Action< string > OnCompleted )
inline

Creates an anchor at the given pose.

Parameters
poseThe pose to create the anchor at.
OnCompletedThe action to invoke when the anchor is created.

◆ DestroyAnchor()

override void MLAnchorProvider.DestroyAnchor ( string id)
inline

Destroys the anchor with the given id.

Parameters
idThe id of the anchor to destroy.

◆ GetAllAnchors()

override FMARAnchor[] MLAnchorProvider.GetAllAnchors ( )
inline

Gets all anchors.

Returns
All anchors.

◆ TryGetAnchor()

override bool MLAnchorProvider.TryGetAnchor ( string id,
out FMARAnchor anchor )
inline

Tries to get the anchor with the given id.

Parameters
idThe id of the anchor to get.
anchorThe anchor to get.
Returns
Whether the anchor was found.

◆ TryGetClosestAnchor()

override bool MLAnchorProvider.TryGetClosestAnchor ( Vector3 position,
float radius,
out FMARAnchor anchor )
inline

Tries to get the closest anchor to the given position within the given radius.

Parameters
positionThe position to search from.
radiusThe radius to search in.
anchorThe anchor to get.
Returns
Whether the anchor was found.

◆ Update()

void MLAnchorProvider.Update ( )
inline

Updates the anchors every updateIntervalSeconds seconds.

◆ UpdateAnchors()

void MLAnchorProvider.UpdateAnchors ( )
inline

Updates the anchors to match the anchors in the Magic Leap system.

Property Documentation

◆ Ready

override bool MLAnchorProvider.Ready
get

The documentation for this class was generated from the following file: