From fc3cf2b5a3ec6d5405db41c2729a968d11c4a8fb Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 1 May 2012 23:21:28 +0200 Subject: Fix saving of attachment positions --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index bc2ca4c..10d53d7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -3700,7 +3700,7 @@ namespace OpenSim.Region.Framework.Scenes } if ((change & ObjectChangeType.Position) != 0) { - group.AbsolutePosition = data.position; + UpdateGroupPosition(data.position); updateType = updatetype.groupterse; } else -- cgit v1.1 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 +++++++ OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 3 +++ OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 1 + 3 files changed, 11 insertions(+) (limited to 'OpenSim/Region') 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); 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 public Vector3 AttachOffset = Vector3.Zero; [XmlIgnore] + public Quaternion AttachRotation = Quaternion.Identity; + + [XmlIgnore] public int STATUS_ROTATE_X; 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 group.RootPart.AttachPoint = group.RootPart.Shape.State; group.RootPart.AttachOffset = group.AbsolutePosition; + group.RootPart.AttachRotation = group.GroupRotation; group.ResetIDs(); -- cgit v1.1