aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
diff options
context:
space:
mode:
authorUbitUmarov2015-09-04 09:42:33 +0100
committerUbitUmarov2015-09-04 09:42:33 +0100
commitac4b2b2f50d03bf94e63902961d91604734395fb (patch)
tree9efafaa4022b6c6d8e93efb527d1b342587abd3b /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
parenta bit better addAvatar() call chain (diff)
downloadopensim-SC-ac4b2b2f50d03bf94e63902961d91604734395fb.zip
opensim-SC-ac4b2b2f50d03bf94e63902961d91604734395fb.tar.gz
opensim-SC-ac4b2b2f50d03bf94e63902961d91604734395fb.tar.bz2
opensim-SC-ac4b2b2f50d03bf94e63902961d91604734395fb.tar.xz
normalise physics plugins to return fps as (simulated time / requested simulation time). improved a bit old ode simulations per call math
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 8a19944..8af9e88 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -710,7 +710,8 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
710 // The physics engine returns the number of milliseconds it simulated this call. 710 // The physics engine returns the number of milliseconds it simulated this call.
711 // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. 711 // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS.
712 // Multiply by a fixed nominal frame rate to give a rate similar to the simulator (usually 55). 712 // Multiply by a fixed nominal frame rate to give a rate similar to the simulator (usually 55).
713 m_simulatedTime += (float)numSubSteps * m_fixedTimeStep * 1000f * NominalFrameRate; 713// m_simulatedTime += (float)numSubSteps * m_fixedTimeStep * 1000f * NominalFrameRate;
714 m_simulatedTime += (float)numSubSteps * m_fixedTimeStep * 1000f;
714 } 715 }
715 716
716 // Called by a BSPhysObject to note that it has changed properties and this information 717 // Called by a BSPhysObject to note that it has changed properties and this information
@@ -797,7 +798,8 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
797 798
798 // Return the framerate simulated to give the above returned results. 799 // Return the framerate simulated to give the above returned results.
799 // (Race condition here but this is just bookkeeping so rare mistakes do not merit a lock). 800 // (Race condition here but this is just bookkeeping so rare mistakes do not merit a lock).
800 float simTime = m_simulatedTime; 801 // undo math above
802 float simTime = m_simulatedTime / timeStep;
801 m_simulatedTime = 0f; 803 m_simulatedTime = 0f;
802 return simTime; 804 return simTime;
803 } 805 }