Only translate linked prim specified offset pos by the link prim rotation, not any specified avatar rotation as well.
Don't translate root prim position by avatar rotation.link-sitting
parent
36d146bf27
commit
a3c72dafe6
|
@ -2277,16 +2277,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
offset = part.SitTargetPosition;
|
offset = part.SitTargetPosition;
|
||||||
sitOrientation = part.SitTargetOrientation;
|
sitOrientation = part.SitTargetOrientation;
|
||||||
|
|
||||||
|
if (!part.IsRoot)
|
||||||
|
{
|
||||||
// m_log.DebugFormat("Old sit orient {0}", sitOrientation);
|
// m_log.DebugFormat("Old sit orient {0}", sitOrientation);
|
||||||
if (part.IsRoot)
|
|
||||||
sitOrientation = sitOrientation;
|
|
||||||
else
|
|
||||||
sitOrientation = part.RotationOffset * sitOrientation;
|
sitOrientation = part.RotationOffset * sitOrientation;
|
||||||
// m_log.DebugFormat("New sit orient {0}", sitOrientation);
|
// m_log.DebugFormat("New sit orient {0}", sitOrientation);
|
||||||
|
|
||||||
// m_log.DebugFormat("Old sit offset {0}", offset);
|
// m_log.DebugFormat("Old sit offset {0}", offset);
|
||||||
offset = offset * sitOrientation;
|
offset = offset * part.RotationOffset;
|
||||||
// m_log.DebugFormat("New sit offset {0}", offset);
|
// m_log.DebugFormat("New sit offset {0}", offset);
|
||||||
|
}
|
||||||
|
|
||||||
canSit = true;
|
canSit = true;
|
||||||
}
|
}
|
||||||
|
@ -2604,19 +2603,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//Quaternion result = (sitTargetOrient * vq) * nq;
|
//Quaternion result = (sitTargetOrient * vq) * nq;
|
||||||
|
|
||||||
Vector3 newPos = sitTargetPos + SIT_TARGET_ADJUSTMENT;
|
Vector3 newPos = sitTargetPos + SIT_TARGET_ADJUSTMENT;
|
||||||
|
Quaternion newRot;
|
||||||
|
|
||||||
if (part.IsRoot)
|
if (part.IsRoot)
|
||||||
Rotation = sitTargetOrient;
|
{
|
||||||
|
newRot = sitTargetOrient;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Rotation = part.RotationOffset * sitTargetOrient;
|
{
|
||||||
|
newPos = newPos * part.RotationOffset;
|
||||||
// m_log.DebugFormat("Old offset2 {0}", newPos);
|
newRot = part.RotationOffset * sitTargetOrient;
|
||||||
newPos = newPos * Rotation;
|
}
|
||||||
// m_log.DebugFormat("New offset2 {0}", newPos);
|
|
||||||
|
|
||||||
newPos += part.OffsetPosition;
|
newPos += part.OffsetPosition;
|
||||||
|
|
||||||
m_pos = newPos;
|
m_pos = newPos;
|
||||||
|
Rotation = newRot;
|
||||||
ParentPosition = part.AbsolutePosition;
|
ParentPosition = part.AbsolutePosition;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue