![]() |
Base class responsible for calculating contact data between two given shapes, calculateContact needs to determine whether the two shapes intersect, and if yes calculate the correct data for this contact, which consists of, the normal to displace the first shape so that the two shapes just barely touch. More...
#include <SurgSim/Collision/ContactCalculation.h>
Public Member Functions | |
ContactCalculation () | |
Constructor. More... | |
virtual | ~ContactCalculation () |
Destructor. More... | |
void | calculateContact (std::shared_ptr< CollisionPair > pair) |
Function that handles asymmetric pair and calls the actual contact calculation routine of the sub class. More... | |
virtual std::pair< int, int > | getShapeTypes ()=0 |
Virtual function that returns the shapes that this ContactCalculation class handles. More... | |
Private Member Functions | |
virtual void | doCalculateContact (std::shared_ptr< CollisionPair > pair)=0 |
Calculate the actual contact between two shapes of the given CollisionPair. More... | |
Base class responsible for calculating contact data between two given shapes, calculateContact needs to determine whether the two shapes intersect, and if yes calculate the correct data for this contact, which consists of, the normal to displace the first shape so that the two shapes just barely touch.
And the penetration point (the point that is furthest inside the other object) for each shape. This base class also handles the swapping of the shapes if the pair is asymmetric. The sub classes assume that the pair is always in correct order.
SurgSim::Collision::ContactCalculation::ContactCalculation | ( | ) |
Constructor.
|
virtual |
Destructor.
void SurgSim::Collision::ContactCalculation::calculateContact | ( | std::shared_ptr< CollisionPair > | pair | ) |
Function that handles asymmetric pair and calls the actual contact calculation routine of the sub class.
pair | The pair that is under consideration. |
|
privatepure virtual |
Calculate the actual contact between two shapes of the given CollisionPair.
pair | The symmetric pair that is under consideration. |
Implemented in SurgSim::Collision::DefaultContactCalculation, SurgSim::Collision::BoxSphereDcdContact, SurgSim::Collision::OctreeDcdContact, SurgSim::Collision::BoxCapsuleDcdContact, SurgSim::Collision::BoxPlaneDcdContact, SurgSim::Collision::BoxDoubleSidedPlaneDcdContact, SurgSim::Collision::CapsuleSphereDcdContact, SurgSim::Collision::SphereDoubleSidedPlaneDcdContact, SurgSim::Collision::SpherePlaneDcdContact, SurgSim::Collision::SphereSphereDcdContact, SurgSim::Collision::TriangleMeshPlaneDcdContact, and SurgSim::Collision::TriangleMeshTriangleMeshDcdContact.
|
pure virtual |
Virtual function that returns the shapes that this ContactCalculation class handles.
Implemented in SurgSim::Collision::DefaultContactCalculation, SurgSim::Collision::OctreeDcdContact, SurgSim::Collision::BoxCapsuleDcdContact, SurgSim::Collision::BoxPlaneDcdContact, SurgSim::Collision::BoxDoubleSidedPlaneDcdContact, SurgSim::Collision::BoxSphereDcdContact, SurgSim::Collision::CapsuleSphereDcdContact, SurgSim::Collision::SphereDoubleSidedPlaneDcdContact, SurgSim::Collision::SpherePlaneDcdContact, SurgSim::Collision::SphereSphereDcdContact, SurgSim::Collision::TriangleMeshPlaneDcdContact, and SurgSim::Collision::TriangleMeshTriangleMeshDcdContact.