aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneGraph.cs3
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs31
2 files changed, 24 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs
index d261e2d..dbb8539 100644
--- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs
@@ -1690,6 +1690,9 @@ namespace OpenSim.Region.Environment.Scenes
1690 copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 0); 1690 copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 0);
1691 copy.HasGroupChanged = true; 1691 copy.HasGroupChanged = true;
1692 copy.ScheduleGroupForFullUpdate(); 1692 copy.ScheduleGroupForFullUpdate();
1693
1694 // required for physics to update it's position
1695 copy.AbsolutePosition = copy.AbsolutePosition;
1693 return copy; 1696 return copy;
1694 } 1697 }
1695 } 1698 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index f4ccc46..36ba683 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -2132,6 +2132,21 @@ namespace OpenSim.Region.Environment.Scenes
2132 2132
2133 private void LinkNonRootPart(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation, int linkNum) 2133 private void LinkNonRootPart(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation, int linkNum)
2134 { 2134 {
2135
2136 Quaternion parentRot = oldGroupRotation;
2137 Quaternion oldRot = part.RotationOffset;
2138 Quaternion worldRot = parentRot * oldRot;
2139
2140 parentRot = oldGroupRotation;
2141
2142 Vector3 axPos = part.OffsetPosition;
2143
2144 axPos *= parentRot;
2145 part.OffsetPosition = axPos;
2146 part.GroupPosition = oldGroupPosition + part.OffsetPosition;
2147 part.OffsetPosition = Vector3.Zero;
2148 part.RotationOffset = worldRot;
2149
2135 part.SetParent(this); 2150 part.SetParent(this);
2136 part.ParentID = m_rootPart.LocalId; 2151 part.ParentID = m_rootPart.LocalId;
2137 2152
@@ -2140,11 +2155,8 @@ namespace OpenSim.Region.Environment.Scenes
2140 2155
2141 part.LinkNum = linkNum; 2156 part.LinkNum = linkNum;
2142 2157
2143 Vector3 oldPos = part.OffsetPosition; 2158
2144 oldPos *= oldGroupRotation; 2159 part.OffsetPosition = part.GroupPosition - AbsolutePosition;
2145 oldPos += oldGroupPosition;
2146 Vector3 oldAbsolutePosition = oldPos;
2147 part.OffsetPosition = oldAbsolutePosition - AbsolutePosition;
2148 2160
2149 Quaternion rootRotation = m_rootPart.RotationOffset; 2161 Quaternion rootRotation = m_rootPart.RotationOffset;
2150 2162
@@ -2152,11 +2164,10 @@ namespace OpenSim.Region.Environment.Scenes
2152 pos *= Quaternion.Inverse(rootRotation); 2164 pos *= Quaternion.Inverse(rootRotation);
2153 part.OffsetPosition = pos; 2165 part.OffsetPosition = pos;
2154 2166
2155 Quaternion partRotation = part.RotationOffset; 2167 parentRot = m_rootPart.RotationOffset;
2156 2168 oldRot = part.RotationOffset;
2157 partRotation *= oldGroupRotation; 2169 Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
2158 partRotation *= Quaternion.Inverse(rootRotation); 2170 part.RotationOffset = newRot;
2159 part.RotationOffset = partRotation;
2160 } 2171 }
2161 2172
2162 /// <summary> 2173 /// <summary>