aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorTom Grimshaw2010-06-20 15:38:48 -0700
committerTom Grimshaw2010-06-20 15:38:48 -0700
commitfc715a092c9b48ddfbf75eb35e1a052885aecbff (patch)
tree5e4b4f3139175cc4cad140680e7689ea1af224c3 /OpenSim/Region/Framework/Scenes
parentMerge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff)
downloadopensim-SC-fc715a092c9b48ddfbf75eb35e1a052885aecbff.zip
opensim-SC-fc715a092c9b48ddfbf75eb35e1a052885aecbff.tar.gz
opensim-SC-fc715a092c9b48ddfbf75eb35e1a052885aecbff.tar.bz2
opensim-SC-fc715a092c9b48ddfbf75eb35e1a052885aecbff.tar.xz
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.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs18
1 files changed, 15 insertions, 3 deletions
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
1766 1766
1767 if (m_parentID != 0) 1767 if (m_parentID != 0)
1768 { 1768 {
1769 SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); 1769 SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
1770 if (part != null) 1770 if (part != null)
1771 { 1771 {
1772 part.TaskInventory.LockItemsForRead(true); 1772 part.TaskInventory.LockItemsForRead(true);
@@ -2028,7 +2028,9 @@ namespace OpenSim.Region.Framework.Scenes
2028//Console.WriteLine("Camera At ={0}", cameraAtOffset); 2028//Console.WriteLine("Camera At ={0}", cameraAtOffset);
2029//Console.WriteLine("Camera Eye ={0}", cameraEyeOffset); 2029//Console.WriteLine("Camera Eye ={0}", cameraEyeOffset);
2030 2030
2031 ControllingClient.SendSitResponse(part.UUID, offsetr, sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook); 2031 //NOTE: SendSitResponse should be relative to the GROUP *NOT* THE PRIM if we're sitting on a child
2032 ControllingClient.SendSitResponse(part.ParentGroup.UUID, offsetr + part.OffsetPosition, sitOrientation, autopilot, cameraAtOffset, cameraEyeOffset, forceMouselook);
2033
2032 m_requestedSitTargetUUID = part.UUID; //KF: Correct autopilot target 2034 m_requestedSitTargetUUID = part.UUID; //KF: Correct autopilot target
2033 // This calls HandleAgentSit twice, once from here, and the client calls 2035 // This calls HandleAgentSit twice, once from here, and the client calls
2034 // HandleAgentSit itself after it gets to the location 2036 // HandleAgentSit itself after it gets to the location
@@ -2398,7 +2400,17 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
2398 return; 2400 return;
2399 } 2401 }
2400 } 2402 }
2401 m_parentID = m_requestedSitTargetID; 2403
2404 //We want our offsets to reference the root prim, not the child we may have sat on
2405 if (!part.IsRoot)
2406 {
2407 m_parentID = part.ParentGroup.RootPart.LocalId;
2408 m_pos += part.OffsetPosition;
2409 }
2410 else
2411 {
2412 m_parentID = m_requestedSitTargetID;
2413 }
2402 2414
2403 Velocity = Vector3.Zero; 2415 Velocity = Vector3.Zero;
2404 RemoveFromPhysicalScene(); 2416 RemoveFromPhysicalScene();