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));
}
}