![]() |
Encapsulates a calculation over a selection of objects, needs to be subclassed to be used. More...
#include <SurgSim/Physics/Computation.h>
Public Member Functions | |
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... | |
virtual std::string | getClassName () const =0 |
The class name for this class. More... | |
Framework::Timer & | getTimer () |
Provides access to the update timer. More... | |
Protected Member Functions | |
virtual std::shared_ptr< PhysicsManagerState > | doUpdate (const double &dt, const std::shared_ptr< PhysicsManagerState > &state)=0 |
Override this function to implement the computations specific behavior. More... | |
Private Member Functions | |
std::shared_ptr< PhysicsManagerState > | preparePhysicsState (const std::shared_ptr< PhysicsManagerState > &state) |
Copy the PhysicsManagerState object when isCopyingState() is true. More... | |
Private Attributes | |
bool | m_copyState |
Framework::Timer | m_timer |
The update timer. More... | |
Encapsulates a calculation over a selection of objects, needs to be subclassed to be used.
|
explicit |
Constructor.
doCopyState | Specify if the output state in Computation::Update() is a copy or not of the input state |
|
virtual |
Destructor.
|
protectedpure virtual |
Override this function to implement the computations specific behavior.
Implemented in SurgSim::Physics::ContactConstraintGeneration, SurgSim::Physics::SolveMlcp, SurgSim::Physics::DcdCollision, SurgSim::Physics::CcdCollision, SurgSim::Physics::PrepareCollisionPairs, SurgSim::Physics::CcdCollisionLoop, SurgSim::Physics::ContactFiltering, SurgSim::Physics::PushResults, SurgSim::Physics::FreeMotion, SurgSim::Physics::PostUpdate, SurgSim::Physics::UpdateCcdData, SurgSim::Physics::ComputationGroup, SurgSim::Physics::PreUpdate, SurgSim::Physics::BuildMlcp, SurgSim::Physics::ParticleCollisionResponse, SurgSim::Physics::UpdateCollisionData, SurgSim::Physics::UpdateCollisionRepresentations, and SurgSim::Physics::UpdateDcdData.
|
pure virtual |
The class name for this class.
Framework::Timer & SurgSim::Physics::Computation::getTimer | ( | ) |
Provides access to the update timer.
bool SurgSim::Physics::Computation::isCopyingState | ( | ) |
Query if this object is copying the PhysicsManagerState.
|
private |
Copy the PhysicsManagerState object when isCopyingState() is true.
void SurgSim::Physics::Computation::setDoCopyState | ( | bool | val | ) |
Sets up whether the computation will copy the state of PhysicsManagerState before executing.
val | Whether to create a copy of the PhysicsState before running the update fuction. |
std::shared_ptr< PhysicsManagerState > SurgSim::Physics::Computation::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.
dt | The time passed from the last update in seconds. |
state | The physics state. |
|
private |
|
private |
The update timer.