diff options
author | Melanie | 2010-11-27 01:25:02 +0000 |
---|---|---|
committer | Melanie | 2010-11-27 01:25:02 +0000 |
commit | a1ab2a22440bc446c1412f17d602e7c75deb0a7c (patch) | |
tree | 3a4e0d6be4fc74ed8d9781cfc8c9aacd3f3d684b /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | Merge branch 'master' into careminster-presence-refactor (diff) | |
parent | llUnsit position fix 4063 (updated 11-20-2010) (diff) | |
download | opensim-SC-a1ab2a22440bc446c1412f17d602e7c75deb0a7c.zip opensim-SC-a1ab2a22440bc446c1412f17d602e7c75deb0a7c.tar.gz opensim-SC-a1ab2a22440bc446c1412f17d602e7c75deb0a7c.tar.bz2 opensim-SC-a1ab2a22440bc446c1412f17d602e7c75deb0a7c.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 98a3b29..1e749da 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -464,16 +464,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
464 | // if (actor != null) | 464 | // if (actor != null) |
465 | if ((actor != null) && (m_parentID == 0)) // KF Do NOT update m_pos here if Av is sitting! | 465 | if ((actor != null) && (m_parentID == 0)) // KF Do NOT update m_pos here if Av is sitting! |
466 | m_pos = actor.Position; | 466 | m_pos = actor.Position; |
467 | 467 | else // OS Mantis #4063 | |
468 | // If we're sitting, we need to update our position | 468 | { // OS Mantis #4063 |
469 | if (m_parentID != 0) | 469 | // OpenSim Mantis #4063. Obtain the correct position of a seated avatar. In addition |
470 | { | 470 | // to providing the correct position while the avatar is seated, this value will also |
471 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); | 471 | // be used as the location to unsit to. |
472 | if (part != null) | 472 | // |
473 | m_parentPosition = part.AbsolutePosition; | 473 | // If m_parentID is not 0, assume we are a seated avatar and we should return the |
474 | } | 474 | // position based on the sittarget offset and rotation of the prim we are seated on. |
475 | 475 | // | |
476 | return m_parentPosition + m_pos; | 476 | // Generally, m_pos will contain the position of the avator in the sim unless the avatar |
477 | // is on a sit target. While on a sit target, m_pos will contain the desired offset | ||
478 | // without the parent rotation applied. | ||
479 | if (m_parentID != 0) // OS Mantis #4063 | ||
480 | { | ||
481 | SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); // OS Mantis #4063 | ||
482 | if (part != null) // OS Mantis #4063 | ||
483 | { // OS Mantis #4064 | ||
484 | return m_parentPosition + (m_pos * part.GetWorldRotation()); // OS Mantis #4063 | ||
485 | } | ||
486 | else // OS Mantis #4064 | ||
487 | { // OS Mantis #4063 | ||
488 | return m_parentPosition + m_pos; // OS Mantis #4064 | ||
489 | } // OS Mantis #4063 | ||
490 | } // OS Mantis #4063 | ||
491 | } // OS Mantis #4063 | ||
492 | |||
493 | return m_pos; // OS Mantis #4063 | ||
477 | } | 494 | } |
478 | set | 495 | set |
479 | { | 496 | { |