NTRT Simulator
v1.1
|
#include <tgSimulation.h>
Public Member Functions | |
tgSimulation (tgSimView &view) | |
void | step (double dt) const |
void | run () const |
void | run (int steps) const |
void | addModel (tgModel *pModel) |
void | onVisit (const tgModelVisitor &r) const |
void | reset () |
tgWorld & | getWorld () const |
Holds objects necessary for simulation, a world, a view and a list of models.
Definition at line 43 of file tgSimulation.h.
tgSimulation::tgSimulation | ( | tgSimView & | view | ) |
The only constructor.
[in,out] | view | the way the world and its models are rendered. |
Definition at line 39 of file tgSimulation.cpp.
void tgSimulation::addModel | ( | tgModel * | pModel | ) |
Add a Tensegrity to the simulation.
[in] | pModel | a pointer to a tgModel representing a Tensegrity; an exception is thrown if it is NULL |
std::invalid_argument | if pModel is NULL |
Definition at line 60 of file tgSimulation.cpp.
tgWorld & tgSimulation::getWorld | ( | ) | const |
Returns a reference to the world
Definition at line 107 of file tgSimulation.cpp.
void tgSimulation::onVisit | ( | const tgModelVisitor & | r | ) | const |
Pass the tgModelVisitor to all of the models
Definition at line 79 of file tgSimulation.cpp.
void tgSimulation::reset | ( | ) |
Calls teardown, then calls setup on the view, finally calls setup on the models Will delete and remake the dynamics world
Definition at line 91 of file tgSimulation.cpp.
void tgSimulation::run | ( | ) | const |
Run until stopped by user. Calls tgSimView.run()
Definition at line 151 of file tgSimulation.cpp.
void tgSimulation::run | ( | int | steps | ) | const |
Run for a specific number of steps. Calls tgSimView.run(int steps)
[in] | steps | the number of steps to update the graphics |
Definition at line 156 of file tgSimulation.cpp.
void tgSimulation::step | ( | double | dt | ) | const |
Advance the simulation.
[in] | dt | the number of seconds since the previous call; throw an exception if not positive |
std::invalid_argument | if dt is not positive |
Definition at line 112 of file tgSimulation.cpp.