16 #ifndef SURGSIM_PHYSICS_COMPUTATION_H 17 #define SURGSIM_PHYSICS_COMPUTATION_H 27 class PhysicsManagerState;
47 std::shared_ptr<PhysicsManagerState>
update(
double dt,
const std::shared_ptr<PhysicsManagerState>& state);
60 virtual std::shared_ptr<PhysicsManagerState>
doUpdate(
62 const std::shared_ptr<PhysicsManagerState>& state) = 0;
68 std::shared_ptr<PhysicsManagerState>
preparePhysicsState(
const std::shared_ptr<PhysicsManagerState>& state);
75 #endif // SURGSIM_PHYSICS_COMPUTATION_H Definition: DriveElementFromInputBehavior.cpp:27
virtual ~Computation()
Destructor.
Definition: Computation.cpp:30
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:35
void setDoCopyState(bool val)
Sets up whether the computation will copy the state of PhysicsManagerState before executing...
Definition: Computation.cpp:40
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:50
Encapsulates a calculation over a selection of objects, needs to be subclassed to be used...
Definition: Computation.h:30
bool m_copyState
Definition: Computation.h:65
Computation(bool doCopyState)
Constructor.
Definition: Computation.cpp:25
bool isCopyingState()
Query if this object is copying the PhysicsManagerState.
Definition: Computation.cpp:45