Aggregates all the contact information generated by the collision detection engine. More...
#include <physics/physics.hh>
Public Member Functions | |
ContactManager () | |
Constructor. | |
virtual | ~ContactManager () |
Destructor. | |
void | Clear () |
Clear all stored contacts. | |
Contact * | GetContact (unsigned int _index) const |
Get a single contact by index. | |
unsigned int | GetContactCount () const |
Return the number of valid contacts. | |
const std::vector< Contact * > & | GetContacts () const |
Get all the contacts. | |
void | Init (WorldPtr _world) |
Initialize the ContactManager. | |
Contact * | NewContact (Collision *_collision1, Collision *_collision2, const common::Time &_time) |
Add a new contact. | |
void | PublishContacts () |
Publish all contacts in a msgs::Contacts message. | |
void | ResetCount () |
Set the contact count to zero. | |
Aggregates all the contact information generated by the collision detection engine.
gazebo::physics::ContactManager::ContactManager | ( | ) |
Constructor.
|
virtual |
Destructor.
void gazebo::physics::ContactManager::Clear | ( | ) |
Clear all stored contacts.
Contact* gazebo::physics::ContactManager::GetContact | ( | unsigned int | _index | ) | const |
Get a single contact by index.
The index must be between 0 and ContactManager::GetContactCount.
[in] | _index | Index of the Contact to return. |
unsigned int gazebo::physics::ContactManager::GetContactCount | ( | ) | const |
Return the number of valid contacts.
const std::vector<Contact*>& gazebo::physics::ContactManager::GetContacts | ( | ) | const |
Get all the contacts.
The return vector may have invalid contacts. Only use contents of the vector between 0 and ContactManager::GetContactCount
void gazebo::physics::ContactManager::Init | ( | WorldPtr | _world | ) |
Initialize the ContactManager.
This is required in order to publish contact messages via the ContactManager::PublishContacts method.
[in] | _world | Pointer to the world that is initializing the contact manager. |
Contact* gazebo::physics::ContactManager::NewContact | ( | Collision * | _collision1, |
Collision * | _collision2, | ||
const common::Time & | _time | ||
) |
Add a new contact.
Noramlly this is only used by a Physics/Collision engine when a new contact is generated. All other users should just make use of the accessor functions.
If no one is listening, then the return value will be NULL. This is a signal to the Physics engine that it can skip the extra processing necessary to get back contact information.
void gazebo::physics::ContactManager::PublishContacts | ( | ) |
Publish all contacts in a msgs::Contacts message.
void gazebo::physics::ContactManager::ResetCount | ( | ) |
Set the contact count to zero.