hpp-fcl  3.0.0
HPP fork of FCL -- The Flexible Collision Library
hpp::fcl::Contact Struct Reference

Contact information returned by collision. More...

#include <hpp/fcl/collision_data.h>

Collaboration diagram for hpp::fcl::Contact:

Public Member Functions

 Contact ()
 Default constructor. More...
 
 Contact (const CollisionGeometry *o1_, const CollisionGeometry *o2_, int b1_, int b2_)
 
 Contact (const CollisionGeometry *o1_, const CollisionGeometry *o2_, int b1_, int b2_, const Vec3f &pos_, const Vec3f &normal_, FCL_REAL depth_)
 
 Contact (const CollisionGeometry *o1_, const CollisionGeometry *o2_, int b1_, int b2_, const Vec3f &p1, const Vec3f &p2, const Vec3f &normal_, FCL_REAL depth_)
 
bool operator< (const Contact &other) const
 
bool operator== (const Contact &other) const
 
bool operator!= (const Contact &other) const
 
FCL_REAL getDistanceToCollision (const CollisionRequest &request) const
 

Public Attributes

const CollisionGeometryo1
 collision object 1 More...
 
const CollisionGeometryo2
 collision object 2 More...
 
int b1
 contact primitive in object 1 if object 1 is mesh or point cloud, it is the triangle or point id if object 1 is geometry shape, it is NONE (-1), if object 1 is octree, it is the id of the cell More...
 
int b2
 contact primitive in object 2 if object 2 is mesh or point cloud, it is the triangle or point id if object 2 is geometry shape, it is NONE (-1), if object 2 is octree, it is the id of the cell More...
 
Vec3f normal
 contact normal, pointing from o1 to o2. The normal defined as the normalized separation vector: normal = (p2 - p1) / dist(o1, o2), where p1 = nearest_points[0] belongs to o1 and p2 = nearest_points[1] belongs to o2 and dist(o1, o2) is the signed distance between o1 and o2. The normal always points from o1 to o2. More...
 
std::array< Vec3f, 2 > nearest_points
 nearest points associated to this contact. More...
 
Vec3f pos
 contact position, in world space More...
 
FCL_REAL penetration_depth
 penetration depth More...
 

Static Public Attributes

static const int NONE = -1
 invalid contact primitive information More...
 

Detailed Description

Contact information returned by collision.

Constructor & Destructor Documentation

◆ Contact() [1/4]

hpp::fcl::Contact::Contact ( )
inline

Default constructor.

◆ Contact() [2/4]

hpp::fcl::Contact::Contact ( const CollisionGeometry o1_,
const CollisionGeometry o2_,
int  b1_,
int  b2_ 
)
inline

◆ Contact() [3/4]

hpp::fcl::Contact::Contact ( const CollisionGeometry o1_,
const CollisionGeometry o2_,
int  b1_,
int  b2_,
const Vec3f pos_,
const Vec3f normal_,
FCL_REAL  depth_ 
)
inline

◆ Contact() [4/4]

hpp::fcl::Contact::Contact ( const CollisionGeometry o1_,
const CollisionGeometry o2_,
int  b1_,
int  b2_,
const Vec3f p1,
const Vec3f p2,
const Vec3f normal_,
FCL_REAL  depth_ 
)
inline

Member Function Documentation

◆ getDistanceToCollision()

FCL_REAL hpp::fcl::Contact::getDistanceToCollision ( const CollisionRequest request) const
inline

◆ operator!=()

bool hpp::fcl::Contact::operator!= ( const Contact other) const
inline

◆ operator<()

bool hpp::fcl::Contact::operator< ( const Contact other) const
inline

◆ operator==()

bool hpp::fcl::Contact::operator== ( const Contact other) const
inline

Member Data Documentation

◆ b1

int hpp::fcl::Contact::b1

contact primitive in object 1 if object 1 is mesh or point cloud, it is the triangle or point id if object 1 is geometry shape, it is NONE (-1), if object 1 is octree, it is the id of the cell

◆ b2

int hpp::fcl::Contact::b2

contact primitive in object 2 if object 2 is mesh or point cloud, it is the triangle or point id if object 2 is geometry shape, it is NONE (-1), if object 2 is octree, it is the id of the cell

◆ nearest_points

std::array<Vec3f, 2> hpp::fcl::Contact::nearest_points

nearest points associated to this contact.

Note
Also referred as "witness points" in other collision libraries. The points p1 = nearest_points[0] and p2 = nearest_points[1] verify the property that dist(o1, o2) * (p1 - p2) is the separation vector between o1 and o2, with dist(o1, o2) being the signed distance separating o1 from o2. See DistanceResult::normal for the definition of the separation vector. If o1 and o2 have multiple contacts, the nearest_points are associated with the contact which has the greatest penetration depth. TODO (louis): rename nearest_points to witness_points.

◆ NONE

const int hpp::fcl::Contact::NONE = -1
static

invalid contact primitive information

◆ normal

Vec3f hpp::fcl::Contact::normal

contact normal, pointing from o1 to o2. The normal defined as the normalized separation vector: normal = (p2 - p1) / dist(o1, o2), where p1 = nearest_points[0] belongs to o1 and p2 = nearest_points[1] belongs to o2 and dist(o1, o2) is the signed distance between o1 and o2. The normal always points from o1 to o2.

Note
The separation vector is the smallest vector such that if o1 is translated by it, o1 and o2 are in touching contact (they share at least one contact point but have a zero intersection volume). If the shapes overlap, dist(o1, o2) = -((p2-p1).norm()). Otherwise, dist(o1, o2) = (p2-p1).norm().

◆ o1

const CollisionGeometry* hpp::fcl::Contact::o1

collision object 1

◆ o2

const CollisionGeometry* hpp::fcl::Contact::o2

collision object 2

◆ penetration_depth

FCL_REAL hpp::fcl::Contact::penetration_depth

penetration depth

◆ pos

Vec3f hpp::fcl::Contact::pos

contact position, in world space


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