chrono::collision::ChCollisionSystemSpheres Class Reference

Description

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

Contains either the broadphase and the narrow phase Bullet methods.

#include <ChCCollisionSystemSpheres.h>

Inheritance diagram for chrono::collision::ChCollisionSystemSpheres:
Collaboration diagram for chrono::collision::ChCollisionSystemSpheres:

Public Member Functions

 ChCollisionSystemSpheres (unsigned int max_objects=16000, double scene_size=500)
 
virtual void Clear (void)
 Clears all data instanced by this algorithm if any (like persistent contact manifolds)
 
virtual void Add (ChCollisionModel *model)
 Adds a collision model to the collision engine (custom data may be allocated). More...
 
virtual void Remove (ChCollisionModel *model)
 Removes a collision model from the collision engine (custom data may be deallocated). More...
 
virtual void Run ()
 Removes all collision models from the collision engine (custom data may be deallocated). More...
 
virtual void updateDataStructures ()
 
virtual void ReportContacts (ChContactContainerBase *mcontactcontainer)
 After the Run() has completed, you can call this function to fill a 'contact container', that is an object inherited from class ChContactContainerBase. More...
 
virtual void ReportProximities (ChProximityContainerBase *mproximitycontainer)
 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 ChProximityContainerBase. More...
 
virtual bool RayHit (const ChVector<> &from, const ChVector<> &to, ChRayhitResult &mresult)
 Perform a raycast (ray-hit test with the collision models).
 
void host_Generate_AABB (const realV *pos, const real *radius, realV *aabb_data)
 
void host_Count_AABB_BIN_Intersection (const realV *aabb_data, uint *Bins_Intersected)
 
void host_Store_AABB_BIN_Intersection (const realV *aabb_data, const uint *Bins_Intersected, uint *bin_number, uint *body_number)
 
void host_Count_AABB_AABB_Intersection (const realV *aabb_data, const uint *bin_number, const uint *body_number, const uint *bodyIndex, const uint *bin_start_index, const bool *active, uint *Num_ContactD)
 
void host_Store_AABB_AABB_Intersection (const realV *aabb_data, const uint *bin_number, const uint *body_number, const uint *bodyIndex, const uint *bin_start_index, const uint *Num_ContactD, const bool *active, long long *potential_contacts)
 
void host_Store_Contact (const long long *potential_contacts, const realV *pos, const float *radius, const uint *bodyIndex, uint *id_a, uint *id_b, realV *cpt_a, realV *cpt_b, realV *Norm, float *c_dist, float *rest_len, uint *counter)
 
- Public Member Functions inherited from chrono::collision::ChCollisionSystem
 ChCollisionSystem (unsigned int max_objects=16000, double scene_size=500)
 
void SetBroadPhaseCallback (ChBroadPhaseCallback *mcallback)
 Sets the user ChBroadPhaseCallback to be used to tell the near-enough pairs found during the Run() execution. More...
 
void SetNarrowPhaseCallback (ChNarrowPhaseCallback *mcallback)
 Sets the used ChNarrowPhaseCallback to be used to report the contacts found during the Run() execution. More...
 
virtual void ArchiveOUT (ChArchiveOut &marchive)
 
virtual void ArchiveIN (ChArchiveIn &marchive)
 

Public Attributes

thrust::host_vector< long long > potential_contacts
 
thrust::host_vector< realVaabb_data
 
thrust::host_vector< uint > Bins_Intersected
 
thrust::host_vector< uint > bin_number
 
thrust::host_vector< uint > body_number
 
thrust::host_vector< uint > bin_start_index
 
thrust::host_vector< uint > Num_ContactD
 
ChCollisionSpheres * particle_list
 
ChContacts * contact_list
 

Additional Inherited Members

- Protected Attributes inherited from chrono::collision::ChCollisionSystem
ChBroadPhaseCallbackbroad_callback
 
ChNarrowPhaseCallbacknarrow_callback
 

Member Function Documentation

void chrono::collision::ChCollisionSystemSpheres::Add ( ChCollisionModel model)
virtual

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

Implements chrono::collision::ChCollisionSystem.

void chrono::collision::ChCollisionSystemSpheres::Remove ( ChCollisionModel model)
virtual

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

Implements chrono::collision::ChCollisionSystem.

void chrono::collision::ChCollisionSystemSpheres::ReportContacts ( ChContactContainerBase mcontactcontainer)
virtual

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

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::ChCollisionSystemSpheres::ReportProximities ( ChProximityContainerBase mproximitycontainer)
virtual

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 ChProximityContainerBase.

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::ChCollisionSystemSpheres::Run ( )
virtual

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.