31 #include "tgGLDebugDrawer.h"
33 #include "BulletSoftBody/btSoftRigidDynamicsWorld.h"
41 gDebugDrawer =
new tgGLDebugDrawer();
44 tgSimViewGraphics::~tgSimViewGraphics()
47 CProfileManager::Release_Iterator(m_profileIterator);
48 #endif //BT_NO_PROFILE
49 delete m_shootBoxShape;
60 btSoftRigidDynamicsWorld& dynamicsWorld =
65 m_dynamicsWorld = &dynamicsWorld;
68 dynamicsWorld.setDebugDrawer(gDebugDrawer);
72 std::cout <<
"setup graphics" << std::endl;
75 void tgSimViewGraphics::teardown()
79 tgSimView::teardown();
82 void tgSimViewGraphics::render()
87 glClear(GL_COLOR_BUFFER_BIT |
89 GL_STENCIL_BUFFER_BIT);
95 clientMoveAndDisplay();
96 tgGlutMainEventLoop();
105 tgglutmain(1024, 600,
"Tensegrity Demo",
this);
106 const double dt = 1.0f/120.f;
130 void tgSimViewGraphics::reset()
137 void tgSimViewGraphics::clientMoveAndDisplay()
146 m_dynamicsWorld->debugDrawWorld();
156 void tgSimViewGraphics::displayCallback()
160 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
165 m_dynamicsWorld->debugDrawWorld();
172 void tgSimViewGraphics::clientResetScene()
bool isInitialzed() const
tgModelVisitor * m_pModelVisitor
static btSoftRigidDynamicsWorld & worldToDynamicsWorld(tgWorld &world)
tgSimViewGraphics(tgWorld &world, double stepSize=1.0/120.0, double renderRate=1.0/60.0)
tgWorld & getWorld() const
Contains the definition of class tgSimulation $Id$.
Contains the definition of class tgSimViewGraphics $Id$.
Contains the definition of class tgBulletUtil.
tgSimulation * m_pSimulation
void step(double dt) const