diff options
author | Justin Clark-Casey (justincc) | 2014-07-29 01:21:15 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-07-29 01:21:15 +0100 |
commit | 3654ae8d8cea0bf0455974efe18ff99e484d2893 (patch) | |
tree | 4daebd94efd967de9d64f69ace7d057f514635e6 /OpenSim/Region/Physics | |
parent | minor: make "debug scene set" usage command accurate again from last commit f... (diff) | |
download | opensim-SC-3654ae8d8cea0bf0455974efe18ff99e484d2893.zip opensim-SC-3654ae8d8cea0bf0455974efe18ff99e484d2893.tar.gz opensim-SC-3654ae8d8cea0bf0455974efe18ff99e484d2893.tar.bz2 opensim-SC-3654ae8d8cea0bf0455974efe18ff99e484d2893.tar.xz |
Allow the "debug scene set physics false|true" command to work when bulletsim physics is running in a separate thread.
This will also allow the "disable physics" setting in the region debug viewer dialog to work in this circumstance.
Diffstat (limited to 'OpenSim/Region/Physics')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 5 |
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 | ||