Struct CollisionResult

Inheritance Relationships

Base Type

Struct Documentation

struct CollisionResult : public coal::QueryResult

collision result

Public Functions

inline CollisionResult()
inline void updateDistanceLowerBound(const CoalScalar &distance_lower_bound_)

Update the lower bound only if the distance is inferior.

inline void addContact(const Contact &c)

add one contact into result structure

inline bool operator==(const CollisionResult &other) const

whether two CollisionResult are the same or not

inline bool isCollision() const

return binary collision result

inline size_t numContacts() const

number of contacts found

inline const Contact &getContact(size_t i) const

get the i-th contact calculated

inline void setContact(size_t i, const Contact &c)

set the i-th contact calculated

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

get all the contacts

inline const std::vector<Contact> &getContacts() const
inline void clear()

clear the results obtained

void swapObjects()

reposition Contact objects when fcl inverts them during their construction.

Public Members

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

Vec3s normal

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

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.