Struct XRAnchor
Describes session-relative data for an anchor.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public struct XRAnchor : ITrackable, IEquatable<XRAnchor>
Constructors
XRAnchor(TrackableId, Pose, TrackingState, IntPtr)
Construct an instance.
Declaration
public XRAnchor(TrackableId trackableId, Pose pose, TrackingState trackingState, IntPtr nativePtr)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableId | The trackable ID. |
Pose | pose | The pose in session space. |
TrackingState | trackingState | The tracking state. |
IntPtr | nativePtr | The native pointer. |
See Also
XRAnchor(TrackableId, Pose, TrackingState, IntPtr, Guid)
Construct an instance.
Declaration
public XRAnchor(TrackableId trackableId, Pose pose, TrackingState trackingState, IntPtr nativePtr, Guid sessionId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableId | The trackable ID. |
Pose | pose | The pose in session space. |
TrackingState | trackingState | The tracking state. |
IntPtr | nativePtr | The native pointer. |
Guid | sessionId | The ID of the session from which this anchor originated. |
See Also
XRAnchor(TrackableId, Pose, TrackingState, IntPtr, Guid, TrackableId)
Construct an instance.
Declaration
public XRAnchor(TrackableId trackableId, Pose pose, TrackingState trackingState, IntPtr nativePtr, Guid sessionId, TrackableId parentId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableId | The trackable ID. |
Pose | pose | The pose in session space. |
TrackingState | trackingState | The tracking state. |
IntPtr | nativePtr | The native pointer. |
Guid | sessionId | The ID of the session from which this anchor originated. |
TrackableId | parentId | The trackable ID of the parent trackable. |
See Also
XRAnchor(TrackableId, Pose, TrackingState, IntPtr, TrackableId)
Construct an instance.
Declaration
public XRAnchor(TrackableId trackableId, Pose pose, TrackingState trackingState, IntPtr nativePtr, TrackableId parentId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableId | The trackable ID. |
Pose | pose | The pose in session space. |
TrackingState | trackingState | The tracking state. |
IntPtr | nativePtr | The native pointer. |
TrackableId | parentId | The trackable ID of the parent trackable. |
See Also
Properties
defaultValue
Get a default-initialized XRAnchor, which is distinct from C# default
as Pose.identity
is not equal to 0
.
Declaration
public static XRAnchor defaultValue { get; }
Property Value
Type | Description |
---|---|
XRAnchor |
See Also
nativePtr
Get this anchor's native pointer. The data pointed to by this pointer is implementation-specific.
Declaration
public IntPtr nativePtr { get; }
Property Value
Type | Description |
---|---|
IntPtr |
See Also
parentId
Get the trackable ID of this anchor's parent trackable.
Declaration
public TrackableId parentId { get; }
Property Value
Type | Description |
---|---|
TrackableId |
See Also
pose
Get this anchor's pose in session space.
Declaration
public Pose pose { get; }
Property Value
Type | Description |
---|---|
Pose |
See Also
sessionId
Get the ID of the session from which this anchor originated.
Declaration
public Guid sessionId { get; }
Property Value
Type | Description |
---|---|
Guid |
See Also
trackableId
Get this anchor's trackable ID.
Declaration
public TrackableId trackableId { get; }
Property Value
Type | Description |
---|---|
TrackableId |
See Also
trackingState
Get this anchor's tracking state.
Declaration
public 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(XRAnchor)
Tests for equality.
Declaration
public bool Equals(XRAnchor other)
Parameters
Type | Name | Description |
---|---|---|
XRAnchor | other | The other XRAnchor to compare against. |
Returns
Type | Description |
---|---|
bool |
|
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
Operators
operator ==(XRAnchor, XRAnchor)
Tests for equality. Equivalent to Equals(XRAnchor).
Declaration
public static bool operator ==(XRAnchor lhs, XRAnchor rhs)
Parameters
Type | Name | Description |
---|---|---|
XRAnchor | lhs | The left-hand side of the comparison. |
XRAnchor | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
See Also
operator !=(XRAnchor, XRAnchor)
Tests for inequality. Equivalent to !
Equals(XRAnchor).
Declaration
public static bool operator !=(XRAnchor lhs, XRAnchor rhs)
Parameters
Type | Name | Description |
---|---|---|
XRAnchor | lhs | The left-hand side of the comparison. |
XRAnchor | rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|