diff options
author | Justin Clark-Casey (justincc) | 2011-07-16 04:28:49 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-07-16 04:28:49 +0100 |
commit | 122745fe1c17ff0862f5a0cb2f97e8abf8d67cb6 (patch) | |
tree | 09c9ce8f19aa5220349e09c2ec05029f52202f6f /OpenSim/Region/Framework/Scenes | |
parent | refactor: Push all part resize code down into SceneObjectPart.Resize() (diff) | |
download | opensim-SC-122745fe1c17ff0862f5a0cb2f97e8abf8d67cb6.zip opensim-SC-122745fe1c17ff0862f5a0cb2f97e8abf8d67cb6.tar.gz opensim-SC-122745fe1c17ff0862f5a0cb2f97e8abf8d67cb6.tar.bz2 opensim-SC-122745fe1c17ff0862f5a0cb2f97e8abf8d67cb6.tar.xz |
refactor: replace scale limiting code with more elegant Math.Min calls
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ffde68e..f5b8daf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2846,12 +2846,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2846 | /// <param name="scale"></param> | 2846 | /// <param name="scale"></param> |
2847 | public void Resize(Vector3 scale) | 2847 | public void Resize(Vector3 scale) |
2848 | { | 2848 | { |
2849 | if (scale.X > ParentGroup.Scene.m_maxNonphys) | 2849 | scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxNonphys); |
2850 | scale.X = ParentGroup.Scene.m_maxNonphys; | 2850 | scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxNonphys); |
2851 | if (scale.Y > ParentGroup.Scene.m_maxNonphys) | 2851 | scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxNonphys); |
2852 | scale.Y = ParentGroup.Scene.m_maxNonphys; | ||
2853 | if (scale.Z > ParentGroup.Scene.m_maxNonphys) | ||
2854 | scale.Z = ParentGroup.Scene.m_maxNonphys; | ||
2855 | 2852 | ||
2856 | // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); | 2853 | // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); |
2857 | 2854 | ||
@@ -2865,12 +2862,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2865 | { | 2862 | { |
2866 | if (PhysActor.IsPhysical) | 2863 | if (PhysActor.IsPhysical) |
2867 | { | 2864 | { |
2868 | if (scale.X > ParentGroup.Scene.m_maxPhys) | 2865 | scale.X = Math.Min(scale.X, ParentGroup.Scene.m_maxPhys); |
2869 | scale.X = ParentGroup.Scene.m_maxPhys; | 2866 | scale.Y = Math.Min(scale.Y, ParentGroup.Scene.m_maxPhys); |
2870 | if (scale.Y > ParentGroup.Scene.m_maxPhys) | 2867 | scale.Z = Math.Min(scale.Z, ParentGroup.Scene.m_maxPhys); |
2871 | scale.Y = ParentGroup.Scene.m_maxPhys; | ||
2872 | if (scale.Z > ParentGroup.Scene.m_maxPhys) | ||
2873 | scale.Z = ParentGroup.Scene.m_maxPhys; | ||
2874 | } | 2868 | } |
2875 | 2869 | ||
2876 | PhysActor.Size = scale; | 2870 | PhysActor.Size = scale; |