coal  3.0.1
Coal, The Collision Detection Library. Previously known as HPP-FCL, fork of FCL -- The Flexible Collision Library
coal::CollisionResult Struct Reference

collision result More...

#include <coal/collision_data.h>

Inheritance diagram for coal::CollisionResult:
Collaboration diagram for coal::CollisionResult:

Public Member Functions

 CollisionResult ()
 
void updateDistanceLowerBound (const Scalar &distance_lower_bound_)
 Update the lower bound only if the distance is inferior. More...
 
void addContact (const Contact &c)
 add one contact into result structure More...
 
bool operator== (const CollisionResult &other) const
 whether two CollisionResult are the same or not More...
 
bool isCollision () const
 return binary collision result More...
 
size_t numContacts () const
 number of contacts found More...
 
const ContactgetContact (size_t i) const
 get the i-th contact calculated More...
 
void setContact (size_t i, const Contact &c)
 set the i-th contact calculated More...
 
void getContacts (std::vector< Contact > &contacts_) const
 get all the contacts More...
 
const std::vector< Contact > & getContacts () const
 
void clear ()
 clear the results obtained More...
 
void swapObjects ()
 reposition Contact objects when fcl inverts them during their construction. More...
 
- Public Member Functions inherited from coal::QueryResult
 QueryResult ()
 

Public Attributes

Scalar distance_lower_bound
 
Vec3s normal
 normal associated to nearest_points. Same as CollisionResult::nearest_points but for the normal. More...
 
std::array< Vec3s, 2 > nearest_points
 nearest points. A CollisionResult can have multiple contacts. The nearest points in CollisionResults correspond to the witness points associated with the smallest distance i.e the distance_lower_bound. For bounding volumes and BVHs, these nearest points are available only when distance_lower_bound is inferior to CollisionRequest::break_distance. More...
 
- Public Attributes inherited from coal::QueryResult
Vec3s cached_gjk_guess
 stores the last GJK ray when relevant. More...
 
support_func_guess_t cached_support_func_guess
 stores the last support function vertex index, when relevant. More...
 
CPUTimes timings
 timings for the given request More...
 

Detailed Description

collision result

Constructor & Destructor Documentation

◆ CollisionResult()

coal::CollisionResult::CollisionResult ( )
inline

Member Function Documentation

◆ addContact()

void coal::CollisionResult::addContact ( const Contact c)
inline

add one contact into result structure

◆ clear()

void coal::CollisionResult::clear ( )
inline

clear the results obtained

◆ getContact()

const Contact& coal::CollisionResult::getContact ( size_t  i) const
inline

get the i-th contact calculated

◆ getContacts() [1/2]

const std::vector<Contact>& coal::CollisionResult::getContacts ( ) const
inline

◆ getContacts() [2/2]

void coal::CollisionResult::getContacts ( std::vector< Contact > &  contacts_) const
inline

get all the contacts

◆ isCollision()

bool coal::CollisionResult::isCollision ( ) const
inline

return binary collision result

◆ numContacts()

size_t coal::CollisionResult::numContacts ( ) const
inline

number of contacts found

◆ operator==()

bool coal::CollisionResult::operator== ( const CollisionResult other) const
inline

whether two CollisionResult are the same or not

◆ setContact()

void coal::CollisionResult::setContact ( size_t  i,
const Contact c 
)
inline

set the i-th contact calculated

◆ swapObjects()

void coal::CollisionResult::swapObjects ( )

reposition Contact objects when fcl inverts them during their construction.

◆ updateDistanceLowerBound()

void coal::CollisionResult::updateDistanceLowerBound ( const Scalar distance_lower_bound_)
inline

Update the lower bound only if the distance is inferior.

Member Data Documentation

◆ distance_lower_bound

Scalar coal::CollisionResult::distance_lower_bound

Lower bound on distance between objects if they are disjoint. See Collision

Note
Always computed. If CollisionRequest::distance_upper_bound is set to infinity, distance_lower_bound is the actual distance between the shapes.

◆ nearest_points

std::array<Vec3s, 2> coal::CollisionResult::nearest_points

nearest points. A CollisionResult can have multiple contacts. The nearest points in CollisionResults correspond to the witness points associated with the smallest distance i.e the distance_lower_bound. For bounding volumes and BVHs, these nearest points are available only when distance_lower_bound is inferior to CollisionRequest::break_distance.

◆ normal

Vec3s coal::CollisionResult::normal

normal associated to nearest_points. Same as CollisionResult::nearest_points but for the normal.


The documentation for this struct was generated from the following file: