diff options
author | Justin Clark-Casey (justincc) | 2010-12-14 00:11:41 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-12-14 00:11:41 +0000 |
commit | e62b3dba8a1b8c816d6b09dc1f14b915f1560afe (patch) | |
tree | 19d945106d9d3c1147d441ab9351e9f33c910a36 /OpenSim/Region | |
parent | Trigger event with flag CHANGED_LINK when agent sits on objects that have not... (diff) | |
download | opensim-SC-e62b3dba8a1b8c816d6b09dc1f14b915f1560afe.zip opensim-SC-e62b3dba8a1b8c816d6b09dc1f14b915f1560afe.tar.gz opensim-SC-e62b3dba8a1b8c816d6b09dc1f14b915f1560afe.tar.bz2 opensim-SC-e62b3dba8a1b8c816d6b09dc1f14b915f1560afe.tar.xz |
reinstate IAttachmentsModule.UpdateAttachmentPosition() since this is being used by a 3rd party region module and contains non-obvious attachment specific code
There are no functional changes. UpdateAttachmentPosition() is adapted to the new approach of only saving attachment state on logout
Diffstat (limited to 'OpenSim/Region')
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 | { |