Struct XRRaycastHit
Represents the intersection of a raycast with a trackable.
Syntax
public struct XRRaycastHit : IEquatable<XRRaycastHit>
Constructors
XRRaycastHit(TrackableId, Pose, Single, TrackableType)
Declaration
public XRRaycastHit(TrackableId trackableId, Pose pose, float distance, TrackableType hitType)
Parameters
Type |
Name |
Description |
TrackableId |
trackableId |
The TrackableId of the trackable which was hit.
|
Pose |
pose |
The session-space Pose of the intersection.
|
Single |
distance |
The session-space distance from the raycast origin to the intersection point.
|
TrackableType |
hitType |
The type(s) of trackables which were hit by the ray.
|
Properties
distance
The session-space distance from the raycast origin to the intersection point.
Declaration
public float distance { get; set; }
Property Value
hitType
The type(s) of trackables which were hit by the ray.
Declaration
public TrackableType hitType { get; set; }
Property Value
pose
The session-space Pose
of the intersection.
Declaration
public Pose pose { get; set; }
Property Value
trackableId
The TrackableId of the trackable which was hit. This may be invalidId
as not all trackables have ids, e.g., feature points.
Declaration
public TrackableId trackableId { get; set; }
Property Value
Methods
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
Equals(XRRaycastHit)
Declaration
public bool Equals(XRRaycastHit other)
Parameters
Returns
GetDefault()
Creates a default-initialized raycast hit. This may be different
from a zero-initialized raycast hit.
Declaration
public static XRRaycastHit GetDefault()
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Operators
Equality(XRRaycastHit, XRRaycastHit)
Declaration
public static bool operator ==(XRRaycastHit lhs, XRRaycastHit rhs)
Parameters
Returns
Inequality(XRRaycastHit, XRRaycastHit)
Declaration
public static bool operator !=(XRRaycastHit lhs, XRRaycastHit rhs)
Parameters
Returns