From 9afe2b018fbe444c0500695dbce37bdce126feee Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 26 Nov 2015 17:29:50 +0100 Subject: Mantis #7765: Add new ClampNegativeZ option. Defaults to false to restore prior functionality. Avination code wasn't designed for deep building. --- OpenSim/Region/Framework/Scenes/Scene.cs | 9 +++++++++ OpenSim/Region/Framework/Scenes/SceneGraph.cs | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 55c4fda..2296981 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 9308500..2ecb55b 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; -- cgit v1.1