16 #ifndef SURGSIM_PHYSICS_COMPUTATION_H 17 #define SURGSIM_PHYSICS_COMPUTATION_H 29 class PhysicsManagerState;
49 std::shared_ptr<PhysicsManagerState>
update(
double dt,
const std::shared_ptr<PhysicsManagerState>& state);
71 virtual std::shared_ptr<PhysicsManagerState>
doUpdate(
73 const std::shared_ptr<PhysicsManagerState>& state) = 0;
79 std::shared_ptr<PhysicsManagerState>
preparePhysicsState(
const std::shared_ptr<PhysicsManagerState>& state);
89 #endif // SURGSIM_PHYSICS_COMPUTATION_H Definition: CompoundShapeToGraphics.cpp:29
virtual ~Computation()
Destructor.
Definition: Computation.cpp:31
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 secon...
Definition: Computation.cpp:36
Framework::Timer & getTimer()
Provides access to the update timer.
Definition: Computation.cpp:54
Framework::Timer m_timer
The update timer.
Definition: Computation.h:82
void setDoCopyState(bool val)
Sets up whether the computation will copy the state of PhysicsManagerState before executing...
Definition: Computation.cpp:44
Timer class, measures execution times.
Definition: Timer.h:30
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.
std::shared_ptr< PhysicsManagerState > preparePhysicsState(const std::shared_ptr< PhysicsManagerState > &state)
Copy the PhysicsManagerState object when isCopyingState() is true.
Definition: Computation.cpp:59
Encapsulates a calculation over a selection of objects, needs to be subclassed to be used...
Definition: Computation.h:32
bool m_copyState
Definition: Computation.h:76
virtual std::string getClassName() const =0
The class name for this class.
Computation(bool doCopyState)
Constructor.
Definition: Computation.cpp:26
bool isCopyingState()
Query if this object is copying the PhysicsManagerState.
Definition: Computation.cpp:49