aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs43
1 files changed, 27 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c47db97..66a6520 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -2339,7 +2339,7 @@ namespace OpenSim.Region.Framework.Scenes
2339 { 2339 {
2340 pa.PIDHoverHeight = height; 2340 pa.PIDHoverHeight = height;
2341 pa.PIDHoverType = hoverType; 2341 pa.PIDHoverType = hoverType;
2342 pa.PIDTau = tau; 2342 pa.PIDHoverTau = tau;
2343 pa.PIDHoverActive = true; 2343 pa.PIDHoverActive = true;
2344 } 2344 }
2345 else 2345 else
@@ -2664,19 +2664,21 @@ namespace OpenSim.Region.Framework.Scenes
2664 Quaternion oldRootRotation = linkPart.RotationOffset; 2664 Quaternion oldRootRotation = linkPart.RotationOffset;
2665 2665
2666 linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition; 2666 linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition;
2667
2667 linkPart.ParentID = m_rootPart.LocalId; 2668 linkPart.ParentID = m_rootPart.LocalId;
2668 linkPart.GroupPosition = AbsolutePosition; 2669
2669 Vector3 axPos = linkPart.OffsetPosition; 2670 linkPart.GroupPosition = AbsolutePosition;
2670 2671
2672 Vector3 axPos = linkPart.OffsetPosition;
2671 Quaternion parentRot = m_rootPart.RotationOffset; 2673 Quaternion parentRot = m_rootPart.RotationOffset;
2672 axPos *= Quaternion.Inverse(parentRot); 2674 axPos *= Quaternion.Inverse(parentRot);
2673
2674 linkPart.OffsetPosition = axPos; 2675 linkPart.OffsetPosition = axPos;
2676
2675 Quaternion oldRot = linkPart.RotationOffset; 2677 Quaternion oldRot = linkPart.RotationOffset;
2676 Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot; 2678 Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
2677 linkPart.RotationOffset = newRot; 2679 linkPart.RotationOffset = newRot;
2678 2680
2679 linkPart.ParentID = m_rootPart.LocalId; 2681// linkPart.ParentID = m_rootPart.LocalId; done above
2680 2682
2681 if (m_rootPart.LinkNum == 0) 2683 if (m_rootPart.LinkNum == 0)
2682 m_rootPart.LinkNum = 1; 2684 m_rootPart.LinkNum = 1;
@@ -3707,16 +3709,25 @@ namespace OpenSim.Region.Framework.Scenes
3707 3709
3708 if (togroup) 3710 if (togroup)
3709 { 3711 {
3710 // related to group 3712 // related to group
3711 if ((change & ObjectChangeType.Position) != 0) 3713 if ((change & (ObjectChangeType.Rotation | ObjectChangeType.Position)) != 0)
3712 {
3713 group.AbsolutePosition = data.position;
3714 updateType = updatetype.groupterse;
3715 }
3716 if ((change & ObjectChangeType.Rotation) != 0)
3717 { 3714 {
3718 group.RootPart.UpdateRotation(data.rotation); 3715 if ((change & ObjectChangeType.Rotation) != 0)
3719 updateType = updatetype.none; 3716 {
3717 group.RootPart.UpdateRotation(data.rotation);
3718 updateType = updatetype.none;
3719 }
3720 if ((change & ObjectChangeType.Position) != 0)
3721 {
3722 group.AbsolutePosition = data.position;
3723 updateType = updatetype.groupterse;
3724 }
3725 else
3726 // ugly rotation update of all parts
3727 {
3728 group.AbsolutePosition = AbsolutePosition;
3729 }
3730
3720 } 3731 }
3721 if ((change & ObjectChangeType.Scale) != 0) 3732 if ((change & ObjectChangeType.Scale) != 0)
3722 { 3733 {
@@ -3741,10 +3752,10 @@ namespace OpenSim.Region.Framework.Scenes
3741 3752
3742 if (part == group.RootPart) 3753 if (part == group.RootPart)
3743 { 3754 {
3744 if ((change & ObjectChangeType.Position) != 0)
3745 group.UpdateRootPosition(data.position);
3746 if ((change & ObjectChangeType.Rotation) != 0) 3755 if ((change & ObjectChangeType.Rotation) != 0)
3747 group.UpdateRootRotation(data.rotation); 3756 group.UpdateRootRotation(data.rotation);
3757 if ((change & ObjectChangeType.Position) != 0)
3758 group.UpdateRootPosition(data.position);
3748 if ((change & ObjectChangeType.Scale) != 0) 3759 if ((change & ObjectChangeType.Scale) != 0)
3749 part.Resize(data.scale); 3760 part.Resize(data.scale);
3750 } 3761 }