diff options
author | Robert Adams | 2012-12-27 18:19:25 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-27 22:12:28 -0800 |
commit | c1e7539c77480b839d513dbb7db74aa8f260eba0 (patch) | |
tree | c67c637a678b0ec432438eb56a66481a258eab19 /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |
parent | BulletSim: move logic for IsColliding, CollidingGround and CollidingObj from ... (diff) | |
download | opensim-SC_OLD-c1e7539c77480b839d513dbb7db74aa8f260eba0.zip opensim-SC_OLD-c1e7539c77480b839d513dbb7db74aa8f260eba0.tar.gz opensim-SC_OLD-c1e7539c77480b839d513dbb7db74aa8f260eba0.tar.bz2 opensim-SC_OLD-c1e7539c77480b839d513dbb7db74aa8f260eba0.tar.xz |
BulletSim: Parameterize nominal frame rate (55) and add parameters to dynamially turn on/off detailed, unmanaged data dumping of prims and vehicles.
Diffstat (limited to '')
-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 a5fbf10..8edcd20 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -74,6 +74,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
74 | internal int m_maxSubSteps; | 74 | internal int m_maxSubSteps; |
75 | internal float m_fixedTimeStep; | 75 | internal float m_fixedTimeStep; |
76 | internal long m_simulationStep = 0; | 76 | internal long m_simulationStep = 0; |
77 | internal float NominalFrameRate { get; set; } | ||
77 | public long SimulationStep { get { return m_simulationStep; } } | 78 | public long SimulationStep { get { return m_simulationStep; } } |
78 | internal int m_taintsToProcessPerStep; | 79 | internal int m_taintsToProcessPerStep; |
79 | internal float LastTimeStep { get; private set; } | 80 | internal float LastTimeStep { get; private set; } |
@@ -162,6 +163,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
162 | private string m_physicsLoggingPrefix; | 163 | private string m_physicsLoggingPrefix; |
163 | private int m_physicsLoggingFileMinutes; | 164 | private int m_physicsLoggingFileMinutes; |
164 | private bool m_physicsLoggingDoFlush; | 165 | private bool m_physicsLoggingDoFlush; |
166 | private bool m_physicsPhysicalDumpEnabled; | ||
165 | // 'true' of the vehicle code is to log lots of details | 167 | // 'true' of the vehicle code is to log lots of details |
166 | public bool VehicleLoggingEnabled { get; private set; } | 168 | public bool VehicleLoggingEnabled { get; private set; } |
167 | public bool VehiclePhysicalLoggingEnabled { get; private set; } | 169 | public bool VehiclePhysicalLoggingEnabled { get; private set; } |
@@ -272,6 +274,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
272 | m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); | 274 | m_physicsLoggingPrefix = pConfig.GetString("PhysicsLoggingPrefix", "physics-%REGIONNAME%-"); |
273 | m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); | 275 | m_physicsLoggingFileMinutes = pConfig.GetInt("PhysicsLoggingFileMinutes", 5); |
274 | m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); | 276 | m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); |
277 | m_physicsPhysicalDumpEnabled = pConfig.GetBoolean("PhysicsPhysicalDumpEnabled", false); | ||
275 | // Very detailed logging for vehicle debugging | 278 | // Very detailed logging for vehicle debugging |
276 | VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); | 279 | VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); |
277 | VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false); | 280 | VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false); |
@@ -488,7 +491,8 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
488 | 491 | ||
489 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. | 492 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. |
490 | // Only enable this in a limited test world with few objects. | 493 | // Only enable this in a limited test world with few objects. |
491 | // BulletSimAPI.DumpAllInfo2(World.ptr); // DEBUG DEBUG DEBUG | 494 | if (m_physicsPhysicalDumpEnabled) |
495 | BulletSimAPI.DumpAllInfo2(World.ptr); | ||
492 | 496 | ||
493 | // step the physical world one interval | 497 | // step the physical world one interval |
494 | m_simulationStep++; | 498 | m_simulationStep++; |
@@ -587,12 +591,13 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
587 | 591 | ||
588 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. | 592 | // The following causes the unmanaged code to output ALL the values found in ALL the objects in the world. |
589 | // Only enable this in a limited test world with few objects. | 593 | // Only enable this in a limited test world with few objects. |
590 | // BulletSimAPI.DumpAllInfo2(World.ptr); // DEBUG DEBUG DEBUG | 594 | if (m_physicsPhysicalDumpEnabled) |
595 | BulletSimAPI.DumpAllInfo2(World.ptr); | ||
591 | 596 | ||
592 | // The physics engine returns the number of milliseconds it simulated this call. | 597 | // The physics engine returns the number of milliseconds it simulated this call. |
593 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. | 598 | // These are summed and normalized to one second and divided by 1000 to give the reported physics FPS. |
594 | // Multiply by 55 to give a nominal frame rate of 55. | 599 | // Multiply by 55 to give a nominal frame rate of 55. |
595 | return (float)numSubSteps * m_fixedTimeStep * 1000f * 55f; | 600 | return (float)numSubSteps * m_fixedTimeStep * 1000f * NominalFrameRate; |
596 | } | 601 | } |
597 | 602 | ||
598 | // Something has collided | 603 | // Something has collided |