Go to the documentation of this file.
16 #ifndef SURGSIM_PHYSICS_PHYSICSMANAGER_H
17 #define SURGSIM_PHYSICS_PHYSICSMANAGER_H
19 #include <boost/thread/mutex.hpp>
80 void addComputation(std::shared_ptr<SurgSim::Physics::Computation> computation);
85 void setComputations(std::vector<std::shared_ptr<Physics::Computation>> computations);
88 bool executeAdditions(
const std::shared_ptr<SurgSim::Framework::Component>& component)
override;
90 bool executeRemovals(
const std::shared_ptr<SurgSim::Framework::Component>& component)
override;
124 std::vector<std::shared_ptr<Physics::Computation>>
createDcdPipeline(
bool copyState =
false);
128 std::vector<std::shared_ptr<Physics::Computation>>
createCcdPipeline(
bool copyState =
false);
void setComputations(std::vector< std::shared_ptr< Physics::Computation >> computations)
Set a group of computations, the computations will be run in the order in the vector.
Definition: PhysicsManager.cpp:75
void addComputation(std::shared_ptr< SurgSim::Physics::Computation > computation)
Add a computation to the list of computations to perform each update.
Definition: PhysicsManager.cpp:69
std::vector< std::shared_ptr< Physics::Computation > > createDcdPipeline(bool copyState)
Creates default DCD pipeline, this currently does basic DCD without regard to CCD.
Definition: PhysicsManager.cpp:174
std::vector< std::shared_ptr< Collision::ContactFilter > > m_contactFilters
Definition: PhysicsManager.h:108
void doBeforeStop() override
Prepares the thread for its execution to be stopped.
Definition: PhysicsManager.cpp:159
bool doStartUp() override
Definition: PhysicsManager.cpp:81
std::vector< std::shared_ptr< ConstraintComponent > > m_constraintComponents
Definition: PhysicsManager.h:112
PhysicsManager()
Constructor.
Definition: PhysicsManager.cpp:44
bool doUpdate(double dt) override
Implementation of actual work function for this thread, this has a default implementation to handle d...
Definition: PhysicsManager.cpp:112
Base Component Manager class.
Definition: ComponentManager.h:50
Definition: CompoundShapeToGraphics.cpp:30
int getType() const override
Overrides ComponentManager::getType()
Definition: PhysicsManager.cpp:55
bool executeAdditions(const std::shared_ptr< SurgSim::Framework::Component > &component) override
Adds a component.
Definition: PhysicsManager.cpp:91
std::vector< std::shared_ptr< Physics::Computation > > createCcdPipeline(bool copyState)
Create default CCD pipeline, this currently does basic CCD without regard to DCD.
Definition: PhysicsManager.cpp:196
std::vector< std::shared_ptr< SurgSim::Physics::Computation > > m_computations
A list of computations, to perform the physics update.
Definition: PhysicsManager.h:116
PhyicsManager handles the physics and motion calculation, it uses Computations to separate the algori...
Definition: PhysicsManager.h:60
Definition: PhysicsManagerState.h:49
void getFinalState(SurgSim::Physics::PhysicsManagerState *s) const
Get the last PhysicsManagerState from the previous PhysicsManager update.
Definition: PhysicsManager.cpp:86
virtual ~PhysicsManager()
Definition: PhysicsManager.cpp:50
bool executeRemovals(const std::shared_ptr< SurgSim::Framework::Component > &component) override
Handle representations, override for each thread.
Definition: PhysicsManager.cpp:103
bool doInitialize() override
Initialize the Physics Manager Derived class(es) should override this method to have a customized lis...
Definition: PhysicsManager.cpp:60
SurgSim::Framework::LockedContainer< SurgSim::Physics::PhysicsManagerState > m_finalState
A thread-safe copy of the last PhysicsManagerState in the previous update.
Definition: PhysicsManager.h:119
std::vector< std::shared_ptr< Collision::Representation > > m_collisionRepresentations
Definition: PhysicsManager.h:106
friend class PhysicsManagerTest
Definition: PhysicsManager.h:70
std::vector< std::shared_ptr< Particles::Representation > > m_particleRepresentations
Definition: PhysicsManager.h:110
DataStructures::Vertices< ParticleData > Particles
Definition: Particles.h:53
std::vector< std::shared_ptr< Representation > > m_representations
Definition: PhysicsManager.h:104