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:
SurgSim::Physics::Computation

Public Member Functions

 ContactConstraintGeneration (bool doCopyState=false)
 Constructor. More...
 
 SURGSIM_CLASSNAME (SurgSim::Physics::ContactConstraintGeneration)
 
 ~ContactConstraintGeneration ()
 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...
 
virtual std::string getClassName () const =0
 The class name for this class. More...
 
Framework::TimergetTimer ()
 Provides access to the update timer. More...
 

Private Member Functions

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

Private Attributes

std::shared_ptr< SurgSim::Framework::Loggerm_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

◆ ContactConstraintGeneration()

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

◆ ~ContactConstraintGeneration()

SurgSim::Physics::ContactConstraintGeneration::~ContactConstraintGeneration ( )

Destructor.

Member Function Documentation

◆ doUpdate()

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.

◆ makeLocation()

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

Generate a location 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.
Note
Asserts if cannot Location create shared object.

◆ SURGSIM_CLASSNAME()

SurgSim::Physics::ContactConstraintGeneration::SURGSIM_CLASSNAME ( SurgSim::Physics::ContactConstraintGeneration  )

Member Data Documentation

◆ m_logger

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: