chrono::collision Namespace Reference

Description

Namespace with classes for collision detection.

Classes

class  ChCollisionInfo
 Class for passing basic data about contact pairs. More...
 
class  ChCollisionModel
 Class containing the geometric model ready for collision detection. More...
 
class  ChCollisionPair
 Class for storing information about a collision point. More...
 
class  ChCollisionSystem
 Base class for generic collision engine. More...
 
class  ChCollisionSystemBullet
 Class for collision engine based on the 'Bullet' library. More...
 
class  ChCollisionSystemSpheres
 Class for collision engine based on the 'Bullet' library. More...
 
class  ChCollisionUtils
 Class with some utility functions for collision detection, as static functions. More...
 
class  ChConvexHullLibraryWrapper
 Wrapper for using andexporting the Bullet implementation of the convex hull library. More...
 
class  ChConvexDecomposition
 Base interface class for convex decomposition. More...
 
class  ChConvexDecompositionHACD
 Class for wrapping the HACD convex decomposition code by Khaled Mamou (in the convexdecomposition/ directory) so that it is easier to use it by passing the Chrono::Engine structures of type ChTriangleMesh, ChTriangle, etc. More...
 
class  ChConvexDecompositionJR
 Class for wrapping the NvConvexDecomposition code by John W. More...
 
class  ChConvexDecompositionHACDv2
 Class for wrapping the HACD convex decomposition code revisited by John Ratcliff. More...
 
class  ChModelBullet
 A wrapper to use the Bullet collision detection library. More...
 
class  ChModelSphereSet
 A wrapper to use the Bullet collision detection library. More...
 
class  ChModelSphereSetBody
 Class for the collision model to be used in ChIndexedParticles shapes, that are collections of point-like nodes (each with 3 DOFs) using features of the Bullet library. More...
 
class  ChModelSphereSetDEM
 Class for the collision model to be used in ChIndexedParticles shapes, that are collections of point-like nodes (each with 3 DOFs) using features of the Bullet library. More...
 
class  ChCollisionSystemBulletParallel
 Class for collision engine based on the spatial subdivision method. More...
 
class  ChCollisionSystemParallel
 Class for collision engine based on the spatial subdivision method. More...
 
struct  ConvexModel
 Class to encapsulate description of a convex collision shape. More...
 
class  ChCollisionModelParallel
 Class for geometric model for collision detection. More...
 

Typedefs

typedef thrust::pair< realV,
realV
bbox
 

Enumerations

enum  ShapeType {
  SPHERE, ELLIPSOID, BOX, CYLINDER,
  CONVEXHULL, TRIANGLEMESH, BARREL, CAPSULE,
  CONE, ROUNDEDBOX, ROUNDEDCYL, ROUNDEDCONE,
  CONVEX, TETRAHEDRON
}
 Shape types that can be created.
 

Functions

template<class T >
int3 Hash (const T &A, const realV &bin_size_vec)
 
template<class T >
uint Hash_Index (const T &A)
 
void function_Generate_AABB (const uint &index, const realV *pos, const real *radius, const uint &number_of_particles, realV *aabb_data)
 
void function_Count_AABB_BIN_Intersection (const uint &index, const realV *aabb_data, const realV &bin_size_vec, const uint &number_of_particles, uint *Bins_Intersected)
 
void function_Store_AABB_BIN_Intersection (const uint &index, const realV *aabb_data, const uint *Bins_Intersected, const realV &bin_size_vec, const uint &number_of_particles, uint *bin_number, uint *body_number)
 
void function_Count_AABB_AABB_Intersection (const uint &index, const realV *aabb_data, const uint &number_of_particles, const uint *bin_number, const uint *body_number, const uint *bodyIndex, const uint *bin_start_index, const bool *active, uint *Num_ContactD)
 
void function_Store_AABB_AABB_Intersection (const uint &index, const realV *aabb_data, const uint &number_of_particles, const uint *bin_number, const uint *body_number, const uint *bodyIndex, const uint *bin_start_index, const uint *Num_ContactD, const bool *active, long long *potential_contacts)
 
void function_Store_Contact (const uint &index, const long long *potential_contacts, const realV *pos, const float *radius, const uint *bodyIndex, uint *id_a, uint *id_b, realV *cpt_a, realV *cpt_b, realV *Norm, float *c_dist, float *rest_len, uint *counter)
 
bool DegenerateTriangle (Vector Dx, Vector Dy)
 
int GetIndex (ChVector< double > vertex, std::vector< ChVector< double > > &vertexOUT, double tol)
 
void FuseMesh (std::vector< ChVector< double > > &vertexIN, std::vector< ChVector< int > > &triangleIN, std::vector< ChVector< double > > &vertexOUT, std::vector< ChVector< int > > &triangleOUT, double tol=0.0)
 
void __recurse_add_newcollshapes (btCollisionShape *ashape, std::vector< std::shared_ptr< btCollisionShape > > &shapes)
 
template<class T >
vec3 HashMin (const T &A, const real3 &inv_bin_size_vec)
 
template<class T >
vec3 HashMax (const T &A, const real3 &inv_bin_size_vec)
 
CH_PARALLEL_API bool MPRContact (const ConvexShape &ShapeA, const ConvexShape &ShapeB, const real &envelope, real3 &returnNormal, real3 &point, real &depth)
 
CH_PARALLEL_API bool MPRCollision (const ConvexShape &ShapeA, const ConvexShape &ShapeB, real envelope, real3 &returnNormal, real3 &pointA, real3 &pointB, real &depth, real &effectiveRadius, real defaultRadius)
 
CH_PARALLEL_API void MPRGetPoints (const ConvexShape &ShapeA, const ConvexShape &ShapeB, const real &envelope, real3 &N, real3 p0, real3 &p1, real3 &p2)
 
CH_PARALLEL_API bool MPRSphereSphere (const ConvexShape &ShapeA, const ConvexShape &ShapeB, real3 &N, real &dist, real3 &p1, real3 &p2)
 
void TransformToCOG (ChBody *body, const ChVector<> &pos, const ChMatrix33<> &rot, ChFrame<> &frame)
 
int GridCoord (real x, real inv_bin_edge, real minimum)
 
int GridHash (int x, int y, int z, const vec3 &bins_per_axis)
 
CH_PARALLEL_API bool MPRContact (const ConvexBase *ShapeA, const ConvexBase *ShapeB, const real &envelope, real3 &returnNormal, real3 &point, real &depth)
 
CH_PARALLEL_API bool MPRCollision (const ConvexBase *ShapeA, const ConvexBase *ShapeB, real envelope, real3 &returnNormal, real3 &pointA, real3 &pointB, real &depth)
 
CH_PARALLEL_API void MPRGetPoints (const ConvexBase *ShapeA, const ConvexBase *ShapeB, const real &envelope, real3 &N, real3 p0, real3 &p1, real3 &p2)
 
CH_PARALLEL_API bool MPRSphereSphere (const ConvexBase *ShapeA, const ConvexBase *ShapeB, real3 &N, real &dist, real3 &p1, real3 &p2)
 
bool RCollision (const ConvexBase *shapeA,const ConvexBase *shapeB,real separation,real3 *ct_norm,real3 *ct_pt1,real3 *ct_pt2,real *ct_depth,real *ct_eff_rad,int &nC)
 [output] number of contacts found More...
 
bool sphere_sphere (const real3 &pos1, const real &radius1, const real3 &pos2, const real &radius2, const real &separation, real3 &norm, real &depth, real3 &pt1, real3 &pt2, real &eff_radius)
 
bool capsule_sphere (const real3 &pos1, const quaternion &rot1, const real &radius1, const real &hlen1, const real3 &pos2, const real &radius2, const real &separation, real3 &norm, real &depth, real3 &pt1, real3 &pt2, real &eff_radius)
 
bool cylinder_sphere (const real3 &pos1, const quaternion &rot1, const real &radius1, const real &hlen1, const real3 &pos2, const real &radius2, const real &separation, real3 &norm, real &depth, real3 &pt1, real3 &pt2, real &eff_radius)
 
bool roundedcyl_sphere (const real3 &pos1, const quaternion &rot1, const real &radius1, const real &hlen1, const real &srad1, const real3 &pos2, const real &radius2, const real &separation, real3 &norm, real &depth, real3 &pt1, real3 &pt2, real &eff_radius)
 
bool box_sphere (const real3 &pos1, const quaternion &rot1, const real3 &hdims1, const real3 &pos2, const real &radius2, const real &separation, real3 &norm, real &depth, real3 &pt1, real3 &pt2, real &eff_radius)
 
bool roundedbox_sphere (const real3 &pos1, const quaternion &rot1, const real3 &hdims1, const real &srad1, const real3 &pos2, const real &radius2, const real &separation, real3 &norm, real &depth, real3 &pt1, real3 &pt2, real &eff_radius)
 
bool face_sphere (const real3 &A1, const real3 &B1, const real3 &C1, const real3 &pos2, const real &radius2, const real &separation, real3 &norm, real &depth, real3 &pt1, real3 &pt2, real &eff_radius)
 
int capsule_capsule (const real3 &pos1, const quaternion &rot1, const real &radius1, const real &hlen1, const real3 &pos2, const quaternion &rot2, const real &radius2, const real &hlen2, const real &separation, real3 *norm, real *depth, real3 *pt1, real3 *pt2, real *eff_radius)
 
int box_capsule (const real3 &pos1, const quaternion &rot1, const real3 &hdims1, const real3 &pos2, const quaternion &rot2, const real &radius2, const real &hlen2, const real &separation, real3 *norm, real *depth, real3 *pt1, real3 *pt2, real *eff_radius)
 
int box_box (const real3 &pos1, const quaternion &rot1, const real3 &hdims1, const real3 &pos2, const quaternion &rot2, const real3 &hdims2, real3 *norm, real *depth, real3 *pt1, real3 *pt2, real *eff_radius)
 
real3 face_normal (const real3 &A, const real3 &B, const real3 &C)
 
bool snap_to_face (const real3 &A, const real3 &B, const real3 &C, const real3 &P, real3 &res)
 
uint snap_to_cylinder (const real &rad, const real &hlen, real3 &loc)
 
uint snap_to_box (const real3 &hdims, real3 &loc)
 
real3 box_farthest_corner (const real3 &hdims, const real3 &dir)
 
real3 box_closest_corner (const real3 &hdims, const real3 &dir)
 
uint box_closest_feature (const real3 &dir)
 
bool box_intersects_box (const real3 &hdims1, const real3 &hdims2, const real3 &pos, const quaternion &rot, real3 &dir)
 
real3 GetSupportPoint_Sphere (const real &radius, const real3 &n)
 
real3 GetSupportPoint_Triangle (const real3 *t, const real3 &n)
 
real3 GetSupportPoint_Box (const real3 &B, const real3 &n)
 
real3 GetSupportPoint_Ellipsoid (const real3 &B, const real3 &n)
 
real3 GetSupportPoint_Cylinder (const real3 &B, const real3 &n)
 
real3 GetSupportPoint_Plane (const real3 &B, const real3 &n)
 
real3 GetSupportPoint_Cone (const real3 &B, const real3 &n)
 
real3 GetSupportPoint_Seg (const real B, const real3 &n)
 
real3 GetSupportPoint_Capsule (const real2 &B, const real3 &n)
 
real3 GetSupportPoint_Disk (const real &B, const real3 &n)
 
real3 GetSupportPoint_Rect (const real3 &B, const real3 &n)
 
real3 GetSupportPoint_RoundedBox (const real4 &B, const real3 &n)
 
real3 GetSupportPoint_RoundedCylinder (const real4 &B, const real3 &n)
 
real3 GetSupportPoint_RoundedCone (const real4 &B, const real3 &n)
 
real3 GetSupportPoint_Convex (const int size, const real3 *convex_data, const real3 &n)
 
real3 GetSupportPoint_Tetrahedron (const uvec4 indices, const real3 *nodes, const real3 &n)
 
real3 GetCenter_Sphere ()
 
real3 GetCenter_Triangle (const real3 *t)
 
real3 GetCenter_Box ()
 
real3 GetCenter_Ellipsoid ()
 
real3 GetCenter_Cylinder ()
 
real3 GetCenter_Plane ()
 
real3 GetCenter_Cone (const real3 &B)
 
real3 GetCenter_Convex (const int size, const real3 *convex_data)
 
real3 GetCenter_Tetrahedron (const uvec4 indices, const real3 *nodes)
 
real3 SupportVertNoMargin (const chrono::collision::ConvexBase *Shape, const real3 &nv, const real &envelope)
 
real3 LocalSupportVert (const chrono::collision::ConvexBase *Shape, const real3 &n, const real &envelope)
 
real3 TransformSupportVert (const chrono::collision::ConvexBase *Shape, const real3 &n, const real &envelope)
 

Function Documentation

CH_PARALLEL_API bool chrono::collision::RCollision ( const ConvexBase *  shapeA,
const ConvexBase *  shapeB,
real  separation,
real3 *  ct_norm,
real3 *  ct_pt1,
real3 *  ct_pt2,
real *  ct_depth,
real *  ct_eff_rad,
int &  nC 
)

[output] number of contacts found

Parameters
shapeAfirst candidate shape
shapeBsecond candidate shape
separationmaximum separation
[out]ct_normcontact normal (per contact pair)
[out]ct_pt1point on shape1 (per contact pair)
[out]ct_pt2point on shape2 (per contact pair)
[out]ct_depthpenetration depth (per contact pair)
[out]ct_eff_radeffective contact radius (per contact pair)