Fix issues with UpdateRootRotation and also increase efficiency

avinationmerge
Tom 2011-03-27 13:09:19 -07:00
parent 8338b74d3f
commit 553a195493
1 changed files with 8 additions and 7 deletions

View File

@ -3393,7 +3393,9 @@ namespace OpenSim.Region.Framework.Scenes
m_rootPart.Undoing = true;
cancelUndo = true;
}
m_rootPart.UpdateRotation(rot);
//Don't use UpdateRotation because it schedules an update prematurely
m_rootPart.RotationOffset = rot;
if (m_rootPart.PhysActor != null)
{
m_rootPart.PhysActor.Orientation = m_rootPart.RotationOffset;
@ -3408,14 +3410,13 @@ namespace OpenSim.Region.Framework.Scenes
{
prim.IgnoreUndoUpdate = true;
Vector3 axPos = prim.OffsetPosition;
axPos *= oldParentRot;
axPos *= Quaternion.Inverse(axRot);
prim.OffsetPosition = axPos;
Quaternion primsRot = prim.RotationOffset;
Quaternion newRot = primsRot * oldParentRot;
newRot *= Quaternion.Inverse(axRot);
prim.RotationOffset = newRot;
prim.ScheduleTerseUpdate();
prim.RotationOffset *= Quaternion.Inverse(prim.GetWorldRotation()) * (oldParentRot * prim.RotationOffset);
prim.IgnoreUndoUpdate = false;
}
}
@ -3424,7 +3425,7 @@ namespace OpenSim.Region.Framework.Scenes
m_rootPart.Undoing = false;
}
m_rootPart.ScheduleTerseUpdate();
ScheduleGroupForTerseUpdate();
}
#endregion