minor tweak to BenchmarkDemo to enable toggling between console/graphical output
Disable island manager for 3000 falling boxes: we need to add some batching rather then running thousands of single-body islands
This commit is contained in:
@@ -17,9 +17,9 @@ subject to the following restrictions:
|
||||
#define COLLISION_RADIUS 0.0f
|
||||
|
||||
#include "BenchmarkDemo.h"
|
||||
#ifdef USE_GLUT_DEMO_APPLICATION
|
||||
#ifdef USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
#include "GlutStuff.h"
|
||||
#endif //USE_GLUT_DEMO_APPLICATION
|
||||
#endif //USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
|
||||
///btBulletDynamicsCommon.h is the main Bullet include file, contains most common include files.
|
||||
#include "btBulletDynamicsCommon.h"
|
||||
@@ -178,7 +178,7 @@ public:
|
||||
|
||||
void draw ()
|
||||
{
|
||||
#ifdef USE_GLUT_DEMO_APPLICATION
|
||||
#ifdef USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
glDisable (GL_LIGHTING);
|
||||
glColor3f (0.0, 1.0, 0.0);
|
||||
glBegin (GL_LINES);
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
}
|
||||
glEnd ();
|
||||
glEnable (GL_LIGHTING);
|
||||
#endif //USE_GLUT_DEMO_APPLICATION
|
||||
#endif //USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
|
||||
}
|
||||
};
|
||||
@@ -217,9 +217,9 @@ static btRaycastBar2 raycastBar;
|
||||
|
||||
void BenchmarkDemo::clientMoveAndDisplay()
|
||||
{
|
||||
#ifdef USE_GLUT_DEMO_APPLICATION
|
||||
#ifdef USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
#endif //USE_GLUT_DEMO_APPLICATION
|
||||
#endif //USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
|
||||
//simple dynamics world doesn't handle fixed-time-stepping
|
||||
float ms = getDeltaTimeMicroseconds();
|
||||
@@ -242,11 +242,11 @@ void BenchmarkDemo::clientMoveAndDisplay()
|
||||
|
||||
renderme();
|
||||
|
||||
#ifdef USE_GLUT_DEMO_APPLICATION
|
||||
#ifdef USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
glFlush();
|
||||
|
||||
glutSwapBuffers();
|
||||
#endif //USE_GLUT_DEMO_APPLICATION
|
||||
#endif //USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ void BenchmarkDemo::clientMoveAndDisplay()
|
||||
void BenchmarkDemo::displayCallback(void)
|
||||
{
|
||||
|
||||
#ifdef USE_GLUT_DEMO_APPLICATION
|
||||
#ifdef USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
renderme();
|
||||
@@ -266,7 +266,7 @@ void BenchmarkDemo::displayCallback(void)
|
||||
|
||||
glFlush();
|
||||
glutSwapBuffers();
|
||||
#endif //USE_GLUT_DEMO_APPLICATION
|
||||
#endif //USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
}
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ void BenchmarkDemo::initPhysics()
|
||||
|
||||
btDiscreteDynamicsWorld* dynamicsWorld;
|
||||
m_dynamicsWorld = dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver,m_collisionConfiguration);
|
||||
//dynamicsWorld->getSimulationIslandManager()->setSplitIslands(false);
|
||||
dynamicsWorld->getSimulationIslandManager()->setSplitIslands(false);
|
||||
dynamicsWorld->getDispatchInfo().m_useConvexConservativeDistanceUtil = true;
|
||||
dynamicsWorld->getDispatchInfo().m_convexConservativeDistanceThreshold = btScalar(0.01);
|
||||
|
||||
@@ -1224,7 +1224,8 @@ void BenchmarkDemo::exitPhysics()
|
||||
|
||||
|
||||
|
||||
#ifndef USE_GLUT_DEMO_APPLICATION
|
||||
#ifndef USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
|
||||
btRigidBody* DemoApplication::localCreateRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape)
|
||||
{
|
||||
btAssert((!shape || shape->getShapeType() != INVALID_SHAPE_PROXYTYPE));
|
||||
@@ -1245,5 +1246,5 @@ btRigidBody* DemoApplication::localCreateRigidBody(float mass, const btTransform
|
||||
|
||||
return body;
|
||||
}
|
||||
#endif //USE_GLUT_DEMO_APPLICATION
|
||||
#endif //USE_GLUT_GRAPHICAL_BENCHMARK
|
||||
|
||||
|
||||
Reference in New Issue
Block a user