aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorRobert Adams2014-04-28 11:08:47 -0700
committerRobert Adams2014-04-28 11:08:47 -0700
commit63aea3a5f281ac396787beab5615214b36e2332e (patch)
tree5fca14829eb458bb7d2cf199ac1215ef21f4629f /OpenSim
parentRemoved dependency on Linq in OpenProfileClient (diff)
downloadopensim-SC-63aea3a5f281ac396787beab5615214b36e2332e.zip
opensim-SC-63aea3a5f281ac396787beab5615214b36e2332e.tar.gz
opensim-SC-63aea3a5f281ac396787beab5615214b36e2332e.tar.bz2
opensim-SC-63aea3a5f281ac396787beab5615214b36e2332e.tar.xz
BUlletSim: move safeynet ground plane to lower altitude. Define new BulletSim
parameter 'TerrainGroundPlane' which defaults to -500. BulletSim had assumed altitudes never went negative but that is not true. The ground plane is just a safety net so things wouldn't fall to infinity.
Diffstat (limited to 'OpenSim')
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs3
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs5
2 files changed, 6 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index f2ad528..6683446 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
@@ -97,6 +97,7 @@ public static class BSParam
97 97
98 public static float TerrainImplementation { get; set; } 98 public static float TerrainImplementation { get; set; }
99 public static int TerrainMeshMagnification { get; private set; } 99 public static int TerrainMeshMagnification { get; private set; }
100 public static float TerrainGroundPlane { get; private set; }
100 public static float TerrainFriction { get; private set; } 101 public static float TerrainFriction { get; private set; }
101 public static float TerrainHitFraction { get; private set; } 102 public static float TerrainHitFraction { get; private set; }
102 public static float TerrainRestitution { get; private set; } 103 public static float TerrainRestitution { get; private set; }
@@ -544,6 +545,8 @@ public static class BSParam
544 (float)BSTerrainPhys.TerrainImplementation.Heightmap ), 545 (float)BSTerrainPhys.TerrainImplementation.Heightmap ),
545 new ParameterDefn<int>("TerrainMeshMagnification", "Number of times the 256x256 heightmap is multiplied to create the terrain mesh" , 546 new ParameterDefn<int>("TerrainMeshMagnification", "Number of times the 256x256 heightmap is multiplied to create the terrain mesh" ,
546 2 ), 547 2 ),
548 new ParameterDefn<float>("TerrainGroundPlane", "Altitude of ground plane used to keep things from falling to infinity" ,
549 -500.0f ),
547 new ParameterDefn<float>("TerrainFriction", "Factor to reduce movement against terrain surface" , 550 new ParameterDefn<float>("TerrainFriction", "Factor to reduce movement against terrain surface" ,
548 0.3f ), 551 0.3f ),
549 new ParameterDefn<float>("TerrainHitFraction", "Distance to measure hit collisions" , 552 new ParameterDefn<float>("TerrainHitFraction", "Distance to measure hit collisions" ,
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs
index 3013077..9067a2c 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs
@@ -136,9 +136,10 @@ public sealed class BSTerrainManager : IDisposable
136 { 136 {
137 DetailLog("{0},BSTerrainManager.CreateInitialGroundPlaneAndTerrain,region={1}", BSScene.DetailLogZero, m_physicsScene.RegionName); 137 DetailLog("{0},BSTerrainManager.CreateInitialGroundPlaneAndTerrain,region={1}", BSScene.DetailLogZero, m_physicsScene.RegionName);
138 // The ground plane is here to catch things that are trying to drop to negative infinity 138 // The ground plane is here to catch things that are trying to drop to negative infinity
139 BulletShape groundPlaneShape = m_physicsScene.PE.CreateGroundPlaneShape(BSScene.GROUNDPLANE_ID, 1f, BSParam.TerrainCollisionMargin); 139 BulletShape groundPlaneShape = m_physicsScene.PE.CreateGroundPlaneShape(BSScene.GROUNDPLANE_ID, 1f, BSParam.TerrainCollisionMargin);
140 Vector3 groundPlaneAltitude = new Vector3(0f, 0f, BSParam.TerrainGroundPlane);
140 m_groundPlane = m_physicsScene.PE.CreateBodyWithDefaultMotionState(groundPlaneShape, 141 m_groundPlane = m_physicsScene.PE.CreateBodyWithDefaultMotionState(groundPlaneShape,
141 BSScene.GROUNDPLANE_ID, Vector3.Zero, Quaternion.Identity); 142 BSScene.GROUNDPLANE_ID, groundPlaneAltitude, Quaternion.Identity);
142 143
143 // Everything collides with the ground plane. 144 // Everything collides with the ground plane.
144 m_groundPlane.collisionType = CollisionType.Groundplane; 145 m_groundPlane.collisionType = CollisionType.Groundplane;