Created
: bool
[Get] |
Checks 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] |
Checks 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 |
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 |
OnLocalize
: Action< OperationResult > |
Event that is dispatched when the localization process finishes.
Signature
Action<OperationResult> OVRSpatialAnchor.OnLocalize |
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.
|
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
Only spatial anchors retrieved as
Signature
static bool OVRSpatialAnchor.FromOVRAnchor(OVRAnchor anchor, out UnboundAnchor unboundAnchor) Parameters unboundAnchor: out UnboundAnchor
The created unboundAnchor.
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] |
The world space pose of the spatial anchor.
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.
|
| 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.
|