Collision Pair class, it signifies a pair of items that should be checked with the collision algorithm, this structure will be used for input as well as output, as contacts get appended to the contacts list when found.
More...
#include <SurgSim/Collision/CollisionPair.h>
|
| CollisionPair () |
| Default Constructor. More...
|
|
| CollisionPair (const std::shared_ptr< Representation > &first, const std::shared_ptr< Representation > &second) |
| Normal constructor. More...
|
|
| ~CollisionPair () |
| Destructor. More...
|
|
void | setRepresentations (const std::shared_ptr< Representation > &first, const std::shared_ptr< Representation > &second) |
| Sets the representations in this pair, representations cannot be the same instance and neither can be nullptr. More...
|
|
const std::pair< std::shared_ptr< Representation >, std::shared_ptr< Representation > > & | getRepresentations () const |
| Function that returns the pair of representations of the objects that are colliding. More...
|
|
std::shared_ptr< Representation > | getFirst () const |
|
std::shared_ptr< Representation > | getSecond () const |
|
bool | hasContacts () const |
|
void | addContact (const double &depth, const SurgSim::Math::Vector3d &contactPoint, const SurgSim::Math::Vector3d &normal, const std::pair< SurgSim::DataStructures::Location, SurgSim::DataStructures::Location > &penetrationPoints) |
| Adds a contact to the collision pair. More...
|
|
void | addContact (const double &depth, const SurgSim::Math::Vector3d &normal, const std::pair< SurgSim::DataStructures::Location, SurgSim::DataStructures::Location > &penetrationPoints) |
| Adds a contact to the collision pair. More...
|
|
void | addContact (const std::shared_ptr< Contact > &contact) |
| Adds a contact. More...
|
|
const std::list< std::shared_ptr< Contact > > & | getContacts () const |
|
void | clearContacts () |
| Reset clear the list of contacts, invalidating all the contacts. More...
|
|
void | swapRepresentations () |
| Swap the representation pair so that first becomes second and second becomes first. More...
|
|
bool | isSwapped () const |
| Query if this the pair has been swapped from when it was constructed. More...
|
|
Collision Pair class, it signifies a pair of items that should be checked with the collision algorithm, this structure will be used for input as well as output, as contacts get appended to the contacts list when found.
SurgSim::Collision::CollisionPair::CollisionPair |
( |
| ) |
|
SurgSim::Collision::CollisionPair::CollisionPair |
( |
const std::shared_ptr< Representation > & |
first, |
|
|
const std::shared_ptr< Representation > & |
second |
|
) |
| |
SurgSim::Collision::CollisionPair::~CollisionPair |
( |
| ) |
|
Adds a contact to the collision pair.
- Parameters
-
depth | The depth of the intersection. |
contactPoint | The contact point, between the two bodies. |
normal | The normal of the contact pointing into the first representation. |
penetrationPoints | The points furthest into the opposing object |
Adds a contact to the collision pair.
- Parameters
-
depth | The depth of the intersection. |
normal | The normal of the contact pointing into the first representation. |
penetrationPoints | The points furthest into the opposing object |
void SurgSim::Collision::CollisionPair::addContact |
( |
const std::shared_ptr< Contact > & |
contact | ) |
|
Adds a contact.
- Parameters
-
contact | The contact between the first and the second representation. |
void SurgSim::Collision::CollisionPair::clearContacts |
( |
| ) |
|
Reset clear the list of contacts, invalidating all the contacts.
const std::list< std::shared_ptr< Contact > > & SurgSim::Collision::CollisionPair::getContacts |
( |
| ) |
const |
std::shared_ptr< Representation > SurgSim::Collision::CollisionPair::getFirst |
( |
| ) |
const |
- Returns
- The representation considered to be the first
const std::pair< std::shared_ptr< Representation >, std::shared_ptr< Representation > > & SurgSim::Collision::CollisionPair::getRepresentations |
( |
| ) |
const |
Function that returns the pair of representations of the objects that are colliding.
- Returns
- The pair of representations that are colliding.
std::shared_ptr< Representation > SurgSim::Collision::CollisionPair::getSecond |
( |
| ) |
const |
- Returns
- The representation considered to be the second
bool SurgSim::Collision::CollisionPair::hasContacts |
( |
| ) |
const |
- Returns
- true if there are any contacts assigned to the pair, false otherwise
bool SurgSim::Collision::CollisionPair::isSwapped |
( |
| ) |
const |
Query if this the pair has been swapped from when it was constructed.
- Returns
- true if swapped, false if not.
void SurgSim::Collision::CollisionPair::setRepresentations |
( |
const std::shared_ptr< Representation > & |
first, |
|
|
const std::shared_ptr< Representation > & |
second |
|
) |
| |
Sets the representations in this pair, representations cannot be the same instance and neither can be nullptr.
- Parameters
-
void SurgSim::Collision::CollisionPair::swapRepresentations |
( |
| ) |
|
Swap the representation pair so that first becomes second and second becomes first.
std::list<std::shared_ptr<Contact> > SurgSim::Collision::CollisionPair::m_contacts |
|
private |
List of current contacts.
bool SurgSim::Collision::CollisionPair::m_isSwapped |
|
private |
Pair of objects that are colliding.
The documentation for this class was generated from the following files: