FirstModulAR 0.1.0
Loading...
Searching...
No Matches
AnchorProvider Class Referenceabstract

Abstract base class for any system which allows the creation and management of anchors in the environment. This is required as different platforms have different ways of handling anchors. It allows us to abstract away the differences and provide a unified interface for the rest of the system. More...

Inheritance diagram for AnchorProvider:
MLAnchorProvider MockAnchorProvider OVRAnchorProvider

Public Member Functions

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.
 

Static Public Attributes

static Action OnAnchorsUpdated
 
static Action OnAnchorAdded
 
static Action OnAnchorRemoved
 

Properties

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

Detailed Description

Abstract base class for any system which allows the creation and management of anchors in the environment. This is required as different platforms have different ways of handling anchors. It allows us to abstract away the differences and provide a unified interface for the rest of the system.

Member Function Documentation

◆ Awake()

virtual void AnchorProvider.Awake ( )
inlinevirtual

Initializes the singleton instance of the anchor provider.

Reimplemented in MockAnchorProvider, and OVRAnchorProvider.

◆ CreateAnchor()

void AnchorProvider.CreateAnchor ( Pose pose,
Action< string > OnCompleted = null )
abstract

Creates an anchor at the specified pose.

Parameters
poseThe pose where the anchor should be created.
OnCompletedCallback invoked when the anchor creation is completed.

◆ DestroyAnchor()

void AnchorProvider.DestroyAnchor ( string id)
abstract

Destroys the anchor with the specified ID.

Parameters
idThe ID of the anchor to destroy.

◆ GetAllAnchors()

FMARAnchor[] AnchorProvider.GetAllAnchors ( )
abstract

Gets all anchors managed by the provider.

Returns
An array of all anchors.

◆ OnDestroy()

virtual void AnchorProvider.OnDestroy ( )
inlinevirtual

Cleans up the singleton instance when the provider is destroyed.

◆ TryGetAnchor()

bool AnchorProvider.TryGetAnchor ( string id,
out FMARAnchor anchor )
abstract

Tries to get the anchor with the specified ID.

Parameters
idThe ID of the anchor to retrieve.
anchorThe retrieved anchor, if found.
Returns
True if the anchor was found; otherwise, false.

◆ TryGetClosestAnchor()

bool AnchorProvider.TryGetClosestAnchor ( Vector3 position,
float radius,
out FMARAnchor anchor )
abstract

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

Parameters
positionThe position to search from.
radiusThe search radius.
anchorThe closest anchor, if found.
Returns
True if an anchor was found; otherwise, false.

Member Data Documentation

◆ OnAnchorAdded

Action AnchorProvider.OnAnchorAdded
static

◆ OnAnchorRemoved

Action AnchorProvider.OnAnchorRemoved
static

◆ OnAnchorsUpdated

Action AnchorProvider.OnAnchorsUpdated
static

Property Documentation

◆ Instance

AnchorProvider AnchorProvider.Instance
staticget

◆ Ready

bool AnchorProvider.Ready
getabstract

Gets a value indicating whether the provider is ready to create and manage anchors.


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