Struct ARRaycastHit
Represents the result of a raycast intersection with a trackable.
Syntax
public struct ARRaycastHit : IEquatable<ARRaycastHit>, IComparable<ARRaycastHit>
Constructors
Constructor invoked by the methods.
Declaration
public ARRaycastHit(XRRaycastHit hit, float distance, Transform transform)
Parameters
Type |
Name |
Description |
XRRaycastHit |
hit |
Session-relative raycast hit data.
|
Single |
distance |
The distance, in Unity world space, of the hit.
|
Transform |
transform |
The Transform that transforms from session space to world space.
|
Properties
distance
The distance, in Unity world space, from the ray origin to the intersection point.
Declaration
public float distance { readonly get; }
Property Value
hitType
The type of trackable hit by the raycast.
Declaration
public readonly TrackableType hitType { get; }
Property Value
Type |
Description |
TrackableType |
|
pose
The Pose
, in Unity world space, of the intersection point.
Declaration
public readonly Pose pose { get; }
Property Value
sessionRelativeDistance
The distance, in local (session) space, from the ray origin to the intersection point.
Declaration
public readonly float sessionRelativeDistance { get; }
Property Value
sessionRelativePose
The Pose
, in local (session) space, of the intersection point.
Declaration
public readonly Pose sessionRelativePose { get; }
Property Value
trackableId
The session-unique identifier for the trackable that was hit.
Declaration
public readonly TrackableId trackableId { get; }
Property Value
Type |
Description |
TrackableId |
|
Methods
CompareTo(ARRaycastHit)
Declaration
public int CompareTo(ARRaycastHit other)
Parameters
Returns
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
Equals(ARRaycastHit)
Declaration
public bool Equals(ARRaycastHit other)
Parameters
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Operators
Equality(ARRaycastHit, ARRaycastHit)
Declaration
public static bool operator ==(ARRaycastHit lhs, ARRaycastHit rhs)
Parameters
Returns
Inequality(ARRaycastHit, ARRaycastHit)
Declaration
public static bool operator !=(ARRaycastHit lhs, ARRaycastHit rhs)
Parameters
Returns