mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 13:50:04 +00:00
remove some sleep delays from PhysicsServerExample physics loop.
This commit is contained in:
parent
4587813a63
commit
6db217b36a
@ -299,7 +299,6 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
|
|||||||
|
|
||||||
|
|
||||||
double deltaTimeInSeconds = 0;
|
double deltaTimeInSeconds = 0;
|
||||||
double sleepCounter = 0;
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
BT_PROFILE("loop");
|
BT_PROFILE("loop");
|
||||||
@ -310,27 +309,7 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
|
|||||||
}
|
}
|
||||||
double dt = double(clock.getTimeMicroseconds())/1000000.;
|
double dt = double(clock.getTimeMicroseconds())/1000000.;
|
||||||
clock.reset();
|
clock.reset();
|
||||||
|
|
||||||
sleepCounter+=dt;
|
|
||||||
|
|
||||||
if (sleepCounter > sleepTimeThreshold)
|
|
||||||
{
|
|
||||||
BT_PROFILE("usleep(100)");
|
|
||||||
sleepCounter = 0;
|
|
||||||
b3Clock::usleep(100);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
if (gEnableRealTimeSimVR)
|
|
||||||
{
|
|
||||||
BT_PROFILE("usleep(1000)");
|
|
||||||
b3Clock::usleep(1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
deltaTimeInSeconds+= dt;
|
deltaTimeInSeconds+= dt;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user