diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index f2ad5280d1..6683446200 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs @@ -97,6 +97,7 @@ public static class BSParam public static float TerrainImplementation { get; set; } public static int TerrainMeshMagnification { get; private set; } + public static float TerrainGroundPlane { get; private set; } public static float TerrainFriction { get; private set; } public static float TerrainHitFraction { get; private set; } public static float TerrainRestitution { get; private set; } @@ -544,6 +545,8 @@ public static class BSParam (float)BSTerrainPhys.TerrainImplementation.Heightmap ), new ParameterDefn("TerrainMeshMagnification", "Number of times the 256x256 heightmap is multiplied to create the terrain mesh" , 2 ), + new ParameterDefn("TerrainGroundPlane", "Altitude of ground plane used to keep things from falling to infinity" , + -500.0f ), new ParameterDefn("TerrainFriction", "Factor to reduce movement against terrain surface" , 0.3f ), new ParameterDefn("TerrainHitFraction", "Distance to measure hit collisions" , diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs index 3013077ef8..9067a2c639 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSTerrainManager.cs @@ -136,9 +136,10 @@ public sealed class BSTerrainManager : IDisposable { DetailLog("{0},BSTerrainManager.CreateInitialGroundPlaneAndTerrain,region={1}", BSScene.DetailLogZero, m_physicsScene.RegionName); // The ground plane is here to catch things that are trying to drop to negative infinity - BulletShape groundPlaneShape = m_physicsScene.PE.CreateGroundPlaneShape(BSScene.GROUNDPLANE_ID, 1f, BSParam.TerrainCollisionMargin); + BulletShape groundPlaneShape = m_physicsScene.PE.CreateGroundPlaneShape(BSScene.GROUNDPLANE_ID, 1f, BSParam.TerrainCollisionMargin); + Vector3 groundPlaneAltitude = new Vector3(0f, 0f, BSParam.TerrainGroundPlane); m_groundPlane = m_physicsScene.PE.CreateBodyWithDefaultMotionState(groundPlaneShape, - BSScene.GROUNDPLANE_ID, Vector3.Zero, Quaternion.Identity); + BSScene.GROUNDPLANE_ID, groundPlaneAltitude, Quaternion.Identity); // Everything collides with the ground plane. m_groundPlane.collisionType = CollisionType.Groundplane;