From a1416612a9f9e0d5cbe1c1f02d313e9be020226d Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Sun, 20 Jun 2010 14:45:04 -0700 Subject: Update all clients sitting on a linkset if a child prim is moved. This prevents avatars being "lost in the void" until they stand up when a child prim is moved that they're sitting on. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index b80a557..78faa01 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -711,6 +711,12 @@ namespace OpenSim.Region.Framework.Scenes // Tell the physics engines that this prim changed. m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(actor); } + + List avs = ParentGroup.GetLinkedAvatars(); + foreach (ScenePresence av in avs) + { + av.SendFullUpdateToAllClients(); + } } } } -- cgit v1.1 From fc715a092c9b48ddfbf75eb35e1a052885aecbff Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Sun, 20 Jun 2010 15:38:48 -0700 Subject: Fix the sit code to ensure that we use the root prim of a linkset as a reference in the case of an avatar sitting on a child prim. This fixes various camera issues and fixes mantis #0000059. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 76267ab..472c389 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1766,7 +1766,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_parentID != 0) { - SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); + SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); if (part != null) { part.TaskInventory.LockItemsForRead(true); @@ -2028,7 +2028,9 @@ namespace OpenSim.Region.Framework.Scenes //Console.WriteLine("Camera At ={0}", cameraAtOffset); //Console.WriteLine("Camera Eye ={0}", cameraEyeOffset); - ControllingClient.SendSitResponse(part.UUID, offsetr, sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook); + //NOTE: SendSitResponse should be relative to the GROUP *NOT* THE PRIM if we're sitting on a child + ControllingClient.SendSitResponse(part.ParentGroup.UUID, offsetr + part.OffsetPosition, sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook); + m_requestedSitTargetUUID = part.UUID; //KF: Correct autopilot target // This calls HandleAgentSit twice, once from here, and the client calls // HandleAgentSit itself after it gets to the location @@ -2398,7 +2400,17 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos); return; } } - m_parentID = m_requestedSitTargetID; + + //We want our offsets to reference the root prim, not the child we may have sat on + if (!part.IsRoot) + { + m_parentID = part.ParentGroup.RootPart.LocalId; + m_pos += part.OffsetPosition; + } + else + { + m_parentID = m_requestedSitTargetID; + } Velocity = Vector3.Zero; RemoveFromPhysicalScene(); -- cgit v1.1 From 9d251b1dc518522979b73fdadc0329067b669149 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Sun, 20 Jun 2010 15:57:01 -0700 Subject: Fix the StandUp position to calculate as if we're still using the child prim id. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 472c389..a376ab1 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1822,7 +1822,7 @@ namespace OpenSim.Region.Framework.Scenes //CW: If the part isn't null then we can set the current position if (part != null) { - Vector3 avWorldStandUp = avStandUp + part.GetWorldPosition() + (m_pos * partRot); // + av sit offset! + Vector3 avWorldStandUp = avStandUp + part.GetWorldPosition() + ((m_pos - part.OffsetPosition) * partRot); // + av sit offset! AbsolutePosition = avWorldStandUp; //KF: Fix stand up. part.IsOccupied = false; part.ParentGroup.DeleteAvatar(ControllingClient.AgentId); -- cgit v1.1