Sweep, Sphere, Closest
Finds the closest collider that is hit by the input sweep.
It also provides you with detailed information about the exact point where the collider intersects with the input sweep sphere as well as the path to the physics body that the collider 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 |
|
Input execution |
|
Origin (origin) |
|
Sweep origin |
|
Direction (direction) |
|
Sweep direction vector |
|
Radius (radius) |
|
Sphere radius |
|
Distance (sweepRange) |
|
Sweep maximum distance. Use negative for infinite. If omitted, infinity is used. |
|
Both sides (bothSides) |
|
Sets whether backfaces of colliders should be included in checks. |
False |
Outputs
Name |
Type |
Description |
Default |
---|---|---|---|
execOut |
|
Output execution |
|
hit |
|
Returns true if any colliders are hit by the sweep. |
|
Collider Prim path (colliderPrimPath) |
|
Path of the closest collider prim that is hit by the sweep. |
|
bodyPrimPath |
|
Path of the associated body prim of the closest collider prim hit by the sweep. |
|
position |
|
The position of the point hit. |
|
normal |
|
The surface normal of the point hit. |
|
Hit Distance (distance) |
|
The distance from the origin to the point hit. |
|
faceIndex |
|
The face index of the point hit. |
|
materialPath |
|
Path of the material 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.