Generate Geometry Contacts
Returns a list of contact points.
Generate Geometry Contacts is an Immediate Node that tests if intersection exists on prims at corresponding indexes into the overlap pairs arrays.
In addition to Compute Geometry Overlaps this node will generate contacts for the given geometries.
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.
The output is a bundle of child prims named prim0
… primN
where N
is one minus the length of the overlapPairs0
(or overlapPairs1
) array.
It’s possible to extract each child bundle output with the Extract Prim node with a prim path set to prim0
… primN
.
Each child bundle has the following attributes:
points
: an array offloat3
indicating the contact pointsnormals
: an array offloat3
indicating the normals at each corresponding contact pointdepths
: an array offloat
indicating the penetration depth at each contact point
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’). 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 contactwith corresponding item at same index in overlapsPair1 input attribute. |
|
overlapsPair1 |
|
Path of the second geometry from the Prims Bundle to check for contactwith corresponding item at same index in overlapsPair0 input attribute |
|
Contact Distance (contactDistance) |
|
Contact Distance. |
0.01 |
Mesh Contact Margin (meshContactMargin) |
|
Mesh Contact Margin. |
0.01 |
Tolerance Length (toleranceLength) |
|
Tolerance Length. |
0.1 |
Outputs
Name |
Type |
Description |
Default |
---|---|---|---|
execOut |
|
Output execution |
|
contacts |
|
Bundle of Child bundles containg contacts for each pair. Child Bundles are named prim0…primN that can be extracted with ‘Extract Prim’. Each child bundle has ‘points’, ‘normals’ and ‘depths’ attributes. |
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.
Note
You can use Bundle Inspector to print the content of the contacts bundle output to console to better understand its structure.
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: