llUnsit position fix 4063 (updated 11-20-2010)

viewer-2-initial-appearance
Micheil Merlin 2010-11-20 21:49:37 -06:00 committed by Justin Clark-Casey (justincc)
parent a8a8fb6e13
commit 6ed63487d9
1 changed files with 26 additions and 1 deletions

View File

@ -445,8 +445,33 @@ namespace OpenSim.Region.Framework.Scenes
PhysicsActor actor = m_physicsActor; PhysicsActor actor = m_physicsActor;
if (actor != null) if (actor != null)
m_pos = actor.Position; m_pos = actor.Position;
else // OS Mantis #4063
{ // OS Mantis #4063
// OpenSim Mantis #4063. Obtain the correct position of a seated avatar. In addition
// to providing the correct position while the avatar is seated, this value will also
// be used as the location to unsit to.
//
// If m_parentID is not 0, assume we are a seated avatar and we should return the
// position based on the sittarget offset and rotation of the prim we are seated on.
//
// Generally, m_pos will contain the position of the avator in the sim unless the avatar
// is on a sit target. While on a sit target, m_pos will contain the desired offset
// without the parent rotation applied.
if (m_parentID != 0) // OS Mantis #4063
{
SceneObjectPart part = m_scene.GetSceneObjectPart(m_parentID); // OS Mantis #4063
if (part != null) // OS Mantis #4063
{ // OS Mantis #4064
return m_parentPosition + (m_pos * part.GetWorldRotation()); // OS Mantis #4063
}
else // OS Mantis #4064
{ // OS Mantis #4063
return m_parentPosition + m_pos; // OS Mantis #4064
} // OS Mantis #4063
} // OS Mantis #4063
} // OS Mantis #4063
return m_parentPosition + m_pos; return m_pos; // OS Mantis #4063
} }
set set
{ {