aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs10
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs5
2 files changed, 14 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index 8b4df05..867d6ff 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
@@ -54,6 +54,14 @@ public static class BSParam
54 // =================== 54 // ===================
55 // From: 55 // From:
56 56
57 /// <summary>
58 /// Set whether physics is active or not.
59 /// </summary>
60 /// <remarks>
61 /// Can be enabled and disabled to start and stop physics.
62 /// </remarks>
63 public static bool Active { get; private set; }
64
57 public static bool UseSeparatePhysicsThread { get; private set; } 65 public static bool UseSeparatePhysicsThread { get; private set; }
58 public static float PhysicsTimeStep { get; private set; } 66 public static float PhysicsTimeStep { get; private set; }
59 67
@@ -373,6 +381,8 @@ public static class BSParam
373 // v = value (appropriate type) 381 // v = value (appropriate type)
374 private static ParameterDefnBase[] ParameterDefinitions = 382 private static ParameterDefnBase[] ParameterDefinitions =
375 { 383 {
384 new ParameterDefn<bool>("Active", "If 'true', false then physics is not active",
385 false ),
376 new ParameterDefn<bool>("UseSeparatePhysicsThread", "If 'true', the physics engine runs independent from the simulator heartbeat", 386 new ParameterDefn<bool>("UseSeparatePhysicsThread", "If 'true', the physics engine runs independent from the simulator heartbeat",
377 false ), 387 false ),
378 new ParameterDefn<float>("PhysicsTimeStep", "If separate thread, seconds to simulate each interval", 388 new ParameterDefn<float>("PhysicsTimeStep", "If separate thread, seconds to simulate each interval",
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 17d26a9..e517389 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -821,7 +821,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
821 while (m_initialized) 821 while (m_initialized)
822 { 822 {
823 int beginSimulationRealtimeMS = Util.EnvironmentTickCount(); 823 int beginSimulationRealtimeMS = Util.EnvironmentTickCount();
824 DoPhysicsStep(BSParam.PhysicsTimeStep); 824
825 if (BSParam.Active)
826 DoPhysicsStep(BSParam.PhysicsTimeStep);
827
825 int simulationRealtimeMS = Util.EnvironmentTickCountSubtract(beginSimulationRealtimeMS); 828 int simulationRealtimeMS = Util.EnvironmentTickCountSubtract(beginSimulationRealtimeMS);
826 int simulationTimeVsRealtimeDifferenceMS = ((int)(BSParam.PhysicsTimeStep*1000f)) - simulationRealtimeMS; 829 int simulationTimeVsRealtimeDifferenceMS = ((int)(BSParam.PhysicsTimeStep*1000f)) - simulationRealtimeMS;
827 830