From bb5ab05482c2eb3b8d6c0ae41f54866f41105033 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 19 Nov 2014 18:20:30 +0000 Subject: fix rez position being for root or center for a single object case --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 9721edb..1dd3d2f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2491,6 +2491,28 @@ namespace OpenSim.Region.Framework.Scenes sourcePart.Inventory.RemoveInventoryItem(item.ItemID); } + SceneObjectGroup sog; + // position adjust + if (totalPrims > 1) // nothing to do on a single prim + { + if (objlist.Count == 1) + { + // current object position is root position + if(!atRoot) + { + sog = objlist[0]; + Quaternion orot; + if (rot == null) + orot = sog.RootPart.GetWorldRotation(); + else + orot = rot.Value; + Vector3 off = sog.GetGeometricCenter(); + off *= orot; + pos -= off; + } + } + } + for (int i = 0; i < objlist.Count; i++) { SceneObjectGroup group = objlist[i]; -- cgit v1.1