diff options
author | Charles Krinke | 2008-04-19 21:01:26 +0000 |
---|---|---|
committer | Charles Krinke | 2008-04-19 21:01:26 +0000 |
commit | 6865f1c67d8f4b6fa44ddd9f3040a29e9e180950 (patch) | |
tree | 5f8b65c2abac19e736c103b2773d5dc236e59d7d /OpenSim/Region/Environment/Scenes | |
parent | * Fix build break in previous revision (diff) | |
download | opensim-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.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 11 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 44 |
3 files changed, 55 insertions, 1 deletions
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 | ||