Struct XRRaycastHit
Represents the intersection of a raycast with a trackable.
Implements
Inherited Members
Namespace: UnityEngine .XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public struct XRRaycastHit : IEquatable<XRRaycastHit>
Constructors
XRRaycastHit(TrackableId, Pose, float, TrackableType)
Constructs an XRRaycast
Declaration
public XRRaycastHit(TrackableId trackableId, Pose pose, float distance, TrackableType hitType)
Parameters
Type | Name | Description |
---|---|---|
Trackable |
trackableId | The Trackable |
Pose | pose | The session-space |
float | distance | The session-space distance from the raycast origin to the intersection point. |
Trackable |
hitType | The types of trackables which were hit by the ray. |
See Also
Properties
defaultValue
A default-initialized raycast hit. This can be different from a zero-initialized raycast hit.
Declaration
public static XRRaycastHit defaultValue { get; }
Property Value
Type | Description |
---|---|
XRRaycast |
See Also
distance
The session-space distance from the raycast origin to the intersection point.
Declaration
public float distance { get; set; }
Property Value
Type | Description |
---|---|
float |
See Also
hitType
The types of trackables which were hit by the ray.
Declaration
public TrackableType hitType { get; set; }
Property Value
Type | Description |
---|---|
Trackable |
See Also
pose
The session-space Pose
of the intersection.
Declaration
public Pose pose { get; set; }
Property Value
Type | Description |
---|---|
Pose |
See Also
trackableId
The Trackable
Declaration
public TrackableId trackableId { get; set; }
Property Value
Type | Description |
---|---|
Trackable |
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(XRRaycastHit)
Tests for equality.
Declaration
public bool Equals(XRRaycastHit other)
Parameters
Type | Name | Description |
---|---|---|
XRRaycast |
other | The other XRRaycast |
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 ==(XRRaycastHit, XRRaycastHit)
Tests for equality. Same as Equals(XRRaycast
Declaration
public static bool operator ==(XRRaycastHit lhs, XRRaycastHit rhs)
Parameters
Type | Name | Description |
---|---|---|
XRRaycast |
lhs | The left-hand side of the comparison. |
XRRaycast |
rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|
See Also
operator !=(XRRaycastHit, XRRaycastHit)
Tests for inequality. Same as !
Equals(XRRaycast
Declaration
public static bool operator !=(XRRaycastHit lhs, XRRaycastHit rhs)
Parameters
Type | Name | Description |
---|---|---|
XRRaycast |
lhs | The left-hand side of the comparison. |
XRRaycast |
rhs | The right-hand side of the comparison. |
Returns
Type | Description |
---|---|
bool |
|