diff options
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index beaea1f..f63ad95 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -413,7 +413,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
413 | // prevent simulation until we've been initialized | 413 | // prevent simulation until we've been initialized |
414 | if (!m_initialized) return 10.0f; | 414 | if (!m_initialized) return 10.0f; |
415 | 415 | ||
416 | long simulateStartTime = Util.EnvironmentTickCount(); | 416 | int simulateStartTime = Util.EnvironmentTickCount(); |
417 | 417 | ||
418 | // update the prim states while we know the physics engine is not busy | 418 | // update the prim states while we know the physics engine is not busy |
419 | ProcessTaints(); | 419 | ProcessTaints(); |
@@ -511,8 +511,13 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
511 | // long simulateTotalTime = Util.EnvironmentTickCountSubtract(simulateStartTime); | 511 | // long simulateTotalTime = Util.EnvironmentTickCountSubtract(simulateStartTime); |
512 | // return (timeStep * (float)simulateTotalTime); | 512 | // return (timeStep * (float)simulateTotalTime); |
513 | 513 | ||
514 | // TODO: FIX THIS: fps calculation wrong. This calculation always returns about 1 in normal operation. | 514 | // TODO: FIX THIS: fps calculation possibly wrong. |
515 | return timeStep / (numSubSteps * m_fixedTimeStep) * 1000f; | 515 | // This calculation says 1/timeStep is the ideal frame rate. Any time added to |
516 | // that by the physics simulation gives a slower frame rate. | ||
517 | long totalSimulationTime = Util.EnvironmentTickCountSubtract(simulateStartTime); | ||
518 | if (totalSimulationTime >= timeStep) | ||
519 | return 0; | ||
520 | return 1f / (timeStep + totalSimulationTime); | ||
516 | } | 521 | } |
517 | 522 | ||
518 | // Something has collided | 523 | // Something has collided |