6 #include "imstkCDObjectFactory.h" 8 #include "imstkBidirectionalPlaneToSphereCD.h" 9 #include "imstkCapsuleToCapsuleCD.h" 10 #include "imstkClosedSurfaceMeshToCapsuleCD.h" 11 #include "imstkClosedSurfaceMeshToMeshCD.h" 12 #include "imstkCompoundCD.h" 13 #include "imstkGeometry.h" 14 #include "imstkImplicitGeometryToPointSetCCD.h" 15 #include "imstkImplicitGeometryToPointSetCD.h" 16 #include "imstkLineMeshToCapsuleCD.h" 17 #include "imstkLineMeshToLineMeshCCD.h" 18 #include "imstkLineMeshToSphereCD.h" 19 #include "imstkPointSetToCapsuleCD.h" 20 #include "imstkPointSetToCylinderCD.h" 21 #include "imstkPointSetToOrientedBoxCD.h" 22 #include "imstkPointSetToPlaneCD.h" 23 #include "imstkPointSetToSphereCD.h" 24 #include "imstkSphereToCapsuleCD.h" 25 #include "imstkSphereToCylinderCD.h" 26 #include "imstkSphereToSphereCD.h" 27 #include "imstkSurfaceMeshToCapsuleCD.h" 28 #include "imstkSurfaceMeshToSphereCD.h" 29 #include "imstkSurfaceMeshToSurfaceMeshCD.h" 30 #include "imstkTetrahedralMesh.h" 31 #include "imstkTetraToLineMeshCD.h" 32 #include "imstkTetraToPointSetCD.h" 33 #include "imstkUnidirectionalPlaneToCapsuleCD.h" 34 #include "imstkUnidirectionalPlaneToSphereCD.h" 38 IMSTK_REGISTER_COLLISION_DETECTION(BidirectionalPlaneToSphereCD);
39 IMSTK_REGISTER_COLLISION_DETECTION(CapsuleToCapsuleCD);
40 IMSTK_REGISTER_COLLISION_DETECTION(ClosedSurfaceMeshToCapsuleCD);
41 IMSTK_REGISTER_COLLISION_DETECTION(ClosedSurfaceMeshToMeshCD);
42 IMSTK_REGISTER_COLLISION_DETECTION(ImplicitGeometryToPointSetCD);
43 IMSTK_REGISTER_COLLISION_DETECTION(ImplicitGeometryToPointSetCCD);
44 IMSTK_REGISTER_COLLISION_DETECTION(LineMeshToLineMeshCCD);
45 IMSTK_REGISTER_COLLISION_DETECTION(LineMeshToSphereCD);
46 IMSTK_REGISTER_COLLISION_DETECTION(LineMeshToCapsuleCD);
47 IMSTK_REGISTER_COLLISION_DETECTION(PointSetToCapsuleCD);
48 IMSTK_REGISTER_COLLISION_DETECTION(PointSetToCylinderCD);
49 IMSTK_REGISTER_COLLISION_DETECTION(PointSetToPlaneCD);
50 IMSTK_REGISTER_COLLISION_DETECTION(PointSetToSphereCD);
51 IMSTK_REGISTER_COLLISION_DETECTION(PointSetToOrientedBoxCD);
52 IMSTK_REGISTER_COLLISION_DETECTION(SphereToCapsuleCD);
53 IMSTK_REGISTER_COLLISION_DETECTION(SphereToCylinderCD);
54 IMSTK_REGISTER_COLLISION_DETECTION(SphereToSphereCD);
55 IMSTK_REGISTER_COLLISION_DETECTION(SurfaceMeshToSurfaceMeshCD);
56 IMSTK_REGISTER_COLLISION_DETECTION(SurfaceMeshToCapsuleCD);
57 IMSTK_REGISTER_COLLISION_DETECTION(SurfaceMeshToSphereCD);
58 IMSTK_REGISTER_COLLISION_DETECTION(TetraToPointSetCD);
59 IMSTK_REGISTER_COLLISION_DETECTION(TetraToLineMeshCD);
60 IMSTK_REGISTER_COLLISION_DETECTION(UnidirectionalPlaneToSphereCD);
61 IMSTK_REGISTER_COLLISION_DETECTION(UnidirectionalPlaneToCapsuleCD);
62 IMSTK_REGISTER_COLLISION_DETECTION(CompoundCD);
65 #define IMSTK_MAP_TYPES(geomA, geomB, cdType) \ 66 { std::string(#geomA) + std::string(#geomB), std::string(#cdType) }, \ 67 { std::string(#geomB) + std::string(#geomA), std::string(#cdType) } \ 70 std::shared_ptr<CollisionDetectionAlgorithm>
73 if (collisionTypeName ==
"MeshToMeshBruteForceCD")
75 LOG(WARNING) <<
"MeshToMeshBruteForceCD deprecated. Using ClosedSurfaceMeshToMeshCD instead.";
76 return create(
"ClosedSurfaceMeshToMeshCD");
80 LOG(FATAL) <<
"No collision detection type named: " << collisionTypeName;
85 return create(collisionTypeName);
102 static std::unordered_map<std::string, std::string> cdTypeMap = {
165 if (cdTypeMap.find(type1 + type2) == cdTypeMap.end())
167 LOG(INFO) <<
"No valid collision detection type for : " << type1 + type2;
168 return std::string(
"");
171 return cdTypeMap[type1 + type2];
OrientedBox geometry, specified with extents (half lengths)
Sphere to Capsule collision detection.
PointSet to OrientedBox collision detection. Generates point-direction contact data. By default only generates contact data for the pointset.
Base class for all geometries represented by discrete points and elements The pointsets follow a pipe...
Capsule to Capsule collision detection.
Sphere to sphere collision detection Generates point-direction contact data. By default generates con...
Cylinder geometry, default configuration is at origin with length running up the y axes...
virtual const std::string getTypeName() const =0
Returns the string representing the type name of the geometry.
Represents and infinite plane, width can be used for visual purposes.
static std::shared_ptr< CollisionDetectionAlgorithm > makeCollisionDetection(const std::string collisionTypeName)
attempts to create a new CD algorithm
LineMesh to Sphere collision detection Generates point-edge and point-point CD data By default only g...
Represents a set of tetrahedrons & vertices via an array of Vec3d double vertices & Vec4i integer ind...
Base class for any geometrical representation.
Closed mesh to mesh collision with brute force strategy. It can handle closed SurfaceMesh vs PointSet...
PointSet to sphere collision detection Generates point-direction contact data. By default only genera...
static bool contains(const std::string &name)
Base class for all volume mesh types.
Represents a set of triangles & vertices via an array of Vec3d double vertices & Vec3i integer indice...
Represents a sphere via its position & radius.
ImplicitGeometry to PointSet collision detection. This generates PointDirection collision data via si...
static std::string getCDType(const Geometry &obj1, const Geometry &obj2)
Get the CD type from the types of objects colliding.
SurfaceMesh to Sphere collision detection Generates vertex-triangle, point-edge, and point-point CD d...
Plane to sphere collision detection Generates point-direction contact data.
Structured field of signed distances implemented with ImageData The SDF differs in that when you scal...
Plane to capsule collision detection Generates point-direction contact data. By default only generate...
PointSet to Cylinder collision detection. Generates point-direction contact data. By default only gen...
LineMesh to LineMesh continous collision detection. This CCD method can process self collision as wel...
Collision detection that supports a geometry consisting of multiple subgeometries. For the actual calcualation the information gets passed to the appropriate shape/subshape CD algorithm. Currently Does not support adding/removing a shape during runtime.
Sphere-Cylinder collision detection Generates point-direction contact data. By default generates cont...
Capsule geometry, default configuration is centered at origin with length running up and down the y a...
PointSet to unidirectional plane collision detection Generates point-direction contact data...
PointSet to Capsule collision detection. Generates point-direction contact data. By default only gene...
static std::shared_ptr< CollisionDetectionAlgorithm > create(const std::string &name, Args &&... args)
tries to construct the object give name, it will forward the given paramters
LineMesh to Capsule collision detection Generates point-edge and point-point CD data By default only ...
SurfaceMesh to Capsule collision detection Generates vertex-triangle, point-edge, and point-point CD ...