aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
diff options
context:
space:
mode:
authorRobert Adams2012-12-11 00:13:13 -0800
committerRobert Adams2012-12-11 00:13:13 -0800
commit8b861e880ad128edc0267b8e2d5931cfc8a142bc (patch)
tree5b003bc0c79c2d3c7f4efa0de1ba6d75db5a1bdf /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
parentBulletSim: set mass for single prim linksets when going physical. This fixes ... (diff)
downloadopensim-SC_OLD-8b861e880ad128edc0267b8e2d5931cfc8a142bc.zip
opensim-SC_OLD-8b861e880ad128edc0267b8e2d5931cfc8a142bc.tar.gz
opensim-SC_OLD-8b861e880ad128edc0267b8e2d5931cfc8a142bc.tar.bz2
opensim-SC_OLD-8b861e880ad128edc0267b8e2d5931cfc8a142bc.tar.xz
BulletSim: add ini file and command line parameters to control
dumping of physical vehicle parameters (out of Bullet) on each simulation step and to optionally scale vehicle angular velocity by the time step. The latter looks to be part of a difference between angular parameters for ODE and BulletSim. SL docs say angular velocity is measured in radians/timeScale. Not sure if this is different than what ODE does.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 17cc7b4..f4f2801 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -188,6 +188,8 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
188 private bool m_physicsLoggingDoFlush; 188 private bool m_physicsLoggingDoFlush;
189 // 'true' of the vehicle code is to log lots of details 189 // 'true' of the vehicle code is to log lots of details
190 public bool VehicleLoggingEnabled { get; private set; } 190 public bool VehicleLoggingEnabled { get; private set; }
191 public bool VehiclePhysicalLoggingEnabled { get; private set; }
192 public bool VehicleScaleAngularVelocityByTimestep { get; private set; }
191 193
192 #region Construction and Initialization 194 #region Construction and Initialization
193 public BSScene(string identifier) 195 public BSScene(string identifier)
@@ -297,6 +299,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
297 m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false); 299 m_physicsLoggingDoFlush = pConfig.GetBoolean("PhysicsLoggingDoFlush", false);
298 // Very detailed logging for vehicle debugging 300 // Very detailed logging for vehicle debugging
299 VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false); 301 VehicleLoggingEnabled = pConfig.GetBoolean("VehicleLoggingEnabled", false);
302 VehiclePhysicalLoggingEnabled = pConfig.GetBoolean("VehiclePhysicalLoggingEnabled", false);
300 303
301 // Do any replacements in the parameters 304 // Do any replacements in the parameters
302 m_physicsLoggingPrefix = m_physicsLoggingPrefix.Replace("%REGIONNAME%", RegionName); 305 m_physicsLoggingPrefix = m_physicsLoggingPrefix.Replace("%REGIONNAME%", RegionName);
@@ -501,7 +504,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
501 504
502 try 505 try
503 { 506 {
504 // if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG 507 if (VehiclePhysicalLoggingEnabled) DumpVehicles(); // DEBUG
505 if (PhysicsLogging.Enabled) beforeTime = Util.EnvironmentTickCount(); 508 if (PhysicsLogging.Enabled) beforeTime = Util.EnvironmentTickCount();
506 509
507 numSubSteps = BulletSimAPI.PhysicsStep2(World.ptr, timeStep, m_maxSubSteps, m_fixedTimeStep, 510 numSubSteps = BulletSimAPI.PhysicsStep2(World.ptr, timeStep, m_maxSubSteps, m_fixedTimeStep,
@@ -510,7 +513,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
510 if (PhysicsLogging.Enabled) simTime = Util.EnvironmentTickCountSubtract(beforeTime); 513 if (PhysicsLogging.Enabled) simTime = Util.EnvironmentTickCountSubtract(beforeTime);
511 DetailLog("{0},Simulate,call, frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}", 514 DetailLog("{0},Simulate,call, frame={1}, nTaints={2}, simTime={3}, substeps={4}, updates={5}, colliders={6}",
512 DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, updatedEntityCount, collidersCount); 515 DetailLogZero, m_simulationStep, numTaints, simTime, numSubSteps, updatedEntityCount, collidersCount);
513 // if (VehicleLoggingEnabled) DumpVehicles(); // DEBUG 516 if (VehiclePhysicalLoggingEnabled) DumpVehicles(); // DEBUG
514 } 517 }
515 catch (Exception e) 518 catch (Exception e)
516 { 519 {
@@ -1226,6 +1229,11 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
1226 (s,cf,p,v) => { s.m_params[0].vehicleAngularDamping = cf.GetFloat(p, v); }, 1229 (s,cf,p,v) => { s.m_params[0].vehicleAngularDamping = cf.GetFloat(p, v); },
1227 (s) => { return s.m_params[0].vehicleAngularDamping; }, 1230 (s) => { return s.m_params[0].vehicleAngularDamping; },
1228 (s,p,l,v) => { s.m_params[0].vehicleAngularDamping = v; } ), 1231 (s,p,l,v) => { s.m_params[0].vehicleAngularDamping = v; } ),
1232 new ParameterDefn("VehicleScaleAngularVelocityByTimestep", "If true, scale angular turning by timestep",
1233 ConfigurationParameters.numericFalse,
1234 (s,cf,p,v) => { s.VehicleScaleAngularVelocityByTimestep = cf.GetBoolean(p, s.BoolNumeric(v)); },
1235 (s) => { return s.NumericBool(s.VehicleScaleAngularVelocityByTimestep); },
1236 (s,p,l,v) => { s.VehicleScaleAngularVelocityByTimestep = s.BoolNumeric(v); } ),
1229 1237
1230 new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)", 1238 new ParameterDefn("MaxPersistantManifoldPoolSize", "Number of manifolds pooled (0 means default of 4096)",
1231 0f, 1239 0f,