From 98e9f225446ade7f1650db96fb4b8d763af1730e Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 2 May 2012 00:29:56 +0200 Subject: Preserve attachment rotation on objects rezzed via a script. Makes toasters work right, finally. --- .../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim/Region/CoreModules/Framework') 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 : objectGroup.AbsolutePosition.Y, objectGroup.AbsolutePosition.Z); + Quaternion inventoryStoredRotation = objectGroup.GroupRotation; originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition; // Restore attachment data after trip through the sim if (objectGroup.RootPart.AttachPoint > 0) + { inventoryStoredPosition = objectGroup.RootPart.AttachOffset; + inventoryStoredRotation = objectGroup.RootPart.AttachRotation; + } objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint; objectGroup.AbsolutePosition = inventoryStoredPosition; + objectGroup.RootPart.RotationOffset = inventoryStoredRotation; // Make sure all bits but the ones we want are clear // on take. @@ -768,6 +773,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess { g.RootPart.AttachPoint = g.RootPart.Shape.State; g.RootPart.AttachOffset = g.AbsolutePosition; + g.RootPart.AttachRotation = g.GroupRotation; g.RootPart.Shape.State = 0; } @@ -801,6 +807,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml); g.RootPart.AttachPoint = g.RootPart.Shape.State; g.RootPart.AttachOffset = g.AbsolutePosition; + g.RootPart.AttachRotation = g.GroupRotation; g.RootPart.Shape.State = 0; objlist.Add(g); -- cgit v1.1