aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorRobert Adams2012-03-23 10:59:40 -0700
committerRobert Adams2012-03-23 13:15:23 -0700
commit142de1d02f086c80888eb216cfd31b84ec27a79b (patch)
tree46c1cf1e68d18992aacd2a78c4e80c116f3517e9 /OpenSim/Region
parentBulletSim: remove confusion between angularVelocity and rotationalVelocity (t... (diff)
downloadopensim-SC_OLD-142de1d02f086c80888eb216cfd31b84ec27a79b.zip
opensim-SC_OLD-142de1d02f086c80888eb216cfd31b84ec27a79b.tar.gz
opensim-SC_OLD-142de1d02f086c80888eb216cfd31b84ec27a79b.tar.bz2
opensim-SC_OLD-142de1d02f086c80888eb216cfd31b84ec27a79b.tar.xz
BulletSim: add a bunch of internal Bullet configuration parameters to OpenSimDefaults.ini and the code.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs34
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs9
2 files changed, 43 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 13d5e03..8d0f9a6 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -240,6 +240,15 @@ public class BSScene : PhysicsScene, IPhysicsParameters
240 parms.avatarDensity = 60f; 240 parms.avatarDensity = 60f;
241 parms.avatarCapsuleRadius = 0.37f; 241 parms.avatarCapsuleRadius = 0.37f;
242 parms.avatarCapsuleHeight = 1.5f; // 2.140599f 242 parms.avatarCapsuleHeight = 1.5f; // 2.140599f
243 parms.avatarContactProcessingThreshold = 0.1f;
244
245 parms.maxPersistantManifoldPoolSize = 0f;
246 parms.shouldDisableContactPoolDynamicAllocation = ConfigurationParameters.numericFalse;
247 parms.shouldForceUpdateAllAabbs = ConfigurationParameters.numericFalse;
248 parms.shouldRandomizeSolverOrder = ConfigurationParameters.numericFalse;
249 parms.shouldSplitSimulationIslands = ConfigurationParameters.numericFalse;
250 parms.shouldEnableFrictionCaching = ConfigurationParameters.numericFalse;
251 parms.numberOfSolverIterations = 0f; // means use default
243 252
244 if (config != null) 253 if (config != null)
245 { 254 {
@@ -285,11 +294,36 @@ public class BSScene : PhysicsScene, IPhysicsParameters
285 parms.avatarDensity = pConfig.GetFloat("AvatarDensity", parms.avatarDensity); 294 parms.avatarDensity = pConfig.GetFloat("AvatarDensity", parms.avatarDensity);
286 parms.avatarCapsuleRadius = pConfig.GetFloat("AvatarCapsuleRadius", parms.avatarCapsuleRadius); 295 parms.avatarCapsuleRadius = pConfig.GetFloat("AvatarCapsuleRadius", parms.avatarCapsuleRadius);
287 parms.avatarCapsuleHeight = pConfig.GetFloat("AvatarCapsuleHeight", parms.avatarCapsuleHeight); 296 parms.avatarCapsuleHeight = pConfig.GetFloat("AvatarCapsuleHeight", parms.avatarCapsuleHeight);
297 parms.avatarContactProcessingThreshold = pConfig.GetFloat("AvatarContactProcessingThreshold", parms.avatarContactProcessingThreshold);
298
299 parms.maxPersistantManifoldPoolSize = pConfig.GetFloat("MaxPersistantManifoldPoolSize", parms.maxPersistantManifoldPoolSize);
300 parms.shouldDisableContactPoolDynamicAllocation = ParamBoolean(pConfig, "ShouldDisableContactPoolDynamicAllocation", parms.shouldDisableContactPoolDynamicAllocation);
301 parms.shouldForceUpdateAllAabbs = ParamBoolean(pConfig, "ShouldForceUpdateAllAabbs", parms.shouldForceUpdateAllAabbs);
302 parms.shouldRandomizeSolverOrder = ParamBoolean(pConfig, "ShouldRandomizeSolverOrder", parms.shouldRandomizeSolverOrder);
303 parms.shouldSplitSimulationIslands = ParamBoolean(pConfig, "ShouldSplitSimulationIslands", parms.shouldSplitSimulationIslands);
304 parms.shouldEnableFrictionCaching = ParamBoolean(pConfig, "ShouldEnableFrictionCaching", parms.shouldEnableFrictionCaching);
305 parms.numberOfSolverIterations = pConfig.GetFloat("NumberOfSolverIterations", parms.numberOfSolverIterations);
288 } 306 }
289 } 307 }
290 m_params[0] = parms; 308 m_params[0] = parms;
291 } 309 }
292 310
311 // A helper function that handles a true/false parameter and returns the proper float number encoding
312 float ParamBoolean(IConfig config, string parmName, float deflt)
313 {
314 float ret = deflt;
315 if (config.Contains(parmName))
316 {
317 ret = ConfigurationParameters.numericFalse;
318 if (config.GetBoolean(parmName, false))
319 {
320 ret = ConfigurationParameters.numericTrue;
321 }
322 }
323 return ret;
324 }
325
326
293 // Called directly from unmanaged code so don't do much 327 // Called directly from unmanaged code so don't do much
294 private void BulletLogger(string msg) 328 private void BulletLogger(string msg)
295 { 329 {
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
index aab0994..086f0dc 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs
@@ -132,6 +132,15 @@ public struct ConfigurationParameters
132 public float avatarRestitution; 132 public float avatarRestitution;
133 public float avatarCapsuleRadius; 133 public float avatarCapsuleRadius;
134 public float avatarCapsuleHeight; 134 public float avatarCapsuleHeight;
135 public float avatarContactProcessingThreshold;
136
137 public float maxPersistantManifoldPoolSize;
138 public float shouldDisableContactPoolDynamicAllocation;
139 public float shouldForceUpdateAllAabbs;
140 public float shouldRandomizeSolverOrder;
141 public float shouldSplitSimulationIslands;
142 public float shouldEnableFrictionCaching;
143 public float numberOfSolverIterations;
135 144
136 public const float numericTrue = 1f; 145 public const float numericTrue = 1f;
137 public const float numericFalse = 0f; 146 public const float numericFalse = 0f;