Compute Geometry Overlaps
Compute overlaps between geometries (currently supports meshes prims)
Compute Geometry Overlaps is an Immediate Node that tests if intersection exists on prims at corresponding indexes into the overlap pairs arrays.
For example given the following overlap pairs arrays:
overlapPairs0
= ['/Prim1'
,'/Prim2'
]overlapPairs1
= ['/Prim3'
,'/Prim4'
]
This node will test:
'/Prim1'
<–>'/Prim3'
'/Prim2'
<–>'/Prim4'
Such prims must exist in the prims bundle that passed to the primsBundle
input, otherwise an error will be thrown.
Prims can be supplied to primsBundle
connecting the output of a Read Prims node or Compute Geometry Bounds node.
The output is an array of booleans where every boolean at a given index returns true if the two prims at the same corresponding index in the overlapPairs0
and overlapPairs1
arrays do actually intersect.
So looking at the previous example if only '/Prim2'
overlaps with '/Prim4'
then the overlaps will be:
overlaps
= [false
,true
]
Installation
To use this Node, you must enable omni.physx.graph
in the Extension Manager.
Inputs
Name |
Type |
Description |
Default |
---|---|---|---|
execIn |
|
Input execution |
|
primsBundle |
|
The prims of interest. It must be a bundle with one or more prim children. Currently only meshes prim are supported (sourcePrimType == ‘Mesh’). Overlap check is always executed with trianagle mesh approximation for both items of a pair unless the (optional) ‘physics:approximation’ is set to different type (can be ‘convex mesh’ for example). From each Mesh prim child reads: - ‘sourecePrimPath’ - ‘sourcePrimType’ - ‘points’ - ‘faceVertexIndices’ - ‘faceVertexCounts’ - ‘worldMatrix’ - ‘sourcePrimPath’ (and optionally ‘holeIndices’, ‘orientation’, ‘meshKey’ and ‘physics:approximation’) attributes |
|
overlapsPair0 |
|
Path of the first geometry from the Prims Bundle to check for overlap with corresponding item at same index in overlapsPair1 input attribute. |
|
overlapsPair1 |
|
Path of the second geometry from the Prims Bundle to check for overlap with corresponding item at same index in overlapsPair0 input attribute. |
Outputs
Name |
Type |
Description |
Default |
---|---|---|---|
execOut |
|
Output execution |
|
overlaps |
|
Array of booleans where ‘True’ value signals that a corresponding pair of meshes in overlapsPair0 and overlapsPair1 input arrays at the same index do actually overlap. |
Note
Connecting the output of Compute Geometry Bounds node is often a better choice because that node allows precompute mesh hash and cooking data structures at the start of a graph, avoiding such computation at every invocation of this node.
Important
Immediate nodes currently only support Mesh Prims, and not Shape prims.
Demos:
Several demo scenes can be accessed through the physics demo scenes menu option (Window > Simulation > Physics / Demo Scenes
).
This will enable a Physics Demo Scenes window.
A demo using this node is labeled Objects de-penetration: