chrono::collision::ChCollisionSystemBullet Class Reference

Description

Class for collision engine based on the 'Bullet' library.

Contains either the broadphase and the narrow phase Bullet methods.

#include <ChCCollisionSystemBullet.h>

Inheritance diagram for chrono::collision::ChCollisionSystemBullet:
Collaboration diagram for chrono::collision::ChCollisionSystemBullet:

Public Member Functions

 ChCollisionSystemBullet (unsigned int max_objects=16000, double scene_size=500)
 
virtual void Clear (void) override
 Clears all data instanced by this algorithm if any (like persistent contact manifolds)
 
virtual void Add (ChCollisionModel *model) override
 Adds a collision model to the collision engine (custom data may be allocated). More...
 
virtual void Remove (ChCollisionModel *model) override
 Removes a collision model from the collision engine (custom data may be deallocated). More...
 
virtual void Run () override
 Removes all collision models from the collision engine (custom data may be deallocated). More...
 
virtual void ResetTimers () override
 Reset timers for collision detection.
 
virtual double GetTimerCollisionBroad () const override
 Return the time (in seconds) for broadphase collision detection.
 
virtual double GetTimerCollisionNarrow () const override
 Return the time (in seconds) for narrowphase collision detection.
 
virtual void ReportContacts (ChContactContainer *mcontactcontainer) override
 After the Run() has completed, you can call this function to fill a 'contact container', that is an object inherited from class ChContactContainer. More...
 
virtual void ReportProximities (ChProximityContainer *mproximitycontainer) override
 After the Run() has completed, you can call this function to fill a 'proximity container' (container of narrow phase pairs), that is an object inherited from class ChProximityContainer. More...
 
virtual bool RayHit (const ChVector<> &from, const ChVector<> &to, ChRayhitResult &mresult) const override
 Perform a ray-hit test with all collision models.
 
bool RayHit (const ChVector<> &from, const ChVector<> &to, ChRayhitResult &mresult, short int filter_group, short int filter_mask) const
 Perform a ray-hit test with all collision models. More...
 
virtual bool RayHit (const ChVector<> &from, const ChVector<> &to, ChCollisionModel *model, ChRayhitResult &mresult) const override
 Perform a ray-hit test with the specified collision model.
 
bool RayHit (const ChVector<> &from, const ChVector<> &to, ChCollisionModel *model, ChRayhitResult &mresult, short int filter_group, short int filter_mask) const
 Perform a ray-hit test with the specified collision model. More...
 
btCollisionWorld * GetBulletCollisionWorld ()
 
- Public Member Functions inherited from chrono::collision::ChCollisionSystem
 ChCollisionSystem (unsigned int max_objects=16000, double scene_size=500)
 
void RegisterBroadphaseCallback (BroadphaseCallback *callback)
 Specify a callback object to be used each time a pair of 'near enough' collision shapes is found by the broad-phase collision step. More...
 
void RegisterNarrowphaseCallback (NarrowphaseCallback *callback)
 Specify a callback object to be used each time a collision pair is found during the narrow-phase collision detection step. More...
 
virtual void ArchiveOUT (ChArchiveOut &marchive)
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIN (ChArchiveIn &marchive)
 Method to allow de-serialization of transient data from archives.
 

Static Public Member Functions

static void SetContactBreakingThreshold (double threshold)
 

Additional Inherited Members

- Protected Attributes inherited from chrono::collision::ChCollisionSystem
BroadphaseCallbackbroad_callback
 user callback for each near-enough pair of shapes
 
NarrowphaseCallbacknarrow_callback
 user callback for each collision pair
 

Member Function Documentation

void chrono::collision::ChCollisionSystemBullet::Add ( ChCollisionModel model)
overridevirtual

Adds a collision model to the collision engine (custom data may be allocated).

Implements chrono::collision::ChCollisionSystem.

bool chrono::collision::ChCollisionSystemBullet::RayHit ( const ChVector<> &  from,
const ChVector<> &  to,
ChRayhitResult mresult,
short int  filter_group,
short int  filter_mask 
) const

Perform a ray-hit test with all collision models.

This version allows specifying the Bullet collision filter group and mask (see btBroadphaseProxy::CollisionFilterGroups).

bool chrono::collision::ChCollisionSystemBullet::RayHit ( const ChVector<> &  from,
const ChVector<> &  to,
ChCollisionModel model,
ChRayhitResult mresult,
short int  filter_group,
short int  filter_mask 
) const

Perform a ray-hit test with the specified collision model.

This version allows specifying the Bullet collision filter group and mask (see btBroadphaseProxy::CollisionFilterGroups).

void chrono::collision::ChCollisionSystemBullet::Remove ( ChCollisionModel model)
overridevirtual

Removes a collision model from the collision engine (custom data may be deallocated).

Implements chrono::collision::ChCollisionSystem.

void chrono::collision::ChCollisionSystemBullet::ReportContacts ( ChContactContainer mcontactcontainer)
overridevirtual

After the Run() has completed, you can call this function to fill a 'contact container', that is an object inherited from class ChContactContainer.

For instance ChSystem, after each Run() collision detection, calls this method multiple times for all contact containers in the system, The basic behavior of the implementation is the following: collision system will call in sequence the functions BeginAddContact(), AddContact() (x n times), EndAddContact() of the contact container.

Implements chrono::collision::ChCollisionSystem.

void chrono::collision::ChCollisionSystemBullet::ReportProximities ( ChProximityContainer mproximitycontainer)
overridevirtual

After the Run() has completed, you can call this function to fill a 'proximity container' (container of narrow phase pairs), that is an object inherited from class ChProximityContainer.

For instance ChSystem, after each Run() collision detection, calls this method multiple times for all proximity containers in the system, The basic behavior of the implementation is the following: collision system will call in sequence the functions BeginAddProximities(), AddProximity() (x n times), EndAddProximities() of the proximity container.

Implements chrono::collision::ChCollisionSystem.

void chrono::collision::ChCollisionSystemBullet::Run ( )
overridevirtual

Removes all collision models from the collision engine (custom data may be deallocated).

Run the algorithm and finds all the contacts. (Contacts will be managed by the Bullet persistent contact cache).

Implements chrono::collision::ChCollisionSystem.