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

OVRSpace Struct

Extends IEquatable< OVRSpace >
Represents an XrSpace in the Oculus Runtime.
A "space" is an instance of an XrSpace in the OpenXR runtime and is used typically as the low-level handle of an anchor.
DeprecatedMost APIs that use OVRSpace are deprecated. For low-level access to anchors, use OVRAnchor instead.
Read more about anchors generally at Spatial Anchor Overview and Scene Overview.

Constructors

OVRSpace ( handle )
Constructs an OVRSpace object from an existing runtime handle and UUID.
This constructor does not create a new space. An OVRSpace is a wrapper for low-level functionality in the Oculus Runtime. To create a new spatial anchor, use OVRSpatialAnchor.
Signature
OVRSpace(ulong handle)
Parameters
handle: ulong  The runtime handle associated with the space.

Properties

Handle : ulong
[Get]
A runtime handle associated with this OVRSpace.
The handle can change between subsequent sessions. To refer to a persistent anchor, use TryGetUuid to get a unique identifier for the anchor.
Signature
ulong Handle
Valid : bool
[Get]
Indicates whether this OVRSpace represents a valid space (vs a default constructed OVRSpace).
Signature
bool Valid

Methods

Equals ( other )
Compares for equality with another space.
Signature
bool Equals(OVRSpace other)
Parameters
other: OVRSpace  The OVRSpace to compare for equality with this space.
Returns
bool  Returns true if the two spaces represent the same space instance, otherwise false.
Equals ( obj )
Compares for equality with an object.
Signature
override bool Equals(object obj)
Parameters
obj: object  The object to compare for equality with this space.
Returns
override bool  Returns true if obj is an OVRSpace and represents the same space instance as this one, otherwise false.
GetHashCode ()
Generates a hash code suitable for use in a Dictionary or HashSet
Signature
override int GetHashCode()
Returns
override int  Returns a hash code suitable for use in a Dictionary or HashSet
ToString ()
Generates a string representation of this OVRSpace of the form "0xYYYYYYYY" where "Y" are the hexadecimal digits of the Handle.
Signature
override string ToString()
Returns
override string  Returns a string representation of this OVRSpace.
TryGetUuid ( uuid )
Retrieve the universally unique identifier (UUID) associated with this OVRSpace.
Every space that can be persisted will have a UUID associated with it. UUIDs are consistent across different sessions and apps.
The UUID of a space does not change over time, but not all spaces are guaranteed to have a UUID.
Signature
bool TryGetUuid(out Guid uuid)
Parameters
uuid: out Guid  If successful, the uuid associated with this OVRSpace, otherwise, Guid.Empty.
Returns
bool  Returns true if the uuid could be retrieved, otherwise false.

Static Methods

operator OVRSpace ( handle )
Casts a ulong handle to an OVRSpace.
Signature
static implicit operator OVRSpace(ulong handle)
Parameters
handle: ulong  The handle of the XrSpace to convert.
Returns
implicit  Returns the handle as an OVRSpace.
operator ulong ( space )
Casts an OVRSpace to its underlying XrSpace handle.
Signature
static implicit operator ulong(OVRSpace space)
Parameters
space: OVRSpace  The OVRSpace to cast.
Returns
implicit  Returns the XrSpace handle of the OVRSpace.
operator!= ( lhs , rhs )
Compares two spaces for inequality.
This is the logical negation of Equals(OVRSpace).
Signature
static bool operator!=(OVRSpace lhs, OVRSpace rhs)
Parameters
lhs: OVRSpace  The space to compare with rhs .
rhs: OVRSpace  The space to compare with lhs .
Returns
bool  Returns true if lhs is not equal to rhs , otherwise false.
operator== ( lhs , rhs )
Compares two spaces for equality.
This is the same equality test as Equals(OVRSpace).
Signature
static bool operator==(OVRSpace lhs, OVRSpace rhs)
Parameters
lhs: OVRSpace  The space to compare with rhs .
rhs: OVRSpace  The space to compare with lhs .
Returns
bool  Returns true if lhs is equal to rhs , otherwise false.

Inner Enum

StorageLocation Enum

DeprecatedRepresents a storage location for an anchor.
DeprecatedAPIs that accept a storage location are obsolete.
When you save (OVRSpatialAnchor.SaveAsync(OVRSpatialAnchor.SaveOptions), erase (OVRSpatialAnchor.EraseAsync(OVRSpatialAnchor.EraseOptions), or load (OVRSpatialAnchor.LoadUnboundAnchorsAsync(OVRSpatialAnchor.LoadOptions) a spatial anchor using these obsolete APIs, you may specify a storage location to indicate from where you would like to save, erase, or load the anchor(s), respectively.

Enumeration Constants

MemberDescription
Local
The storage location is local to the device.
Cloud
The storage location is in the cloud.