Add Primitive Static Collision Detections
SurfaceMesh (most useful and difficult):
- Easiest of the surface mesh ones.
- SurfaceMeshToCylinderCD (involves both curved surface and sharp edges)
PointSetToCylinderCD (easiest, see sphere to cylinder CD as well as cylinder's signed distance function)
- Only produces single point contact. PointDirection for cylinder and PointIndexDirection for point.
TetrahedralMesh (less useful at the moment but easy):
- Completed but doesn't handle the rare case of line completely embedded in the tetrahedron.
- MeshToMeshBruteForceCD (encompasses PointSet, SurfaceMesh, and LineMesh collision detection)
Primitive v Primitive (these tend to be less common in medical scenarios):
... All other permutations ...
These can be added via unit tests (see existing CD unit tests). You don't need to implement them in some fancy simulation or verify against models, just check the CollisionData output. An accompanying example or interactive visual test for those complex ones might be useful. CollisionDataDebugObject may be used to draw contact, see BoxToBoxTest in Examples/CollisionDetection.
Do not add any spatial acceleration. That will be patterned out later for all CDs.
See CollisionUtils.h for a place to put all your collision/intersection functions. There are a number of existing basic ones provided: closest point on two lines. Closest point on triangle.
Various resources on collision detection:
- Real Time Collision Detection Book: http://www.r-5.org/files/books/computers/algo-list/realtime-3d/Christer_Ericson-Real-Time_Collision_Detection-EN.pdf
- Brief on Contact Manifolds: https://www.slideserve.com/gracej/contact-manifolds-powerpoint-ppt-presentation
- You may also refer to the documentation provided in the branch. Docs/Collision_Detection.rst