Struct ARRaycastHit
Represents the result of a raycast intersection with a trackable.
Inherited Members
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: UnityEngine.XR.ARFoundation
Syntax
public struct ARRaycastHit : IEquatable<ARRaycastHit>
Constructors
ARRaycastHit(XRRaycastHit, Single, Transform)
Constructor invoked by the Raycast(Vector3, List<ARRaycastHit>, TrackableType) methods.
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 |
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
Type | Description |
---|---|
Pose |
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
Type | Description |
---|---|
Pose |
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
Type | Name | Description |
---|---|---|
ARRaycastHit | other |
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
Type | Name | Description |
---|---|---|
ARRaycastHit | lhs | |
ARRaycastHit | rhs |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(ARRaycastHit, ARRaycastHit)
Declaration
public static bool operator !=(ARRaycastHit lhs, ARRaycastHit rhs)
Parameters
Type | Name | Description |
---|---|---|
ARRaycastHit | lhs | |
ARRaycastHit | rhs |
Returns
Type | Description |
---|---|
System.Boolean |