DART
6.7.3
|
#include <BulletCollisionDetector.hpp>
Classes | |
class | BulletCollisionShapeDeleter |
This deleter is responsible for deleting BulletCollsionShape objects and removing them from mShapeMap when they are not shared by any CollisionObjects. More... | |
struct | ShapeInfo |
Information for a shape that was generated by this collision detector. More... | |
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 | ~BulletCollisionDetector () |
Constructor. More... | |
std::shared_ptr< CollisionDetector > | cloneWithoutCollisionObjects () override |
Create a clone of this CollisionDetector. More... | |
const std::string & | getType () const override |
Return collision detection engine type as a std::string. More... | |
std::unique_ptr< CollisionGroup > | createCollisionGroup () override |
Create a collision group. More... | |
bool | collide (CollisionGroup *group, const CollisionOption &option=CollisionOption(false, 1u, nullptr), CollisionResult *result=nullptr) override |
Perform collision check for a single group. More... | |
bool | collide (CollisionGroup *group1, CollisionGroup *group2, const CollisionOption &option=CollisionOption(false, 1u, nullptr), CollisionResult *result=nullptr) override |
Perform collision check for two groups. More... | |
double | distance (CollisionGroup *group, const DistanceOption &option=DistanceOption(false, 0.0, nullptr), DistanceResult *result=nullptr) override |
Get the minimum signed distance between the Shape pairs in the given CollisionGroup. More... | |
double | distance (CollisionGroup *group1, CollisionGroup *group2, const DistanceOption &option=DistanceOption(false, 0.0, nullptr), DistanceResult *result=nullptr) override |
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... | |
virtual std::unique_ptr< CollisionGroup > | createCollisionGroup ()=0 |
Create a collision group. 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::unique_ptr< CollisionGroup > | createCollisionGroup (const Args &... args) |
Create a collision group from any objects that are supported by CollisionGroup::addShapeFramesOf(). More... | |
std::shared_ptr< CollisionGroup > | createCollisionGroupAsSharedPtr () |
Helper function that creates and returns CollisionGroup as a shared_ptr. More... | |
template<typename... Args> | |
std::shared_ptr< CollisionGroup > | createCollisionGroupAsSharedPtr (const Args &... args) |
Helper function that creates and returns CollisionGroup as shared_ptr. More... | |
Static Public Member Functions | |
static std::shared_ptr< BulletCollisionDetector > | create () |
static const std::string & | getStaticType () |
Get collision detector type for this class. More... | |
static Factory * | getFactory () |
Returns the singleton factory. More... | |
Protected Member Functions | |
BulletCollisionDetector () | |
Constructor. More... | |
std::unique_ptr< CollisionObject > | createCollisionObject (const dynamics::ShapeFrame *shapeFrame) override |
Create CollisionObject. More... | |
void | refreshCollisionObject (CollisionObject *object) override |
Update the collision geometry of a ShapeFrame. More... | |
void | notifyCollisionObjectDestroying (CollisionObject *object) override |
Notify that a CollisionObject is destroying. Do nothing by default. More... | |
std::shared_ptr< CollisionObject > | claimCollisionObject (const dynamics::ShapeFrame *shapeFrame) |
Claim CollisionObject associated with shapeFrame. More... | |
Protected Attributes | |
std::unique_ptr< CollisionObjectManager > | mCollisionObjectManager |
Private Member Functions | |
std::shared_ptr< BulletCollisionShape > | claimBulletCollisionShape (const dynamics::ConstShapePtr &shape) |
void | reclaimBulletCollisionShape (const dynamics::ConstShapePtr &shape) |
std::unique_ptr< BulletCollisionShape > | createBulletCollisionShape (const dynamics::ConstShapePtr &shape) |
Private Attributes | |
std::map< dynamics::ConstShapePtr, ShapeInfo > | mShapeMap |
std::unique_ptr< BulletCollisionGroup > | mGroupForFiltering |
Static Private Attributes | |
static Registrar< BulletCollisionDetector > | mRegistrar |
Friends | |
class | CollisionDetector |
|
inherited |
|
inherited |
|
inherited |
|
virtual |
Constructor.
|
protected |
Constructor.
|
private |
|
protectedinherited |
Claim CollisionObject associated with shapeFrame.
New CollisionObject will be created if it hasn't created yet for shapeFrame.
|
overridevirtual |
Create a clone of this CollisionDetector.
All the properties will be copied over, but not collision objects.
Implements dart::collision::CollisionDetector.
|
overridevirtual |
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.
Implements dart::collision::CollisionDetector.
|
overridevirtual |
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.
Implements dart::collision::CollisionDetector.
|
static |
|
private |
|
overridevirtual |
Create a collision group.
Implements dart::collision::CollisionDetector.
|
virtual |
Create a collision group.
Implements dart::collision::CollisionDetector.
std::unique_ptr< CollisionGroup > dart::collision::CollisionDetector::createCollisionGroup | ( | typename... | 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.
|
inherited |
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.
|
inherited |
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.
|
inherited |
Helper function that creates and returns CollisionGroup as shared_ptr.
|
overrideprotectedvirtual |
Create CollisionObject.
Implements dart::collision::CollisionDetector.
|
overridevirtual |
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.
Implements dart::collision::CollisionDetector.
|
overridevirtual |
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.
Implements dart::collision::CollisionDetector.
|
staticinherited |
Returns the singleton factory.
|
static |
Get collision detector type for this class.
|
overridevirtual |
Return collision detection engine type as a std::string.
Implements dart::collision::CollisionDetector.
|
overrideprotectedvirtual |
Notify that a CollisionObject is destroying. Do nothing by default.
Reimplemented from dart::collision::CollisionDetector.
|
private |
|
overrideprotectedvirtual |
Update the collision geometry of a ShapeFrame.
Implements dart::collision::CollisionDetector.
|
friend |
|
protectedinherited |
|
private |
|
staticprivate |
|
private |