Public Member Functions | Private Member Functions | Private Attributes | List of all members
SurgSim::Collision::DefaultContactCalculation Class Reference

A default calculation, it does nothing and can be used as a placeholder. More...

#include <SurgSim/Collision/DefaultContactCalculation.h>

Inheritance diagram for SurgSim::Collision::DefaultContactCalculation:
SurgSim::Collision::ContactCalculation

Public Member Functions

 DefaultContactCalculation (bool doAssert=false)
 Constructor. More...
 
virtual ~DefaultContactCalculation ()
 Destructor. More...
 
std::pair< int, int > getShapeTypes () override
 Virtual function that returns the shapes that this ContactCalculation class handles. More...
 
- Public Member Functions inherited from SurgSim::Collision::ContactCalculation
 ContactCalculation ()
 Constructor. More...
 
virtual ~ContactCalculation ()
 Destructor. More...
 
void calculateContact (std::shared_ptr< CollisionPair > pair)
 Calculate the contacts for a given pair. More...
 
std::list< std::shared_ptr< Contact > > calculateDcdContact (const Math::PosedShape< std::shared_ptr< Math::Shape >> posedShape1, const Math::PosedShape< std::shared_ptr< Math::Shape >> posedShape2)
 Calculate the dcd contacts between two posed/transformed shapes. More...
 
std::list< std::shared_ptr< Contact > > calculateCcdContact (const Math::PosedShapeMotion< std::shared_ptr< Math::Shape >> posedShapeMotion1, const Math::PosedShapeMotion< std::shared_ptr< Math::Shape >> posedShapeMotion2)
 Calculate the ccd contacts between two posed/transformed shapes. More...
 

Private Member Functions

void doCalculateContact (std::shared_ptr< CollisionPair > pair) override
 Calculate the actual contact between two shapes of the given CollisionPair. More...
 
std::list< std::shared_ptr< Contact > > doCalculateDcdContact (const Math::PosedShape< std::shared_ptr< Math::Shape >> &posedShape1, const Math::PosedShape< std::shared_ptr< Math::Shape >> &posedShape2) override
 Virtual function receives the call from the public interface, usually will type the shapes statically to their known types and then execute a specific contact calculation between the two shapes. More...
 
std::list< std::shared_ptr< Contact > > doCalculateCcdContact (const Math::PosedShapeMotion< std::shared_ptr< Math::Shape >> &posedShapeMotion1, const Math::PosedShapeMotion< std::shared_ptr< Math::Shape >> &posedShapeMotion2) override
 Virtual function receives the call from the public interface, usually will type the shapes statically to their known types and then execute a specific contact calculation between the two shapes. More...
 

Private Attributes

bool m_doAssert
 

Additional Inherited Members

- Public Types inherited from SurgSim::Collision::ContactCalculation
typedef std::array< std::array< std::shared_ptr< ContactCalculation >, Math::SHAPE_TYPE_COUNT >, Math::SHAPE_TYPE_COUNTTableType
 
- Static Public Member Functions inherited from SurgSim::Collision::ContactCalculation
static void registerDcdContactCalculation (const std::shared_ptr< ContactCalculation > &calculation)
 Register an instance of a contact calculation in the table. More...
 
static void registerCcdContactCalculation (const std::shared_ptr< ContactCalculation > &calculation)
 Register an instance of a contact calculation in the table. More...
 
static const TableTypegetDcdContactTable ()
 
static const TableTypegetCcdContactTable ()
 

Detailed Description

A default calculation, it does nothing and can be used as a placeholder.

Constructor & Destructor Documentation

§ DefaultContactCalculation()

SurgSim::Collision::DefaultContactCalculation::DefaultContactCalculation ( bool  doAssert = false)
explicit

Constructor.

Parameters
doAssertIf set the calculation will throw an exception if it is executed, this can be used to detect cases where a contact calculation is being called on a pair that should be implemented

§ ~DefaultContactCalculation()

SurgSim::Collision::DefaultContactCalculation::~DefaultContactCalculation ( )
virtual

Destructor.

Member Function Documentation

§ doCalculateCcdContact()

std::list< std::shared_ptr< Contact > > SurgSim::Collision::DefaultContactCalculation::doCalculateCcdContact ( const Math::PosedShapeMotion< std::shared_ptr< Math::Shape >> &  posedShapeMotion1,
const Math::PosedShapeMotion< std::shared_ptr< Math::Shape >> &  posedShapeMotion2 
)
overrideprivatevirtual

Virtual function receives the call from the public interface, usually will type the shapes statically to their known types and then execute a specific contact calculation between the two shapes.

Parameters
posedShapeMotion1,posedShapeMotion2The two posed shapes motion to calculate ccd contact for
Returns
a list of ccd contacts between the two given posed shapes motion

Reimplemented from SurgSim::Collision::ContactCalculation.

§ doCalculateContact()

void SurgSim::Collision::DefaultContactCalculation::doCalculateContact ( std::shared_ptr< CollisionPair pair)
overrideprivatevirtual

Calculate the actual contact between two shapes of the given CollisionPair.

Parameters
pairThe symmetric pair that is under consideration.

Reimplemented from SurgSim::Collision::ContactCalculation.

§ doCalculateDcdContact()

std::list< std::shared_ptr< Contact > > SurgSim::Collision::DefaultContactCalculation::doCalculateDcdContact ( const Math::PosedShape< std::shared_ptr< Math::Shape >> &  posedShape1,
const Math::PosedShape< std::shared_ptr< Math::Shape >> &  posedShape2 
)
overrideprivatevirtual

Virtual function receives the call from the public interface, usually will type the shapes statically to their known types and then execute a specific contact calculation between the two shapes.

Parameters
posedShape1,posedShape2The two posed shapes to calculate dcd contact for
Returns
a list of dcd contacts between the two given posed shapes

Reimplemented from SurgSim::Collision::ContactCalculation.

§ getShapeTypes()

std::pair< int, int > SurgSim::Collision::DefaultContactCalculation::getShapeTypes ( )
overridevirtual

Virtual function that returns the shapes that this ContactCalculation class handles.

Returns
Return the shape types this class handles.

Implements SurgSim::Collision::ContactCalculation.

Member Data Documentation

§ m_doAssert

bool SurgSim::Collision::DefaultContactCalculation::m_doAssert
private

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