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

OVRAnchor Struct

Extends IEquatable< OVRAnchor >, IDisposable
Represents an anchor.
An OVRAnchor can represent either a "spatial anchor", which is created and managed by the app, or a "scene anchor", which is created and managed by the system and used to represent the Scene Model.
This is a low-level, lightweight interface to access anchors. For more Unity-friendly components, see OVRSpatialAnchor (for spatial anchors) or Access Scene data with OVRAnchor for Scene.
This API gives you access to all anchor functionality:

Static Fields

Null : readonly OVRAnchor
Represents a null anchor.
Because OVRAnchor is a value-type, it is not C#-nullable. However, if you default-construct an OVRAnchor (instead of obtaining one from a query or creation method) then it will be equal to Null. You can test for null by comparing against Null:
async void CreateAnchor(Pose pose) {
  var anchor = await OVRAnchor.CreateSpatialAnchorAsync(pose);
  if (anchor == OVRAnchor.Null) {
    Debug.LogError("Anchor creation failed!");
  } else {
    // anchor is valid
  }
}
Signature
readonly OVRAnchor Null

Properties

Uuid : Guid
[Get]
The unique identifier of this anchor.
UUIDs persist across sessions. If you load a persisted anchor, you can use the UUID to identify it.
Signature
Guid Uuid

Methods

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.
Signature
void Dispose()
Returns
void
Equals ( other )
Compares two anchors for equality.
Signature
bool Equals(OVRAnchor other)
Parameters
other: OVRAnchor  The anchor to compare with this one.
Returns
bool  Returns true if both anchor UUIDs are the same and they are the same runtime instance. That is, they are the same instance of the same anchor.
Equals ( obj )
Compares this anchor with an object for equality.
Signature
override bool Equals(object obj)
Parameters
obj: object  The object to compare with this anchor.
Returns
override bool  Returns true if obj is an OVRAnchor and Equals(OVRAnchor) is also true, otherwise false.
EraseAsync ()
Erases this anchor.
This method removes the anchor from persistent storage. Note this does not destroy the current instance.
This operation is asynchronous. Use the returned OVRTask to track the result of the asynchronous operation.
NOTE: When erasing multiple anchors, it is more efficient to erase them in a batch using EraseAsync(IEnumerable<OVRAnchor>,IEnumerable<Guid>).
Signature
OVRTask< OVRResult< EraseResult > > EraseAsync()
Returns
OVRTask< OVRResult< EraseResult > >  An awaitable OVRTask representing the asynchronous request.
GetComponent< T > ()
Gets the anchor's component of a specific type.
Make sure the anchor supports the specified type of component using SupportsComponent<T>
Signature
T GetComponent< T >()
Returns
T  The requested component.
Throws
InvalidOperationException  Thrown if the anchor doesn't support the specified type of component.
GetHashCode ()
Generates a hash code suitable for use in a Dictionary or HashSet
Signature
override int GetHashCode()
Returns
override int  Returns a hash code suitable for use in a Dictionary or HashSet
GetSupportedComponents ( components )
Get all the supported components of an anchor.
Signature
bool GetSupportedComponents(List< SpaceComponentType > components)
Parameters
components: List< SpaceComponentType >  The list to populate with the supported components. The list is cleared first.
Returns
bool true if the supported components could be retrieved, otherwise false.
GetTrackableType ()
Gets the type of trackable this anchor represents, or TrackableType.None.
Signature
TrackableType GetTrackableType()
Returns
TrackableType  Returns the type of trackable this anchor represents.
SaveAsync ()
Save this anchor.
This method persists the anchor so that it may be retrieved later, e.g., by using FetchAnchorsAsync(List<OVRAnchor>,FetchOptions,Action<List<OVRAnchor>,int>).
This operation is asynchronous. Use the returned OVRTask to track the result of the asynchronous operation.
NOTE: When saving multiple anchors, it is more efficient to save them in a batch using SaveAsync(IEnumerable<OVRAnchor>).
Signature
OVRTask< OVRResult< SaveResult > > SaveAsync()
Returns
OVRTask< OVRResult< SaveResult > >  An awaitable OVRTask representing the asynchronous request.
ShareAsync ( users )
Share this anchor with the specified users.
This method shares the anchor with a collection of OVRSpaceUser.
This operation is asynchronous. Use the returned OVRTask to track the result of the asynchronous operation.
Signature
OVRTask< OVRResult< ShareResult > > ShareAsync(IEnumerable< OVRSpaceUser > users)
Parameters
users: IEnumerable< OVRSpaceUser >  A collection of users with whom anchors will be shared.
Returns
OVRTask< OVRResult< ShareResult > >  An awaitable OVRTask representing the asynchronous request.
Throws
ArgumentNullException  Thrown if users is null. ArgumentException  Thrown if users count is less than one.
ShareAsync ( groupUuid )
Shares this anchor with the group associated with the given UUID.
This method is asynchronous; use the returned OVRTask wrapper to be notified of completion.
The groupUuid parameter can be any valid Guid, which excludes the default value Guid, that is, Guid.Empty.
Signature
OVRTask< OVRResult< ShareResult > > ShareAsync(Guid groupUuid)
Parameters
groupUuid: Guid  A UUID of a group to share the anchor with. Anchors shared to this groupUuid can be loaded by other clients via OVRSpatialAnchor.LoadUnboundSharedAnchorsAsync(Guid,List<OVRSpatialAnchor.UnboundAnchor>).
NOTE: You may arbitrarily generate your own UUIDs (e.g. with System.Guid.NewGuid), or you may use UUIDs provided by colocation APIs such as in OVRColocationSession.
Returns
OVRTask< OVRResult< ShareResult > >  Returns an OVRResult<OVRAnchor.ShareResult> indicating the status of the share operation.
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,
Signature
bool SupportsComponent< T >()
Returns
bool  Whether or not the specified type of component is supported.
ToString ()
Generates a string representation of this anchor, based on its Uuid.
Signature
override string ToString()
Returns
override string  Returns the stringification of this anchor's Uuid.
TryGetComponent< T > ( component )
Tries to get the anchor's component of a specific type.
Signature
bool TryGetComponent< T >(out T component)
Parameters
component: out T  The requested component, as an out parameter.
Returns
bool  Whether or not the request succeeded. It may fail if the anchor doesn't support this type of component.

Static Methods

CreateSpatialAnchorAsync ( 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<OVRAnchor> can be awaited or used to track the completion of the request.
If spatial anchor creation fails, the resulting OVRAnchor will be OVRAnchor.Null.
Signature
static OVRTask< OVRAnchor > CreateSpatialAnchorAsync(Pose trackingSpacePose)
Parameters
trackingSpacePose: Pose  The pose, in tracking space, at which you wish to create the spatial anchor.
Returns
OVRTask< OVRAnchor >  A task which can be used to track completion of the request.
CreateSpatialAnchorAsync ( transform , 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<OVRAnchor> can be awaited or used to track the completion of the request.
If spatial anchor creation fails, the resulting OVRAnchor will be OVRAnchor.Null.
Signature
static OVRTask< OVRAnchor > CreateSpatialAnchorAsync(Transform transform, Camera centerEyeCamera)
Parameters
transform: Transform  The transform at which you wish to create the spatial anchor.
centerEyeCamera: Camera  The Camera associated with the Meta Quest's center eye.
Returns
OVRTask< OVRAnchor >  A task which can be used to track completion of the request.
Throws
ArgumentNullException  Thrown when transform is null. ArgumentNullException  Thrown when centerEyeCamera is null.
EraseAsync ( anchors , uuids )
Erase a collection of anchors.
This method removes anchors from persistent storage.
This operation is asynchronous. Use the returned OVRTask to track the result of the asynchronous operation.
Signature
static OVRTask< OVRResult< EraseResult > > EraseAsync(IEnumerable< OVRAnchor > anchors, IEnumerable< Guid > uuids)
Parameters
anchors: IEnumerable< OVRAnchor >  (Optional) A collection of anchors to remove from persistent storage.
uuids: IEnumerable< Guid >  (Optional) A collection of uuids to remove from persistent storage.
Returns
OVRTask< OVRResult< EraseResult > >  Returns an awaitable OVRTask representing the asynchronous request.
Throws
ArgumentException  Thrown if both anchors and uuids are null.
FetchAnchorsAsync ( anchors , options , incrementalResultsCallback )
Fetch anchors matching a query.
This method queries for anchors that match the corresponding options . This method is asynchronous; use the returned OVRTask to check for completion.
Anchors may be returned in batches. If incrementalResultsCallback is not null, then this delegate is invoked whenever results become available prior to the completion of the entire operation. New anchors are appended to anchors . The delegate receives a reference to anchors and the starting index of the anchors that have been added. The parameters are:
  • anchors: The same List provided by anchors .
  • index: The starting index of the newly available anchors
Signature
static OVRTask< TaskResult > FetchAnchorsAsync(List< OVRAnchor > anchors, FetchOptions options, Action< List< OVRAnchor >, int > incrementalResultsCallback=null)
Parameters
anchors: List< OVRAnchor >  A buffer to store the results. This container is cleared before any async requests are made.
options: FetchOptions  Options describing which anchors to fetch.
incrementalResultsCallback: Action< List< OVRAnchor >, int >  (Optional) A callback invoked when incremental results are available.
Returns
OVRTask< TaskResult >  Returns an OVRTask that can be used to track the asynchronous fetch.
Throws
ArgumentNullException  Thrown if anchors is null.
FetchAnchorsAsync ( uuids , anchors , location , timeout )
(Obsolete) Asynchronous method that fetches anchors with specifics uuids.
Dispose of the returned OVRTask<bool> if you don't use the results
Signature
static OVRTask< bool > FetchAnchorsAsync(IEnumerable< Guid > uuids, IList< OVRAnchor > anchors, OVRSpace.StorageLocation location=OVRSpace.StorageLocation.Local, double timeout=0.0)
Parameters
uuids: IEnumerable< Guid >  Enumerable of uuids that anchors fetched must verify
anchors: IList< OVRAnchor >  IList that will get cleared and populated with the requested anchors.
location: OVRSpace.StorageLocation  Storage location to query
timeout: double  Timeout in seconds for the query.
Returns
OVRTask< bool >  Returns an OVRTask<bool> 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.
Throws
System.ArgumentNullException  Thrown if uuids is null. System.ArgumentNullException  Thrown if anchors is null.
FetchAnchorsAsync< T > ( anchors , location , maxResults , timeout )
(Obsolete) Asynchronous method that fetches anchors with a specific component.
Dispose of the returned OVRTask<bool> if you don't use the results
Signature
static OVRTask< bool > FetchAnchorsAsync< T >(IList< OVRAnchor > anchors, OVRSpace.StorageLocation location=OVRSpace.StorageLocation.Local, int maxResults=OVRSpaceQuery.Options.MaxUuidCount, double timeout=0.0)
Parameters
anchors: IList< OVRAnchor >  IList that will get cleared and populated with the requested anchors.
location: OVRSpace.StorageLocation  Storage location to query
maxResults: int  The maximum number of results the query can return
timeout: double  Timeout in seconds for the query.
Returns
OVRTask< bool >  Returns an OVRTask<bool> 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.
Throws
System.ArgumentNullException  Thrown if anchors is null.
FetchSharedAnchorsAsync ( groupUuid , anchors )
Loads all anchors shared with a group by its UUID.
This method is asynchronous. The returned OVRTask wrapper completes when all results are available.

In order to be loaded, the anchor must have previously been shared with the group, e.g., with ShareAsync(IEnumerable<OVRAnchor>, Guid) or ShareAsync(Guid).
Signature
static async OVRTask< TaskResult > FetchSharedAnchorsAsync(Guid groupUuid, List< OVRAnchor > anchors)
Parameters
groupUuid: Guid  The group UUID from which to load any associated shared anchors.
anchors: List< OVRAnchor >  A non-null buffer to store the loaded anchors. This container is cleared before being populated.
Returns
async OVRTask< TaskResult >  Returns an OVRResult<List<OVRAnchor>,FetchResult>, which indicates the status of the load operation, as well as returning a now-populated reference to the anchors buffer list originally provided to this call.
This result's Status will be FetchResult.FailureInvalidOption if groupUuid is Guid.Empty.
Throws
ArgumentNullException  Thrown if anchors is null.
FetchSharedAnchorsAsync ( groupUuid , allowedAnchorUuids , anchors )
Loads all anchors shared with a group by its UUID.
This method is asynchronous. The returned OVRTask wrapper completes when all results are available.

In order to be loaded, the anchor must have previously been shared with the group, e.g., with ShareAsync(IEnumerable<OVRAnchor>, Guid) or ShareAsync(Guid).
Signature
static async OVRTask< TaskResult > FetchSharedAnchorsAsync(Guid groupUuid, IEnumerable< Guid > allowedAnchorUuids, List< OVRAnchor > anchors)
Parameters
groupUuid: Guid  The group UUID from which to load any associated shared anchors.
allowedAnchorUuids: IEnumerable< Guid >  A non-null, non-empty set of known anchor UUIDs to load from the group. They will not be loaded if:
  • they never existed
  • they've been erased from cloud storage
  • they were never shared to the given groupUuid Any anchor not specified will be omitted from the results in anchors .
    The elements in this set will NOT be individually validated; you should be sure that none of them are Guid.Empty before calling this API.
anchors: List< OVRAnchor >  A non-null buffer to store the loaded anchors. This container is always cleared unless an exception is thrown.
Returns
async OVRTask< TaskResult >  Returns an OVRResult<List<OVRAnchor>,FetchResult>, which indicates the status of the load operation, as well as returning a now-populated reference to the anchors buffer list originally provided to this call.
This result's Status will be FetchResult.FailureInvalidOption if groupUuid is Guid.Empty, or allowedAnchorUuids is larger than OVRSpaceQuery.MaxResultsForAnchors.
Throws
ArgumentNullException  Thrown if either allowedAnchorUuids or anchors is null.
FetchTrackablesAsync ( anchors , trackableTypes , incrementalResultsCallback )
Fetch anchors by TrackableType.
This method queries for anchors of the given trackableTypes . This method is asynchronous; use the returned OVRTask to check for completion.
Anchors may be returned in batches. If incrementalResultsCallback is not null, then this delegate is invoked whenever results become available prior to the completion of the entire operation. New anchors are appended to anchors . The delegate receives a reference to anchors and the starting index of the anchors that have been added. The parameters are:
  • anchors: The same List provided by anchors .
  • index: The starting index of the newly available anchors
Signature
static async OVRTask< OVRResult< List< OVRAnchor >, FetchResult > > FetchTrackablesAsync(List< OVRAnchor > anchors, IEnumerable< TrackableType > trackableTypes, Action< List< OVRAnchor >, int > incrementalResultsCallback=null)
Parameters
anchors: List< OVRAnchor >  Container to store the results. The list is cleared before adding any anchors.
trackableTypes: IEnumerable< TrackableType >  The type of trackables to fetch.
incrementalResultsCallback: Action< List< OVRAnchor >, int >  (Optional) A callback invoked when incremental results are available.
Returns
async OVRTask< OVRResult< List< OVRAnchor >, FetchResult > >  Returns an OVRTask that can be used to track the asynchronous fetch.
Throws
ArgumentNullException  Thrown if anchors is null. ArgumentNullException  Thrown if trackableTypes is null.
operator!= ( lhs , rhs )
Compares two anchors for inequality.
This is the logical negation of Equals(OVRAnchor).
Signature
static bool operator!=(OVRAnchor lhs, OVRAnchor rhs)
Parameters
lhs: OVRAnchor  The anchor to compare with rhs .
rhs: OVRAnchor  The anchor to compare with lhs .
Returns
bool  Returns true if lhs is not equal to rhs , otherwise false.
operator== ( lhs , rhs )
Compares two anchors for equality.
This is the same equality test as Equals(OVRAnchor).
Signature
static bool operator==(OVRAnchor lhs, OVRAnchor rhs)
Parameters
lhs: OVRAnchor  The anchor to compare with rhs .
rhs: OVRAnchor  The anchor to compare with lhs .
Returns
bool  Returns true if lhs is equal to rhs , otherwise false.
SaveAsync ( anchors )
Save a collection of anchors.
This method persists anchors so that they may be retrieved later.
This operation is asynchronous. Use the returned OVRTask to track the result of the asynchronous operation.
Signature
static OVRTask< OVRResult< SaveResult > > SaveAsync(IEnumerable< OVRAnchor > anchors)
Parameters
anchors: IEnumerable< OVRAnchor >  A collection of anchors to persist.
Returns
OVRTask< OVRResult< SaveResult > >  Returns an awaitable OVRTask representing the asynchronous request.
ShareAsync ( anchors , users )
Share a collection of anchors with a collection of users.
This method shares a collection of anchors with a collection of users.
This operation is asynchronous. Use the returned OVRTask to track the result of the asynchronous operation.
Signature
static OVRTask< OVRResult< ShareResult > > ShareAsync(IEnumerable< OVRAnchor > anchors, IEnumerable< OVRSpaceUser > users)
Parameters
anchors: IEnumerable< OVRAnchor >  A collection of anchors to share.
users: IEnumerable< OVRSpaceUser >  A collection of users with whom anchors will be shared.
Returns
OVRTask< OVRResult< ShareResult > >  Returns an awaitable OVRTask representing the asynchronous request.
Throws
ArgumentNullException  Thrown if anchors or users are null. ArgumentException  Thrown if users count is less than one.
ShareAsync ( anchors , groupUuid )
Shares a collection of anchors to a group.
This method is asynchronous; use the returned OVRTask wrapper to be notified of completion.

The groupUuid parameter can be any valid Guid, which excludes the default value Guid, AKA Guid.Empty.
Signature
static OVRTask< OVRResult< ShareResult > > ShareAsync(IEnumerable< OVRAnchor > anchors, Guid groupUuid)
Parameters
anchors: IEnumerable< OVRAnchor >  The collection of anchors to share.
groupUuid: Guid  A UUID of a group to share the anchors with. Anchors shared to this groupUuid can be loaded by other clients via LoadUnboundSharedAnchorsAsync(Guid,List<UnboundAnchor>).
NOTE: You may arbitrarily generate your own UUIDs (e.g. with System.Guid.NewGuid), or you may use UUIDs provided by colocation APIs such as in OVRColocationSession.
Returns
OVRTask< OVRResult< ShareResult > >  Returns an OVRResult<OVRAnchor.ShareResult> indicating the status of the share operation.
Throws
ArgumentNullException  Thrown if anchors is null.

Inner Class

Tracker Class

Extends IDisposable
Represents system resources related to trackable anchors.
A "trackable" is a type of anchor that can be detected at runtime.
When you create a new Tracker, you must then "configure" it using ConfigureAsync.
When you no longer need a realtime tracker, you should disable trackers by disposing the Tracker (see Dispose).

Properties

Configuration : TrackerConfiguration
[Get]
The current configuration for this Tracker.
This property may differ from what was last requested with ConfigureAsync if one or more of the requested configuration options was not able to be satisfied. This represents the current state of the tracker.
Signature
TrackerConfiguration Configuration

Methods

ConfigureAsync ( configuration )
Configures this Tracker with the specified configuration .
It is possible for some configuration options to be satisfied while others are not, if, for example, one type of tracking is supported while another is not. In this case, ConfigureAsync will return something other than success (OVRResult<T>.Success) even though some options have been satisfied.
Configuration represents the current state of the tracker at any given time; use this to determine the current configuration.
Signature
async OVRTask< OVRResult< ConfigureTrackerResult > > ConfigureAsync(TrackerConfiguration configuration)
Parameters
configuration: TrackerConfiguration  The configuration this tracker should use.
Returns
async OVRTask< OVRResult< ConfigureTrackerResult > >  Returns an async task representing the state and eventual result of the operation.
Dispose ()
Disposes of the Tracker.
When you Dispose a Tracker, it stops tracking all trackables indicated by its Tracker.Configuration and destroys any internal resources associated with the tracker.
Signature
async void Dispose()
Returns
async void
FetchTrackablesAsync ( anchors , incrementalResultsCallback )
Fetch anchors that match the TrackableType according to the current Configuration.
This method queries for anchors may be detected according to the current Configuration.
Anchors may be returned in batches. If incrementalResultsCallback is not null, then this delegate is invoked whenever results become available prior to the completion of the entire operation. New anchors are appended to anchors . The delegate receives a reference to anchors and the starting index of the anchors that have been added. The parameters are:
  • anchors: The same List provided by anchors .
  • index: The starting index of the newly available anchors
This is similar to calling OVRAnchor.FetchTrackablesAsync(List<OVRAnchor>,IEnumerable<TrackableType>,Action<List<OVRAnchor>,int>) with an array of TrackableType. You can get the trackables associated with a TrackerConfiguration with TrackerConfiguration.GetTrackableTypes.
Signature
OVRTask< OVRResult< List< OVRAnchor >, FetchResult > > FetchTrackablesAsync(List< OVRAnchor > anchors, Action< List< OVRAnchor >, int > incrementalResultsCallback=null)
Parameters
anchors: List< OVRAnchor >  Container to store the results. The list is cleared before adding any anchors.
incrementalResultsCallback: Action< List< OVRAnchor >, int >  (Optional) A callback invoked when incremental results are available.
Returns
OVRTask< OVRResult< List< OVRAnchor >, FetchResult > >  Returns an OVRTask that can be used to track the asynchronous fetch.
Throws
ArgumentNullException  Thrown if anchors is null.

Inner Structs

FetchOptions Struct

Options for FetchAnchorsAsync(List<OVRAnchor>,FetchOptions,Action<List<OVRAnchor>, int>).
When querying for anchors (OVRAnchor) using FetchAnchorsAsync, you must provide FetchOptions to the query.
These options filter for the anchors you are interested in. If you provide a default-constructed FetchOptions, the query will return all available anchors. If you provide multiple options, the result is the logical AND of those options.
For example, if you specify an array of Uuids and a SingleComponentType, then the result will be anchors that match any of those UUIDs that also support that component type.
Note that the fields prefixed with Single are the same as providing an array of length 1. This is useful in the common cases of retrieving a single anchor by UUID, or querying for all anchors of a single component type, without having to allocate a managed array to hold that single element.
For example, these two are equivalent queries:
async void FetchByUuid(Guid uuid) {
  var options1 = new OVRAnchor.FetchOptions {
    SingleUuid = uuid
  };

  var options2 = new OVRAnchor.FetchOptions {
    Uuids = new Guid[] { uuid }
  };

  // Both options1 and options2 will perform the same query and return the same result
  var result1 = await OVRAnchor.FetchAnchorsAsync(new List<OVRAnchor>(), options1);
  var result2 = await OVRAnchor.FetchAnchorsAsync(new List<OVRAnchor>(), options2);

  Debug.Assert(result1.Status == result2.Status);
  if (result1.Success)
  {
      Debug.Assert(result1.Value.SequenceEqual(result2.Value));
  }
}

Fields

ComponentTypes : IEnumerable< Type >
Fetch anchors that support a given set of component types.
Each anchor supports one or more anchor types (types that implemented IOVRAnchorComponent<T>).
If not null, ComponentTypes must be a collection of types that implement IOVRAnchorComponent<T>, e.g., OVRBounded2D or OVRRoomLayout.
When multiple components are specified, all anchors that support any of those types are returned, i.e., the component types are OR'd together to determine whether an anchor matches.
If you only have a single component type, you can use SingleComponentType to avoid having to create a temporary container of length one.
Signature
IEnumerable<Type> ComponentTypes
SingleComponentType : Type
Fetch anchors that support a given component type.
Each anchor supports one or more anchor types (types that implemented IOVRAnchorComponent<T>).
If not null, SingleComponentType must be a type that implements IOVRAnchorComponent<T>, e.g., OVRBounded2D or OVRRoomLayout.
If you have multiple component types, use ComponentTypes instead.
Signature
Type SingleComponentType
SingleUuid : Guid?
A UUID of an existing anchor to fetch.
Set this to fetch a single anchor with by UUID. If you want to fetch multiple anchors by UUID, use Uuids.
Signature
Guid? SingleUuid
Uuids : IEnumerable< Guid >
A collection of UUIDS to fetch.
If you want to retrieve only a single UUID, you can SingleUuid to avoid having to create a temporary container of length one.
NOTE: Only the first 50 anchors are processed by OVRAnchor.FetchAnchorsAsync(System.Collections.Generic.List<OVRAnchor>,OVRAnchor.FetchOptions,System.Action<System.Collections.Generic.List<OVRAnchor>,int>)
Signature
IEnumerable<Guid> Uuids

TrackerConfiguration Struct

Extends IEquatable< TrackerConfiguration >
Represents a configuration for a Tracker.
A configuration is used to indicate what types of trackables you'd like the Tracker to track.
Configure a Tracker by calling Tracker.ConfigureAsync, or o get a tracker's current configuration using Tracker.Configuration.

Properties

KeyboardTrackingEnabled : bool
[Get][Set]
The Tracker should track keyboards.
When true, a Tracker should attempt to track physical keyboards in the real environment.
Not all devices support keyboard tracking. You can test for keyboard tracking support with KeyboardTrackingSupported.
Signature
bool KeyboardTrackingEnabled
KeyboardTrackingSupported : bool
[Get]
Whether keyboard tracking is supported.
Use this to test for keyboard tracking support before calling Tracker.ConfigureAsync with KeyboardTrackingEnabled set to true.
Signature
bool KeyboardTrackingSupported
QRCodeTrackingEnabled : bool
[Get][Set]
Whether QR code tracking should be enabled.
Signature
bool QRCodeTrackingEnabled
QRCodeTrackingSupported : bool
[Get]
(Obsolete) Whether the QR Code tracking is supported by the runtime.
Use this to test for QR Code tracking support before calling Tracker.ConfigureAsync with QRCodeTrackingEnabled set to true.
Signature
bool QRCodeTrackingSupported

Methods

Equals ( other )
Determines whether two TrackerConfiguration instances are equal.
Signature
bool Equals(TrackerConfiguration other)
Parameters
other: TrackerConfiguration  The other TrackerConfiguration to compare with this one.
Returns
bool  Returns true if other is equal to this one; otherwise, false.
Equals ( obj )
Determines whether an object is equal to this TrackerConfiguration.
Signature
override bool Equals(object obj)
Parameters
obj: object  The object to compare with this TrackerConfiguration.
Returns
override bool  Returns true if obj is an instance of an TrackerConfiguration and is equal to this one; otherwise, false.
GetHashCode ()
Gets a hashcode for this TrackerConfiguration.
This method allows the TrackerConfiguration to be used as a key in a HashSet<T> or Dictionary<TKey,TValue>.
Signature
override int GetHashCode()
Returns
override int  Returns a hash code for this TrackerConfiguration.
GetTrackableTypes ( trackableTypes )
Gets the collection of TrackableTypes implied by this configuration.
This method provides the types of trackables that this configuration would enable. Use this in conjunction with OVRAnchor.TrackableType and OVRAnchor.FetchAnchorsAsync(System.Collections.Generic.List<OVRAnchor>,OVRAnchor.FetchOptions,System.Action<System.Collections.Generic.List<OVRAnchor>,int>)
Signature
void GetTrackableTypes(List< TrackableType > trackableTypes)
Parameters
trackableTypes: List< TrackableType >  The list of TrackableType to populate. The list is cleared before adding any elements.
Returns
void
Throws
ArgumentNullException  Thrown if trackableTypes is null.
ToString ()
Generates a string representation of this TrackerConfiguration.
The returned string is intended for debugging purposes. It indicates which of the requested features are enabled and takes the form
TrackerConfiguration<Option1=Value1, Option2=Value2, ...>
Signature
override string ToString()
Returns
override string  Returns a string representation of this TrackerConfiguration.

Static Methods

operator!= ( lhs , rhs )
Determines whether two TrackerConfiguration instances are not equal.
This is the same as comparing lhs with rhs using Equals(TrackerConfiguration) and negating the result.
Signature
static bool operator!=(TrackerConfiguration lhs, TrackerConfiguration rhs)
Parameters
lhs: TrackerConfiguration  The TrackerConfiguration to compare with rhs .
rhs: TrackerConfiguration  The TrackerConfiguration to compare with lhs .
Returns
bool  Returns false if lhs is equal to rhs ; otherwise, true.
operator== ( lhs , rhs )
Determines whether two TrackerConfiguration instances are equal.
This is the same as comparing lhs with rhs using Equals(TrackerConfiguration).
Signature
static bool operator==(TrackerConfiguration lhs, TrackerConfiguration rhs)
Parameters
lhs: TrackerConfiguration  The TrackerConfiguration to compare with rhs .
rhs: TrackerConfiguration  The TrackerConfiguration to compare with lhs .
Returns
bool  Returns true if lhs is equal to rhs ; otherwise, false.

Inner Enums

SaveResult Enum

Possible results of a save operation.
Saving an anchor is an asynchronous operation that can fail for a number of reasons, enumerated here.

Enumeration Constants

MemberValueDescription
Success
Result.Success
The operation succeeded.
Failure
Result.Failure
The operation failed in an unexpected way.
FailureInvalidAnchor
Result.Failure_HandleInvalid
At least one anchor is invalid. An OVRAnchor is invalid if it is default constructed, which is often the case before an OVRSpatialAnchor gets properly bound, or before it has a chance to invoke its Start() method.
FailureDataIsInvalid
Result.Failure_DataIsInvalid
Typically indicates an uninitialized OVRResult, or a pending OVRTask which expected to have internal result data of a specific type set.
FailureInsufficientResources
Result.Failure_SpaceInsufficientResources
Resource limitation prevented this operation from executing. Recommend retrying, perhaps after a short delay and/or reducing memory consumption.
FailureStorageAtCapacity
Result.Failure_SpaceStorageAtCapacity
The amount of device storage available for anchor data is insufficient for the requested save operation. You can request that the user frees up space on their device, or your app can attempt to free up unused space / anchors under its control before retrying. You may also find partial success saving anchors in smaller batches, if not individually. However, anchors do have a relatively small disk footprint, typically occupying a single 4 kibibyte block per each.
FailureInsufficientView
Result.Failure_SpaceInsufficientView
Device's view of the physical space is insufficient. The user needs to look around the environment more for anchor tracking to function.
FailurePermissionInsufficient
Result.Failure_SpacePermissionInsufficient
User has not granted all the required permissions for the app to use this API. You should confirm the status of the permission(s) needed for using anchor APIs, namely:
  • "com.oculus.permission.USE_ANCHOR_API"
This is handled by checking that your OculusProjectConfig asset enables "Anchor Support", and by subsequently running the Unity menu bar item "Meta > Tools > Update AndroidManifest.xml".
FailureRateLimited
Result.Failure_SpaceRateLimited
Operation canceled due to rate limiting. Your app is sending too many requests in a short amount of time. You should ensure that your request logic is well-formed and the number of outgoing requests is in range of what you expect. If everything is as you intended, it is recommended that you retry FailureRateLimited request(s) after several seconds of delay.
FailureTooDark
Result.Failure_SpaceTooDark
The environment is too dark to save the anchor.
FailureTooBright
Result.Failure_SpaceTooBright
The environment is too bright to save the anchor.
FailureUnsupported
Result.Failure_Unsupported
Save is not supported on this version or platform.
FailurePersistenceNotEnabled
Result.Failure_SpaceComponentNotEnabled
One or more anchors do not have the OVRStorable component enabled, causing the save operation to fail.

EraseResult Enum

Possible results of an erase operation.
Saving an anchor is an asynchronous operation that can fail for a number of reasons, enumerated here.

Enumeration Constants

MemberValueDescription
Success
Result.Success
The operation succeeded.
Failure
Result.Failure
The operation failed in an unexpected way.
FailureInvalidAnchor
Result.Failure_HandleInvalid
At least one anchor is invalid. An OVRAnchor is invalid if it is default constructed, which is often the case before an OVRSpatialAnchor gets properly bound, or before it has a chance to invoke its Start() method.
FailureDataIsInvalid
Result.Failure_DataIsInvalid
Typically indicates an uninitialized OVRResult, or a pending OVRTask which expected to have internal result data of a specific type set.
FailureInsufficientResources
Result.Failure_SpaceInsufficientResources
Resource limitation prevented this operation from executing. Recommend retrying, perhaps after a short delay and/or reducing memory consumption.
FailurePermissionInsufficient
Result.Failure_SpacePermissionInsufficient
User has not granted all the required permissions for the app to use this API. You should confirm the status of the permission(s) needed for using anchor APIs, namely:
  • "com.oculus.permission.USE_ANCHOR_API"
This is handled by checking that your OculusProjectConfig asset enables "Anchor Support", and by subsequently running the Unity menu bar item "Meta > Tools > Update AndroidManifest.xml".
FailureRateLimited
Result.Failure_SpaceRateLimited
Operation canceled due to rate limiting. Your app is sending too many requests in a short amount of time. You should ensure that your request logic is well-formed and the number of outgoing requests is in range of what you expect. If everything is as you intended, it is recommended that you retry FailureRateLimited request(s) after several seconds of delay.
FailureUnsupported
Result.Failure_Unsupported
Erase is not supported on this version or platform.
FailurePersistenceNotEnabled
Result.Failure_SpaceComponentNotEnabled
One or more anchors do not have the OVRStorable component enabled, causing the erase operation to fail.

FetchResult Enum

Possible results of a fetch operation.
Use OVRAnchor.FetchAnchorsAsync(System.Collections.Generic.List<OVRAnchor>,OVRAnchor.FetchOptions,System.Action<System.Collections.Generic.List<OVRAnchor>,int>) to query for anchors. When that operation completes, use the resulting status code to determine whether the operation succeeded, or why it failed.

Enumeration Constants

MemberValueDescription
Success
Result.Success
The operation succeeded.
Failure
Result.Failure
The operation failed in an unexpected way.
FailureDataIsInvalid
Result.Failure_DataIsInvalid
Typically indicates an uninitialized OVRResult, or a pending OVRTask which expected to have internal result data set.
FailureInvalidOption
Result.Failure_InvalidParameter
One of the FetchOptions was invalid. This can happen, for example, if you query for an invalid component type, or if you try requesting more than OVRSpaceQuery.MaxResultsForAnchors anchors in a single call.
FailureInsufficientResources
Result.Failure_SpaceInsufficientResources
Resource limitation prevented this operation from executing. Recommend retrying, perhaps after a short delay and/or reducing memory consumption.
FailureInsufficientView
Result.Failure_SpaceInsufficientView
Device's view of the physical space is insufficient. The user needs to look around the environment more for anchor tracking to function.
FailurePermissionInsufficient
Result.Failure_SpacePermissionInsufficient
User has not granted all the required permissions for the app to use this API. You should confirm the status of the permission(s) needed for using anchor APIs, namely:
  • "com.oculus.permission.USE_ANCHOR_API"
  • "com.oculus.permission.IMPORT_EXPORT_IOT_MAP_DATA" (only required for fetching shared anchors)
This is handled by checking that your OculusProjectConfig asset enables "Anchor Support" and/or "Anchor and Space Sharing Support", and by subsequently running the Unity menu bar item "Meta > Tools > Update AndroidManifest.xml".
FailureRateLimited
Result.Failure_SpaceRateLimited
Operation canceled due to rate limiting. Your app is sending too many requests in a short amount of time. You should ensure that your request logic is well-formed and the number of outgoing requests is in range of what you expect. If everything is as you intended, it is recommended that you retry FailureRateLimited request(s) after several seconds of delay.
FailureTooDark
Result.Failure_SpaceTooDark
The environment is too dark to load anchors.
FailureTooBright
Result.Failure_SpaceTooBright
The environment is too bright to load anchors.
FailureUnsupported
Result.Failure_Unsupported
Fetch is not supported in this version or on this platform.

ShareResult Enum

Possible results of a share operation.
Sharing an anchor is an asynchronous operation that can fail for a number of reasons, enumerated here.

Enumeration Constants

MemberValueDescription
Success
Result.Success
The operation succeeded.
Failure
Result.Failure
The operation failed in an unexpected way.
FailureOperationFailed
Result.Failure_OperationFailed
The operation failed for unspecified reasons. Although distinct from FailureInvalidParameter, this result can often indicate something is wrong with your input parameters; the OVR backend was unable to distinguish this.
FailureInvalidParameter
Result.Failure_InvalidParameter
API call was given an invalid parameter. Try ensuring that any System.Guid parameters are not Guid.Empty (aka default), and that any IEnumerable<T> collections are not empty.
FailureHandleInvalid
Result.Failure_HandleInvalid
One or more invalid handles were provided to the API. This usually refers to anchor handles. An OVRAnchor is invalid if it is default constructed, which is often the case before an OVRSpatialAnchor gets properly bound, or before it has a chance to invoke its Start() method.
FailureDataIsInvalid
Result.Failure_DataIsInvalid
Typically indicates an uninitialized OVRResult, or a pending OVRTask which expected to have internal result data of a specific type set.
FailureNetworkTimeout
Result.Failure_SpaceNetworkTimeout
A network timeout occurred. Ensure your network connectivity is stable, and check that you aren't being blocked or limited by firewalls, custom DNS, VPN, etc.
FailureNetworkRequestFailed
Result.Failure_SpaceNetworkRequestFailed
Network request failed. Recommend ensuring network connectivity.
FailureMappingInsufficient
Result.Failure_SpaceMappingInsufficient
The device has not built a sufficient map of the environment to save the anchor(s). Users should move and look around their space some more, and ensure their environment is sufficiently lit, before retrying.
FailureLocalizationFailed
Result.Failure_SpaceLocalizationFailed
The device was not able to localize the anchor(s) being shared. Make sure that the OVRLocatable component has been added and enabled on this anchor before attempting to share.
FailureSharableComponentNotEnabled
Result.Failure_SpaceComponentNotEnabled
Sharable component not enabled on the anchor(s) being shared. Make sure that the OVRSharable component has been added and enabled on this anchor before attempting to share.
FailureCloudStorageDisabled
Result.Failure_SpaceCloudStorageDisabled
Sharing failed because the user has not enabled the "Share Point Cloud Data" setting. Users can enable this setting in OS Settings > Privacy and Safety > Device Permissions > Share Point Cloud Data.

Once per app launch, the OS may also attempt to provide users a permission request popup over your app when this result is about to be returned. If the user acquiesces, Success would be returned instead of FailureCloudStorageDisabled once your app regains focus.
FailurePermissionInsufficient
Result.Failure_SpacePermissionInsufficient
User has not granted all the required permissions for the app to use this API. You should confirm the status of the permission(s) needed for using anchor APIs, namely:
  • "com.oculus.permission.USE_ANCHOR_API"
  • "com.oculus.permission.IMPORT_EXPORT_IOT_MAP_DATA" (required for sharing)
This is handled by checking that your OculusProjectConfig asset enables "Anchor and Space Sharing Support", and by subsequently running the Unity menu bar item "Meta > Tools > Update AndroidManifest.xml".
FailureUnsupported
Result.Failure_Unsupported
Anchor Sharing is not supported with this version or on this platform.

TrackableType Enum

The type of trackable associated with an anchor, if applicable.
A "trackable" is an OVRAnchor that can be detected at runtime.
Use OVRAnchor.GetTrackableType to determine an anchor's trackable type.

Enumeration Constants

MemberDescription
None
The anchor is not a trackable.
Keyboard
The anchor is a tracked keyboard.
QRCode
The anchor is a QR Code.

ConfigureTrackerResult Enum

The result of Tracker.ConfigureAsync.
Configuring an anchor tracker using Tracker.ConfigureAsync is an asynchronous operation that can fail for a number of reasons, enumerated here.
If any part of the requested TrackerConfiguration cannot be satisfied, then Tracker.ConfigureAsync will return something other than Success, even though some aspects may have succeeded.

Enumeration Constants

MemberValueDescription
Success
Result.Success
The tracker was configured successfully.
Failure
Result.Failure
Tracker configuration failed unexpectedly.
Invalid
Result.Failure_DataIsInvalid
The OVRResult does not represent a valid result.
NotSupported
Result.Failure_Unsupported
A configuration is not supported.