Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
SurgSim::Physics::DcdCollision Class Reference

Computation to determine the contacts between a list of CollisionPairs. More...

#include <SurgSim/Physics/DcdCollision.h>

Inheritance diagram for SurgSim::Physics::DcdCollision:
SurgSim::Physics::Computation

Public Member Functions

 DcdCollision (bool doCopyState=false)
 Constructor. More...
 
virtual ~DcdCollision ()
 Destructor. More...
 
- Public Member Functions inherited from SurgSim::Physics::Computation
 Computation (bool doCopyState)
 Constructor. More...
 
virtual ~Computation ()
 Destructor. More...
 
std::shared_ptr< PhysicsManagerStateupdate (double dt, const std::shared_ptr< PhysicsManagerState > &state)
 Public Interface execute this objects computations, dt is the time from the last update call in seconds. More...
 
void setDoCopyState (bool val)
 Sets up whether the computation will copy the state of PhysicsManagerState before executing. More...
 
bool isCopyingState ()
 Query if this object is copying the PhysicsManagerState. More...
 

Protected Member Functions

virtual std::shared_ptr< PhysicsManagerStatedoUpdate (const double &dt, const std::shared_ptr< PhysicsManagerState > &state) override
 Executes the update operation, overridden from Computation. More...
 

Private Member Functions

void populateCalculationTable ()
 Initializes the table of ContactCalculation objects. More...
 
void updatePairs (std::shared_ptr< PhysicsManagerState > state)
 Updates the collision pairs. More...
 
void setDcdContactInTable (std::shared_ptr< SurgSim::Collision::ContactCalculation > dcdContact)
 Function to populate the m_contactCalculations table for each DcdContact class. More...
 

Private Attributes

std::shared_ptr< SurgSim::Collision::ContactCalculationm_contactCalculations [SurgSim::Math::SHAPE_TYPE_COUNT][SurgSim::Math::SHAPE_TYPE_COUNT]
 Table containing contact calculation, the indices indicate the type of the first pair object and the second pair object in order. More...
 

Detailed Description

Computation to determine the contacts between a list of CollisionPairs.

This Computation class takes a list of representations, it will generate a list of collision pairs from this list on every frame, for each CollisionPair, it uses a two dimensional table of function objects (ContactCalculation) to determine how to calculate a contact between the two members of each pair, if no specific function exists a default function will be used. will update the collision pairs accordingly.

Note
HS-2013-may-24 Currently handles only RigidRepresentation, all others will be ignored

Constructor & Destructor Documentation

SurgSim::Physics::DcdCollision::DcdCollision ( bool  doCopyState = false)
explicit

Constructor.

Parameters
doCopyStateSpecify if the output state in Computation::Update() is a copy or not of the input state
SurgSim::Physics::DcdCollision::~DcdCollision ( )
virtual

Destructor.

Member Function Documentation

std::shared_ptr< PhysicsManagerState > SurgSim::Physics::DcdCollision::doUpdate ( const double &  dt,
const std::shared_ptr< PhysicsManagerState > &  state 
)
overrideprotectedvirtual

Executes the update operation, overridden from Computation.

Parameters
dtThe time passed.
stateThe PhysicsManagerState from previous computation.

Implements SurgSim::Physics::Computation.

void SurgSim::Physics::DcdCollision::populateCalculationTable ( )
private

Initializes the table of ContactCalculation objects.

void SurgSim::Physics::DcdCollision::setDcdContactInTable ( std::shared_ptr< SurgSim::Collision::ContactCalculation dcdContact)
private

Function to populate the m_contactCalculations table for each DcdContact class.

void SurgSim::Physics::DcdCollision::updatePairs ( std::shared_ptr< PhysicsManagerState state)
private

Updates the collision pairs.

Member Data Documentation

std::shared_ptr<SurgSim::Collision::ContactCalculation> SurgSim::Physics::DcdCollision::m_contactCalculations[SurgSim::Math::SHAPE_TYPE_COUNT][SurgSim::Math::SHAPE_TYPE_COUNT]
private

Table containing contact calculation, the indices indicate the type of the first pair object and the second pair object in order.


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