aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2012-03-09 02:11:25 +0100
committerMelanie2012-03-09 02:11:25 +0100
commite1be1c5263e1a758fa96ecd62209413bc4d1ee86 (patch)
tree8efe359172acc45e69d10a966eda1b116e3d90de /OpenSim/Region/Framework
parentFix a merge artefact (diff)
parent more changes on undo/redo group scaling seems to work better (diff)
downloadopensim-SC-e1be1c5263e1a758fa96ecd62209413bc4d1ee86.zip
opensim-SC-e1be1c5263e1a758fa96ecd62209413bc4d1ee86.tar.gz
opensim-SC-e1be1c5263e1a758fa96ecd62209413bc4d1ee86.tar.bz2
opensim-SC-e1be1c5263e1a758fa96ecd62209413bc4d1ee86.tar.xz
Merge branch 'ubitwork'
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs62
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/UndoState.cs18
3 files changed, 39 insertions, 45 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 038eaa4..2d71372 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1569,7 +1569,7 @@ namespace OpenSim.Region.Framework.Scenes
1569// "[SCENE OBJECT GROUP]: Processing OnGrabPart for {0} on {1} {2}, offsetPos {3}", 1569// "[SCENE OBJECT GROUP]: Processing OnGrabPart for {0} on {1} {2}, offsetPos {3}",
1570// remoteClient.Name, part.Name, part.LocalId, offsetPos); 1570// remoteClient.Name, part.Name, part.LocalId, offsetPos);
1571 1571
1572 part.StoreUndoState(); 1572// part.StoreUndoState();
1573 part.OnGrab(offsetPos, remoteClient); 1573 part.OnGrab(offsetPos, remoteClient);
1574 } 1574 }
1575 1575
@@ -3119,7 +3119,7 @@ namespace OpenSim.Region.Framework.Scenes
3119 { 3119 {
3120// m_log.DebugFormat( 3120// m_log.DebugFormat(
3121// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale); 3121// "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale);
3122 RootPart.StoreUndoState(true); 3122// RootPart.StoreUndoState(true);
3123 3123
3124 scale.X = Math.Min(scale.X, Scene.m_maxNonphys); 3124 scale.X = Math.Min(scale.X, Scene.m_maxNonphys);
3125 scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); 3125 scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys);
@@ -3230,7 +3230,7 @@ namespace OpenSim.Region.Framework.Scenes
3230 3230
3231 if (obPart.UUID != m_rootPart.UUID) 3231 if (obPart.UUID != m_rootPart.UUID)
3232 { 3232 {
3233 obPart.IgnoreUndoUpdate = true; 3233// obPart.IgnoreUndoUpdate = true;
3234 3234
3235 Vector3 currentpos = new Vector3(obPart.OffsetPosition); 3235 Vector3 currentpos = new Vector3(obPart.OffsetPosition);
3236 currentpos.X *= x; 3236 currentpos.X *= x;
@@ -3245,7 +3245,7 @@ namespace OpenSim.Region.Framework.Scenes
3245 obPart.Resize(newSize); 3245 obPart.Resize(newSize);
3246 obPart.UpdateOffSet(currentpos); 3246 obPart.UpdateOffSet(currentpos);
3247 3247
3248 obPart.IgnoreUndoUpdate = false; 3248// obPart.IgnoreUndoUpdate = false;
3249 } 3249 }
3250 3250
3251// obPart.IgnoreUndoUpdate = false; 3251// obPart.IgnoreUndoUpdate = false;
@@ -3270,7 +3270,7 @@ namespace OpenSim.Region.Framework.Scenes
3270 { 3270 {
3271// m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos); 3271// m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos);
3272 3272
3273 RootPart.StoreUndoState(true); 3273// RootPart.StoreUndoState(true);
3274 3274
3275// SceneObjectPart[] parts = m_parts.GetArray(); 3275// SceneObjectPart[] parts = m_parts.GetArray();
3276// for (int i = 0; i < parts.Length; i++) 3276// for (int i = 0; i < parts.Length; i++)
@@ -3311,17 +3311,17 @@ namespace OpenSim.Region.Framework.Scenes
3311 { 3311 {
3312 SceneObjectPart part = GetChildPart(localID); 3312 SceneObjectPart part = GetChildPart(localID);
3313 3313
3314 SceneObjectPart[] parts = m_parts.GetArray(); 3314// SceneObjectPart[] parts = m_parts.GetArray();
3315 for (int i = 0; i < parts.Length; i++) 3315// for (int i = 0; i < parts.Length; i++)
3316 parts[i].StoreUndoState(); 3316// parts[i].StoreUndoState();
3317 3317
3318 if (part != null) 3318 if (part != null)
3319 { 3319 {
3320// m_log.DebugFormat( 3320// m_log.DebugFormat(
3321// "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos); 3321// "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos);
3322 3322
3323 part.StoreUndoState(false); 3323// part.StoreUndoState(false);
3324 part.IgnoreUndoUpdate = true; 3324// part.IgnoreUndoUpdate = true;
3325 3325
3326// unlock parts position change 3326// unlock parts position change
3327 if (m_rootPart.PhysActor != null) 3327 if (m_rootPart.PhysActor != null)
@@ -3340,7 +3340,7 @@ namespace OpenSim.Region.Framework.Scenes
3340 m_rootPart.PhysActor.Building = false; 3340 m_rootPart.PhysActor.Building = false;
3341 3341
3342 HasGroupChanged = true; 3342 HasGroupChanged = true;
3343 part.IgnoreUndoUpdate = false; 3343// part.IgnoreUndoUpdate = false;
3344 } 3344 }
3345 } 3345 }
3346 3346
@@ -3377,16 +3377,16 @@ namespace OpenSim.Region.Framework.Scenes
3377 } 3377 }
3378 3378
3379 //We have to set undoing here because otherwise an undo state will be saved 3379 //We have to set undoing here because otherwise an undo state will be saved
3380 if (!m_rootPart.Undoing) 3380// if (!m_rootPart.Undoing)
3381 { 3381// {
3382 m_rootPart.Undoing = true; 3382// m_rootPart.Undoing = true;
3383 AbsolutePosition = newPos;
3384 m_rootPart.Undoing = false;
3385 }
3386 else
3387 {
3388 AbsolutePosition = newPos; 3383 AbsolutePosition = newPos;
3389 } 3384// m_rootPart.Undoing = false;
3385// }
3386// else
3387// {
3388// AbsolutePosition = newPos;
3389// }
3390 3390
3391 HasGroupChanged = true; 3391 HasGroupChanged = true;
3392 if (m_rootPart.Undoing) 3392 if (m_rootPart.Undoing)
@@ -3416,9 +3416,9 @@ namespace OpenSim.Region.Framework.Scenes
3416// for (int i = 0; i < parts.Length; i++) 3416// for (int i = 0; i < parts.Length; i++)
3417// parts[i].StoreUndoState(); 3417// parts[i].StoreUndoState();
3418 3418
3419 m_rootPart.StoreUndoState(true); 3419// m_rootPart.StoreUndoState(true);
3420 3420
3421 m_rootPart.UpdateRotation(rot); 3421// m_rootPart.UpdateRotation(rot);
3422 3422
3423 PhysicsActor actor = m_rootPart.PhysActor; 3423 PhysicsActor actor = m_rootPart.PhysActor;
3424 if (actor != null) 3424 if (actor != null)
@@ -3445,8 +3445,8 @@ namespace OpenSim.Region.Framework.Scenes
3445// for (int i = 0; i < parts.Length; i++) 3445// for (int i = 0; i < parts.Length; i++)
3446// parts[i].StoreUndoState(); 3446// parts[i].StoreUndoState();
3447 3447
3448 RootPart.StoreUndoState(true); 3448// RootPart.StoreUndoState(true);
3449 RootPart.IgnoreUndoUpdate = true; 3449// RootPart.IgnoreUndoUpdate = true;
3450 3450
3451 m_rootPart.UpdateRotation(rot); 3451 m_rootPart.UpdateRotation(rot);
3452 3452
@@ -3462,7 +3462,7 @@ namespace OpenSim.Region.Framework.Scenes
3462 HasGroupChanged = true; 3462 HasGroupChanged = true;
3463 ScheduleGroupForTerseUpdate(); 3463 ScheduleGroupForTerseUpdate();
3464 3464
3465 RootPart.IgnoreUndoUpdate = false; 3465// RootPart.IgnoreUndoUpdate = false;
3466 } 3466 }
3467 3467
3468 /// <summary> 3468 /// <summary>
@@ -3511,8 +3511,8 @@ namespace OpenSim.Region.Framework.Scenes
3511// "[SCENE OBJECT GROUP]: Updating single position and rotation of {0} {1} to {2}", 3511// "[SCENE OBJECT GROUP]: Updating single position and rotation of {0} {1} to {2}",
3512// part.Name, part.LocalId, rot); 3512// part.Name, part.LocalId, rot);
3513 3513
3514 part.StoreUndoState(); 3514// part.StoreUndoState();
3515 part.IgnoreUndoUpdate = true; 3515// part.IgnoreUndoUpdate = true;
3516 3516
3517 if (m_rootPart.PhysActor != null) 3517 if (m_rootPart.PhysActor != null)
3518 m_rootPart.PhysActor.Building = true; 3518 m_rootPart.PhysActor.Building = true;
@@ -3541,7 +3541,7 @@ namespace OpenSim.Region.Framework.Scenes
3541 if (m_rootPart.PhysActor != null) 3541 if (m_rootPart.PhysActor != null)
3542 m_rootPart.PhysActor.Building = false; 3542 m_rootPart.PhysActor.Building = false;
3543 3543
3544 part.IgnoreUndoUpdate = false; 3544// part.IgnoreUndoUpdate = false;
3545 } 3545 }
3546 } 3546 }
3547 3547
@@ -3557,7 +3557,7 @@ namespace OpenSim.Region.Framework.Scenes
3557 3557
3558 Quaternion axRot = rot; 3558 Quaternion axRot = rot;
3559 Quaternion oldParentRot = m_rootPart.RotationOffset; 3559 Quaternion oldParentRot = m_rootPart.RotationOffset;
3560 m_rootPart.StoreUndoState(); 3560// m_rootPart.StoreUndoState();
3561 3561
3562 //Don't use UpdateRotation because it schedules an update prematurely 3562 //Don't use UpdateRotation because it schedules an update prematurely
3563 m_rootPart.RotationOffset = rot; 3563 m_rootPart.RotationOffset = rot;
@@ -3573,7 +3573,7 @@ namespace OpenSim.Region.Framework.Scenes
3573 SceneObjectPart prim = parts[i]; 3573 SceneObjectPart prim = parts[i];
3574 if (prim.UUID != m_rootPart.UUID) 3574 if (prim.UUID != m_rootPart.UUID)
3575 { 3575 {
3576 prim.IgnoreUndoUpdate = true; 3576// prim.IgnoreUndoUpdate = true;
3577 3577
3578 Quaternion NewRot = oldParentRot * prim.RotationOffset; 3578 Quaternion NewRot = oldParentRot * prim.RotationOffset;
3579 NewRot = Quaternion.Inverse(axRot) * NewRot; 3579 NewRot = Quaternion.Inverse(axRot) * NewRot;
@@ -3585,7 +3585,7 @@ namespace OpenSim.Region.Framework.Scenes
3585 axPos *= Quaternion.Inverse(axRot); 3585 axPos *= Quaternion.Inverse(axRot);
3586 prim.OffsetPosition = axPos; 3586 prim.OffsetPosition = axPos;
3587 3587
3588 prim.IgnoreUndoUpdate = false; 3588// prim.IgnoreUndoUpdate = false;
3589 } 3589 }
3590 } 3590 }
3591 3591
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index cce606a..6622495 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -828,7 +828,7 @@ namespace OpenSim.Region.Framework.Scenes
828 828
829 set 829 set
830 { 830 {
831 StoreUndoState(); 831// StoreUndoState();
832 m_rotationOffset = value; 832 m_rotationOffset = value;
833 833
834 PhysicsActor actor = PhysActor; 834 PhysicsActor actor = PhysActor;
@@ -1007,7 +1007,7 @@ namespace OpenSim.Region.Framework.Scenes
1007 { 1007 {
1008 if (m_shape != null) 1008 if (m_shape != null)
1009 { 1009 {
1010 StoreUndoState(); 1010// StoreUndoState();
1011 1011
1012 m_shape.Scale = value; 1012 m_shape.Scale = value;
1013 1013
diff --git a/OpenSim/Region/Framework/Scenes/UndoState.cs b/OpenSim/Region/Framework/Scenes/UndoState.cs
index 029c828..38474de 100644
--- a/OpenSim/Region/Framework/Scenes/UndoState.cs
+++ b/OpenSim/Region/Framework/Scenes/UndoState.cs
@@ -74,14 +74,11 @@ namespace OpenSim.Region.Framework.Scenes
74 ForGroup = forGroup; 74 ForGroup = forGroup;
75 Position = part.ParentGroup.AbsolutePosition; 75 Position = part.ParentGroup.AbsolutePosition;
76 Rotation = part.RotationOffset; 76 Rotation = part.RotationOffset;
77 if (!forGroup) 77 Scale = part.Shape.Scale;
78 Scale = part.Shape.Scale;
79 else
80 Scale = Vector3.Zero; // until we fix it
81 } 78 }
82 else 79 else
83 { 80 {
84 ForGroup = false; // previus code implies only root parts can undo grp 81 ForGroup = false; // only root parts can undo grp
85 Position = part.OffsetPosition; 82 Position = part.OffsetPosition;
86 Rotation = part.RotationOffset; 83 Rotation = part.RotationOffset;
87 Scale = part.Shape.Scale; 84 Scale = part.Shape.Scale;
@@ -108,9 +105,7 @@ namespace OpenSim.Region.Framework.Scenes
108 return false; 105 return false;
109 if (Rotation != part.RotationOffset) 106 if (Rotation != part.RotationOffset)
110 return false; 107 return false;
111 if (ForGroup) 108 return Scale == part.Shape.Scale;
112 return true; // for now don't do grp scale
113 return (Scale == part.Shape.Scale);
114 } 109 }
115 else 110 else
116 { 111 {
@@ -144,10 +139,9 @@ namespace OpenSim.Region.Framework.Scenes
144 139
145 if (Scale != Vector3.Zero) 140 if (Scale != Vector3.Zero)
146 { 141 {
147 // if (ForGroup) 142 if (ForGroup)
148 // part.ParentGroup.GroupResize(Scale); 143 part.ParentGroup.GroupResize(Scale);
149 // else 144 else
150 if (!ForGroup) // we don't have grp scale for now
151 part.Resize(Scale); 145 part.Resize(Scale);
152 } 146 }
153 part.ParentGroup.ScheduleGroupForTerseUpdate(); 147 part.ParentGroup.ScheduleGroupForTerseUpdate();