Function hpp::fcl::defaultDistanceFunction

Function Documentation

bool hpp::fcl::defaultDistanceFunction(CollisionObject *o1, CollisionObject *o2, void *data, FCL_REAL &dist)

Collision data for use with the DefaultContinuousCollisionFunction. It stores the collision request and the result given by the collision algorithm (and stores the conclusion of whether further evaluation of the broadphase collision manager has been deemed unnecessary).

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

This callback will never cause the broadphase evaluation to terminate early. However, if the done member of the DefaultContinuousCollisionData is set to true, this method will simply return without doing any computation.

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

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

This callback will cause the broadphase evaluation to stop if:

  • The distance is less than or equal to zero (i.e., the pair is in contact).

For a given instance of DistanceData, if broadphase evaluation has already terminated (i.e., defaultDistanceFunction() returned true), subsequent invocations with the same instance of DistanceData will simply report the previously reported minimum distance and request 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.

  • o1 – The first object in the culled pair.

  • o2 – The second object in the culled pair.

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

  • dist – The distance computed by distance().

Template Parameters:
  • S – The scalar type with which the computation will be performed.

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

Returns:

True if the broadphase evaluation should stop.

Returns:

true if the broadphase evaluation should stop.