16 #ifndef SURGSIM_PHYSICS_PHYSICSMANAGERSTATE_H 17 #define SURGSIM_PHYSICS_PHYSICSMANAGERSTATE_H 21 #include <unordered_map> 39 class ConstraintComponent;
115 const std::unordered_map<std::shared_ptr<SurgSim::Collision::Representation>,
121 void setCollisionPairs(
const std::vector<std::shared_ptr<SurgSim::Collision::CollisionPair>>& val);
125 const std::vector<std::shared_ptr<SurgSim::Collision::CollisionPair>>&
getCollisionPairs();
129 void setContactFilters(
const std::vector<std::shared_ptr<SurgSim::Collision::ContactFilter>>& val);
132 std::vector<std::shared_ptr<SurgSim::Collision::ContactFilter>>
getContactFilters()
const;
232 std::unordered_map<std::shared_ptr<SurgSim::Collision::Representation>,
239 std::unordered_map<int, std::vector<std::shared_ptr<Constraint>>>
m_constraints;
const std::vector< std::shared_ptr< Representation > > & getRepresentations()
Gets the physics representations.
Definition: PhysicsManagerState.cpp:59
Definition: CompoundShapeToGraphics.cpp:29
std::vector< std::shared_ptr< SurgSim::Collision::Representation > > m_collisionRepresentations
List of all the collision representations known to the state.
Definition: PhysicsManagerState.h:214
std::vector< std::shared_ptr< SurgSim::Collision::Representation > > m_activeCollisionRepresentations
List of all the active collision representations known to the state.
Definition: PhysicsManagerState.h:217
const MlcpMapping< Representation > & getRepresentationsMapping() const
Gets the representations mapping.
Definition: PhysicsManagerState.cpp:220
void setRepresentationsMapping(const MlcpMapping< Representation > &representationsMapping)
Set the representations mapping.
Definition: PhysicsManagerState.cpp:225
double m_timeOfImpact
last time of impact for a CCD calculation
Definition: PhysicsManagerState.h:261
A description of a physical mixed LCP system to be solved.
Definition: MlcpPhysicsProblem.h:43
void setAbortGroup(bool val)
Set whether to abort the current grouped computation.
Definition: PhysicsManagerState.cpp:255
ConstraintGroupType
Definition: PhysicsManagerState.h:41
std::vector< std::shared_ptr< Constraint > > m_activeConstraints
The list of active constraints.
Definition: PhysicsManagerState.h:242
void setCollisionRepresentations(const std::vector< std::shared_ptr< SurgSim::Collision::Representation >> &val)
Sets the collision representations for the state.
Definition: PhysicsManagerState.cpp:83
const std::unordered_map< std::shared_ptr< SurgSim::Collision::Representation >, std::shared_ptr< SurgSim::Physics::Representation > > & getCollisionToPhysicsMap() const
Definition: PhysicsManagerState.cpp:78
std::vector< std::shared_ptr< Representation > > m_activeRepresentations
The list of active representations.
Definition: PhysicsManagerState.h:211
const std::vector< std::shared_ptr< SurgSim::Particles::Representation > > & getParticleRepresentations()
Gets the particle representations.
Definition: PhysicsManagerState.cpp:112
const std::vector< std::shared_ptr< SurgSim::Collision::CollisionPair > > & getCollisionPairs()
Gets collision pairs.
Definition: PhysicsManagerState.cpp:157
void setActiveConstraints(const std::vector< std::shared_ptr< Constraint >> &activeConstraints)
Filter the map of constraints into the active constraints list.
Definition: PhysicsManagerState.cpp:189
MlcpMapping< Constraint > m_constraintsIndexMapping
Constraints mapping.
Definition: PhysicsManagerState.h:248
std::vector< std::shared_ptr< Collision::ContactFilter > > m_contactFilters
List of all the collision filters known to the state.
Definition: PhysicsManagerState.h:220
void setActiveCollisionRepresentations(const std::vector< std::shared_ptr< SurgSim::Collision::Representation >> &val)
Sets the active collision representations for the state.
Definition: PhysicsManagerState.cpp:95
const std::vector< std::shared_ptr< Representation > > & getActiveRepresentations() const
Gets the active physics representations.
Definition: PhysicsManagerState.cpp:70
void setContactFilters(const std::vector< std::shared_ptr< SurgSim::Collision::ContactFilter >> &val)
Set the list of contact filters.
Definition: PhysicsManagerState.cpp:162
bool shouldAbortGroup() const
Definition: PhysicsManagerState.cpp:250
void setRepresentations(const std::vector< std::shared_ptr< Representation >> &val)
Sets the physics representations for the state, these are the basis for all the computations.
Definition: PhysicsManagerState.cpp:41
double getTimeOfImpact()
Definition: PhysicsManagerState.cpp:245
const std::vector< std::shared_ptr< SurgSim::Collision::Representation > > & getCollisionRepresentations()
Gets the collision representations.
Definition: PhysicsManagerState.cpp:90
PhysicsManagerState()
Constructor.
Definition: PhysicsManagerState.cpp:29
std::vector< std::shared_ptr< SurgSim::Collision::ContactFilter > > getContactFilters() const
Definition: PhysicsManagerState.cpp:167
Definition: PhysicsManagerState.h:43
std::vector< std::shared_ptr< ConstraintComponent > > m_constraintComponents
List of the constraint components.
Definition: PhysicsManagerState.h:229
void setConstraintGroup(ConstraintGroupType type, const std::vector< std::shared_ptr< Constraint >> &constraints)
Sets the group of constraints to a given value, the grouping indicates what type of constraint we are...
Definition: PhysicsManagerState.cpp:172
const std::vector< std::shared_ptr< ConstraintComponent > > & getConstraintComponents()
Gets the constraint components.
Definition: PhysicsManagerState.cpp:147
std::vector< std::shared_ptr< SurgSim::Particles::Representation > > m_activeParticleRepresentations
List of all the active particle representations known to the state.
Definition: PhysicsManagerState.h:226
std::vector< std::shared_ptr< Representation > > m_representations
Definition: PhysicsManagerState.h:208
Definition: PhysicsManagerState.h:44
std::vector< std::shared_ptr< SurgSim::Collision::CollisionPair > > m_collisionPairs
The local list of collision pairs.
Definition: PhysicsManagerState.h:236
MlcpPhysicsSolution & getMlcpSolution()
Gets the Mlcp solution.
Definition: PhysicsManagerState.cpp:210
MlcpPhysicsProblem & getMlcpProblem()
Gets the Mlcp problem.
Definition: PhysicsManagerState.cpp:200
void setTimeOfImpact(double timeOfImpact)
Set the time of impact.
Definition: PhysicsManagerState.cpp:240
The description of a solution to a physical MLCP problem.
Definition: MlcpPhysicsSolution.h:34
bool m_abortGroup
Flag for the abort group case.
Definition: PhysicsManagerState.h:258
void setCollisionPairs(const std::vector< std::shared_ptr< SurgSim::Collision::CollisionPair >> &val)
Sets collision pairs that should be considered, while this is not being verified the collision pairs ...
Definition: PhysicsManagerState.cpp:152
const std::vector< std::shared_ptr< Constraint > > & getActiveConstraints() const
Definition: PhysicsManagerState.cpp:195
const std::vector< std::shared_ptr< SurgSim::Collision::Representation > > & getActiveCollisionRepresentations()
Gets the list of active collision representations.
Definition: PhysicsManagerState.cpp:102
void setActiveRepresentations(const std::vector< std::shared_ptr< Representation >> &activeRepresentations)
Set the list of representations into the active representations list.
Definition: PhysicsManagerState.cpp:64
void setConstraintsMapping(const MlcpMapping< Constraint > &constraintsMapping)
Set the constraints mapping.
Definition: PhysicsManagerState.cpp:235
const std::vector< std::shared_ptr< Constraint > > & getConstraintGroup(int type) const
Gets constraint group.
Definition: PhysicsManagerState.cpp:179
void setActiveParticleRepresentations(const std::vector< std::shared_ptr< SurgSim::Particles::Representation >> &val)
Sets the active particle representations for the state.
Definition: PhysicsManagerState.cpp:117
Definition: PhysicsManagerState.h:48
void setParticleRepresentations(const std::vector< std::shared_ptr< SurgSim::Particles::Representation >> &val)
Sets the particle representations for the state.
Definition: PhysicsManagerState.cpp:107
Definition: MlcpMapping.h:27
std::vector< std::shared_ptr< SurgSim::Particles::Representation > > m_particleRepresentations
List of all the particle representations known to the state.
Definition: PhysicsManagerState.h:223
Definition: PhysicsManagerState.h:45
std::unordered_map< std::shared_ptr< SurgSim::Collision::Representation >, std::shared_ptr< SurgSim::Physics::Representation > > m_collisionsToPhysicsMap
Mapping of collision representations to their respective physics representation.
Definition: PhysicsManagerState.h:233
MlcpPhysicsSolution m_mlcpPhysicsSolution
Mlcp solution for this Physics Manager State.
Definition: PhysicsManagerState.h:255
std::unordered_map< int, std::vector< std::shared_ptr< Constraint > > > m_constraints
The local map of constraints.
Definition: PhysicsManagerState.h:239
void setConstraintComponents(const std::vector< std::shared_ptr< ConstraintComponent >> &val)
Sets the list of constraint components.
Definition: PhysicsManagerState.cpp:128
MlcpPhysicsProblem m_mlcpPhysicsProblem
Mlcp problem for this Physics Manager State.
Definition: PhysicsManagerState.h:252
MlcpMapping< Representation > m_representationsIndexMapping
Representation mapping.
Definition: PhysicsManagerState.h:245
const MlcpMapping< Constraint > & getConstraintsMapping() const
Gets the constraints mapping.
Definition: PhysicsManagerState.cpp:230
const std::vector< std::shared_ptr< SurgSim::Particles::Representation > > & getActiveParticleRepresentations()
Gets the list of active particle representations.
Definition: PhysicsManagerState.cpp:123
~PhysicsManagerState()
Destructor.
Definition: PhysicsManagerState.cpp:36