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:
@@ -61,6 +61,8 @@ SET(SharedMemory_SRCS
|
||||
../Importers/ImportMJCFDemo/BulletMJCFImporter.h
|
||||
../Utils/b3ResourcePath.cpp
|
||||
../Utils/b3Clock.cpp
|
||||
../Utils/ChromeTraceUtil.cpp
|
||||
../Utils/ChromeTraceUtil.h
|
||||
../Importers/ImportURDFDemo/URDFImporterInterface.h
|
||||
../Importers/ImportURDFDemo/URDFJointTypes.h
|
||||
../Importers/ImportObjDemo/Wavefront2GLInstanceGraphicsShape.cpp
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
{
|
||||
|
||||
@@ -77,6 +77,8 @@ myfiles =
|
||||
"../Importers/ImportMJCFDemo/BulletMJCFImporter.h",
|
||||
"../Utils/b3ResourcePath.cpp",
|
||||
"../Utils/b3Clock.cpp",
|
||||
"../Utils/ChromeTraceUtil.cpp",
|
||||
"../Utils/ChromeTraceUtil.h",
|
||||
"../../Extras/Serialize/BulletWorldImporter/*",
|
||||
"../../Extras/Serialize/BulletFileLoader/*",
|
||||
"../Importers/ImportURDFDemo/URDFImporterInterface.h",
|
||||
|
||||
Reference in New Issue
Block a user