Struct CollisionResult
Defined in File collision_data.h
Inheritance Relationships
Base Type
public coal::QueryResult(Struct QueryResult)
Struct Documentation
-
struct CollisionResult : public coal::QueryResult
collision result
Public Functions
-
inline CollisionResult()
Default constructor.
-
CollisionResult(const CollisionResult &other) = default
Copy constructor.
-
CollisionResult &operator=(const CollisionResult &other) = default
-
inline CollisionResult(const CollisionResult &other, const std::vector<std::pair<const CollisionGeometry*, const CollisionGeometry*>> &new_geometries)
Copy constructor from an other CollisionResult and two vectors of CollisionGeometry pointers. This constructor allows to copy the collision result information from an other collision result, but remap the pointers to the collision geometries to the provided ones. This is usefull in a deep-copy context, when the collision geometries are also copied and the pointers in the collision result need to be remapped to the new collision geometries.
-
inline void resolveReferences(const std::vector<std::pair<const CollisionGeometry*, const CollisionGeometry*>> &new_geometries)
Resolve the internal points the pointers in the contacts to the provided pairs of collision geometries. This is useful when deep-copying or deserializing a collision result, as the pointers to the collision objects are not valid anymore and need to be remapped to the collision objects in the current context.
-
inline void updateDistanceLowerBound(const Scalar &distance_lower_bound_)
Update the lower bound only if the distance is inferior.
-
inline bool operator==(const CollisionResult &other) const
whether two CollisionResult are the same or not
-
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 void clear()
clear the results obtained
-
inline void disp(std::ostream &os, const std::string &prefix = "") const
Prints the result to the provided output stream.
Public Members
-
Scalar 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_pointsbut for the normal.
-
std::array<Vec3s, 2> nearest_points
nearest points. A
CollisionResultcan have multiple contacts. The nearest points inCollisionResultscorrespond to the witness points associated with the smallest distance i.e thedistance_lower_bound. For bounding volumes and BVHs, these nearest points are available only when distance_lower_bound is inferior to CollisionRequest::break_distance.
Friends
-
inline friend std::ostream &operator<<(std::ostream &os, const CollisionResult &res)
Prints the result to the provided output stream.
-
inline CollisionResult()