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

UnboundAnchor Struct

A spatial anchor that has not been bound to an OVRSpatialAnchor.
Use this object to bind an unbound spatial anchor to an OVRSpatialAnchor.

Properties

The universally unique identifier associated with this anchor.
Whether the anchor has been localized.
Prior to localization, the anchor's Pose cannot be determined.
See Also
WhenLocalizedAsync, Localizing
Whether the anchor is in the process of being localized.
See Also
WhenLocalizedAsync, Localized
(Obsolete) The world space pose of the spatial anchor.
Deprecated
This method is obsolete. Acquiring the pose can fail; consider TryGetPose instead.
See Also
TryGetPose

Member Functions

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.
Parameters
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
Returns true if the pose could be obtained, otherwise false.
Exceptions
InvalidOperationException
Thrown if the anchor is invalid, e.g., because it has been destroyed.
InvalidOperationException
Thrown if the anchor has not been localized.
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.
Parameters
timeout
The timeout, in seconds, to attempt localization, or zero to indicate no timeout.
Returns
Returns an OVRTask<bool> indicating the success of the localization.
Exceptions
InvalidOperationException
Thrown if the anchor does not support localization, e.g., because it is invalid.
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.
Parameters
spatialAnchor
The component to which this unbound anchor should be bound. It should have been recently instantiated, ideally on the same frame as this call.
Exceptions
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.
(Obsolete) Localizes an anchor.
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:
  • bool: Whether localization was successful
  • UnboundAnchor: The anchor to bind
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. Deprecated
This method is obsolete. Use LocalizeAsync instead. To continue using the onComplete callback, use OVRTask<T>.ContinueWith on the returned task.
Parameters
onComplete
A delegate invoked when localization completes (which may fail). The delegate receives two arguments:
  • UnboundAnchor: The anchor to bind
  • bool: Whether localization was successful
timeout
The timeout, in seconds, to attempt localization, or zero to indicate no timeout.
Exceptions
InvalidOperationException
Thrown if
  • The anchor does not support localization, e.g., because it is invalid.
  • The anchor has already been localized.
  • The anchor is being localized, e.g., because Localize was previously called.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon