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

OVRLocatable Struct

Extends 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

Static Fields

Null : readonly OVRLocatable
A null representation of an OVRLocatable.
Use this to compare with another component to determine whether it is null.
Signature
readonly OVRLocatable OVRLocatable.Null

Properties

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

Methods

Equals ( other )
Compares this component for equality with other .
Signature
bool OVRLocatable.Equals(OVRLocatable other)
Parameters
other: OVRLocatable  The other component to compare with.
Returns
bool  True if both components belong to the same OVRAnchor, otherwise false.
Equals ( obj )
Compares this component for equality with obj .
Signature
override bool OVRLocatable.Equals(object obj)
Parameters
obj: object  The object to compare with.
Returns
override bool  True if obj is an OVRLocatable and Equals(OVRLocatable) is true, otherwise false.
FromAnchor ( anchor )
Signature
OVRLocatable IOVRAnchorComponent< OVRLocatable >. OVRLocatable.FromAnchor(OVRAnchor anchor)
Parameters
anchor: OVRAnchor
GetHashCode ()
Gets a hashcode suitable for use in a Dictionary or HashSet.
Signature
override int OVRLocatable.GetHashCode()
Returns
override int  A hashcode for this component.
SetEnabledAsync ( enabled , 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.
Signature
OVRTask< bool > OVRLocatable.SetEnabledAsync(bool enabled, double timeout=0)
Parameters
enabled: bool  The desired state of the component.
timeout: double  The timeout, in seconds, for the operation. Use zero to indicate an infinite timeout.
Returns
OVRTask< bool >  Returns an OVRTask<T> whose result indicates the result of the operation.
SetEnabledSafeAsync ( enabled , timeout )
(Obsolete) Sets the enabled status of this component if it differs from the current enabled state.
This method is obsolete. Use SetEnabledAsync instead.
Signature
OVRTask< bool > OVRLocatable.SetEnabledSafeAsync(bool enabled, double timeout=0)
Parameters
enabled: bool  The desired state of the component.
timeout: double  The timeout, in seconds, for the operation. Use zero to indicate an infinite timeout.
Returns
OVRTask< bool >  Returns an OVRTask<T> whose result indicates the result of the operation.
ToString ()
Gets a string representation of this component.
Signature
override string OVRLocatable.ToString()
Returns
override string  A string representation of this component.
TryGetSceneAnchorPose ( 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'.
Signature
bool OVRLocatable.TryGetSceneAnchorPose(out TrackingSpacePose pose)
Parameters
pose: out TrackingSpacePose  The out TrackingSpacePose which will get filled in.
Returns
bool  True if the request was successful, False otherwise.
TryGetSpatialAnchorPose ( 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'.
Signature
bool OVRLocatable.TryGetSpatialAnchorPose(out TrackingSpacePose pose)
Parameters
pose: out TrackingSpacePose  The out TrackingSpacePose which will get filled in.
Returns
bool  True if the request was successful, False otherwise.

Static Methods

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

Inner Struct

TrackingSpacePose Struct

Tracking space position and rotation of the anchor.
Position and rotation are both nullable Vector3 and Quaternion and might be null independently if one of them or both are invalid.

Properties

IsPositionTracked : bool
[Get]
Indicates whether or not the position is currently tracked.
Signature
bool OVRLocatable.TrackingSpacePose.IsPositionTracked
IsRotationTracked : bool
[Get]
Indicates whether or not the rotation is currently tracked.
Signature
bool OVRLocatable.TrackingSpacePose.IsRotationTracked
Position : Vector3?
[Get]
Position in tracking space of the anchor.
Null if and when the position is invalid
Signature
Vector3? OVRLocatable.TrackingSpacePose.Position
Rotation : Quaternion?
[Get]
Rotation in tracking space of the Anchor.
Null if and when the rotation is invalid
Signature
Quaternion? OVRLocatable.TrackingSpacePose.Rotation

Methods

ComputeWorldPosition ( camera )
Computes the world space position of the anchor.
Signature
Vector3? OVRLocatable.TrackingSpacePose.ComputeWorldPosition(Camera camera)
Parameters
camera: Camera  A Camera component that will be use to compute the transform to world space
Returns
Vector3?  The nullable Vector3 position in world space which may be null if and when Position is invalid or head pose is invalid.
Throws
ArgumentNullException  If camera is null
ComputeWorldRotation ( camera )
Computes the world space rotation of the anchor.
Signature
Quaternion? OVRLocatable.TrackingSpacePose.ComputeWorldRotation(Camera camera)
Parameters
camera: Camera  A Camera component that will be use to compute the transform to world space
Returns
Quaternion?  The nullable Quaternion rotation in world space which may be null if and when Rotation is invalid or if head rotation is invalid.
Throws
ArgumentNullException  If camera is null