DART  6.7.3
dart::collision::CollisionResult Class Reference

#include <CollisionResult.hpp>

Public Member Functions

void addContact (const Contact &contact)
 Add one contact. More...
 
std::size_t getNumContacts () const
 Return number of contacts. More...
 
ContactgetContact (std::size_t index)
 Return the index-th contact. More...
 
const ContactgetContact (std::size_t index) const
 Return (const) the index-th contact. More...
 
const std::vector< Contact > & getContacts () const
 Return contacts. More...
 
const std::unordered_set< const dynamics::BodyNode * > & getCollidingBodyNodes () const
 Return the set of BodyNodes that are in collision. More...
 
const std::unordered_set< const dynamics::ShapeFrame * > & getCollidingShapeFrames () const
 Return the set of ShapeFrames that are in collision. More...
 
bool inCollision (const dynamics::BodyNode *bn) const
 Returns true if the given BodyNode is in collision. More...
 
bool inCollision (const dynamics::ShapeFrame *frame) const
 Returns true if the given ShapeFrame is in collision. More...
 
bool isCollision () const
 Return binary collision result. More...
 
 operator bool () const
 Implicitly converts this CollisionResult to the value of isCollision() More...
 
void clear ()
 Clear all the contacts. More...
 

Protected Member Functions

void addObject (CollisionObject *object)
 

Protected Attributes

std::vector< ContactmContacts
 List of contact information for each contact. More...
 
std::unordered_set< const dynamics::BodyNode * > mCollidingBodyNodes
 Set of BodyNodes that are colliding. More...
 
std::unordered_set< const dynamics::ShapeFrame * > mCollidingShapeFrames
 Set of ShapeFrames that are colliding. More...
 

Member Function Documentation

◆ addContact()

void dart::collision::CollisionResult::addContact ( const Contact contact)

Add one contact.

◆ addObject()

void dart::collision::CollisionResult::addObject ( CollisionObject object)
protected

◆ clear()

void dart::collision::CollisionResult::clear ( )

Clear all the contacts.

◆ getCollidingBodyNodes()

const std::unordered_set< const dynamics::BodyNode * > & dart::collision::CollisionResult::getCollidingBodyNodes ( ) const

Return the set of BodyNodes that are in collision.

◆ getCollidingShapeFrames()

const std::unordered_set< const dynamics::ShapeFrame * > & dart::collision::CollisionResult::getCollidingShapeFrames ( ) const

Return the set of ShapeFrames that are in collision.

◆ getContact() [1/2]

Contact & dart::collision::CollisionResult::getContact ( std::size_t  index)

Return the index-th contact.

◆ getContact() [2/2]

const Contact & dart::collision::CollisionResult::getContact ( std::size_t  index) const

Return (const) the index-th contact.

◆ getContacts()

const std::vector< Contact > & dart::collision::CollisionResult::getContacts ( ) const

Return contacts.

◆ getNumContacts()

std::size_t dart::collision::CollisionResult::getNumContacts ( ) const

Return number of contacts.

◆ inCollision() [1/2]

bool dart::collision::CollisionResult::inCollision ( const dynamics::BodyNode bn) const

Returns true if the given BodyNode is in collision.

◆ inCollision() [2/2]

bool dart::collision::CollisionResult::inCollision ( const dynamics::ShapeFrame frame) const

Returns true if the given ShapeFrame is in collision.

◆ isCollision()

bool dart::collision::CollisionResult::isCollision ( ) const

Return binary collision result.

◆ operator bool()

dart::collision::CollisionResult::operator bool ( ) const

Implicitly converts this CollisionResult to the value of isCollision()

Member Data Documentation

◆ mCollidingBodyNodes

std::unordered_set<const dynamics::BodyNode*> dart::collision::CollisionResult::mCollidingBodyNodes
protected

Set of BodyNodes that are colliding.

◆ mCollidingShapeFrames

std::unordered_set<const dynamics::ShapeFrame*> dart::collision::CollisionResult::mCollidingShapeFrames
protected

Set of ShapeFrames that are colliding.

◆ mContacts

std::vector<Contact> dart::collision::CollisionResult::mContacts
protected

List of contact information for each contact.