Raycast, All#

Returns a list of prim paths of all colliders that are hit by the input ray.

It also provides you with detailed information about the exact point where the colliders intersect with the input ray as well as the paths to the physics bodies that the colliders belong to.

Note

This node is based on PhysX Scene Queries, benefitting from the fast performance of PhysX collision detection, but it will only detect physics colliders and only when simulation is active.

Installation#

To use this Node, you must enable omni.physx.graph in the Extension Manager.

Inputs#

Name

Type

Description

Default

execIn

execution

Input execution

Origin (origin)

pointf[3], pointd[3]

Ray origin

Direction (direction)

vectorf[3], vectord[3]

Ray direction vector

Distance (raycastRange)

float, double

Raycast distance. Use negative for infinite. If omitted, infinity is used.

Both sides (bothSides)

bool

Sets whether backfaces of colliders should be included in checks.

False

Sort by distance (sortByDistance)

bool

Enable to sort outputs by distance.

False

Outputs#

Name

Type

Description

Default

execOut

execution

Output execution

Collider Prim paths (colliderPrimPaths)

token[]

A list of paths of the collider prims that are hit by the input ray.

bodyPrimPaths

token[]

A list of paths of the associated body prims for the collider prims that are hit by the input ray.

positions

pointf[3][]

A list of positions of the points hit.

normals

normalf[3][]

A list of surface normals of the points hit.

Hit distances (distances)

float[]

A list of distances from the origin to the points hit.

faceIndexes

int[]

A list of the face indexes of the points hit.

materialPaths

token[]

A list of paths of the physics materials at the points hit.

Note

The node has an execution in and out connecter to allow you to control exactly when in the graph execution chain that the scene query will be processed, thereby avoiding redundant executions. However, to guarantee that the output data is current, make sure that any other nodes reading it are later in the execution chain, i.e. belong to a node tree connected to the node execution out.

For examples of concrete use of scene query nodes within an ActionGraph, see the OmniGraph demos in the physics demo scenes under Scene Query.