added some debugging variable for CCD motion clamping

This commit is contained in:
erwin.coumans
2008-09-11 18:44:30 +00:00
parent 732745d06c
commit 569946a96f
2 changed files with 17 additions and 0 deletions

View File

@@ -39,8 +39,11 @@ btTransform startTransforms[maxNumObjects];
btCollisionShape* gShapePtr[maxNumObjects];//1 rigidbody has 1 shape (no re-use of shapes)
#define SHOW_NUM_DEEP_PENETRATIONS 1
extern int gNumClampedCcdMotions;
#ifdef SHOW_NUM_DEEP_PENETRATIONS
extern int gNumDeepPenetrationChecks;
extern int gNumSplitImpulseRecoveries;
extern int gNumGjkChecks;
extern int gNumAlignedAllocs;
@@ -541,6 +544,9 @@ void DemoApplication::shootBox(const btVector3& destination)
body->getWorldTransform().setRotation(btQuaternion(0,0,0,1));
body->setLinearVelocity(linVel);
body->setAngularVelocity(btVector3(0,0,0));
body->setCcdSquareMotionThreshold(3600);//1600);//40ms/sec for 60 hertz gives 0.66 m/frame. 40*40=1600
body->setCcdSweptSphereRadius(0.2f);
}
}
@@ -1154,6 +1160,11 @@ void DemoApplication::renderme()
sprintf(buf,"gNumGjkChecks= %d",gNumGjkChecks);
BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf);
yStart += yIncr;
glRasterPos3f(xOffset,yStart,0);
sprintf(buf,"gNumClampedCcdMotions = %d",gNumClampedCcdMotions);
BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf);
yStart += yIncr;
glRasterPos3f(xOffset,yStart,0);
sprintf(buf,"gNumSplitImpulseRecoveries= %d",gNumSplitImpulseRecoveries);
@@ -1218,6 +1229,7 @@ void DemoApplication::clientResetScene()
gNumGjkChecks = 0;
#endif //SHOW_NUM_DEEP_PENETRATIONS
gNumClampedCcdMotions = 0;
int numObjects = 0;
if (m_dynamicsWorld)
{