From ef4122213c440c55d32c097c08e52170f4b4346a Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Mon, 6 Aug 2012 15:35:40 +0100 Subject: enables configurable minimum sizes for physical & non-physical prims --- .../Region/Framework/Scenes/SceneObjectGroup.cs | 60 +++++++++++++++++++--- 1 file changed, 54 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 5f90035..f6c725b 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2674,17 +2674,17 @@ namespace OpenSim.Region.Framework.Scenes RootPart.StoreUndoState(true); - scale.X = Math.Min(scale.X, Scene.m_maxNonphys); - scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); - scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys); + scale.X = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.X)); + scale.Y = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Y)); + scale.Z = Math.Max(Scene.m_minNonphys, Math.Min(Scene.m_maxNonphys, scale.Z)); PhysicsActor pa = m_rootPart.PhysActor; if (pa != null && pa.IsPhysical) { - scale.X = Math.Min(scale.X, Scene.m_maxPhys); - scale.Y = Math.Min(scale.Y, Scene.m_maxPhys); - scale.Z = Math.Min(scale.Z, Scene.m_maxPhys); + scale.X = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.X)); + scale.Y = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Y)); + scale.Z = Math.Max(Scene.m_minPhys, Math.Min(Scene.m_maxPhys, scale.Z)); } float x = (scale.X / RootPart.Scale.X); @@ -2716,6 +2716,14 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } + else if (oldSize.X * x < m_scene.m_minPhys) + { + f = m_scene.m_minPhys / oldSize.X; + a = f / x; + x *= a; + y *= a; + z *= a; + } if (oldSize.Y * y > m_scene.m_maxPhys) { @@ -2725,6 +2733,14 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } + else if (oldSize.Y * y < m_scene.m_minPhys) + { + f = m_scene.m_minPhys / oldSize.Y; + a = f / y; + x *= a; + y *= a; + z *= a; + } if (oldSize.Z * z > m_scene.m_maxPhys) { @@ -2734,6 +2750,14 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } + else if (oldSize.Z * z < m_scene.m_minPhys) + { + f = m_scene.m_minPhys / oldSize.Z; + a = f / z; + x *= a; + y *= a; + z *= a; + } } else { @@ -2745,6 +2769,14 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } + else if (oldSize.X * x < m_scene.m_minNonphys) + { + f = m_scene.m_minNonphys / oldSize.X; + a = f / x; + x *= a; + y *= a; + z *= a; + } if (oldSize.Y * y > m_scene.m_maxNonphys) { @@ -2754,6 +2786,14 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } + else if (oldSize.Y * y < m_scene.m_minNonphys) + { + f = m_scene.m_minNonphys / oldSize.Y; + a = f / y; + x *= a; + y *= a; + z *= a; + } if (oldSize.Z * z > m_scene.m_maxNonphys) { @@ -2763,6 +2803,14 @@ namespace OpenSim.Region.Framework.Scenes y *= a; z *= a; } + else if (oldSize.Z * z < m_scene.m_minNonphys) + { + f = m_scene.m_minNonphys / oldSize.Z; + a = f / z; + x *= a; + y *= a; + z *= a; + } } // obPart.IgnoreUndoUpdate = false; -- cgit v1.1