Created
: bool
[Get] |
Whether the spatial anchor is created.
Creation is asynchronous and may take several frames. If creation fails, the component is destroyed.
Signature
bool OVRSpatialAnchor.Created |
Localized
: bool
[Get] |
Whether the spatial anchor is localized.
When you create a new spatial anchor, it may take a few frames before it is localized. Once localized, its transform updates automatically.
Signature
bool OVRSpatialAnchor.Localized |
OnLocalize
: Action< OperationResult > |
Event that is dispatched when the anchor is localized.
If the anchor is already localized when a subscriber is added, the subscriber is invoked immediately.
Consider WhenLocalizedAsync for a more flexible way to await anchor localization.
Signature
Action<OperationResult> OVRSpatialAnchor.OnLocalize |
PendingCreation
: bool
[Get] |
Checks whether the spatial anchor is pending creation.
Signature
bool OVRSpatialAnchor.PendingCreation |
Space
: OVRSpace
[Get] |
The space associated with the spatial anchor.
NOTE: This property is obsolete. This class provides all spatial anchor functionality and it should not be necessary to use this low-level handle directly. See SaveAsync(), ShareAsync(OVRSpaceUser), and EraseAsync().
The OVRSpace represents the runtime instance of the spatial anchor and will change across different sessions.
Signature
OVRSpace OVRSpatialAnchor.Space |
Uuid
: Guid
[Get] |
The UUID associated with the spatial anchor.
UUIDs persist across sessions. If you load a persisted anchor, you can use the UUID to identify it.
Signature
Guid OVRSpatialAnchor.Uuid |
Erase
(
onComplete
)
|
(Obsolete) Erases the OVRSpatialAnchor from persistent storage.
DeprecatedThis method is obsolete. Use EraseAsync(). To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
This method is asynchronous. Use onComplete to be notified of completion. Erasing an OVRSpatialAnchor does not destroy the anchor.
Signature
void OVRSpatialAnchor.Erase(Action< OVRSpatialAnchor, bool > onComplete=null) Parameters onComplete: Action< OVRSpatialAnchor, bool >Â
Invoked when the erase operation completes. May be null. Parameters are
Returns void |
Erase
(
eraseOptions
, onComplete
)
|
(Obsolete) Erases the OVRSpatialAnchor from specified storage.
DeprecatedThis method is obsolete. Use EraseAsync(EraseOptions). To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
This method is asynchronous. Use onComplete to be notified of completion. Erasing an OVRSpatialAnchor does not destroy the anchor.
Signature
void OVRSpatialAnchor.Erase(EraseOptions eraseOptions, Action< OVRSpatialAnchor, bool > onComplete=null) Parameters eraseOptions: EraseOptionsÂ
Options how the anchor should be erased.
onComplete: Action< OVRSpatialAnchor, bool >Â
Invoked when the erase operation completes. May be null. Parameters are
Returns void |
EraseAnchorAsync
()
|
Erase the anchor from persistent storage.
This operation is asynchronous. Use the returned OVRTask<TResult> to track the result of the asynchronous operation.
NOTE: If you have a collection of anchors to save, it is more efficient to use EraseAnchorsAsync.
Signature
OVRTask< OVRResult< OVRAnchor.EraseResult > > OVRSpatialAnchor.EraseAnchorAsync() Returns OVRTask< OVRResult< OVRAnchor.EraseResult > >Â
An awaitable OVRTask<TResult> representing the asynchronous erase operation.
|
EraseAsync
()
|
(Obsolete) Erases the OVRSpatialAnchor from specified storage.
DeprecatedThis method is obsolete. Use EraseAnchorAsync instead.
This method is asynchronous; use the returned OVRTask<TResult> to be notified of completion. Erasing an OVRSpatialAnchor does not destroy the anchor.
Signature
OVRTask< bool > OVRSpatialAnchor.EraseAsync() Returns OVRTask< bool >Â
An OVRTask<TResult> with a boolean type parameter indicating the success of the erase operation.
|
EraseAsync
(
eraseOptions
)
|
(Obsolete) Erases the OVRSpatialAnchor from specified storage.
DeprecatedThis method is obsolete. Use EraseAnchorAsync instead.
This method is asynchronous; use the returned OVRTask<TResult> to be notified of completion. Erasing an OVRSpatialAnchor does not destroy the anchor.
Signature
OVRTask< bool > OVRSpatialAnchor.EraseAsync(EraseOptions eraseOptions) Parameters eraseOptions: EraseOptionsÂ
Options for how the anchor should be erased.
Returns OVRTask< bool >Â
An OVRTask<TResult> with a boolean type parameter indicating the success of the erase operation.
|
InitializeFromExisting
(
space
, uuid
)
|
(Obsolete) Initializes this component from an existing space handle and uuid, e.g., the result of a call to OVRPlugin.QuerySpaces.
DeprecatedThis method is obsolete. To create a new anchor, use
AddComponent<OVRSpatialAnchor>()
. To load a previously saved anchor, use LoadUnboundAnchorsAsync.
This method associates the component with an existing spatial anchor, for example, the one that was saved in a previous session. Do not call this method to create a new spatial anchor.
If you call this method, you must do so prior to the component's Start method. You cannot change the spatial anchor associated with this component after that.
Signature
void OVRSpatialAnchor.InitializeFromExisting(OVRSpace space, Guid uuid) Parameters Returns voidThrows InvalidOperationExceptionÂ
Thrown if Start has already been called on this component.
ArgumentExceptionÂ
Thrown if space is not OVRSpace.Valid.
|
Save
(
onComplete
)
|
(Obsolete) Saves the OVRSpatialAnchor to local persistent storage.
DeprecatedThis method is obsolete. Use SaveAsync() instead. To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
This method is asynchronous. Use onComplete to be notified of completion.
When saved, an OVRSpatialAnchor can be loaded by a different session. Use the Uuid to identify the same OVRSpatialAnchor at a future time.
This operation fully succeeds or fails, which means, either all anchors are successfully saved, or the operation fails.
Signature
void OVRSpatialAnchor.Save(Action< OVRSpatialAnchor, bool > onComplete=null) Parameters onComplete: Action< OVRSpatialAnchor, bool >Â
Invoked when the save operation completes. May be null. Parameters are
Returns void |
Save
(
saveOptions
, onComplete
)
|
(Obsolete) Saves the OVRSpatialAnchor with specified SaveOptions.
DeprecatedThis method is obsolete. Use SaveAsync() instead. To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
This method is asynchronous. Use onComplete to be notified of completion. When saved, the OVRSpatialAnchor can be loaded by a different session. Use the Uuid to identify the same OVRSpatialAnchor at a future time.
This operation fully succeeds or fails; that is, either all anchors are successfully saved, or the operation fails.
Signature
void OVRSpatialAnchor.Save(SaveOptions saveOptions, Action< OVRSpatialAnchor, bool > onComplete=null) Parameters saveOptions: SaveOptionsÂ
Save options, e.g., whether local or cloud.
onComplete: Action< OVRSpatialAnchor, bool >Â
Invoked when the save operation completes. May be null. Parameters are
Returns void |
SaveAnchorAsync
()
|
Saves this anchor to persistent storage.
This operation is asynchronous. Use the returned OVRTask<TResult> to track the result of the asynchronous operation.
When saved, an OVRSpatialAnchor can be loaded by a different session. Use the Uuid to identify the same OVRSpatialAnchor at a future time.
NOTE: If you have a collection of anchors to save, it is more efficient to use SaveAnchorsAsync.
Signature
OVRTask< OVRResult< OVRAnchor.SaveResult > > OVRSpatialAnchor.SaveAnchorAsync() Returns OVRTask< OVRResult< OVRAnchor.SaveResult > >Â
An awaitable OVRTask<TResult> representing the asynchronous save operation.
|
SaveAsync
()
|
(Obsolete) Saves the OVRSpatialAnchor with specified SaveOptions.
DeprecatedThis method is obsolete. Use SaveAnchorAsync instead.
This method is asynchronous; use the returned OVRTask<TResult> to be notified of completion. When saved, the OVRSpatialAnchor can be loaded by a different session. Use the Uuid to identify the same OVRSpatialAnchor at a future time.
This operation fully succeeds or fails; that is, either all anchors are successfully saved, or the operation fails.
Signature
OVRTask< bool > OVRSpatialAnchor.SaveAsync() Returns OVRTask< bool >Â
An OVRTask<TResult> with a boolean type parameter indicating the success of the save operation.
|
SaveAsync
(
saveOptions
)
|
(Obsolete) Saves the OVRSpatialAnchor with specified SaveOptions.
DeprecatedThis method is obsolete. Use SaveAnchorAsync instead.
This method is asynchronous; use the returned OVRTask<TResult> to be notified of completion. When saved, the OVRSpatialAnchor can be loaded by a different session. Use the Uuid to identify the same OVRSpatialAnchor at a future time.
This operation fully succeeds or fails; that is, either all anchors are successfully saved, or the operation fails.
Signature
OVRTask< bool > OVRSpatialAnchor.SaveAsync(SaveOptions saveOptions) Parameters saveOptions: SaveOptionsÂ
Options for how the anchor will be saved.
Returns OVRTask< bool >Â
An OVRTask<TResult> with a boolean type parameter indicating the success of the save operation.
|
Share
(
user
, onComplete
)
|
(Obsolete) Shares the anchor to an OVRSpaceUser.
The specified user will be able to download, track, and share specified anchors.
DeprecatedThis method is obsolete. Use ShareAsync(OVRSpaceUser) instead. To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
This method is asynchronous. Use onComplete to be notified of completion.
Signature
void OVRSpatialAnchor.Share(OVRSpaceUser user, Action< OperationResult > onComplete=null) Parameters onComplete: Action< OperationResult >Â
Invoked when the share operation completes. May be null. Delegate parameter is
Returns void |
Share
(
user1
, user2
, onComplete
)
|
(Obsolete) Shares the anchor with two OVRSpaceUser.
Specified users will be able to download, track, and share specified anchors.
DeprecatedThis method is obsolete. Use ShareAsync(OVRSpaceUser, OVRSpaceUser) instead. To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
This method is asynchronous. Use onComplete to be notified of completion.
Signature
void OVRSpatialAnchor.Share(OVRSpaceUser user1, OVRSpaceUser user2, Action< OperationResult > onComplete=null) Parameters onComplete: Action< OperationResult >Â
Invoked when the share operation completes. May be null. Delegate parameter is
Returns void |
Share
(
user1
, user2
, user3
, onComplete
)
|
(Obsolete) Shares the anchor with three OVRSpaceUser.
Specified users will be able to download, track, and share specified anchors.
DeprecatedThis method is obsolete. Use ShareAsync(OVRSpaceUser, OVRSpaceUser, OVRSpaceUser) instead. To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
This method is asynchronous. Use onComplete to be notified of completion.
Signature
void OVRSpatialAnchor.Share(OVRSpaceUser user1, OVRSpaceUser user2, OVRSpaceUser user3, Action< OperationResult > onComplete=null) Parameters onComplete: Action< OperationResult >Â
Invoked when the share operation completes. May be null. Delegate parameter is
Returns void |
Share
(
user1
, user2
, user3
, user4
, onComplete
)
|
(Obsolete) Shares the anchor with four OVRSpaceUser.
Specified users will be able to download, track, and share specified anchors.
DeprecatedThis method is obsolete. Use ShareAsync(OVRSpaceUser, OVRSpaceUser, OVRSpaceUser, OVRSpaceUser) instead. To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
This method is asynchronous. Use onComplete to be notified of completion.
Signature
void OVRSpatialAnchor.Share(OVRSpaceUser user1, OVRSpaceUser user2, OVRSpaceUser user3, OVRSpaceUser user4, Action< OperationResult > onComplete=null) Parameters onComplete: Action< OperationResult >Â
Invoked when the share operation completes. May be null. Delegate parameter is
Returns void |
Share
(
users
, onComplete
)
|
(Obsolete) Shares the anchor to a collection of OVRSpaceUser.
Specified users will be able to download, track, and share specified anchors.
DeprecatedThis method is obsolete. Use ShareAsync(IEnumerable<OVRSpaceUser>). To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
This method is asynchronous. Use onComplete to be notified of completion.
Signature
void OVRSpatialAnchor.Share(IEnumerable< OVRSpaceUser > users, Action< OperationResult > onComplete=null) Parameters onComplete: Action< OperationResult >Â
Invoked when the share operation completes. May be null. Delegate parameter is
Returns void |
ShareAsync
(
user
)
|
Shares the anchor to an OVRSpaceUser.
The specified user will be able to download, track, and share specified anchors.
This method is asynchronous; use the returned OVRTask<TResult> to be notified of completion.
Signature
OVRTask< OperationResult > OVRSpatialAnchor.ShareAsync(OVRSpaceUser user) Parameters Returns OVRTask< OperationResult >Â
An OVRTask<TResult> with a OperationResult type parameter indicating the success of the share operation.
|
ShareAsync
(
user1
, user2
)
|
Shares the anchor to an OVRSpaceUser.
The specified user will be able to download, track, and share specified anchors.
This method is asynchronous; use the returned OVRTask<TResult> to be notified of completion.
Signature
OVRTask< OperationResult > OVRSpatialAnchor.ShareAsync(OVRSpaceUser user1, OVRSpaceUser user2) Parameters Returns OVRTask< OperationResult >Â
An OVRTask<TResult> with a OperationResult type parameter indicating the success of the share operation.
|
ShareAsync
(
user1
, user2
, user3
)
|
Shares the anchor to an OVRSpaceUser.
The specified user will be able to download, track, and share specified anchors.
This method is asynchronous; use the returned OVRTask<TResult> to be notified of completion.
Signature
OVRTask< OperationResult > OVRSpatialAnchor.ShareAsync(OVRSpaceUser user1, OVRSpaceUser user2, OVRSpaceUser user3) Parameters Returns OVRTask< OperationResult >Â
An OVRTask<TResult> with a OperationResult type parameter indicating the success of the share operation.
|
ShareAsync
(
user1
, user2
, user3
, user4
)
|
Shares the anchor to an OVRSpaceUser.
The specified user will be able to download, track, and share specified anchors.
This method is asynchronous; use the returned OVRTask<TResult> to be notified of completion.
Signature
OVRTask< OperationResult > OVRSpatialAnchor.ShareAsync(OVRSpaceUser user1, OVRSpaceUser user2, OVRSpaceUser user3, OVRSpaceUser user4) Parameters Returns OVRTask< OperationResult >Â
An OVRTask<TResult> with a OperationResult type parameter indicating the success of the share operation.
|
ShareAsync
(
users
)
|
Shares the anchor to an OVRSpaceUser.
The specified user will be able to download, track, and share specified anchors.
This method is asynchronous; use the returned OVRTask<TResult> to be notified of completion.
Signature
OVRTask< OperationResult > OVRSpatialAnchor.ShareAsync(IEnumerable< OVRSpaceUser > users) Parameters Returns OVRTask< OperationResult >Â
An OVRTask<TResult> with a OperationResult type parameter indicating the success of the share operation.
|
WhenCreatedAsync
()
|
Creates an async task that completes when Created becomes True.
Anchor creation is asynchronous, and adding this component to a GameObject will start the creation operation. You can use this async method to await the creation from another async method.
This allows you to write code like this:
async Task<OVRSpatialAnchor> CreateAnchor(GameObject gameObject) {
var anchor = gameObject.AddComponent<OVRSpatialAnchor>();
await anchor.WhenCreatedAsync();
return anchor;
}
Signature
async OVRTask< bool > OVRSpatialAnchor.WhenCreatedAsync() Returns async OVRTask< bool >Â
A task-like object that can be used to track the completion of the creation. If creation succeeds, the result of the task is True, otherwise False.
|
WhenLocalizedAsync
()
|
Async method that completes when localization completes.
Localization occurs automatically, but the process may take some time. After creating a new OVRSpatialAnchor, you can await this method from within another async method to pause execution until the anchor has been localized.
If the localization operation has already completed, this method returns immediately.
The bool result of the returned OVRTask<TResult> indicates whether localization was successful.
To create a new spatial anchor and wait until it is both created and localized, you can use code like this:
async Task<OVRSpatialAnchor> CreateAnchor(GameObject gameObject) {
var anchor = gameObject.AddComponent<OVRSpatialAnchor>();
await anchor.WhenLocalizedAsync();
return anchor; // anchor is localized and ready to use
}
Signature
async OVRTask< bool > OVRSpatialAnchor.WhenLocalizedAsync() Returns async OVRTask< bool >Â
A task-like object that can be used to track the completion of the asynchronous localization operation.
|
EraseAnchorsAsync
(
anchors
, uuids
)
|
Erase a collection of anchors from persistent storage.
This operation is asynchronous. Use the returned OVRTask<TResult> to track the result of the asynchronous operation.
The total number of anchors (anchors and uuids ) may not exceed 32.
Signature
static OVRTask< OVRResult< OVRAnchor.EraseResult > > OVRSpatialAnchor.EraseAnchorsAsync(IEnumerable< OVRSpatialAnchor > anchors, IEnumerable< Guid > uuids) Parameters uuids: IEnumerable< Guid >Â
(Optional) The UUIDs to erase
Returns OVRTask< OVRResult< OVRAnchor.EraseResult > >Â
An awaitable OVRTask<TResult> representing the asynchronous erase operation.
Throws ArgumentExceptionÂ
Thrown if anchors and uuids are both null.
ArgumentExceptionÂ
Thrown if the combined number of anchors and uuids is greater than 32.
|
FromOVRAnchor
(
anchor
, unboundAnchor
)
|
Create an unbound spatial anchor from an OVRAnchor.
Only spatial anchors retrieved as OVRAnchors should use this method. Using this function on system-managed scene anchors will succeed, but certain functions will not work.
Signature
static bool OVRSpatialAnchor.FromOVRAnchor(OVRAnchor anchor, out UnboundAnchor unboundAnchor) Parameters Returns boolÂ
True if anchor is localizable and is not already bound to an OVRSpatialAnchor, otherwise false.
|
LoadUnboundAnchors
(
options
, onComplete
)
|
(Obsolete) Performs a query for anchors with the specified options .
DeprecatedThis method is obsolete. Use LoadUnboundAnchorsAsync. To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
Use this method to find anchors that were previously persisted with Save(Action<OVRSpatialAnchor, bool>. The query is asynchronous; when the query completes, onComplete is invoked with an array of UnboundAnchors for which tracking may be requested.
onComplete is invoked with null.
Signature
static bool OVRSpatialAnchor.LoadUnboundAnchors(LoadOptions options, Action< UnboundAnchor[]> onComplete) Parameters options: LoadOptionsÂ
Options that affect the query.
onComplete: Action< UnboundAnchor[]>Â
A delegate invoked when the query completes. The delegate accepts one argument:
Returns boolÂ
Returns true if the operation could be initiated; otherwise false.
Throws ArgumentNullExceptionÂ
Thrown if onComplete is null.
InvalidOperationExceptionÂ
Thrown if LoadOptions.Uuids of options is null.
|
LoadUnboundAnchorsAsync
(
uuids
, unboundAnchors
, onIncrementalResultsAvailable
)
|
Loads up to 50 unbound anchors with specified UUIDs.
An UnboundAnchor is an anchor that exists, but that isn't managed by an OVRSpatialAnchor. Use this method to load a collection of anchors by UUID that haven't already been bound to an OVRSpatialAnchor.
In order to be loaded, the anchor must have previously been persisted, e.g., with SaveAnchorsAsync.
NOTE: This method will only process the first 50 UUIDs provided by uuids .
This method is asynchronous. The returned OVRTask<TResult> completes when all results are available. However, anchors may be loaded in batches. To be notified as the results of individual batches are loaded, provide an onIncrementalResultsAvailable callback. The callback accepts two parameters:
(List<UnboundAnchor> unboundAnchors, int startingIndex)
Before the task completes, it is undefined behavior to access unboundAnchors outside of onIncrementalResultsAvailable invocations.
Note that if you bind an UnboundAnchor in the onIncrementalResultsAvailable callback, that same anchor will no longer be present in the unboundAnchors provided to future incremental results, or after the task completes. That is, an UnboundAnchor is removed from the list of unboundAnchors once it is bound.
unboundAnchors is the buffer used to store the results. This allows you to reuse the same buffer between subsequent calls. The list is cleared before any anchors are added to it.
Signature
static OVRTask< OVRResult< List< UnboundAnchor >, OVRAnchor.FetchResult > > OVRSpatialAnchor.LoadUnboundAnchorsAsync(IEnumerable< Guid > uuids, List< UnboundAnchor > unboundAnchors, Action< List< UnboundAnchor >, int > onIncrementalResultsAvailable=null) Parameters uuids: IEnumerable< Guid >Â
The UUIDs of the anchors to load.
unboundAnchors: List< UnboundAnchor >Â
The buffer to store the resulting unbound anchors into.
onIncrementalResultsAvailable: Action< List< UnboundAnchor >, int >Â
An optional callback that is invoked whenever a new batch of unbound anchors has been loaded.
Returns OVRTask< OVRResult< List< UnboundAnchor >, OVRAnchor.FetchResult > >Â
A new OVRTask<TResult> that completes when the loading operation completes.
Throws ArgumentNullExceptionÂ
Thrown if uuids is null.
ArgumentNullExceptionÂ
Thrown if unboundAnchors is null.
|
LoadUnboundAnchorsAsync
(
options
)
|
(Obsolete) Performs a query for anchors with the specified options .
DeprecatedThis method is obsolete. Use LoadUnboundAnchorsAsync(IEnumerable<Guid>,List<UnboundAnchor>,Action<List<UnboundAnchor>, int> instead.
Use this method to find anchors that were previously persisted with Save(Action<OVRSpatialAnchor, bool>. The query is asynchronous; when the query completes, the returned OVRTask<TResult> will contain an array of UnboundAnchors for which tracking may be requested.
Signature
static OVRTask< UnboundAnchor[]> OVRSpatialAnchor.LoadUnboundAnchorsAsync(LoadOptions options) Parameters options: LoadOptionsÂ
Options that affect the query.
Returns OVRTask< UnboundAnchor[]>Â
An OVRTask<TResult> with a T:UnboundAnchor[] type parameter containing the loaded unbound anchors.
|
LoadUnboundSharedAnchorsAsync
(
uuids
, unboundAnchors
)
|
Load anchors that have been shared with you.
Use this method to load spatial anchors that have been shared with you by another user.
This method requires access to Meta servers to query for shared anchors. This method can fail in a few ways:
To load other types of anchors, use LoadUnboundAnchorsAsync(IEnumerable<Guid>,List<UnboundAnchor>,Action<List<UnboundAnchor>,int>).
Signature
static OVRTask< OVRResult< List< UnboundAnchor >, OperationResult > > OVRSpatialAnchor.LoadUnboundSharedAnchorsAsync(IEnumerable< Guid > uuids, List< UnboundAnchor > unboundAnchors) Parameters uuids: IEnumerable< Guid >Â
The set of anchor UUIDs to load
unboundAnchors: List< UnboundAnchor >Â
A buffer to store the loaded anchors. This container is cleared before being populated.
Returns OVRTask< OVRResult< List< UnboundAnchor >, OperationResult > >Â
Returns an awaitable task-like object that can be used to track completion of the load operation.
Throws ArgumentNullExceptionÂ
Thrown if uuids is null.
ArgumentNullExceptionÂ
Thrown if unboundAnchors is null.
|
Save
(
anchors
, saveOptions
, onComplete
)
|
(Obsolete) Saves a collection of anchors to persistent storage.
DeprecatedThis method is obsolete. Use SaveAsync(IEnumerable<OVRSpatialAnchor>, SaveOptions) instead. To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
This method is asynchronous. Use onComplete to be notified of completion. When saved, an OVRSpatialAnchor can be loaded by a different session. Use the Uuid to identify the same OVRSpatialAnchor at a future time.
Signature
static void OVRSpatialAnchor.Save(ICollection< OVRSpatialAnchor > anchors, SaveOptions saveOptions, Action< ICollection< OVRSpatialAnchor >, OperationResult > onComplete=null) Parameters saveOptions: SaveOptionsÂ
Save options, e.g., whether local or cloud.
onComplete: Action< ICollection< OVRSpatialAnchor >, OperationResult >Â
Invoked when the save operation completes. May be null. onComplete receives two parameters:
Returns voidThrows ArgumentNullExceptionÂ
Thrown if anchors is null.
|
SaveAnchorsAsync
(
anchors
)
|
Saves a collection of anchors.
This method is asynchronous; use the returned OVRTask<TResult> to be notified of completion. When saved, the OVRSpatialAnchor can be loaded by a different session. Use LoadUnboundAnchorsAsync(IEnumerable<Guid>,List<UnboundAnchor>,Action<List<UnboundAnchor>,int>) to load some or all OVRSpatialAnchor at a future time.
This operation fully succeeds or fails; that is, either all anchors are successfully saved, or the operation fails.
Signature
static OVRTask< OVRResult< OVRAnchor.SaveResult > > OVRSpatialAnchor.SaveAnchorsAsync(IEnumerable< OVRSpatialAnchor > anchors) Parameters Returns OVRTask< OVRResult< OVRAnchor.SaveResult > >Â
An awaitable OVRTask<TResult> representing the asynchronous save operation.
Throws ArgumentNullExceptionÂ
Thrown if anchors is null.
ArgumentExceptionÂ
Thrown if anchors contains more than 32 anchors.
|
SaveAsync
(
anchors
, saveOptions
)
|
(Obsolete) Saves a collection of anchors to persistent storage.
DeprecatedThis method is obsolete. Use SaveAnchorsAsync instead.
This method is asynchronous. Use the returned OVRTask<TResult> to track the progress of the save operation.
When saved, an OVRSpatialAnchor can be loaded in a different session. Use the Uuid to identify the same OVRSpatialAnchor at a future time.
Signature
static OVRTask< OperationResult > OVRSpatialAnchor.SaveAsync(IEnumerable< OVRSpatialAnchor > anchors, SaveOptions saveOptions) Parameters saveOptions: SaveOptionsÂ
Save options, e.g., whether local or cloud.
Throws ArgumentNullExceptionÂ
Thrown if anchors is null.
|
Share
(
anchors
, users
, onComplete
)
|
(Obsolete) Shares a collection of OVRSpatialAnchor to specified users.
Specified users will be able to download, track, and share specified anchors.
DeprecatedThis method is obsolete. Use ShareAsync(IEnumerable<OVRSpatialAnchor>,IEnumerable<OVRSpaceUser>) instead. To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
This method is asynchronous. Use onComplete to be notified of completion.
This operation fully succeeds or fails, which means, either all anchors are successfully shared or the operation fails.
Signature
static void OVRSpatialAnchor.Share(ICollection< OVRSpatialAnchor > anchors, ICollection< OVRSpaceUser > users, Action< ICollection< OVRSpatialAnchor >, OperationResult > onComplete=null) Parameters onComplete: Action< ICollection< OVRSpatialAnchor >, OperationResult >Â
Invoked when the share operation completes. May be null. Delegate parameter is
Returns voidThrows ArgumentNullExceptionÂ
Thrown if anchors is null.
ArgumentNullExceptionÂ
Thrown if users is null.
|
ShareAsync
(
anchors
, users
)
|
Shares a collection of anchors with a collection of users.
The users will be able to download, localize, and share the specified anchors.
This method is asynchronous. Use the returned OVRTask<TResult> to monitor completion.
This operation fully succeeds or fails, which means, either all anchors are successfully shared or the operation fails.
Signature
static OVRTask< OperationResult > OVRSpatialAnchor.ShareAsync(IEnumerable< OVRSpatialAnchor > anchors, IEnumerable< OVRSpaceUser > users) Parameters Returns OVRTask< OperationResult >Â
A task that can be used to track the completion of the sharing operation.
Throws ArgumentNullExceptionÂ
Thrown if anchors is null.
ArgumentNullExceptionÂ
Thrown if users is null.
|
Storage
: OVRSpace.StorageLocation |
Location from where OVRSpatialAnchor will be erased.
Signature
OVRSpace.StorageLocation OVRSpatialAnchor.EraseOptions.Storage |
OVRSpatialAnchor.LoadOptions options = new OVRSpatialAnchor.LoadOptions
{
Timeout = 0,
Uuids = savedAnchorUuids
};MaxSupported
: const int |
The maximum number of uuids that may be present in the Uuids collection.
Signature
const int OVRSpatialAnchor.LoadOptions.MaxSupported |
MaxAnchorCount
: int
[Get][Set] |
(Obsolete) The maximum number of anchors to query.
In prior SDK versions, it was mandatory to set this property to receive any results. However, this property is now obsolete. If MaxAnchorCount is zero, i.e., the default initialized value, it will automatically be set to the count of Uuids.
If non-zero, the number of anchors in the result will be limited to MaxAnchorCount, preserving the previous behavior.
Signature
int OVRSpatialAnchor.LoadOptions.MaxAnchorCount |
StorageLocation
: OVRSpace.StorageLocation
[Get][Set] |
The storage location from which to query spatial anchors.
Signature
OVRSpace.StorageLocation OVRSpatialAnchor.LoadOptions.StorageLocation |
Timeout
: double
[Get][Set] |
The timeout, in seconds, for the query operation.
A value of zero indicates no timeout.
Signature
double OVRSpatialAnchor.LoadOptions.Timeout |
Uuids
: IReadOnlyList< Guid >
[Get][Set] |
The set of spatial anchors to query, identified by their UUIDs.
The UUIDs are copied by the OVRSpatialAnchor.LoadUnboundAnchorsAsync method and no longer referenced internally afterwards.
You must supply a list of UUIDs. OVRSpatialAnchor.LoadUnboundAnchorsAsync will throw if this property is null.
Signature
IReadOnlyList<Guid> OVRSpatialAnchor.LoadOptions.Uuids |
Storage
: OVRSpace.StorageLocation |
Location where OVRSpatialAnchor will be saved.
Signature
OVRSpace.StorageLocation OVRSpatialAnchor.SaveOptions.Storage |
Localized
: bool
[Get] |
Whether the anchor has been localized.
Prior to localization, the anchor's Pose cannot be determined.
Signature
bool OVRSpatialAnchor.UnboundAnchor.Localized |
Localizing
: bool
[Get] |
Whether the anchor is in the process of being localized.
Signature
bool OVRSpatialAnchor.UnboundAnchor.Localizing |
Pose
: Pose
[Get] |
(Obsolete) The world space pose of the spatial anchor.
DeprecatedThis method is obsolete. Acquiring the pose can fail; consider TryGetPose instead.
Signature
Pose OVRSpatialAnchor.UnboundAnchor.Pose |
Uuid
: Guid
[Get] |
The universally unique identifier associated with this anchor.
Signature
Guid OVRSpatialAnchor.UnboundAnchor.Uuid |
BindTo
(
spatialAnchor
)
|
Binds an unbound anchor to an OVRSpatialAnchor component.
Use this to bind an unbound anchor to an OVRSpatialAnchor. After BindTo is used to bind an UnboundAnchor to an OVRSpatialAnchor, the UnboundAnchor is no longer valid; that is, it cannot be bound to another OVRSpatialAnchor.
Signature
void OVRSpatialAnchor.UnboundAnchor.BindTo(OVRSpatialAnchor spatialAnchor) Parameters Returns voidThrows InvalidOperationExceptionÂ
Thrown if this UnboundAnchor does not refer to a valid anchor.
ArgumentNullExceptionÂ
Thrown if spatialAnchor is null.
ArgumentExceptionÂ
Thrown if an anchor is already bound to spatialAnchor .
ArgumentExceptionÂ
Thrown if spatialAnchor is pending creation (see OVRSpatialAnchor.PendingCreation).
InvalidOperationExceptionÂ
Thrown if this UnboundAnchor is already bound to an OVRSpatialAnchor.
|
Localize
(
onComplete
, timeout
)
|
(Obsolete) Localizes an anchor.
DeprecatedThis method is obsolete. Use LocalizeAsync instead. To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
The delegate supplied to OVRSpatialAnchor.LoadUnboundAnchors receives an array of unbound spatial anchors. You can choose whether to localize each one and be notified when localization completes.
The onComplete delegate receives two arguments:
Upon successful localization, your delegate should instantiate an OVRSpatialAnchor, then bind the UnboundAnchor to the OVRSpatialAnchor by calling UnboundAnchor.BindTo. Once an UnboundAnchor is bound to an OVRSpatialAnchor, it cannot be used again; that is, it cannot be bound to multiple OVRSpatialAnchor components.
Signature
void OVRSpatialAnchor.UnboundAnchor.Localize(Action< UnboundAnchor, bool > onComplete=null, double timeout=0) Parameters onComplete: Action< UnboundAnchor, bool >Â
A delegate invoked when localization completes (which may fail). The delegate receives two arguments:
timeout: doubleÂ
The timeout, in seconds, to attempt localization, or zero to indicate no timeout.
Returns voidThrows InvalidOperationExceptionÂ
Thrown if
|
LocalizeAsync
(
timeout
)
|
Localizes an anchor.
The delegate supplied to LoadUnboundAnchorsAsync(IEnumerable<Guid>,List<UnboundAnchor>,Action<List<UnboundAnchor>,int>) receives an array of unbound spatial anchors. You can choose whether to localize each one and be notified when localization completes.
Upon successful localization, your delegate should instantiate an OVRSpatialAnchor, then bind the UnboundAnchor to the OVRSpatialAnchor by calling UnboundAnchor.BindTo. Once an UnboundAnchor is bound to an OVRSpatialAnchor, it cannot be used again; that is, it cannot be bound to multiple OVRSpatialAnchor components.
Signature
OVRTask< bool > OVRSpatialAnchor.UnboundAnchor.LocalizeAsync(double timeout=0) Parameters timeout: doubleÂ
The timeout, in seconds, to attempt localization, or zero to indicate no timeout.
Returns OVRTask< bool >Â
An OVRTask<TResult> with a boolean type parameter indicating the success of the localization.
Throws InvalidOperationExceptionÂ
Thrown if the anchor does not support localization, e.g., because it is invalid.
|
TryGetPose
(
pose
)
|
The world space pose of the spatial anchor.
Use this method to get the pose of the anchor after it has been localized with LocalizeAsync.
If the anchor is not localized, this method throws InvalidOperationException. If the anchor has been localized, but the pose cannot be retrieved (for example, because of a temporary tracking issue), then this method returns False, and you should try again later.
Signature
bool OVRSpatialAnchor.UnboundAnchor.TryGetPose(out Pose pose) Parameters pose: out PoseÂ
If this method returns True, then pose will contain the world space pose of the anchor. If this method returns False, pose is set to identity.
Returns boolÂ
Returns True if the pose could be obtained, otherwise False.
Throws InvalidOperationExceptionÂ
Thrown if the anchor is invalid, e.g., because it has been destroyed.
InvalidOperationExceptionÂ
Thrown if the anchor has not been localized.
|
| Member | Value | Description |
|---|---|---|
Success | OVRPlugin.Result.Success |
Operation succeeded.
|
Failure | OVRPlugin.Result.Failure |
Operation failed.
|
Failure_DataIsInvalid | OVRPlugin.Result.Failure_DataIsInvalid |
Invalid data.
|
Failure_SpaceCloudStorageDisabled | OVRPlugin.Result.Failure_SpaceCloudStorageDisabled |
Saving anchors to cloud storage is not permitted by the user.
|
Failure_SpaceMappingInsufficient | OVRPlugin.Result.Failure_SpaceMappingInsufficient |
The user was able to download the anchors, but the device was unable to localize itself in the spatial data received from the sharing device.
|
Failure_SpaceLocalizationFailed | OVRPlugin.Result.Failure_SpaceLocalizationFailed |
The user was able to download the anchors, but the device was unable to localize them.
|
Failure_SpaceNetworkTimeout | OVRPlugin.Result.Failure_SpaceNetworkTimeout |
Network operation timed out.
|
Failure_SpaceNetworkRequestFailed | OVRPlugin.Result.Failure_SpaceNetworkRequestFailed |
Network operation failed.
|