API reference
API reference
Select your platform
No SDKs available
No versions available

OVRAnchor Struct

Represents an anchor.
OVRAnchor extends IEquatable< OVRAnchor >.
OVRAnchor extends IDisposable.

Overview

Static Fields

static readonly OVRAnchor
Null[Get]
static readonly Dictionary< DeferredKey, List< DeferredValue > >

Properties

ulong
Handle[Get]
Guid
Uuid[Get]
Unique Identifier representing the anchor.

Static Public Member Functions

static OVRTask< bool >
FetchAnchorsAsync< T >
( IList< OVRAnchor > anchors,
int maxResults,
double timeout )
Asynchronous method that fetches anchors with a specific component.
static OVRTask< bool >
FetchAnchorsAsync
( IEnumerable< Guid > uuids,
IList< OVRAnchor > anchors,
double timeout )
Asynchronous method that fetches anchors with specifics uuids.
static OVRTask< OVRAnchor >
CreateSpatialAnchorAsync
( Pose trackingSpacePose )
Creates a new spatial anchor.
static OVRTask< OVRAnchor >
CreateSpatialAnchorAsync
( Transform transform,
Camera centerEyeCamera )
Creates a new spatial anchor.
static bool
static bool

Public Member Functions

T
Gets the anchor's component of a specific type.
bool
TryGetComponent< T >
( out T component )
Tries to get the anchor's component of a specific type.
bool
Tests whether or not the anchor supports a specific type of component.
bool
GetSupportedComponents
( List< SpaceComponentType > components )
Get all the supported components of an anchor.
bool
Equals
( OVRAnchor other )
override bool
Equals
( object obj )
override int
override string
void
Dispose ( )
Disposes of an anchor.

Details

Detailed Description

Scenes anchors are uniquely identified with their Uuid.
You may dispose of an anchor by calling their Dispose method.

Public Statics

readonly OVRAnchor OVRAnchor.Null
No description available.
readonly Dictionary<DeferredKey, List<DeferredValue> > OVRAnchor._deferredTasks
No description available.

Properties

ulong OVRAnchor.Handle
No description available.
Guid OVRAnchor.Uuid
Unique Identifier representing the anchor.

Static Member Functions

static OVRTask< bool > OVRAnchor.FetchAnchorsAsync< T >
( IList< OVRAnchor > anchors,
int maxResults,
double timeout )
Asynchronous method that fetches anchors with a specific component.
Others
T
The type of component the fetched anchor must have.
Parameters
anchors
IList that will get cleared and populated with the requested anchors.
s
Parameters
location
Storage location to query
maxResults
The maximum number of results the query can return
timeout
Timeout in seconds for the query.
Dispose of the returned OVRTask<T> if you don't use the results
Returns
An OVRTask<T> that will eventually let you test if the fetch was successful or not. If the result is true, then the anchors parameter has been populated with the requested anchors.
Exceptions
System.ArgumentNullException
Thrown if anchors is null.
static OVRTask< bool > OVRAnchor.FetchAnchorsAsync
( IEnumerable< Guid > uuids,
IList< OVRAnchor > anchors,
double timeout )
Asynchronous method that fetches anchors with specifics uuids.
Parameters
uuids
Enumerable of uuids that anchors fetched must verify
anchors
IList that will get cleared and populated with the requested anchors.
s
Parameters
location
Storage location to query
timeout
Timeout in seconds for the query.
Dispose of the returned OVRTask<T> if you don't use the results
Returns
An OVRTask<T> that will eventually let you test if the fetch was successful or not. If the result is true, then the anchors parameter has been populated with the requested anchors.
Exceptions
System.ArgumentNullException
Thrown if uuids is null.
System.ArgumentNullException
Thrown if anchors is null.
static OVRTask< OVRAnchor > OVRAnchor.CreateSpatialAnchorAsync
( Pose trackingSpacePose )
Creates a new spatial anchor.
Spatial anchor creation is asynchronous. This method initiates a request to create a spatial anchor at trackingSpacePose . The returned OVRTask<TResult> can be awaited or used to track the completion of the request.
If spatial anchor creation fails, the resulting OVRAnchor will be OVRAnchor.Null.
Parameters
trackingSpacePose
The pose, in tracking space, at which you wish to create the spatial anchor.
Returns
A task which can be used to track completion of the request.
static OVRTask< OVRAnchor > OVRAnchor.CreateSpatialAnchorAsync
( Transform transform,
Camera centerEyeCamera )
Creates a new spatial anchor.
Spatial anchor creation is asynchronous. This method initiates a request to create a spatial anchor at transform . The returned OVRTask<TResult> can be awaited or used to track the completion of the request.
If spatial anchor creation fails, the resulting OVRAnchor will be OVRAnchor.Null.
Parameters
transform
The transform at which you wish to create the spatial anchor.
centerEyeCamera
The Camera associated with the Meta Quest's center eye.
Returns
A task which can be used to track completion of the request.
Exceptions
ArgumentNullException
Thrown when transform is null.
ArgumentNullException
Thrown when centerEyeCamera is null.
static bool OVRAnchor.operator==
( OVRAnchor lhs,
OVRAnchor rhs )
No description available.
static bool OVRAnchor.operator!=
( OVRAnchor lhs,
OVRAnchor rhs )
No description available.

Member Functions

T OVRAnchor.GetComponent< T > ( )
Gets the anchor's component of a specific type.
Others
T
The type of the component.
Returns
The requested component.
Make sure the anchor supports the specified type of component using SupportsComponent<T>
Exceptions
InvalidOperationException
Thrown if the anchor doesn't support the specified type of component.
bool OVRAnchor.TryGetComponent< T >
( out T component )
Tries to get the anchor's component of a specific type.
Parameters
component
The requested component, as an out parameter.
Others
T
The type of the component.
Returns
Whether or not the request succeeded. It may fail if the anchor doesn't support this type of component.
See Also:
bool OVRAnchor.SupportsComponent< T > ( )
Tests whether or not the anchor supports a specific type of component.
For performance reasons, we use xrGetSpaceComponentStatusFB, which can result in an error in the logs when the component is not available.
This error does not have impact on the control flow. The alternative method, avoids this error reporting, but does have performance constraints.
Others
T
The type of the component.
Returns
Whether or not the specified type of component is supported.
bool OVRAnchor.GetSupportedComponents
( List< SpaceComponentType > components )
Get all the supported components of an anchor.
Parameters
components
The list to populate with the supported components. The list is cleared first.
Returns
True if the supported components could be retrieved, otherwise False.
bool OVRAnchor.Equals
( OVRAnchor other )
No description available.
override bool OVRAnchor.Equals
( object obj )
No description available.
override int OVRAnchor.GetHashCode ( )
No description available.
override string OVRAnchor.ToString ( )
No description available.
void OVRAnchor.Dispose ( )
Disposes of an anchor.
Calling this method will destroy the anchor so that it won't be managed by internal systems until the next time it is fetched again.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon