Raycast

 
 
 

Categories

  • Geometry Queries

Description

Finds the first location on a surface that is hit by a ray cast from a given position in a given direction. If a ray does not hit the surface, the result is filtered — a value of Undefined Location is not returned.

Locations are "glued" to the surface of a geometry so that they stay in the same relative position even as the geometry transforms and deforms, unless you recompute and reset the locations' values at different frames.

Parameters

Proximity Method

Method used to compute the proximity:

  • Semi-line shoots an infinite ray in one direction.

  • Line shoots a ray in both directions.

  • Segment shoots a ray in one direction and is bounded by the length of the direction vector.

Ports

Inputs

Geometry

The surface to be tested for hits by the ray.

Position

The position from which the ray originates. Coordinates are interpreted with respect to the reference frame of the "self" object. In particular, this means that if you want to raycast from an object's center, you must use (0, 0, 0).

Direction

The direction of the ray, with respect to the reference frame of the "self" object.

Enable Cutoff Distance

True to only look at locations within a given distance.

Cutoff Distance

Distance within which to look for ray hits.

Outputs

Location

The location at which the ray hit the surface.

Hit

A Boolean indicating whether the ray actually hit the surface.