ARRaycastManagerExtensions

Extensions to AR Foundation's ARRaycastManager class.

Summary

Public static functions

RaycastStreetscapeGeometry(this ARRaycastManager raycastManager, Vector2 screenPoint, ref List< XRRaycastHit > raycastResults)
bool
Performs a raycast against ARStreetscapeGeometrys being tracked by ARCore.
RaycastStreetscapeGeometry(this ARRaycastManager raycastManager, Ray ray, ref List< XRRaycastHit > raycastResults)
bool
Performs a raycast against ARStreetscapeGeometrys being tracked by ARCore.

Public static functions

RaycastStreetscapeGeometry

bool RaycastStreetscapeGeometry(
  this ARRaycastManager raycastManager,
  Vector2 screenPoint,
  ref List< XRRaycastHit > raycastResults
)

Performs a raycast against ARStreetscapeGeometrys being tracked by ARCore.

Outputs all intersections along the ray sorted in ascending order of distance. Accepts Unity's native 2D screen coordinate (0, 0) starting from the bottom left.

Details
Parameters
raycastManager
The ARRaycastManager this method extends.
screenPoint
2D screen touch position in Unity screen coordinates.
raycastResults
A list of XRRaycastHit if the raycast is successful.
Returns
true if the raycast had a hit, otherwise false.

RaycastStreetscapeGeometry

bool RaycastStreetscapeGeometry(
  this ARRaycastManager raycastManager,
  Ray ray,
  ref List< XRRaycastHit > raycastResults
)

Performs a raycast against ARStreetscapeGeometrys being tracked by ARCore.

Outputs all intersections along the ray sorted in ascending order of distance. Accepts Unity's native 3D coordinates.

Details
Parameters
raycastManager
The ARRaycastManager this methods extends.
ray
Ray for the origin and direction of the raycast.
raycastResults
A list of XRRaycastHit if the raycast is successful.
Returns
true if the raycast had a hit, otherwise false.