aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs16
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs15
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs9
3 files changed, 27 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index 1f49a01..360a014 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -484,6 +484,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
484 } 484 }
485 } 485 }
486 486
487 public void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos)
488 {
489 // First we save the
490 // attachment point information, then we update the relative
491 // positioning. Then we have to mark the object as NOT an
492 // attachment. This is necessary in order to correctly save
493 // and retrieve GroupPosition information for the attachment.
494 // Finally, we restore the object's attachment status.
495 byte attachmentPoint = sog.GetAttachmentPoint();
496 sog.UpdateGroupPosition(pos);
497 sog.RootPart.IsAttachment = false;
498 sog.AbsolutePosition = sog.RootPart.AttachedPos;
499 sog.SetAttachmentPoint(attachmentPoint);
500 sog.HasGroupChanged = true;
501 }
502
487 /// <summary> 503 /// <summary>
488 /// Update the attachment asset for the new sog details if they have changed. 504 /// Update the attachment asset for the new sog details if they have changed.
489 /// </summary> 505 /// </summary>
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index b3576c5..6cc64c6 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -113,15 +113,18 @@ namespace OpenSim.Region.Framework.Interfaces
113 /// <summary> 113 /// <summary>
114 /// Update the user inventory to show a detach. 114 /// Update the user inventory to show a detach.
115 /// </summary> 115 /// </summary>
116 /// <param name="itemID"> 116 /// <param name="itemID">/param>
117 /// A <see cref="UUID"/> 117 /// <param name="remoteClient"></param>
118 /// </param>
119 /// <param name="remoteClient">
120 /// A <see cref="IClientAPI"/>
121 /// </param>
122 void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient); 118 void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient);
123 119
124 /// <summary> 120 /// <summary>
121 /// Update the position of an attachment.
122 /// </summary>
123 /// <param name="sog"></param>
124 /// <param name="pos"></param>
125 void UpdateAttachmentPosition(SceneObjectGroup sog, Vector3 pos);
126
127 /// <summary>
125 /// Update the user inventory with a changed attachment 128 /// Update the user inventory with a changed attachment
126 /// </summary> 129 /// </summary>
127 /// <param name="remoteClient"> 130 /// <param name="remoteClient">
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 78e5da3..a2ed54f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1281,13 +1281,8 @@ namespace OpenSim.Region.Framework.Scenes
1281 { 1281 {
1282 if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0)) 1282 if (group.IsAttachment || (group.RootPart.Shape.PCode == 9 && group.RootPart.Shape.State != 0))
1283 { 1283 {
1284 // Set the new attachment point data in the object 1284 if (m_parentScene.AttachmentsModule != null)
1285 byte attachmentPoint = group.GetAttachmentPoint(); 1285 m_parentScene.AttachmentsModule.UpdateAttachmentPosition(group, pos);
1286 group.UpdateGroupPosition(pos);
1287 group.RootPart.IsAttachment = false;
1288 group.AbsolutePosition = group.RootPart.AttachedPos;
1289 group.SetAttachmentPoint(attachmentPoint);
1290 group.HasGroupChanged = true;
1291 } 1286 }
1292 else 1287 else
1293 { 1288 {