Class

ARRaycastQuery

A mathematical ray you use to find 3D positions on real-world surfaces.

Declaration

@interface ARRaycastQuery : NSObject

Overview

You create a ray-cast query by providing a 3D vector and starting place.

To create a ray-cast query using a 2D screen location and default vector that casts outward in the z-direction from the user, you use the convenience functions, makeRaycastQuery(from:allowing:alignment:) on ARView, or raycastQueryFromPoint:allowingTarget:alignment: on ARSCNView.

Topics

Creating a Raycast Query

Getting the Target

target

A plane type that allows the ray to terminate if it's encountered.

ARRaycastTarget

The types of plane you allow a raycast to intersect with.

targetAlignment

The target's alignment with respect to gravity.

ARRaycastTargetAlignment

A specification that indicates a target's alignment with respect to gravity.

Interpreting the Ray

direction

A vector that describes the ray's trajectory in 3D space.

origin

A 3D coordinate that defines the ray's starting place.

Relationships

Inherits From

See Also

Ray-Casting

ARTrackedRaycast

A ray-cast query that ARKit repeats in succession to give you refined results over time.

ARRaycastResult

Information about a real-world surface found by examining a point on the screen.