aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-19 03:01:54 +0100
committerJustin Clark-Casey (justincc)2011-07-19 03:01:54 +0100
commit430a4aeba8e98b8285ea3ebdf264baf429a55e22 (patch)
tree68ca3695b7422f0d73aaa45555a77f2babae51d7 /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
parentremove undo state storage in a few places where it's pointless (diff)
downloadopensim-SC-430a4aeba8e98b8285ea3ebdf264baf429a55e22.zip
opensim-SC-430a4aeba8e98b8285ea3ebdf264baf429a55e22.tar.gz
opensim-SC-430a4aeba8e98b8285ea3ebdf264baf429a55e22.tar.bz2
opensim-SC-430a4aeba8e98b8285ea3ebdf264baf429a55e22.tar.xz
Fix undo for resizing linksets
This involves implementing a boolean in UndoState to signal whether the undo needs to be done for an entire group/linkset or just a single prim Resizing individual components of linksets is still dodgy. Resizing still has to be down twice, since for some reason the client is sending two multiobjectupdate packets on every resize except the very first. This applies to single prims and linksets. Need to look into this.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs23
1 files changed, 15 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 7254992..3bbf76c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2624,6 +2624,8 @@ namespace OpenSim.Region.Framework.Scenes
2624// m_log.DebugFormat( 2624// m_log.DebugFormat(
2625// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale); 2625// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale);
2626 2626
2627 RootPart.StoreUndoState(true);
2628
2627 scale.X = Math.Min(scale.X, Scene.m_maxNonphys); 2629 scale.X = Math.Min(scale.X, Scene.m_maxNonphys);
2628 scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); 2630 scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys);
2629 scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys); 2631 scale.Z = Math.Min(scale.Z, Scene.m_maxNonphys);
@@ -2722,16 +2724,20 @@ namespace OpenSim.Region.Framework.Scenes
2722 prevScale.X *= x; 2724 prevScale.X *= x;
2723 prevScale.Y *= y; 2725 prevScale.Y *= y;
2724 prevScale.Z *= z; 2726 prevScale.Z *= z;
2727
2728// RootPart.IgnoreUndoUpdate = true;
2725 RootPart.Resize(prevScale); 2729 RootPart.Resize(prevScale);
2730// RootPart.IgnoreUndoUpdate = false;
2726 2731
2727 parts = m_parts.GetArray(); 2732 parts = m_parts.GetArray();
2728 for (int i = 0; i < parts.Length; i++) 2733 for (int i = 0; i < parts.Length; i++)
2729 { 2734 {
2730 SceneObjectPart obPart = parts[i]; 2735 SceneObjectPart obPart = parts[i];
2731// obPart.IgnoreUndoUpdate = true;
2732 2736
2733 if (obPart.UUID != m_rootPart.UUID) 2737 if (obPart.UUID != m_rootPart.UUID)
2734 { 2738 {
2739 obPart.IgnoreUndoUpdate = true;
2740
2735 Vector3 currentpos = new Vector3(obPart.OffsetPosition); 2741 Vector3 currentpos = new Vector3(obPart.OffsetPosition);
2736 currentpos.X *= x; 2742 currentpos.X *= x;
2737 currentpos.Y *= y; 2743 currentpos.Y *= y;
@@ -2741,12 +2747,11 @@ namespace OpenSim.Region.Framework.Scenes
2741 newSize.X *= x; 2747 newSize.X *= x;
2742 newSize.Y *= y; 2748 newSize.Y *= y;
2743 newSize.Z *= z; 2749 newSize.Z *= z;
2744
2745 obPart.Resize(newSize);
2746 2750
2747 obPart.IgnoreUndoUpdate = true; 2751 obPart.Resize(newSize);
2748 obPart.UpdateOffSet(currentpos); 2752 obPart.UpdateOffSet(currentpos);
2749 obPart.IgnoreUndoUpdate = false; 2753
2754 obPart.IgnoreUndoUpdate = false;
2750 } 2755 }
2751 2756
2752// obPart.IgnoreUndoUpdate = false; 2757// obPart.IgnoreUndoUpdate = false;
@@ -2769,9 +2774,11 @@ namespace OpenSim.Region.Framework.Scenes
2769 { 2774 {
2770// m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos); 2775// m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos);
2771 2776
2772 SceneObjectPart[] parts = m_parts.GetArray(); 2777 RootPart.StoreUndoState(true);
2773 for (int i = 0; i < parts.Length; i++) 2778
2774 parts[i].StoreUndoState(); 2779// SceneObjectPart[] parts = m_parts.GetArray();
2780// for (int i = 0; i < parts.Length; i++)
2781// parts[i].StoreUndoState();
2775 2782
2776 if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) 2783 if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
2777 { 2784 {