API reference

OVRLocatable Struct

Extends IOVRAnchorComponent< OVRLocatable >, IEquatable< OVRLocatable >
Represents the Pose of the anchor.
Enabling it will localize the anchor.
This component can be accessed from an OVRAnchor that supports it by calling OVRAnchor.GetComponent<T> from the anchor. This component needs to be enabled before requesting its Pose. See IsEnabled and SetEnabledAsync

Properties

SpaceComponentType IOVRAnchorComponent< OVRLocatable >. Type[Get]
ulong IOVRAnchorComponent< OVRLocatable >. Handle[Get]
bool IsNull[Get]
Whether this object represents a valid anchor component.
bool IsEnabled[Get]
True if this component is enabled and no change to its enabled status is pending.
SpaceComponentType Type[Get]
ulong Handle[Get]

Public Statics

static readonly OVRLocatable Null[Get]
A null representation of an OVRLocatable.
Use this to compare with another component to determine whether it is null.

Member Functions

OVRTask< bool > SetEnabledAsync
( bool enabled,
double timeout )
Sets the enabled status of this component.
A component must be enabled in order to access its data or do enable its functionality.This method is asynchronous. Use the returned task to track the completion of this operation. The task's value indicates whether the operation was successful.If the current enabled state matches enabled , then the returned task completes immediately with a True result. If there is already a pending change to the enabled state, the new request is queued.
Parameters
enabled
The desired state of the component.
timeout
The timeout, in seconds, for the operation. Use zero to indicate an infinite timeout.
Returns
Returns an OVRTask<T> whose result indicates the result of the operation.
OVRTask< bool > SetEnabledSafeAsync
( bool enabled,
double timeout )
(Obsolete) Sets the enabled status of this component if it differs from the current enabled state.
This method is obsolete. Use SetEnabledAsync instead.
Parameters
enabled
The desired state of the component.
timeout
The timeout, in seconds, for the operation. Use zero to indicate an infinite timeout.
Returns
Returns an OVRTask<T> whose result indicates the result of the operation.
bool Equals
( OVRLocatable other )
Compares this component for equality with other .
Parameters
other
The other component to compare with.
Returns
True if both components belong to the same OVRAnchor, otherwise false.
override bool Equals
( object obj )
Compares this component for equality with obj .
Parameters
obj
The object to compare with.
Returns
True if obj is an OVRLocatable and Equals(OVRLocatable) is true, otherwise false.
override int GetHashCode ( )
Gets a hashcode suitable for use in a Dictionary or HashSet.
Returns
A hashcode for this component.
override string ToString ( )
Gets a string representation of this component.
Returns
A string representation of this component.
bool TryGetSceneAnchorPose
( out TrackingSpacePose pose )
Tries to get the TrackingSpacePose representing the position and rotation of this anchor, treated as a scene anchor, in tracking space.
Although the request may succeed and provide a valid TrackingSpacePose, actual Position and Rotation provided may not be valid and/or tracked, see TrackingSpacePose for more information on how to use its data.Scene anchors follow a different transform from the raw OpenXR data than spatial anchors'.
Parameters
pose
The out TrackingSpacePose which will get filled in.
Returns
True if the request was successful, False otherwise.
bool TryGetSpatialAnchorPose
( out TrackingSpacePose pose )
Tries to get the TrackingSpacePose representing the position and rotation of this anchor, treated as a spatial anchor, in tracking space.
Although the request may succeed and provide a valid TrackingSpacePose, actual position and rotation provided may not be valid and/or tracked, see TrackingSpacePose for more information on how to use its data.Spatial anchors follow a different transform from the raw OpenXR data than scene anchors'.
Parameters
pose
The out TrackingSpacePose which will get filled in.
Returns
True if the request was successful, False otherwise.

Static Member Functions

static bool operator==
( OVRLocatable lhs,
Compares two components for equality.
Parameters
lhs
The component to compare with rhs .
rhs
The component to compare with lhs .
Returns
True if both components belong to the same OVRAnchor, otherwise false.
static bool operator!=
( OVRLocatable lhs,
Compares two components for inequality.
Parameters
lhs
The component to compare with rhs .
rhs
The component to compare with lhs .
Returns
True if the components do not belong to the same OVRAnchor, otherwise false.