From 142de1d02f086c80888eb216cfd31b84ec27a79b Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 23 Mar 2012 10:59:40 -0700 Subject: BulletSim: add a bunch of internal Bullet configuration parameters to OpenSimDefaults.ini and the code. --- OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 34 ++++++++++++++++++++++ .../Region/Physics/BulletSPlugin/BulletSimAPI.cs | 9 ++++++ 2 files changed, 43 insertions(+) (limited to 'OpenSim') 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 parms.avatarDensity = 60f; parms.avatarCapsuleRadius = 0.37f; parms.avatarCapsuleHeight = 1.5f; // 2.140599f + parms.avatarContactProcessingThreshold = 0.1f; + + parms.maxPersistantManifoldPoolSize = 0f; + parms.shouldDisableContactPoolDynamicAllocation = ConfigurationParameters.numericFalse; + parms.shouldForceUpdateAllAabbs = ConfigurationParameters.numericFalse; + parms.shouldRandomizeSolverOrder = ConfigurationParameters.numericFalse; + parms.shouldSplitSimulationIslands = ConfigurationParameters.numericFalse; + parms.shouldEnableFrictionCaching = ConfigurationParameters.numericFalse; + parms.numberOfSolverIterations = 0f; // means use default if (config != null) { @@ -285,11 +294,36 @@ public class BSScene : PhysicsScene, IPhysicsParameters parms.avatarDensity = pConfig.GetFloat("AvatarDensity", parms.avatarDensity); parms.avatarCapsuleRadius = pConfig.GetFloat("AvatarCapsuleRadius", parms.avatarCapsuleRadius); parms.avatarCapsuleHeight = pConfig.GetFloat("AvatarCapsuleHeight", parms.avatarCapsuleHeight); + parms.avatarContactProcessingThreshold = pConfig.GetFloat("AvatarContactProcessingThreshold", parms.avatarContactProcessingThreshold); + + parms.maxPersistantManifoldPoolSize = pConfig.GetFloat("MaxPersistantManifoldPoolSize", parms.maxPersistantManifoldPoolSize); + parms.shouldDisableContactPoolDynamicAllocation = ParamBoolean(pConfig, "ShouldDisableContactPoolDynamicAllocation", parms.shouldDisableContactPoolDynamicAllocation); + parms.shouldForceUpdateAllAabbs = ParamBoolean(pConfig, "ShouldForceUpdateAllAabbs", parms.shouldForceUpdateAllAabbs); + parms.shouldRandomizeSolverOrder = ParamBoolean(pConfig, "ShouldRandomizeSolverOrder", parms.shouldRandomizeSolverOrder); + parms.shouldSplitSimulationIslands = ParamBoolean(pConfig, "ShouldSplitSimulationIslands", parms.shouldSplitSimulationIslands); + parms.shouldEnableFrictionCaching = ParamBoolean(pConfig, "ShouldEnableFrictionCaching", parms.shouldEnableFrictionCaching); + parms.numberOfSolverIterations = pConfig.GetFloat("NumberOfSolverIterations", parms.numberOfSolverIterations); } } m_params[0] = parms; } + // A helper function that handles a true/false parameter and returns the proper float number encoding + float ParamBoolean(IConfig config, string parmName, float deflt) + { + float ret = deflt; + if (config.Contains(parmName)) + { + ret = ConfigurationParameters.numericFalse; + if (config.GetBoolean(parmName, false)) + { + ret = ConfigurationParameters.numericTrue; + } + } + return ret; + } + + // Called directly from unmanaged code so don't do much private void BulletLogger(string msg) { 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 public float avatarRestitution; public float avatarCapsuleRadius; public float avatarCapsuleHeight; + public float avatarContactProcessingThreshold; + + public float maxPersistantManifoldPoolSize; + public float shouldDisableContactPoolDynamicAllocation; + public float shouldForceUpdateAllAabbs; + public float shouldRandomizeSolverOrder; + public float shouldSplitSimulationIslands; + public float shouldEnableFrictionCaching; + public float numberOfSolverIterations; public const float numericTrue = 1f; public const float numericFalse = 0f; -- cgit v1.1