Struct ARRaycastHit
Represents the result of a raycast intersection with a trackable.
Inherited Members
Namespace: UnityEngine.XR.ARFoundation
Assembly: solution.dll
Syntax
public struct ARRaycastHit : IEquatable<ARRaycastHit>, IComparable<ARRaycastHit>
Constructors
Name | Description |
---|---|
ARRaycastHit(XRRaycastHit, float, Transform) | Constructor invoked by Raycast(Vector2, List<ARRaycastHit>, TrackableType) and Raycast(Ray, List<ARRaycastHit>, TrackableType). |
ARRaycastHit(XRRaycastHit, float, Transform, ARTrackable) | Constructor invoked by Raycast(Vector2, List<ARRaycastHit>, TrackableType) and Raycast(Ray, List<ARRaycastHit>, TrackableType). |
Properties
Name | Description |
---|---|
distance | The distance, in Unity world space, from the ray origin to the intersection point. |
hitType | The type of trackable hit by the raycast. |
pose | The |
sessionRelativeDistance | The distance, in local (session) space, from the ray origin to the intersection point. |
sessionRelativePose | The |
trackable | The ARTrackable that this raycast hit, or |
trackableId | The session-unique identifier for the trackable that was hit. |
Methods
Name | Description |
---|---|
CompareTo(ARRaycastHit) | Used for sorting two raycast hits by distance. Uses CompareTo on the raycasts' distance properties. |
Equals(object) | Tests for equality. |
Equals(ARRaycastHit) | Tests for equality. |
GetHashCode() | Generates a hash suitable for use with containers like |
Operators
Name | Description |
---|---|
operator ==(ARRaycastHit, ARRaycastHit) | Tests for equality. Same as Equals(ARRaycastHit). |
operator !=(ARRaycastHit, ARRaycastHit) | Tests for inequality. Same as |