diff options
author | Robert Adams | 2012-03-23 10:59:40 -0700 |
---|---|---|
committer | Robert Adams | 2012-03-23 13:15:23 -0700 |
commit | 142de1d02f086c80888eb216cfd31b84ec27a79b (patch) | |
tree | 46c1cf1e68d18992aacd2a78c4e80c116f3517e9 /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |
parent | BulletSim: remove confusion between angularVelocity and rotationalVelocity (t... (diff) | |
download | opensim-SC-142de1d02f086c80888eb216cfd31b84ec27a79b.zip opensim-SC-142de1d02f086c80888eb216cfd31b84ec27a79b.tar.gz opensim-SC-142de1d02f086c80888eb216cfd31b84ec27a79b.tar.bz2 opensim-SC-142de1d02f086c80888eb216cfd31b84ec27a79b.tar.xz |
BulletSim: add a bunch of internal Bullet configuration parameters to OpenSimDefaults.ini and the code.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 34 |
1 files changed, 34 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 | { |