Struct XRBoundingBox
The session-relative data associated with a 3D bounding box.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public struct XRBoundingBox : ITrackable, IEquatable<XRBoundingBox>
Constructors
XRBoundingBox(TrackableId, Pose, Vector3, TrackingState, BoundingBoxClassifications, IntPtr)
Constructs a new instance. XRBoundingBox
objects are typically created by
XRBoundingBoxSubsystem.GetChanges.
Declaration
public XRBoundingBox(TrackableId trackableId, Pose pose, Vector3 size, TrackingState trackingState, BoundingBoxClassifications classifications, IntPtr nativePtr)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableId | The |
Pose | pose | The pose describing the position and orientation of the bounding box. |
Vector3 | size | The dimensions of the bounding box. |
TrackingState | trackingState | The |
BoundingBoxClassifications | classifications | The BoundingBoxClassification assigned to the bounding box by the XR device. |
IntPtr | nativePtr | The native pointer associated with the bounding box. |
See Also
Properties
classifications
The classifications of this bounding box.
Declaration
public readonly BoundingBoxClassifications classifications { get; }
Property Value
Type | Description |
---|---|
BoundingBoxClassifications |
See Also
nativePtr
A native pointer associated with this bounding box. The data pointed to by this pointer is implementation defined.
Declaration
public readonly IntPtr nativePtr { get; }
Property Value
Type | Description |
---|---|
IntPtr |
See Also
pose
The Pose
, in session space, of the bounding box.
Declaration
public readonly Pose pose { get; }
Property Value
Type | Description |
---|---|
Pose |
See Also
size
The size (dimensions) of the bounding box in meters.
Declaration
public readonly Vector3 size { get; }
Property Value
Type | Description |
---|---|
Vector3 |
See Also
trackableId
The TrackableId associated with this bounding box.
Declaration
public readonly TrackableId trackableId { get; }
Property Value
Type | Description |
---|---|
TrackableId |
See Also
trackingState
The TrackingState of the bounding box.
Declaration
public readonly TrackingState trackingState { get; }
Property Value
Type | Description |
---|---|
TrackingState |
See Also
Methods
Equals(object)
Tests for equality.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The |
Returns
Type | Description |
---|---|
bool |
|
Overrides
See Also
Equals(XRBoundingBox)
Tests for equality.
Declaration
public bool Equals(XRBoundingBox other)
Parameters
Type | Name | Description |
---|---|---|
XRBoundingBox | other | The other XRBoundingBox to compare against. |
Returns
Type | Description |
---|---|
bool | true if every field in |
See Also
GetHashCode()
Generates a hash suitable for use with containers like HashSet
and Dictionary
.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code generated from this object's fields. |
Overrides
See Also
ToString()
Generates a new string that describes the bounding box's properties, suitable for debugging purposes.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that describes the bounding box's properties. |
Overrides
See Also
Operators
operator ==(XRBoundingBox, XRBoundingBox)
Tests for equality. Equivalent to Equals(XRBoundingBox).
Declaration
public static bool operator ==(XRBoundingBox lhs, XRBoundingBox rhs)
Parameters
Type | Name | Description |
---|---|---|
XRBoundingBox | lhs | The left-hand side of the comparison. |
XRBoundingBox | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
See Also
operator !=(XRBoundingBox, XRBoundingBox)
Tests for inequality. Same as !
Equals(XRBoundingBox).
Declaration
public static bool operator !=(XRBoundingBox lhs, XRBoundingBox rhs)
Parameters
Type | Name | Description |
---|---|---|
XRBoundingBox | lhs | The left-hand side of the comparison. |
XRBoundingBox | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |