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/SceneObjectGroup.cs | |
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/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 44 |
1 files changed, 43 insertions, 1 deletions
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 | ||