Refix sitting on child prims by reinserting relevant code back into SP.HandleAgentSit()

master-beforevarregion
Justin Clark-Casey (justincc) 2013-12-11 23:59:52 +00:00
parent 82ebb86d58
commit 1d605642f7
1 changed files with 22 additions and 3 deletions

View File

@ -2868,14 +2868,33 @@ namespace OpenSim.Region.Framework.Scenes
m_pos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT; m_pos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT;
// m_pos = sitTargetPos + SIT_TARGET_ADJUSTMENT - sitOffset; Vector3 newPos = sitTargetPos + sitOffset + SIT_TARGET_ADJUSTMENT;
Rotation = sitTargetOrient; Quaternion newRot;
if (part.IsRoot)
{
newRot = sitTargetOrient;
}
else
{
newPos = newPos * part.RotationOffset;
newRot = part.RotationOffset * sitTargetOrient;
}
newPos += part.OffsetPosition;
m_pos = newPos;
Rotation = newRot;
// ParentPosition = part.AbsolutePosition; // ParentPosition = part.AbsolutePosition;
part.ParentGroup.AddAvatar(UUID); part.ParentGroup.AddAvatar(UUID);
} }
else else
{ {
m_pos -= part.AbsolutePosition; // An viewer expects to specify sit positions as offsets to the root prim, even if a child prim is
// being sat upon.
m_pos -= part.GroupPosition;
// ParentPosition = part.AbsolutePosition; // ParentPosition = part.AbsolutePosition;
part.ParentGroup.AddAvatar(UUID); part.ParentGroup.AddAvatar(UUID);