45 assert(data !=
nullptr);
50 if (collision_data->done)
return true;
52 collide(o1, o2, request, result);
56 collision_data->done =
true;
59 return collision_data->done;
69 assert(data !=
nullptr);
83 if (dist <= 0)
return true;
94 : max_size(max_size) {
108 const std::vector<CollisionCallBackCollect::CollisionPair>&
size_t num_max_contacts
The maximum number of contacts will return.
request to the distance computation
Collision data stores the collision request and the result given by collision algorithm.
bool distance(CollisionObject *o1, CollisionObject *o2, FCL_REAL &dist)
Distance evaluation between two objects in collision. This callback will cause the broadphase evaluat...
size_t numCollisionPairs() const
Returns the number of registered collision pairs.
size_t numContacts() const
number of contacts found
request to the collision algorithm
HPP_FCL_DLLAPI FCL_REAL distance(const Matrix3f &R0, const Vec3f &T0, const kIOS &b1, const kIOS &b2, Vec3f *P=NULL, Vec3f *Q=NULL)
Approximate distance between two kIOS bounding volumes.
FCL_REAL min_distance
minimum distance between two objects. if two objects are in collision, min_distance <= 0...
bool collide(CollisionObject *o1, CollisionObject *o2)
Collision evaluation between two objects in collision. This callback will cause the broadphase evalua...
bool collide(CollisionObject *o1, CollisionObject *o2)
Collision evaluation between two objects in collision. This callback will cause the broadphase evalua...
const std::vector< CollisionPair > & getCollisionPairs() const
Returns a const reference to the active collision_pairs to check.
bool defaultDistanceFunction(CollisionObject *o1, CollisionObject *o2, void *data, FCL_REAL &dist)
Collision data for use with the DefaultContinuousCollisionFunction. It stores the collision request a...
HPP_FCL_DLLAPI std::size_t collide(const CollisionObject *o1, const CollisionObject *o2, const CollisionRequest &request, CollisionResult &result)
Main collision interface: given two collision objects, and the requirements for contacts, including num of max contacts, whether perform exhaustive collision (i.e., returning returning all the contact points), whether return detailed contact information (i.e., normal, contact point, depth; otherwise only contact primitive id is returned), this function performs the collision between them. Return value is the number of contacts generated between the two objects.
bool exist(const CollisionPair &pair) const
Check wether a collision pair exists.
std::pair< CollisionObject *, CollisionObject * > CollisionPair
bool isCollision() const
return binary collision result
CollisionCallBackCollect(const size_t max_size)
Default constructor.
the object for collision or distance computation, contains the geometry and the transform information...
bool 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.
Distance data stores the distance request and the result given by distance algorithm.
std::vector< CollisionPair > collision_pairs
void init()
Reset the callback.