PxCreateContactConstraints

Defined in include/PxImmediateMode.h

bool PxCreateContactConstraints(PxConstraintBatchHeader *batchHeaders, PxU32 nbHeaders, PxSolverContactDesc *contactDescs, PxConstraintAllocator &allocator, PxReal invDt, PxReal bounceThreshold, PxReal frictionOffsetThreshold, PxReal correlationDistance, PxSpatialVector *Z = NULL)

Creates a set of contact constraint blocks.

Note that, depending the results of PxBatchConstraints, each batchHeader may refer to up to 4 solverConstraintDescs. This function will allocate both constraint and friction patch data via the PxConstraintAllocator provided. Constraint data is only valid until PxSolveConstraints has completed. Friction data is to be retained and provided by the application for friction correlation.

Parameters
  • batchHeaders[in] Array of batch headers to process

  • nbHeaders[in] The total number of headers

  • contactDescs[in] An array of contact descs defining the pair and contact properties of each respective contacting pair

  • allocator[in] An allocator callback to allocate constraint and friction memory

  • invDt[in] The inverse timestep

  • bounceThreshold[in] The bounce threshold. Relative velocities below this will be solved by bias only. Relative velocities above this will be solved by restitution. If restitution is zero then these pairs will always be solved by bias.

  • frictionOffsetThreshold[in] The friction offset threshold. Contacts whose separations are below this threshold can generate friction constraints.

  • correlationDistance[in] The correlation distance used by friction correlation to identify whether a friction patch is broken on the grounds of relation separation.

  • Z[out] Temporary buffer for impulse propagation.

Returns

a boolean to define if this method was successful or not.