This commit is contained in:
erwincoumans
2016-05-07 16:19:43 -07:00
18 changed files with 247 additions and 53 deletions

View File

@@ -35,7 +35,11 @@ int main(int argc, char* argv[])
CommonExampleInterface* example = StandaloneExampleCreateFunc(options);
example->initPhysics();
example->stepSimulation(1.f/60.f);
for (int i=0;i<1000;i++)
{
printf("Simulating step %d\n",i);
example->stepSimulation(1.f/60.f);
}
example->exitPhysics();
delete example;

View File

@@ -71,20 +71,24 @@ int main(int argc, char* argv[])
OpenGLGuiHelper gui(app,false);
CommonExampleOptions options(&gui);
example = StandaloneExampleCreateFunc(options);
example->initPhysics();
example = StandaloneExampleCreateFunc(options);
example->initPhysics();
example->resetCamera();
do
{
app->m_instancingRenderer->init();
app->m_instancingRenderer->updateCamera();
app->m_instancingRenderer->updateCamera(app->getUpAxis());
example->stepSimulation(1./60.);
example->renderScene();
app->drawGrid();
DrawGridData dg;
dg.upAxis = app->getUpAxis();
app->drawGrid(dg);
app->swapBuffer();
} while (!app->m_window->requestedExit());

View File

@@ -111,8 +111,8 @@ public:
if (shapeIndex>=0)
{
TinyRenderObjectData* swObj = new TinyRenderObjectData(m_swWidth,m_swHeight,m_rgbColorBuffer,m_depthBuffer);
//swObj->registerMeshShape(vertices,numvertices,indices,numIndices);
swObj->createCube(1,1,1);//MeshShape(vertices,numvertices,indices,numIndices);
swObj->registerMeshShape(vertices,numvertices,indices,numIndices);
//swObj->createCube(1,1,1);//MeshShape(vertices,numvertices,indices,numIndices);
m_swRenderObjects.insert(shapeIndex,swObj);
}
return shapeIndex;
@@ -242,18 +242,20 @@ int main(int argc, char* argv[])
CommonExampleInterface* example = StandaloneExampleCreateFunc(options);
example->initPhysics();
example->resetCamera();
do
{
app->m_instancingRenderer->init();
app->m_instancingRenderer->updateCamera();
app->m_instancingRenderer->updateCamera(app->getUpAxis());
example->stepSimulation(1./60.);
example->renderScene();
app->drawGrid();
DrawGridData dg;
dg.upAxis = app->getUpAxis();
app->drawGrid(dg);
app->swapBuffer();
} while (!app->m_window->requestedExit());