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

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

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.
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>)
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.
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.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon