DART
6.7.3
|
#include <CollisionDetector.hpp>
Classes | |
class | CollisionObjectManager |
class | ManagerForSharableCollisionObjects |
class | ManagerForUnsharableCollisionObjects |
Public Types | |
using | Factory = common::Factory< std::string, CollisionDetector, std::shared_ptr< CollisionDetector > > |
using | SingletonFactory = common::Singleton< Factory > |
template<typename Derived > | |
using | Registrar = common::FactoryRegistrar< std::string, CollisionDetector, Derived, std::shared_ptr< CollisionDetector > > |
Public Member Functions | |
virtual | ~CollisionDetector ()=default |
Destructor. More... | |
virtual std::shared_ptr< CollisionDetector > | cloneWithoutCollisionObjects ()=0 |
Create a clone of this CollisionDetector. More... | |
virtual const std::string & | getType () const =0 |
Return collision detection engine type as a std::string. More... | |
virtual std::unique_ptr< CollisionGroup > | createCollisionGroup ()=0 |
Create a collision group. More... | |
std::shared_ptr< CollisionGroup > | createCollisionGroupAsSharedPtr () |
Helper function that creates and returns CollisionGroup as a shared_ptr. More... | |
template<typename... Args> | |
std::unique_ptr< CollisionGroup > | createCollisionGroup (const Args &... args) |
Create a collision group from any objects that are supported by CollisionGroup::addShapeFramesOf(). More... | |
template<typename... Args> | |
std::shared_ptr< CollisionGroup > | createCollisionGroupAsSharedPtr (const Args &... args) |
Helper function that creates and returns CollisionGroup as shared_ptr. More... | |
virtual bool | collide (CollisionGroup *group, const CollisionOption &option=CollisionOption(false, 1u, nullptr), CollisionResult *result=nullptr)=0 |
Perform collision check for a single group. More... | |
virtual bool | collide (CollisionGroup *group1, CollisionGroup *group2, const CollisionOption &option=CollisionOption(false, 1u, nullptr), CollisionResult *result=nullptr)=0 |
Perform collision check for two groups. More... | |
virtual double | distance (CollisionGroup *group, const DistanceOption &option=DistanceOption(false, 0.0, nullptr), DistanceResult *result=nullptr)=0 |
Get the minimum signed distance between the Shape pairs in the given CollisionGroup. More... | |
virtual double | distance (CollisionGroup *group1, CollisionGroup *group2, const DistanceOption &option=DistanceOption(false, 0.0, nullptr), DistanceResult *result=nullptr)=0 |
Get the minimum signed distance between the Shape pairs where a pair consist of two shapes from each groups (one from group1 and one from group2). More... | |
Static Public Member Functions | |
static Factory * | getFactory () |
Returns the singleton factory. More... | |
Protected Member Functions | |
CollisionDetector ()=default | |
Constructor. More... | |
std::shared_ptr< CollisionObject > | claimCollisionObject (const dynamics::ShapeFrame *shapeFrame) |
Claim CollisionObject associated with shapeFrame. More... | |
virtual std::unique_ptr< CollisionObject > | createCollisionObject (const dynamics::ShapeFrame *shapeFrame)=0 |
Create CollisionObject. More... | |
virtual void | refreshCollisionObject (CollisionObject *object)=0 |
Update the collision geometry of a ShapeFrame. More... | |
virtual void | notifyCollisionObjectDestroying (CollisionObject *object) |
Notify that a CollisionObject is destroying. Do nothing by default. More... | |
Protected Attributes | |
std::unique_ptr< CollisionObjectManager > | mCollisionObjectManager |
Friends | |
class | CollisionObject |
class | CollisionGroup |
using dart::collision::CollisionDetector::Factory = common::Factory< std::string, CollisionDetector, std::shared_ptr<CollisionDetector> > |
using dart::collision::CollisionDetector::Registrar = common::FactoryRegistrar< std::string, CollisionDetector, Derived, std::shared_ptr<CollisionDetector> > |
|
virtualdefault |
Destructor.
|
protecteddefault |
Constructor.
|
protected |
Claim CollisionObject associated with shapeFrame.
New CollisionObject will be created if it hasn't created yet for shapeFrame.
|
pure virtual |
Create a clone of this CollisionDetector.
All the properties will be copied over, but not collision objects.
Implemented in dart::collision::OdeCollisionDetector, dart::collision::FCLCollisionDetector, dart::collision::DARTCollisionDetector, and dart::collision::BulletCollisionDetector.
|
pure virtual |
Perform collision check for a single group.
If nullptr is passed to result, then the this returns only simple information whether there is a collision of not.
Implemented in dart::collision::OdeCollisionDetector, dart::collision::FCLCollisionDetector, dart::collision::DARTCollisionDetector, and dart::collision::BulletCollisionDetector.
|
pure virtual |
Perform collision check for two groups.
If nullptr is passed to result, then the this returns only simple information whether there is a collision of not.
Implemented in dart::collision::OdeCollisionDetector, dart::collision::FCLCollisionDetector, dart::collision::DARTCollisionDetector, and dart::collision::BulletCollisionDetector.
|
pure virtual |
Create a collision group.
Implemented in dart::collision::OdeCollisionDetector, dart::collision::FCLCollisionDetector, dart::collision::DARTCollisionDetector, dart::collision::BulletCollisionDetector, dart::collision::OdeCollisionDetector, dart::collision::FCLCollisionDetector, dart::collision::DARTCollisionDetector, and dart::collision::BulletCollisionDetector.
std::unique_ptr< CollisionGroup > dart::collision::CollisionDetector::createCollisionGroup | ( | const Args &... | args | ) |
Create a collision group from any objects that are supported by CollisionGroup::addShapeFramesOf().
The objects can be any of ShapeFrame, std::vector<ShapeFrame>, CollisionGroup, BodyNode, and Skeleton.
Note that this function adds only the ShapeFrames of each object at the moment that this function is called. Any later addition to or removal of the ShapeFrames that are attached to these objects will NOT be noticed.
std::shared_ptr< CollisionGroup > dart::collision::CollisionDetector::createCollisionGroupAsSharedPtr | ( | ) |
Helper function that creates and returns CollisionGroup as a shared_ptr.
Internally, this function creates a shared_ptr from unique_ptr returned from createCollisionGroup() so the performance would be slighly worse than using std::make_unique.
std::shared_ptr< CollisionGroup > dart::collision::CollisionDetector::createCollisionGroupAsSharedPtr | ( | const Args &... | args | ) |
Helper function that creates and returns CollisionGroup as shared_ptr.
|
protectedpure virtual |
|
pure virtual |
Get the minimum signed distance between the Shape pairs in the given CollisionGroup.
The detailed results are stored in the given DistanceResult if provided.
The results can be different by DistanceOption. By default, non-negative minimum distance (distance >= 0) is returned for all the shape pairs without computing nearest points.
Implemented in dart::collision::OdeCollisionDetector, dart::collision::FCLCollisionDetector, dart::collision::DARTCollisionDetector, and dart::collision::BulletCollisionDetector.
|
pure virtual |
Get the minimum signed distance between the Shape pairs where a pair consist of two shapes from each groups (one from group1 and one from group2).
Note that the distance between shapes within the same CollisionGroup are not accounted.
The detailed results are stored in the given DistanceResult if provided.
The results can be different by DistanceOption. By default, non-negative minimum distance (distance >= 0) is returned for all the shape pairs without computing nearest points.
Implemented in dart::collision::OdeCollisionDetector, dart::collision::FCLCollisionDetector, dart::collision::DARTCollisionDetector, and dart::collision::BulletCollisionDetector.
|
static |
Returns the singleton factory.
|
pure virtual |
Return collision detection engine type as a std::string.
Implemented in dart::collision::OdeCollisionDetector, dart::collision::FCLCollisionDetector, dart::collision::DARTCollisionDetector, and dart::collision::BulletCollisionDetector.
|
protectedvirtual |
Notify that a CollisionObject is destroying. Do nothing by default.
Reimplemented in dart::collision::BulletCollisionDetector.
|
protectedpure virtual |
Update the collision geometry of a ShapeFrame.
Implemented in dart::collision::OdeCollisionDetector, dart::collision::FCLCollisionDetector, dart::collision::DARTCollisionDetector, and dart::collision::BulletCollisionDetector.
|
friend |
|
friend |
|
protected |