diff options
author | Justin Clark-Casey (justincc) | 2011-07-16 04:22:57 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-07-16 04:22:57 +0100 |
commit | 2b68ac4ba31205a55f53f1b69629dd9ebbd66ef6 (patch) | |
tree | 36c44de8244635be032a95d3a2a67f48e68a9b05 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | add test for resizing one part in a group (diff) | |
download | opensim-SC_OLD-2b68ac4ba31205a55f53f1b69629dd9ebbd66ef6.zip opensim-SC_OLD-2b68ac4ba31205a55f53f1b69629dd9ebbd66ef6.tar.gz opensim-SC_OLD-2b68ac4ba31205a55f53f1b69629dd9ebbd66ef6.tar.bz2 opensim-SC_OLD-2b68ac4ba31205a55f53f1b69629dd9ebbd66ef6.tar.xz |
refactor: Push all part resize code down into SceneObjectPart.Resize()
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 5035317..ffde68e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2846,6 +2846,13 @@ 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) | ||
2850 | scale.X = ParentGroup.Scene.m_maxNonphys; | ||
2851 | if (scale.Y > 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 | |||
2849 | // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); | 2856 | // m_log.DebugFormat("[SCENE OBJECT PART]: Resizing {0} {1} to {2}", Name, LocalId, scale); |
2850 | 2857 | ||
2851 | StoreUndoState(); | 2858 | StoreUndoState(); |
@@ -2855,9 +2862,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
2855 | // need to reinsert the sculpt data into the shape, since the physics engine deletes it when done to | 2862 | // need to reinsert the sculpt data into the shape, since the physics engine deletes it when done to |
2856 | // save memory | 2863 | // save memory |
2857 | if (PhysActor != null) | 2864 | if (PhysActor != null) |
2858 | CheckSculptAndLoad(); | 2865 | { |
2866 | if (PhysActor.IsPhysical) | ||
2867 | { | ||
2868 | if (scale.X > ParentGroup.Scene.m_maxPhys) | ||
2869 | scale.X = ParentGroup.Scene.m_maxPhys; | ||
2870 | if (scale.Y > 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 | } | ||
2875 | |||
2876 | PhysActor.Size = scale; | ||
2877 | |||
2878 | if (((OpenMetaverse.SculptType)Shape.SculptType) == SculptType.Mesh) | ||
2879 | CheckSculptAndLoad(); | ||
2880 | else | ||
2881 | ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); | ||
2882 | } | ||
2859 | 2883 | ||
2860 | ParentGroup.HasGroupChanged = true; | 2884 | ParentGroup.HasGroupChanged = true; |
2885 | TriggerScriptChangedEvent(Changed.SCALE); | ||
2861 | ScheduleFullUpdate(); | 2886 | ScheduleFullUpdate(); |
2862 | } | 2887 | } |
2863 | 2888 | ||