int main(int argc, char* argv[]) { SimpleOpenGL3App* app = new SimpleOpenGL3App("Bullet Standalone Example",1024,768,true); OpenGLGuiHelper gui(app,false); CommonExampleOptions options(&gui); CommonExampleInterface* example = StandaloneExampleCreateFunc(options); example->initPhysics(); do { app->m_instancingRenderer->init(); app->m_instancingRenderer->updateCamera(); example->stepSimulation(1./60.); example->renderScene(); app->drawGrid(); app->swapBuffer(); } while (!app->m_window->requestedExit()); example->exitPhysics(); delete example; delete app; return 0; }
int main(int argc, char* argv[]) { DummyGUIHelper noGfx; CommonExampleOptions options(&noGfx); CommonExampleInterface* example = StandaloneExampleCreateFunc(options); example->initPhysics(); example->stepSimulation(1.f/60.f); example->exitPhysics(); delete example; return 0; }
virtual ~InProcessPhysicsClientExistingExampleBrowser() { m_physicsServerExample->exitPhysics(); //s_instancingRenderer->removeAllInstances(); delete m_physicsServerExample; delete m_sharedMem; }
int main(int argc, char* argv[]) { { DummyGUIHelper noGfx; CommonExampleOptions options(&noGfx); CommonExampleInterface* example = StandaloneExampleCreateFunc(options); example->initPhysics(); for (int i = 0; i < 1000; i++) { printf("Simulating step %d\n", i); example->stepSimulation(1.f / 60.f); } example->exitPhysics(); delete example; } return 0; }
int main(int argc, char* argv[]) { SimpleOpenGL3App* app = new SimpleOpenGL3App("Standalone Example (Software Renderer, TinyRenderer)", 1024, 768, true); int textureWidth = 640; int textureHeight = 480; SW_And_OpenGLGuiHelper gui(app, false, textureWidth, textureHeight, app->m_primRenderer); CommonExampleOptions options(&gui); CommonExampleInterface* example = StandaloneExampleCreateFunc(options); example->initPhysics(); example->resetCamera(); do { app->m_instancingRenderer->init(); app->m_instancingRenderer->updateCamera(app->getUpAxis()); example->stepSimulation(1. / 60.); example->renderScene(); DrawGridData dg; dg.upAxis = app->getUpAxis(); app->drawGrid(dg); app->swapBuffer(); } while (!app->m_window->requestedExit()); example->exitPhysics(); delete example; delete app; return 0; }
// return non-null if there is a status, nullptr otherwise virtual const struct SharedMemoryStatus* processServerStatus() { m_physicsServerExample->updateGraphics(); unsigned long long int curTime = m_clock.getTimeMicroseconds(); unsigned long long int dtMicro = curTime - m_prevTime; m_prevTime = curTime; double dt = double(dtMicro)/1000000.; m_physicsServerExample->stepSimulation(dt); { b3Clock::usleep(0); } const SharedMemoryStatus* stat = 0; { stat = PhysicsClientSharedMemory::processServerStatus(); } return stat; }
int main(int argc, char* argv[]) { TinyRendererGUIHelper noGfx(640,480); CommonExampleOptions options(&noGfx); CommonExampleInterface* example = StandaloneExampleCreateFunc(options); example->initPhysics(); example->resetCamera(); for (int i=0;i<1000;i++) { printf("Simulating step %d\n",i); example->stepSimulation(1.f/60.f); example->renderScene(); } example->exitPhysics(); delete example; return 0; }
virtual bool mouseButtonCallback(int button, int state, float x, float y) { return m_physicsServerExample->mouseButtonCallback(button,state,x,y); }
virtual bool mouseMoveCallback(float x, float y) { return m_physicsServerExample->mouseMoveCallback(x,y); }
virtual void debugDraw(int debugDrawMode) { m_physicsServerExample->physicsDebugDraw(debugDrawMode); }
virtual void renderScene() { m_physicsServerExample->renderScene(); }