btMultiBodyConstraintSolver writes back the applied impulse for contact points
(added some debugging output for this in the demos, commented-out by default)
This commit is contained in:
@@ -180,11 +180,13 @@ int main(int argc, char* argv[])
|
||||
|
||||
app->drawGrid();
|
||||
|
||||
static int frameCount = 0;
|
||||
frameCount++;
|
||||
|
||||
if (0)
|
||||
{
|
||||
char bla[1024];
|
||||
static int frameCount = 0;
|
||||
frameCount++;
|
||||
|
||||
sprintf(bla,"Simple test frame %d", frameCount);
|
||||
|
||||
app->drawText(bla,10,10);
|
||||
@@ -197,6 +199,9 @@ int main(int argc, char* argv[])
|
||||
unsigned long int curTimeInMicroseconds = clock.getTimeMicroseconds();
|
||||
unsigned long int diff = curTimeInMicroseconds-prevTimeInMicroseconds;
|
||||
float deltaTimeInSeconds = (diff)*1.e-6;
|
||||
//printf("---------------------------------------------------\n");
|
||||
//printf("Framecount = %d\n",frameCount);
|
||||
|
||||
sCurrentDemo->stepSimulation(deltaTimeInSeconds);//1./60.f);
|
||||
prevTimeInMicroseconds = curTimeInMicroseconds;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,8 @@ void BasicDemo::renderScene()
|
||||
void BasicDemo::stepSimulation(float dt)
|
||||
{
|
||||
m_dynamicsWorld->stepSimulation(dt);
|
||||
/*
|
||||
|
||||
/*
|
||||
//print applied force
|
||||
//contact points
|
||||
for (int i=0;i<m_dynamicsWorld->getDispatcher()->getNumManifolds();i++)
|
||||
@@ -165,7 +166,7 @@ void BasicDemo::stepSimulation(float dt)
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -610,8 +610,27 @@ void FeatherstoneDemo1::renderScene()
|
||||
|
||||
void FeatherstoneDemo1::stepSimulation(float deltaTime)
|
||||
{
|
||||
m_dynamicsWorld->stepSimulation(deltaTime,0);
|
||||
m_dynamicsWorld->stepSimulation(deltaTime);//,0);
|
||||
// CProfileManager::dumpAll();
|
||||
/*
|
||||
for (int i=0;i<m_dynamicsWorld->getDispatcher()->getNumManifolds();i++)
|
||||
{
|
||||
btPersistentManifold* contact = m_dynamicsWorld->getDispatcher()->getManifoldByIndexInternal(i);
|
||||
for (int c=0;c<contact->getNumContacts();c++)
|
||||
{
|
||||
btManifoldPoint& pt = contact->getContactPoint(c);
|
||||
btScalar dist = pt.getDistance();
|
||||
if (dist< contact->getContactProcessingThreshold())
|
||||
{
|
||||
printf("normalImpulse[%d.%d] = %f\n",i,c,pt.m_appliedImpulse);
|
||||
|
||||
} else
|
||||
{
|
||||
printf("?\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -46,6 +46,25 @@ void MultiDofDemo::stepSimulation(float deltaTime)
|
||||
float internalTimeStep = 1./240.f;
|
||||
m_dynamicsWorld->stepSimulation(deltaTime,10,internalTimeStep);
|
||||
// CProfileManager::dumpAll();
|
||||
/*
|
||||
for (int i=0;i<m_dynamicsWorld->getDispatcher()->getNumManifolds();i++)
|
||||
{
|
||||
btPersistentManifold* contact = m_dynamicsWorld->getDispatcher()->getManifoldByIndexInternal(i);
|
||||
for (int c=0;c<contact->getNumContacts();c++)
|
||||
{
|
||||
btManifoldPoint& pt = contact->getContactPoint(c);
|
||||
btScalar dist = pt.getDistance();
|
||||
if (dist< contact->getContactProcessingThreshold())
|
||||
{
|
||||
printf("normalImpulse[%d.%d] = %f\n",i,c,pt.m_appliedImpulse);
|
||||
|
||||
} else
|
||||
{
|
||||
printf("?\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user