From 062236af700cff3b4e452f081e2c0ade8867f154 Mon Sep 17 00:00:00 2001 From: Benelot Date: Sun, 18 Sep 2016 01:03:41 +0200 Subject: [PATCH] Fix running headless to be nearly completely headless. --- examples/CommonInterfaces/CommonTimeWarpBase.h | 2 ++ examples/Evolution/NN3DWalkers.cpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/CommonInterfaces/CommonTimeWarpBase.h b/examples/CommonInterfaces/CommonTimeWarpBase.h index 3c01cba9e..dde06b417 100755 --- a/examples/CommonInterfaces/CommonTimeWarpBase.h +++ b/examples/CommonInterfaces/CommonTimeWarpBase.h @@ -843,6 +843,7 @@ struct CommonTimeWarpBase: public CommonRigidBodyBase { debugDraw(m_dynamicsWorld->getDebugDrawer()->getDebugMode()); } } + mIsHeadless = gIsHeadless; } void resetCamera() { // reset the camera to its original position float dist = 41; @@ -895,6 +896,7 @@ struct CommonTimeWarpBase: public CommonRigidBodyBase { bool mPhysicsStepsPerSecondUpdated; bool mFramesPerSecondUpdated; bool mSolverIterationsUpdated; + bool mIsHeadless; }; #endif //COMMON_TIME_WARP_BASE_H diff --git a/examples/Evolution/NN3DWalkers.cpp b/examples/Evolution/NN3DWalkers.cpp index 06cb14c28..52217b5c6 100755 --- a/examples/Evolution/NN3DWalkers.cpp +++ b/examples/Evolution/NN3DWalkers.cpp @@ -520,7 +520,7 @@ bool legContactProcessedCallback(btManifoldPoint& cp, void* body0, void* body1) // Make a circle with a 0.9 radius at (0,0,0) // with RGB color (1,0,0). if(nn3DWalkers->m_dynamicsWorld->getDebugDrawer() != NULL){ - if(!gIsHeadless){ + if(!nn3DWalkers->mIsHeadless){ nn3DWalkers->m_dynamicsWorld->getDebugDrawer()->drawSphere(cp.getPositionWorldOnA(), 0.1, btVector3(1., 0., 0.)); } } @@ -1016,7 +1016,7 @@ void NN3DWalkersExample::scheduleEvaluations() { } void NN3DWalkersExample::drawMarkings() { - if(!gIsHeadless){ + if(!mIsHeadless){ for(int i = 0; i < NUM_WALKERS;i++) // draw current distance plates of moving walkers { if(m_walkersInPopulation[i]->isInEvaluation()){