aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorCharles Krinke2008-04-19 21:01:26 +0000
committerCharles Krinke2008-04-19 21:01:26 +0000
commit6865f1c67d8f4b6fa44ddd9f3040a29e9e180950 (patch)
tree5f8b65c2abac19e736c103b2773d5dc236e59d7d
parent* Fix build break in previous revision (diff)
downloadopensim-SC_OLD-6865f1c67d8f4b6fa44ddd9f3040a29e9e180950.zip
opensim-SC_OLD-6865f1c67d8f4b6fa44ddd9f3040a29e9e180950.tar.gz
opensim-SC_OLD-6865f1c67d8f4b6fa44ddd9f3040a29e9e180950.tar.bz2
opensim-SC_OLD-6865f1c67d8f4b6fa44ddd9f3040a29e9e180950.tar.xz
Thank you kindly krtaylor for a patch to solve:
Linked objects won't scale together properly, only the root object scales. This happens with scaling both up and down or inputting numbers in the edit dialog.
-rw-r--r--OpenSim/Framework/IClientAPI.cs1
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs30
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs11
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs44
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs1
6 files changed, 81 insertions, 7 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 236bfe7..b8264ba 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -501,6 +501,7 @@ namespace OpenSim.Framework
501 event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; 501 event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
502 event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; 502 event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation;
503 event UpdateVector OnUpdatePrimScale; 503 event UpdateVector OnUpdatePrimScale;
504 event UpdateVector OnUpdatePrimGroupScale;
504 event StatusChange OnChildAgentStatus; 505 event StatusChange OnChildAgentStatus;
505 event GenericCall2 OnStopMovement; 506 event GenericCall2 OnStopMovement;
506 event Action<LLUUID> OnRemoveAvatar; 507 event Action<LLUUID> OnRemoveAvatar;
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 89b0400..292f7f6 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -222,6 +222,7 @@ namespace OpenSim.Region.ClientStack
222 private UpdateVector handlerUpdatePrimSinglePosition = null; //OnUpdatePrimSinglePosition; 222 private UpdateVector handlerUpdatePrimSinglePosition = null; //OnUpdatePrimSinglePosition;
223 private UpdatePrimSingleRotation handlerUpdatePrimSingleRotation = null; //OnUpdatePrimSingleRotation; 223 private UpdatePrimSingleRotation handlerUpdatePrimSingleRotation = null; //OnUpdatePrimSingleRotation;
224 private UpdateVector handlerUpdatePrimScale = null; //OnUpdatePrimScale; 224 private UpdateVector handlerUpdatePrimScale = null; //OnUpdatePrimScale;
225 private UpdateVector handlerUpdatePrimGroupScale = null; //OnUpdateGroupScale;
225 private UpdateVector handlerUpdateVector = null; //OnUpdatePrimGroupPosition; 226 private UpdateVector handlerUpdateVector = null; //OnUpdatePrimGroupPosition;
226 private UpdatePrimRotation handlerUpdatePrimRotation = null; //OnUpdatePrimGroupRotation; 227 private UpdatePrimRotation handlerUpdatePrimRotation = null; //OnUpdatePrimGroupRotation;
227 private UpdatePrimGroupRotation handlerUpdatePrimGroupRotation = null; //OnUpdatePrimGroupMouseRotation; 228 private UpdatePrimGroupRotation handlerUpdatePrimGroupRotation = null; //OnUpdatePrimGroupMouseRotation;
@@ -712,6 +713,7 @@ namespace OpenSim.Region.ClientStack
712 public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; 713 public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
713 public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; 714 public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation;
714 public event UpdateVector OnUpdatePrimScale; 715 public event UpdateVector OnUpdatePrimScale;
716 public event UpdateVector OnUpdatePrimGroupScale;
715 public event StatusChange OnChildAgentStatus; 717 public event StatusChange OnChildAgentStatus;
716 public event GenericCall2 OnStopMovement; 718 public event GenericCall2 OnStopMovement;
717 public event Action<LLUUID> OnRemoveAvatar; 719 public event Action<LLUUID> OnRemoveAvatar;
@@ -2590,6 +2592,7 @@ namespace OpenSim.Region.ClientStack
2590 case 5: 2592 case 5:
2591 2593
2592 LLVector3 scale1 = new LLVector3(block.Data, 12); 2594 LLVector3 scale1 = new LLVector3(block.Data, 12);
2595 LLVector3 pos11 = new LLVector3(block.Data, 0);
2593 2596
2594 handlerUpdatePrimScale = OnUpdatePrimScale; 2597 handlerUpdatePrimScale = OnUpdatePrimScale;
2595 if (handlerUpdatePrimScale != null) 2598 if (handlerUpdatePrimScale != null)
@@ -2597,6 +2600,13 @@ namespace OpenSim.Region.ClientStack
2597 2600
2598 // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); 2601 // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
2599 handlerUpdatePrimScale(localId, scale1, this); 2602 handlerUpdatePrimScale(localId, scale1, this);
2603
2604
2605 handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition;
2606 if (handlerUpdatePrimSinglePosition != null)
2607 {
2608 handlerUpdatePrimSinglePosition(localId, pos11, this);
2609 }
2600 } 2610 }
2601 break; 2611 break;
2602 case 9: 2612 case 9:
@@ -2661,27 +2671,35 @@ namespace OpenSim.Region.ClientStack
2661 LLVector3 scale5 = new LLVector3(block.Data, 12); 2671 LLVector3 scale5 = new LLVector3(block.Data, 12);
2662 LLVector3 pos5 = new LLVector3(block.Data, 0); 2672 LLVector3 pos5 = new LLVector3(block.Data, 0);
2663 2673
2664 handlerUpdatePrimScale = OnUpdatePrimScale; 2674 handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale;
2665 if (handlerUpdatePrimScale != null) 2675 if (handlerUpdatePrimGroupScale != null)
2666 { 2676 {
2667 2677
2668 // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z ); 2678 // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z );
2669 handlerUpdatePrimScale(localId, scale5, this); 2679 handlerUpdatePrimGroupScale(localId, scale5, this);
2680 handlerUpdateVector = OnUpdatePrimGroupPosition;
2670 2681
2671 handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; 2682 if (handlerUpdateVector != null)
2672 if (handlerUpdatePrimSinglePosition != null)
2673 { 2683 {
2674 handlerUpdatePrimSinglePosition(localId, pos5, this); 2684
2685 handlerUpdateVector(localId, pos5, this);
2675 } 2686 }
2676 } 2687 }
2677 break; 2688 break;
2678 case 21: 2689 case 21:
2679 LLVector3 scale6 = new LLVector3(block.Data, 12); 2690 LLVector3 scale6 = new LLVector3(block.Data, 12);
2691 LLVector3 pos6 = new LLVector3(block.Data, 0);
2692
2680 handlerUpdatePrimScale = OnUpdatePrimScale; 2693 handlerUpdatePrimScale = OnUpdatePrimScale;
2681 if (handlerUpdatePrimScale != null) 2694 if (handlerUpdatePrimScale != null)
2682 { 2695 {
2683 // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); 2696 // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
2684 handlerUpdatePrimScale(localId, scale6, this); 2697 handlerUpdatePrimScale(localId, scale6, this);
2698 handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition;
2699 if (handlerUpdatePrimSinglePosition != null)
2700 {
2701 handlerUpdatePrimSinglePosition(localId, pos6, this);
2702 }
2685 } 2703 }
2686 break; 2704 break;
2687 } 2705 }
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index ea4283f..8894db0 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -890,6 +890,17 @@ namespace OpenSim.Region.Environment.Scenes
890 } 890 }
891 } 891 }
892 } 892 }
893 public void UpdatePrimGroupScale(uint localID, LLVector3 scale, IClientAPI remoteClient)
894 {
895 SceneObjectGroup group = GetGroupByPrim(localID);
896 if (group != null)
897 {
898 if (PermissionsMngr.CanEditObjectPosition(remoteClient.AgentId, group.UUID))
899 {
900 group.GroupResize(scale, localID);
901 }
902 }
903 }
893 904
894 /// <summary> 905 /// <summary>
895 /// This handles the nifty little tool tip that you get when you drag your mouse over an object 906 /// This handles the nifty little tool tip that you get when you drag your mouse over an object
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index b81b2d4..c5ed958 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1513,6 +1513,7 @@ namespace OpenSim.Region.Environment.Scenes
1513 client.OnUpdatePrimGroupMouseRotation += m_innerScene.UpdatePrimRotation; 1513 client.OnUpdatePrimGroupMouseRotation += m_innerScene.UpdatePrimRotation;
1514 client.OnUpdatePrimSingleRotation += m_innerScene.UpdatePrimSingleRotation; 1514 client.OnUpdatePrimSingleRotation += m_innerScene.UpdatePrimSingleRotation;
1515 client.OnUpdatePrimScale += m_innerScene.UpdatePrimScale; 1515 client.OnUpdatePrimScale += m_innerScene.UpdatePrimScale;
1516 client.OnUpdatePrimGroupScale += m_innerScene.UpdatePrimGroupScale;
1516 client.OnUpdateExtraParams += m_innerScene.UpdateExtraParam; 1517 client.OnUpdateExtraParams += m_innerScene.UpdateExtraParam;
1517 client.OnUpdatePrimShape += m_innerScene.UpdatePrimShape; 1518 client.OnUpdatePrimShape += m_innerScene.UpdatePrimShape;
1518 client.OnRequestMapBlocks += RequestMapBlocks; 1519 client.OnRequestMapBlocks += RequestMapBlocks;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 3a9e52a..1f38e4f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1520,7 +1520,7 @@ namespace OpenSim.Region.Environment.Scenes
1520 new PhysicsVector(scale.X, scale.Y, scale.Z); 1520 new PhysicsVector(scale.X, scale.Y, scale.Z);
1521 m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor); 1521 m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
1522 } 1522 }
1523 if (part.UUID != m_rootPart.UUID) 1523 //if (part.UUID != m_rootPart.UUID)
1524 ScheduleGroupForFullUpdate(); 1524 ScheduleGroupForFullUpdate();
1525 1525
1526 //if (part.UUID == m_rootPart.UUID) 1526 //if (part.UUID == m_rootPart.UUID)
@@ -1534,6 +1534,48 @@ namespace OpenSim.Region.Environment.Scenes
1534 //} 1534 //}
1535 } 1535 }
1536 } 1536 }
1537 public void GroupResize(LLVector3 scale, uint localID)
1538 {
1539 SceneObjectPart part = GetChildPart(localID);
1540 if (part != null)
1541 {
1542 float x = (scale.X / part.Scale.X);
1543 float y = (scale.Y / part.Scale.Y);
1544 float z = (scale.Z / part.Scale.Z);
1545 part.Resize(scale);
1546
1547 lock (m_parts)
1548 {
1549 foreach (SceneObjectPart obPart in m_parts.Values)
1550 {
1551 if (obPart.UUID != m_rootPart.UUID)
1552 {
1553
1554 LLVector3 currentpos = new LLVector3(obPart.OffsetPosition);
1555 currentpos.X *= x;
1556 currentpos.Y *= y;
1557 currentpos.Z *= z;
1558 LLVector3 newSize = new LLVector3(obPart.Scale);
1559 newSize.X *= x;
1560 newSize.Y *= y;
1561 newSize.Z *= z;
1562 obPart.Resize(newSize);
1563 obPart.UpdateOffSet(currentpos);
1564 }
1565 }
1566 }
1567
1568 if (part.PhysActor != null)
1569 {
1570 part.PhysActor.Size =
1571 new PhysicsVector(scale.X, scale.Y, scale.Z);
1572 m_scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
1573 }
1574
1575
1576 ScheduleGroupForTerseUpdate();
1577 }
1578 }
1537 1579
1538 #endregion 1580 #endregion
1539 1581
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index a9f7fb9..4ce68da 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -109,6 +109,7 @@ namespace OpenSim.Region.Examples.SimpleModule
109 public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; 109 public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
110 public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; 110 public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation;
111 public event UpdateVector OnUpdatePrimScale; 111 public event UpdateVector OnUpdatePrimScale;
112 public event UpdateVector OnUpdatePrimGroupScale;
112 public event StatusChange OnChildAgentStatus; 113 public event StatusChange OnChildAgentStatus;
113 public event GenericCall2 OnStopMovement; 114 public event GenericCall2 OnStopMovement;
114 public event Action<LLUUID> OnRemoveAvatar; 115 public event Action<LLUUID> OnRemoveAvatar;