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/CoreModules/Framework | |
parent | Fix saving of attachment positions (diff) | |
download | opensim-SC-98e9f225446ade7f1650db96fb4b8d763af1730e.zip opensim-SC-98e9f225446ade7f1650db96fb4b8d763af1730e.tar.gz opensim-SC-98e9f225446ade7f1650db96fb4b8d763af1730e.tar.bz2 opensim-SC-98e9f225446ade7f1650db96fb4b8d763af1730e.tar.xz |
Preserve attachment rotation on objects rezzed via a script. Makes toasters
work right, finally.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 7 |
1 files changed, 7 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); |