Generate Geometry Contacts

Returns a list of contact points.

Generate Geometry Contacts Node

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 prim0primN 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 prim0primN.

Each child bundle has the following attributes:

  • points: an array of float3 indicating the contact points

  • normals: an array of float3 indicating the normals at each corresponding contact point

  • depths: an array of float 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

execution

Input execution

primsBundle

bundle

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

token[]

Path of the first geometry from the Prims Bundle to check for contactwith corresponding item at same index in overlapsPair1 input attribute.

overlapsPair1

token[]

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)

float

Contact Distance.

0.01

Mesh Contact Margin (meshContactMargin)

float

Mesh Contact Margin.

0.01

Tolerance Length (toleranceLength)

float

Tolerance Length.

0.1

Outputs

Name

Type

Description

Default

execOut

execution

Output execution

contacts

bundle

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.

../../../../_images/kit_physics_demo_scenes.png

A demo using this node is labeled Objects de-penetration:

../../../../_images/omnigraph-physx-immediate-demo-de-penetration.png