34 #include "LinearMath/btQuickprof.h"
50 tgSimulation::~tgSimulation()
54 for (
int i = 0; i < m_models.size(); i++)
65 throw std::invalid_argument(
"NULL pointer to tgModel");
71 m_models.push_back(pModel);
76 assert(!m_models.empty());
82 BT_PROFILE(
"tgSimulation::onVisit");
83 #endif //BT_NO_PROFILE
86 for (
int i = 0; i < m_models.size(); i++) {
87 m_models[i]->onVisit(r);
97 for (
int i = 0; i != m_models.size(); i++)
100 m_models[i]->setup(m_view.
world());
109 return m_view.
world();
118 throw std::invalid_argument(
"dt for step is not positive");
127 for (
int i = 0; i < m_models.size(); i++)
129 m_models[i]->step(dt);
134 void tgSimulation::teardown()
const
136 const size_t n = m_models.size();
137 for (
int i = 0; i < n; i++)
139 tgModel *
const pModel = m_models[i];
140 assert(pModel != NULL);
161 bool tgSimulation::invariant()
const
virtual void setup(tgWorld &world)
void bindToSimulation(tgSimulation &simulation)
void releaseFromSimulation()
tgWorld & getWorld() const
void addModel(tgModel *pModel)
Contains the definition of class tgModel.
Contains the definition of class tgSimulation.
Contains the definition of class tgSimViewGraphics.
void step(double dt) const
Contains the definition of class tgWorld $Id$.
tgSimulation(tgSimView &view)
void onVisit(const tgModelVisitor &r) const
Contains the definition of class tgSimView.
void step(double dt) const