Move ChromeTracing in its own file, and add tracing support for VR server (App_SharedMemoryPhysics_VR)

Add a bit of extra sleep in PhysicsServer thread, to make rendering smoother.
This commit is contained in:
erwincoumans
2017-01-29 20:59:47 -08:00
parent 446cb77a5e
commit 26a34e3cda
11 changed files with 333 additions and 266 deletions

View File

@@ -300,7 +300,6 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
double deltaTimeInSeconds = 0;
double sleepCounter = 0;
do
{
BT_PROFILE("loop");
@@ -310,6 +309,8 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
b3Clock::usleep(0);
}
double dt = double(clock.getTimeMicroseconds())/1000000.;
clock.reset();
sleepCounter+=dt;
if (sleepCounter > sleepTimeThreshold)
@@ -317,10 +318,18 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
BT_PROFILE("usleep(100)");
sleepCounter = 0;
b3Clock::usleep(100);
}
{
if (gEnableRealTimeSimVR)
{
BT_PROFILE("usleep(1000)");
b3Clock::usleep(1000);
}
}
deltaTimeInSeconds+= dt;
clock.reset();
{