Function coal::defaultCollisionFunction

Function Documentation

bool coal::defaultCollisionFunction(CollisionObject *o1, CollisionObject *o2, void *data)

Provides a simple callback for the collision query in the BroadPhaseCollisionManager. It assumes the data parameter is non-null and points to an instance of CollisionData. It simply invokes the collide() method on the culled pair of geometries and stores the results in the data’s CollisionResult instance.

This callback will cause the broadphase evaluation to stop if:

  • the collision requests disables cost and

  • the collide() reports a collision for the culled pair, and

  • we’ve reported the number of contacts requested in the CollisionRequest.

For a given instance of CollisionData, if broadphase evaluation has already terminated (i.e., defaultCollisionFunction() returned true), subsequent invocations with the same instance of CollisionData will return immediately, requesting termination of broadphase evaluation (i.e., return true).

Parameters:
  • o1 – The first object in the culled pair.

  • o2 – The second object in the culled pair.

  • data – A non-null pointer to a CollisionData instance.

Template Parameters:

S – The scalar type with which the computation will be performed.

Returns:

true if the broadphase evaluation should stop.