diff options
author | Melanie | 2012-05-02 00:29:56 +0200 |
---|---|---|
committer | Melanie | 2012-05-02 00:29:56 +0200 |
commit | 98e9f225446ade7f1650db96fb4b8d763af1730e (patch) | |
tree | a063c28f59d0bb3c4c72e9f8a3a9f2aa97004b98 /OpenSim/Region | |
parent | Fix saving of attachment positions (diff) | |
download | opensim-SC_OLD-98e9f225446ade7f1650db96fb4b8d763af1730e.zip opensim-SC_OLD-98e9f225446ade7f1650db96fb4b8d763af1730e.tar.gz opensim-SC_OLD-98e9f225446ade7f1650db96fb4b8d763af1730e.tar.bz2 opensim-SC_OLD-98e9f225446ade7f1650db96fb4b8d763af1730e.tar.xz |
Preserve attachment rotation on objects rezzed via a script. Makes toasters
work right, finally.
Diffstat (limited to '')
3 files changed, 11 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index f41e89e..ee9961f 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -371,14 +371,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
371 | : objectGroup.AbsolutePosition.Y, | 371 | : objectGroup.AbsolutePosition.Y, |
372 | objectGroup.AbsolutePosition.Z); | 372 | objectGroup.AbsolutePosition.Z); |
373 | 373 | ||
374 | Quaternion inventoryStoredRotation = objectGroup.GroupRotation; | ||
374 | originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition; | 375 | originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition; |
375 | 376 | ||
376 | // Restore attachment data after trip through the sim | 377 | // Restore attachment data after trip through the sim |
377 | if (objectGroup.RootPart.AttachPoint > 0) | 378 | if (objectGroup.RootPart.AttachPoint > 0) |
379 | { | ||
378 | inventoryStoredPosition = objectGroup.RootPart.AttachOffset; | 380 | inventoryStoredPosition = objectGroup.RootPart.AttachOffset; |
381 | inventoryStoredRotation = objectGroup.RootPart.AttachRotation; | ||
382 | } | ||
379 | objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint; | 383 | objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint; |
380 | 384 | ||
381 | objectGroup.AbsolutePosition = inventoryStoredPosition; | 385 | objectGroup.AbsolutePosition = inventoryStoredPosition; |
386 | objectGroup.RootPart.RotationOffset = inventoryStoredRotation; | ||
382 | 387 | ||
383 | // Make sure all bits but the ones we want are clear | 388 | // Make sure all bits but the ones we want are clear |
384 | // on take. | 389 | // on take. |
@@ -768,6 +773,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
768 | { | 773 | { |
769 | g.RootPart.AttachPoint = g.RootPart.Shape.State; | 774 | g.RootPart.AttachPoint = g.RootPart.Shape.State; |
770 | g.RootPart.AttachOffset = g.AbsolutePosition; | 775 | g.RootPart.AttachOffset = g.AbsolutePosition; |
776 | g.RootPart.AttachRotation = g.GroupRotation; | ||
771 | g.RootPart.Shape.State = 0; | 777 | g.RootPart.Shape.State = 0; |
772 | } | 778 | } |
773 | 779 | ||
@@ -801,6 +807,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
801 | SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml); | 807 | SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml); |
802 | g.RootPart.AttachPoint = g.RootPart.Shape.State; | 808 | g.RootPart.AttachPoint = g.RootPart.Shape.State; |
803 | g.RootPart.AttachOffset = g.AbsolutePosition; | 809 | g.RootPart.AttachOffset = g.AbsolutePosition; |
810 | g.RootPart.AttachRotation = g.GroupRotation; | ||
804 | g.RootPart.Shape.State = 0; | 811 | g.RootPart.Shape.State = 0; |
805 | 812 | ||
806 | objlist.Add(g); | 813 | objlist.Add(g); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b198ca7..b0bc188 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -197,6 +197,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
197 | public Vector3 AttachOffset = Vector3.Zero; | 197 | public Vector3 AttachOffset = Vector3.Zero; |
198 | 198 | ||
199 | [XmlIgnore] | 199 | [XmlIgnore] |
200 | public Quaternion AttachRotation = Quaternion.Identity; | ||
201 | |||
202 | [XmlIgnore] | ||
200 | public int STATUS_ROTATE_X; | 203 | public int STATUS_ROTATE_X; |
201 | 204 | ||
202 | public int STATUS_ROTATE_Y; | 205 | public int STATUS_ROTATE_Y; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index a2649ee..959046a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -812,6 +812,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
812 | 812 | ||
813 | group.RootPart.AttachPoint = group.RootPart.Shape.State; | 813 | group.RootPart.AttachPoint = group.RootPart.Shape.State; |
814 | group.RootPart.AttachOffset = group.AbsolutePosition; | 814 | group.RootPart.AttachOffset = group.AbsolutePosition; |
815 | group.RootPart.AttachRotation = group.GroupRotation; | ||
815 | 816 | ||
816 | group.ResetIDs(); | 817 | group.ResetIDs(); |
817 | 818 | ||