aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorTom Grimshaw2010-06-19 10:06:09 -0700
committerTom Grimshaw2010-06-19 10:06:09 -0700
commit49d7d8534ccd037f4690c5ac6aecd66a460960df (patch)
treef3ca2c089c01c31d1e643a645fe26ea072b9f79e /OpenSim/Region/Framework/Scenes/ScenePresence.cs
parentAdd "AvatarHeight/2" to the Home Position when set to avoid having the avatar... (diff)
downloadopensim-SC_OLD-49d7d8534ccd037f4690c5ac6aecd66a460960df.zip
opensim-SC_OLD-49d7d8534ccd037f4690c5ac6aecd66a460960df.tar.gz
opensim-SC_OLD-49d7d8534ccd037f4690c5ac6aecd66a460960df.tar.bz2
opensim-SC_OLD-49d7d8534ccd037f4690c5ac6aecd66a460960df.tar.xz
Allow moving an avatar as part of a linkset using llSetLinkPrimitiveParams. This unlocks an awful lot of poseball-free content, and is a step towards resolving mantis #59.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs39
1 files changed, 37 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index d4fc6cd..76267ab 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -219,6 +219,7 @@ namespace OpenSim.Region.Framework.Scenes
219 //PauPaw:Proper PID Controler for autopilot************ 219 //PauPaw:Proper PID Controler for autopilot************
220 private bool m_moveToPositionInProgress; 220 private bool m_moveToPositionInProgress;
221 private Vector3 m_moveToPositionTarget; 221 private Vector3 m_moveToPositionTarget;
222 private Quaternion m_offsetRotation = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
222 223
223 private bool m_followCamAuto; 224 private bool m_followCamAuto;
224 225
@@ -537,10 +538,39 @@ namespace OpenSim.Region.Framework.Scenes
537 } 538 }
538 } 539 }
539 540
541 public Quaternion OffsetRotation
542 {
543 get { return m_offsetRotation; }
544 set { m_offsetRotation = value; }
545 }
546
540 public Quaternion Rotation 547 public Quaternion Rotation
541 { 548 {
542 get { return m_bodyRot; } 549 get {
543 set { m_bodyRot = value; } 550 if (m_parentID != 0)
551 {
552 if (m_offsetRotation != null)
553 {
554 return m_offsetRotation;
555 }
556 else
557 {
558 return new Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
559 }
560
561 }
562 else
563 {
564 return m_bodyRot;
565 }
566 }
567 set {
568 m_bodyRot = value;
569 if (m_parentID != 0)
570 {
571 m_offsetRotation = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
572 }
573 }
544 } 574 }
545 575
546 public Quaternion PreviousRotation 576 public Quaternion PreviousRotation
@@ -1795,6 +1825,7 @@ namespace OpenSim.Region.Framework.Scenes
1795 Vector3 avWorldStandUp = avStandUp + part.GetWorldPosition() + (m_pos * partRot); // + av sit offset! 1825 Vector3 avWorldStandUp = avStandUp + part.GetWorldPosition() + (m_pos * partRot); // + av sit offset!
1796 AbsolutePosition = avWorldStandUp; //KF: Fix stand up. 1826 AbsolutePosition = avWorldStandUp; //KF: Fix stand up.
1797 part.IsOccupied = false; 1827 part.IsOccupied = false;
1828 part.ParentGroup.DeleteAvatar(ControllingClient.AgentId);
1798 } 1829 }
1799 else 1830 else
1800 { 1831 {
@@ -1804,6 +1835,7 @@ namespace OpenSim.Region.Framework.Scenes
1804 1835
1805 m_parentPosition = Vector3.Zero; 1836 m_parentPosition = Vector3.Zero;
1806 m_parentID = 0; 1837 m_parentID = 0;
1838 m_offsetRotation = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
1807 SendFullUpdateToAllClients(); 1839 SendFullUpdateToAllClients();
1808 m_requestedSitTargetID = 0; 1840 m_requestedSitTargetID = 0;
1809 1841
@@ -1904,6 +1936,7 @@ namespace OpenSim.Region.Framework.Scenes
1904 part.SetAvatarOnSitTarget(UUID); // set that Av will be on it 1936 part.SetAvatarOnSitTarget(UUID); // set that Av will be on it
1905 offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z); // change ofset to the scripted one 1937 offset = new Vector3(avSitOffSet.X, avSitOffSet.Y, avSitOffSet.Z); // change ofset to the scripted one
1906 sitOrientation = avSitOrientation; // Change rotatione to the scripted one 1938 sitOrientation = avSitOrientation; // Change rotatione to the scripted one
1939 OffsetRotation = avSitOrientation;
1907 autopilot = false; // Jump direct to scripted llSitPos() 1940 autopilot = false; // Jump direct to scripted llSitPos()
1908 } 1941 }
1909 else 1942 else
@@ -2311,6 +2344,7 @@ namespace OpenSim.Region.Framework.Scenes
2311 m_bodyRot = sitTargetOrient; 2344 m_bodyRot = sitTargetOrient;
2312 m_parentPosition = part.AbsolutePosition; 2345 m_parentPosition = part.AbsolutePosition;
2313 part.IsOccupied = true; 2346 part.IsOccupied = true;
2347 part.ParentGroup.AddAvatar(agentID);
2314Console.WriteLine("Scripted Sit ofset {0}", m_pos); 2348Console.WriteLine("Scripted Sit ofset {0}", m_pos);
2315 } 2349 }
2316 else 2350 else
@@ -2341,6 +2375,7 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
2341 2375
2342 m_parentPosition = part.AbsolutePosition; 2376 m_parentPosition = part.AbsolutePosition;
2343 part.IsOccupied = true; 2377 part.IsOccupied = true;
2378 part.ParentGroup.AddAvatar(agentID);
2344 m_pos = new Vector3(0f, 0f, 0.05f) + // corrections to get Sit Animation 2379 m_pos = new Vector3(0f, 0f, 0.05f) + // corrections to get Sit Animation
2345 (new Vector3(0.0f, 0f, 0.61f) * partIRot) + // located on center 2380 (new Vector3(0.0f, 0f, 0.61f) * partIRot) + // located on center
2346 (new Vector3(0.34f, 0f, 0.0f) * m_bodyRot) + 2381 (new Vector3(0.34f, 0f, 0.0f) * m_bodyRot) +