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