Fix running headless to be nearly completely headless.

This commit is contained in:
Benelot
2016-09-18 01:03:41 +02:00
parent 51e51ca848
commit 062236af70
2 changed files with 4 additions and 2 deletions

View File

@@ -843,6 +843,7 @@ struct CommonTimeWarpBase: public CommonRigidBodyBase {
debugDraw(m_dynamicsWorld->getDebugDrawer()->getDebugMode()); debugDraw(m_dynamicsWorld->getDebugDrawer()->getDebugMode());
} }
} }
mIsHeadless = gIsHeadless;
} }
void resetCamera() { // reset the camera to its original position void resetCamera() { // reset the camera to its original position
float dist = 41; float dist = 41;
@@ -895,6 +896,7 @@ struct CommonTimeWarpBase: public CommonRigidBodyBase {
bool mPhysicsStepsPerSecondUpdated; bool mPhysicsStepsPerSecondUpdated;
bool mFramesPerSecondUpdated; bool mFramesPerSecondUpdated;
bool mSolverIterationsUpdated; bool mSolverIterationsUpdated;
bool mIsHeadless;
}; };
#endif //COMMON_TIME_WARP_BASE_H #endif //COMMON_TIME_WARP_BASE_H

View File

@@ -520,7 +520,7 @@ bool legContactProcessedCallback(btManifoldPoint& cp, void* body0, void* body1)
// Make a circle with a 0.9 radius at (0,0,0) // Make a circle with a 0.9 radius at (0,0,0)
// with RGB color (1,0,0). // with RGB color (1,0,0).
if(nn3DWalkers->m_dynamicsWorld->getDebugDrawer() != NULL){ if(nn3DWalkers->m_dynamicsWorld->getDebugDrawer() != NULL){
if(!gIsHeadless){ if(!nn3DWalkers->mIsHeadless){
nn3DWalkers->m_dynamicsWorld->getDebugDrawer()->drawSphere(cp.getPositionWorldOnA(), 0.1, btVector3(1., 0., 0.)); nn3DWalkers->m_dynamicsWorld->getDebugDrawer()->drawSphere(cp.getPositionWorldOnA(), 0.1, btVector3(1., 0., 0.));
} }
} }
@@ -1016,7 +1016,7 @@ void NN3DWalkersExample::scheduleEvaluations() {
} }
void NN3DWalkersExample::drawMarkings() { void NN3DWalkersExample::drawMarkings() {
if(!gIsHeadless){ if(!mIsHeadless){
for(int i = 0; i < NUM_WALKERS;i++) // draw current distance plates of moving walkers for(int i = 0; i < NUM_WALKERS;i++) // draw current distance plates of moving walkers
{ {
if(m_walkersInPopulation[i]->isInEvaluation()){ if(m_walkersInPopulation[i]->isInEvaluation()){