chrono::collision Namespace Reference

Description

Namespace with classes for collision detection.

Classes

class  ChCAABBGenerator
 Generator for Axis-Aligned Bounding Boxes. More...
 
class  ChCBroadphase
 Class for performing broad-phase collision detection. More...
 
class  ChCNarrowphaseDispatch
 Class for performing narrow-phase collision detection. More...
 
class  ChCollisionInfo
 Class for passing basic data about contact pairs. More...
 
class  ChCollisionModel
 Class containing the geometric model ready for collision detection. More...
 
class  ChCollisionModelDistributed
 This class adds the ability to track the axis-aligned bounding box for the entire model so that an entire body can be classified by which sub-domains it intersects. More...
 
class  ChCollisionModelParallel
 Class for geometric model 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  ChCollisionSystemBulletParallel
 Class for collision engine based on the spatial subdivision method. More...
 
class  ChCollisionSystemDistributed
 This class scaffolds on ChCollisionSystemParallel in order to manage collision data for the system during MPI exchanges. More...
 
class  ChCollisionSystemParallel
 Class for collision engine based on the spatial subdivision method. More...
 
class  ChCollisionUtils
 Class with some utility functions for collision detection, as static functions. 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 structures of type ChTriangleMesh, ChTriangle, etc. More...
 
class  ChConvexDecompositionHACDv2
 Class for wrapping the HACD convex decomposition code revisited by John Ratcliff. More...
 
class  ChConvexDecompositionJR
 Class for wrapping the NvConvexDecomposition code by John W. More...
 
class  ChConvexHullLibraryWrapper
 Wrapper for using and exporting the Bullet implementation of the convex hull library. More...
 
class  ChModelBullet
 A wrapper to use the Bullet collision detection library. More...
 
class  ConvexBase
 Base class for convex contact shapes. More...
 
struct  ConvexModel
 Class to encapsulate description of a convex collision shape. More...
 
class  ConvexShape
 Convex contact shape. More...
 
class  ConvexShapeCustom
 Custom contact shape. More...
 
class  ConvexShapeSphere
 Sphere contact shape. More...
 
class  ConvexShapeTetrahedron
 Tetrahedron contact shape. More...
 
class  ConvexShapeTriangle
 Triangle contact shape. More...
 

Typedefs

typedef thrust::pair< real3, real3bbox
 

Enumerations

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

Functions

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)
 Convert a position into a bin index ("lower" corner).
 
template<class T >
vec3 HashMax (const T &A, const real3 &inv_bin_size_vec)
 Convert a position into a bin index ("upper" corner).
 
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)
 
void SetDefaultEdgeRadius (real radius)
 Set the fictitious radius of curvature used for collision with a corner or an edge.
 
real GetDefaultEdgeRadius ()
 Return the fictitious radius of curvature used for collisions with a corner or an edge.
 
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)
 Dispatcher for analytic collision functions. 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)
 Analytical sphere vs. sphere collision function.
 
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)
 Analytical capsule vs. sphere collision function.
 
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)
 Analytical cylinder vs. sphere collision function.
 
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)
 Analytical rounded cylinder vs. sphere collision function.
 
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)
 Analytical box vs. sphere collision function.
 
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)
 Analytical rounded box vs. sphere collision function.
 
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)
 Analytical triangle face vs. sphere collision function.
 
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)
 Analytical capsule vs. capsule collision function.
 
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)
 Analytical box vs. capsule collision function.
 
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)
 Analytical box vs. box collision function (not yet completed).
 
real3 face_normal (const real3 &A, const real3 &B, const real3 &C)
 This utility function returns the normal to the triangular face defined by the vertices A, B, and C. More...
 
bool snap_to_face (const real3 &A, const real3 &B, const real3 &C, const real3 &P, real3 &res)
 This utility function takes the location 'P' and snaps it to the closest point on the triangular face with given vertices (A, B, and C). More...
 
uint snap_to_cylinder (const real &rad, const real &hlen, real3 &loc)
 This utility function snaps the specified location to a point on a cylinder with given radius and half-length. More...
 
uint snap_to_box (const real3 &hdims, real3 &loc)
 This utility function snaps the specified location to a point on a box with given half-dimensions. More...
 
real3 box_farthest_corner (const real3 &hdims, const real3 &dir)
 This utility function returns the corner of a box of given dimensions that if farthest in the direction 'dir', which is assumed to be given in the frame of the box.
 
real3 box_closest_corner (const real3 &hdims, const real3 &dir)
 This utility function returns the corner of a box of given dimensions that if closest in the direction 'dir', which is assumed to be given in the frame of the box.
 
uint box_closest_feature (const real3 &dir)
 This utility function returns a code that indicates the closest feature of a box in the specified direction. More...
 
bool box_intersects_box (const real3 &hdims1, const real3 &hdims2, const real3 &pos, const quaternion &rot, real3 &dir)
 This function returns a boolean indicating whether or not a box1 with dimensions hdims1 intersects a second box with the dimensions hdims2. More...
 
real3 GetSupportPoint_Sphere (const real &radius, const real3 &n)
 Support point for a sphere (for GJK and MPR).
 
real3 GetSupportPoint_Triangle (const real3 *t, const real3 &n)
 Support point for a triangle (for GJK and MPR).
 
real3 GetSupportPoint_Box (const real3 &B, const real3 &n)
 Support point for a box (for GJK and MPR).
 
real3 GetSupportPoint_Ellipsoid (const real3 &B, const real3 &n)
 Support point for an ellipsoid (for GJK and MPR).
 
real3 GetSupportPoint_Cylinder (const real3 &B, const real3 &n)
 Support point for a cylinder (for GJK and MPR).
 
real3 GetSupportPoint_Plane (const real3 &B, const real3 &n)
 Support point for a plane (for GJK and MPR).
 
real3 GetSupportPoint_Cone (const real3 &B, const real3 &n)
 Support point for a cone (for GJK and MPR).
 
real3 GetSupportPoint_Seg (const real B, const real3 &n)
 Support point for a line segment (for GJK and MPR).
 
real3 GetSupportPoint_Capsule (const real2 &B, const real3 &n)
 Support point for a capsule (for GJK and MPR).
 
real3 GetSupportPoint_Disk (const real &B, const real3 &n)
 Support point for a disk (for GJK and MPR).
 
real3 GetSupportPoint_Rect (const real3 &B, const real3 &n)
 Support point for a rectangle (for GJK and MPR).
 
real3 GetSupportPoint_RoundedBox (const real4 &B, const real3 &n)
 Support point for a rounded box, i.e. a sphere-swept box (for GJK and MPR).
 
real3 GetSupportPoint_RoundedCylinder (const real4 &B, const real3 &n)
 Support point for a rounded cylinder, i.e. a sphere-swept cylinder (for GJK and MPR).
 
real3 GetSupportPoint_RoundedCone (const real4 &B, const real3 &n)
 Support point for a rounded cone, i.e. a sphere-swept cone (for GJK and MPR).
 
real3 GetSupportPoint_Convex (const int size, const real3 *convex_data, const real3 &n)
 Support point for a gneric convex sphae (for GJK and MPR).
 
real3 GetSupportPoint_Tetrahedron (const uvec4 indices, const real3 *nodes, const real3 &n)
 Support point for a tetrahedron (for GJK and MPR).
 
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)
 

Variables

auto inverted
 

Variable Documentation

◆ inverted

auto chrono::collision::inverted
Initial value:
= thrust::make_tuple(real3(+C_LARGE_REAL, +C_LARGE_REAL, +C_LARGE_REAL),
real3(-C_LARGE_REAL, -C_LARGE_REAL, -C_LARGE_REAL),
0)