diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 55c4fda45f..22969818fd 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -174,6 +174,13 @@ namespace OpenSim.Region.Framework.Scenes public SynchronizeSceneHandler SynchronizeScene; + public bool ClampNegativeZ + { + get { return m_clampNegativeZ; } + } + + private bool m_clampNegativeZ = false; + /// /// Used to prevent simultaneous calls to code that adds and removes agents. /// @@ -1029,6 +1036,8 @@ namespace OpenSim.Region.Framework.Scenes m_clampPrimSize = true; } + m_clampNegativeZ = startupConfig.GetBoolean("ClampNegativeZ", m_clampNegativeZ); + m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete",m_useTrashOnDelete); m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries); m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings); diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 930850091d..2ecb55b427 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -296,13 +296,15 @@ namespace OpenSim.Region.Framework.Scenes Vector3 npos = new Vector3(sceneObject.RootPart.GroupPosition.X, sceneObject.RootPart.GroupPosition.Y, sceneObject.RootPart.GroupPosition.Z); - if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || npos.Z < 0.0 || + bool clampZ = m_parentScene.ClampNegativeZ; + + if (!(((sceneObject.RootPart.Shape.PCode == (byte)PCode.Prim) && (sceneObject.RootPart.Shape.State != 0))) && (npos.X < 0.0 || npos.Y < 0.0 || (npos.Z < 0.0 && clampZ) || npos.X > regionSizeX || npos.Y > regionSizeY)) { if (npos.X < 0.0) npos.X = 1.0f; if (npos.Y < 0.0) npos.Y = 1.0f; - if (npos.Z < 0.0) npos.Z = 0.0f; + if (npos.Z < 0.0 && clampZ) npos.Z = 0.0f; if (npos.X > regionSizeX) npos.X = regionSizeX - 1.0f; if (npos.Y > regionSizeY) npos.Y = regionSizeY - 1.0f; diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 09dda10409..72213537e2 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -138,6 +138,9 @@ ; This can be overridden in the region config file. ClampPrimSize = false + ; If a prim is loaded from an external source, clamp it to Z = 0 if Z is negative. + ClampNegativeZ = false + ; Maximum number of prims allowable in a linkset. Affects creating new linksets. Ignored if less than or equal to zero. ; This can be overridden in the region config file. LinksetPrims = 0