aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
diff options
context:
space:
mode:
authorRobert Adams2012-03-16 16:37:21 -0700
committerRobert Adams2012-03-23 13:15:14 -0700
commitb22d0401693dad44790d4cbf58d85c0fe3870460 (patch)
treec34dcfbde543898032db03b52f508e46f8631c57 /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
parentBulletSim: update BulletSim.dll to Bullet 2.80 and add libBulletSim.so to the... (diff)
downloadopensim-SC_OLD-b22d0401693dad44790d4cbf58d85c0fe3870460.zip
opensim-SC_OLD-b22d0401693dad44790d4cbf58d85c0fe3870460.tar.gz
opensim-SC_OLD-b22d0401693dad44790d4cbf58d85c0fe3870460.tar.bz2
opensim-SC_OLD-b22d0401693dad44790d4cbf58d85c0fe3870460.tar.xz
BulletSim: add some new runtime setable parameters to match the dll.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index b1e551c..977dcbe 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -177,6 +177,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters
177 if (m_log.IsDebugEnabled) 177 if (m_log.IsDebugEnabled)
178 { 178 {
179 m_log.DebugFormat("{0}: Initialize: Setting debug callback for unmanaged code", LogHeader); 179 m_log.DebugFormat("{0}: Initialize: Setting debug callback for unmanaged code", LogHeader);
180 // the handle is saved to it doesn't get freed after this call
180 m_DebugLogCallbackHandle = new BulletSimAPI.DebugLogCallback(BulletLogger); 181 m_DebugLogCallbackHandle = new BulletSimAPI.DebugLogCallback(BulletLogger);
181 BulletSimAPI.SetDebugLogCallback(m_DebugLogCallbackHandle); 182 BulletSimAPI.SetDebugLogCallback(m_DebugLogCallbackHandle);
182 } 183 }
@@ -185,7 +186,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters
185 186
186 mesher = meshmerizer; 187 mesher = meshmerizer;
187 // The bounding box for the simulated world 188 // The bounding box for the simulated world
188 Vector3 worldExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, 4096f); 189 Vector3 worldExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, 8192f);
189 190
190 // m_log.DebugFormat("{0}: Initialize: Calling BulletSimAPI.Initialize.", LogHeader); 191 // m_log.DebugFormat("{0}: Initialize: Calling BulletSimAPI.Initialize.", LogHeader);
191 m_worldID = BulletSimAPI.Initialize(worldExtent, m_paramsHandle.AddrOfPinnedObject(), 192 m_worldID = BulletSimAPI.Initialize(worldExtent, m_paramsHandle.AddrOfPinnedObject(),
@@ -233,7 +234,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters
233 parms.terrainFriction = 0.5f; 234 parms.terrainFriction = 0.5f;
234 parms.terrainHitFraction = 0.8f; 235 parms.terrainHitFraction = 0.8f;
235 parms.terrainRestitution = 0f; 236 parms.terrainRestitution = 0f;
236 parms.avatarFriction = 0.0f; 237 parms.avatarFriction = 0.5f;
237 parms.avatarDensity = 60f; 238 parms.avatarDensity = 60f;
238 parms.avatarCapsuleRadius = 0.37f; 239 parms.avatarCapsuleRadius = 0.37f;
239 parms.avatarCapsuleHeight = 1.5f; // 2.140599f 240 parms.avatarCapsuleHeight = 1.5f; // 2.140599f
@@ -716,6 +717,9 @@ public class BSScene : PhysicsScene, IPhysicsParameters
716 // new PhysParameterEntry("CcdSweptSphereRadius", "" ), 717 // new PhysParameterEntry("CcdSweptSphereRadius", "" ),
717 new PhysParameterEntry("ContactProcessingThreshold", "Distance between contacts before doing collision check" ), 718 new PhysParameterEntry("ContactProcessingThreshold", "Distance between contacts before doing collision check" ),
718 719
720 new PhysParameterEntry("Friction", "Set friction parameter for a specific object" ),
721 new PhysParameterEntry("Restitution", "Set restitution parameter for a specific object" ),
722
719 new PhysParameterEntry("TerrainFriction", "Factor to reduce movement against terrain surface" ), 723 new PhysParameterEntry("TerrainFriction", "Factor to reduce movement against terrain surface" ),
720 new PhysParameterEntry("TerrainHitFraction", "Distance to measure hit collisions" ), 724 new PhysParameterEntry("TerrainHitFraction", "Distance to measure hit collisions" ),
721 new PhysParameterEntry("TerrainRestitution", "Bouncyness" ), 725 new PhysParameterEntry("TerrainRestitution", "Bouncyness" ),
@@ -756,7 +760,7 @@ public class BSScene : PhysicsScene, IPhysicsParameters
756 case "defaultdensity": m_params[0].defaultDensity = val; break; 760 case "defaultdensity": m_params[0].defaultDensity = val; break;
757 case "defaultrestitution": m_params[0].defaultRestitution = val; break; 761 case "defaultrestitution": m_params[0].defaultRestitution = val; break;
758 case "collisionmargin": m_params[0].collisionMargin = val; break; 762 case "collisionmargin": m_params[0].collisionMargin = val; break;
759 case "gravity": m_params[0].gravity = val; TaintedUpdateParameter(lparm, PhysParameterEntry.APPLY_TO_NONE, val); break; 763 case "gravity": m_params[0].gravity = val; TaintedUpdateParameter(lparm, localID, val); break;
760 764
761 case "lineardamping": UpdateParameterPrims(ref m_params[0].linearDamping, lparm, localID, val); break; 765 case "lineardamping": UpdateParameterPrims(ref m_params[0].linearDamping, lparm, localID, val); break;
762 case "angulardamping": UpdateParameterPrims(ref m_params[0].angularDamping, lparm, localID, val); break; 766 case "angulardamping": UpdateParameterPrims(ref m_params[0].angularDamping, lparm, localID, val); break;
@@ -767,6 +771,9 @@ public class BSScene : PhysicsScene, IPhysicsParameters
767 case "ccdsweptsphereradius": UpdateParameterPrims(ref m_params[0].ccdSweptSphereRadius, lparm, localID, val); break; 771 case "ccdsweptsphereradius": UpdateParameterPrims(ref m_params[0].ccdSweptSphereRadius, lparm, localID, val); break;
768 case "contactprocessingthreshold": UpdateParameterPrims(ref m_params[0].contactProcessingThreshold, lparm, localID, val); break; 772 case "contactprocessingthreshold": UpdateParameterPrims(ref m_params[0].contactProcessingThreshold, lparm, localID, val); break;
769 773
774 case "friction": TaintedUpdateParameter(lparm, localID, val); break;
775 case "restitution": TaintedUpdateParameter(lparm, localID, val); break;
776
770 // set a terrain physical feature and cause terrain to be recalculated 777 // set a terrain physical feature and cause terrain to be recalculated
771 case "terrainfriction": m_params[0].terrainFriction = val; TaintedUpdateParameter("terrain", 0, val); break; 778 case "terrainfriction": m_params[0].terrainFriction = val; TaintedUpdateParameter("terrain", 0, val); break;
772 case "terrainhitfraction": m_params[0].terrainHitFraction = val; TaintedUpdateParameter("terrain", 0, val); break; 779 case "terrainhitfraction": m_params[0].terrainHitFraction = val; TaintedUpdateParameter("terrain", 0, val); break;