All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SurgSim::Physics::ContactConstraintGeneration Class Reference

Generate a constraint for every contact that was calculated. More...

#include <SurgSim/Physics/ContactConstraintGeneration.h>

Inheritance diagram for SurgSim::Physics::ContactConstraintGeneration:
Inheritance graph
[legend]
Collaboration diagram for SurgSim::Physics::ContactConstraintGeneration:
Collaboration graph
[legend]

Public Member Functions

 ContactConstraintGeneration (bool doCopyState=false)
 Constructor. More...
 
 ~ContactConstraintGeneration ()
 Destructor. More...
 
- Public Member Functions inherited from SurgSim::Physics::Computation
 Computation (bool doCopyState)
 Constructor. More...
 
virtual ~Computation ()
 Destructor. More...
 
std::shared_ptr
< PhysicsManagerState
update (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...
 

Private Member Functions

virtual std::shared_ptr
< PhysicsManagerState
doUpdate (const double &dt, const std::shared_ptr< PhysicsManagerState > &state) override
 Overridden function from Computation, the actual work is done here. More...
 
std::shared_ptr< LocalizationmakeLocalization (std::shared_ptr< SurgSim::Physics::Representation > physicsRepresentation, std::shared_ptr< SurgSim::Collision::Representation > collisionRepresentation, const SurgSim::DataStructures::Location &location)
 Generate a localization from a Collision Representation. More...
 

Private Attributes

ConstraintImplementationFactory m_factory
 For looking up instances of constrain implementations. More...
 
std::shared_ptr
< SurgSim::Framework::Logger
m_logger
 The logger for this class. More...
 

Additional Inherited Members

Detailed Description

Generate a constraint for every contact that was calculated.

The general algorithm is such, for each pair of Collision Representations that has Contacts For each contact:

Constructor & Destructor Documentation

SurgSim::Physics::ContactConstraintGeneration::ContactConstraintGeneration ( 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::ContactConstraintGeneration::~ContactConstraintGeneration ( )

Destructor.

Member Function Documentation

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

Overridden function from Computation, the actual work is done here.

Parameters
dtThe time passed from the last update in seconds.
stateThe physics state.
Returns
The changed state of the, depending on the setting of doCopyState this is either the same instance or a copied instance of the physics state.

Implements SurgSim::Physics::Computation.

std::shared_ptr< Localization > SurgSim::Physics::ContactConstraintGeneration::makeLocalization ( std::shared_ptr< SurgSim::Physics::Representation physicsRepresentation,
std::shared_ptr< SurgSim::Collision::Representation collisionRepresentation,
const SurgSim::DataStructures::Location location 
)
private

Generate a localization from a Collision Representation.

Parameters
physicsRepresentationThe physics representation.
collisionRepresentationThe collision representation.
locationThe location generated by the contact calculation.
Returns
The localization for the collision representations physics representation.

Member Data Documentation

ConstraintImplementationFactory SurgSim::Physics::ContactConstraintGeneration::m_factory
private

For looking up instances of constrain implementations.

std::shared_ptr<SurgSim::Framework::Logger> SurgSim::Physics::ContactConstraintGeneration::m_logger
private

The logger for this class.


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