Public Member Functions | Private Member Functions | List of all members
SurgSim::Collision::ContactCalculation Class Referenceabstract

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>

Inheritance diagram for SurgSim::Collision::ContactCalculation:
SurgSim::Collision::BoxCapsuleDcdContact SurgSim::Collision::BoxDoubleSidedPlaneDcdContact SurgSim::Collision::BoxPlaneDcdContact SurgSim::Collision::BoxSphereDcdContact SurgSim::Collision::CapsuleSphereDcdContact SurgSim::Collision::DefaultContactCalculation SurgSim::Collision::OctreeDcdContact SurgSim::Collision::SphereDoubleSidedPlaneDcdContact SurgSim::Collision::SpherePlaneDcdContact SurgSim::Collision::SphereSphereDcdContact SurgSim::Collision::TriangleMeshPlaneDcdContact SurgSim::Collision::TriangleMeshTriangleMeshDcdContact

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

SurgSim::Collision::ContactCalculation::ContactCalculation ( )

Constructor.

SurgSim::Collision::ContactCalculation::~ContactCalculation ( )
virtual

Destructor.

Member Function Documentation

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.

Parameters
pairThe pair that is under consideration.
virtual void SurgSim::Collision::ContactCalculation::doCalculateContact ( std::shared_ptr< CollisionPair pair)
privatepure virtual
virtual std::pair<int,int> SurgSim::Collision::ContactCalculation::getShapeTypes ( )
pure virtual

The documentation for this class was generated from the following files: