only update aabb of active objects, thanks Peter Tchernev for reporting (http://bulletphysics.com/Bullet/phpBB3/viewtopic.php?f=9&t=1764 )

move debug aabb rendering from updateAabb to debugDrawWorld
This commit is contained in:
ejcoumans
2007-12-10 02:18:38 +00:00
parent bf5a4a7d39
commit f1be4ab221
15 changed files with 68 additions and 16 deletions

View File

@@ -217,6 +217,9 @@ void BspDemo::clientMoveAndDisplay()
m_dynamicsWorld->stepSimulation(dt);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
renderme();
glFlush();

View File

@@ -246,6 +246,9 @@ void CcdPhysicsDemo::clientMoveAndDisplay()
int numSimSteps = 0;
numSimSteps = m_dynamicsWorld->stepSimulation(dt,maxSimSubSteps);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
#ifdef VERBOSE_TIMESTEPPING_CONSOLEOUTPUT
if (!numSimSteps)
printf("Interpolated transforms\n");

View File

@@ -212,6 +212,9 @@ void ColladaDemo::clientMoveAndDisplay()
m_dynamicsWorld->stepSimulation(dt);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
renderme();
glFlush();
@@ -226,7 +229,8 @@ void ColladaDemo::displayCallback(void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
m_dynamicsWorld->updateAabbs();
if (m_dynamicsWorld)
m_dynamicsWorld->debugDrawWorld();
renderme();

View File

@@ -377,6 +377,9 @@ void ConcaveConvexcastDemo::clientMoveAndDisplay()
m_dynamicsWorld->stepSimulation(dt);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
convexcastBatch.move (dt);
convexcastBatch.cast (m_dynamicsWorld);
renderme();

View File

@@ -325,6 +325,9 @@ void ConcaveDemo::clientMoveAndDisplay()
}
m_dynamicsWorld->stepSimulation(dt);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
renderme();

View File

@@ -351,6 +351,9 @@ void ConcaveRaycastDemo::clientMoveAndDisplay()
m_dynamicsWorld->stepSimulation(dt);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
raycastBar.move (dt);
raycastBar.cast (m_dynamicsWorld);
renderme();

View File

@@ -201,13 +201,17 @@ void ConstraintDemo::clientMoveAndDisplay()
m_clock.reset();
//printf("dt = %f: ",dt);
{
{
//during idle mode, just run 1 simulation step maximum
int maxSimSubSteps = m_idle ? 1 : 1;
if (m_idle)
dt = 1.0/420.f;
int numSimSteps = m_dynamicsWorld->stepSimulation(dt,maxSimSubSteps);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
bool verbose = false;
if (verbose)
{
@@ -225,7 +229,7 @@ void ConstraintDemo::clientMoveAndDisplay()
}
}
}
}
}
renderme();
drawLimit();
@@ -241,9 +245,9 @@ void ConstraintDemo::displayCallback(void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
m_dynamicsWorld->updateAabbs();
if (m_dynamicsWorld)
m_dynamicsWorld->debugDrawWorld();
drawLimit();
renderme();

View File

@@ -372,6 +372,9 @@ void ConvexDecompositionDemo::clientMoveAndDisplay()
m_dynamicsWorld->stepSimulation(dt);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
renderme();
glFlush();
@@ -386,7 +389,8 @@ void ConvexDecompositionDemo::displayCallback(void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
m_dynamicsWorld->updateAabbs();
if (m_dynamicsWorld)
m_dynamicsWorld->debugDrawWorld();
renderme();

View File

@@ -116,7 +116,11 @@ void GenericJointDemo::clientMoveAndDisplay()
ms = minFPS;
if (m_dynamicsWorld)
{
m_dynamicsWorld->stepSimulation(ms / 1000000.f);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
}
renderme();
@@ -130,7 +134,7 @@ void GenericJointDemo::displayCallback()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if (m_dynamicsWorld)
m_dynamicsWorld->updateAabbs();
m_dynamicsWorld->debugDrawWorld();
renderme();

View File

@@ -598,6 +598,10 @@ void GimpactConcaveDemo::clientMoveAndDisplay()
m_clock.reset();
m_dynamicsWorld->stepSimulation(dt);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
m_steps_done++;
//m_dynamicsWorld->stepSimulation(dts);

View File

@@ -1890,6 +1890,9 @@ void ConcaveDemo::clientMoveAndDisplay()
m_clock.reset();
m_dynamicsWorld->stepSimulation(dt);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
renderme();
glFlush();

View File

@@ -369,7 +369,12 @@ void RagdollDemo::clientMoveAndDisplay()
ms = minFPS;
if (m_dynamicsWorld)
{
m_dynamicsWorld->stepSimulation(ms / 1000000.f);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
}
renderme();

View File

@@ -147,6 +147,9 @@ void UserCollisionAlgorithm::clientMoveAndDisplay()
m_dynamicsWorld->stepSimulation(dt);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
renderme();
glFlush();

View File

@@ -453,6 +453,9 @@ void VehicleDemo::clientMoveAndDisplay()
dt = 1.0/420.f;
int numSimSteps = m_dynamicsWorld->stepSimulation(dt,maxSimSubSteps);
//optional but useful: debug drawing
m_dynamicsWorld->debugDrawWorld();
//#define VERBOSE_FEEDBACK
#ifdef VERBOSE_FEEDBACK