Fix undo for rotation of the root prim in a linkset on its own.
The only obviously broken things right now are the undo of the position of just a root prim (stays in place) and the fact that resizes need two undoes.bulletsim
parent
b2722e984a
commit
1fdb16f1cd
|
@ -3013,11 +3013,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="rot"></param>
|
/// <param name="rot"></param>
|
||||||
private void UpdateRootRotation(Quaternion rot)
|
public void UpdateRootRotation(Quaternion rot)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
// "[SCENE OBJECT GROUP]: Updating root rotation of {0} {1} to {2}",
|
"[SCENE OBJECT GROUP]: Updating root rotation of {0} {1} to {2}",
|
||||||
// Name, LocalId, rot);
|
Name, LocalId, rot);
|
||||||
|
|
||||||
Quaternion axRot = rot;
|
Quaternion axRot = rot;
|
||||||
Quaternion oldParentRot = m_rootPart.RotationOffset;
|
Quaternion oldParentRot = m_rootPart.RotationOffset;
|
||||||
|
@ -3046,6 +3046,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
newRot *= Quaternion.Inverse(axRot);
|
newRot *= Quaternion.Inverse(axRot);
|
||||||
prim.RotationOffset = newRot;
|
prim.RotationOffset = newRot;
|
||||||
prim.ScheduleTerseUpdate();
|
prim.ScheduleTerseUpdate();
|
||||||
|
prim.IgnoreUndoUpdate = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3054,12 +3055,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
SceneObjectPart childpart = parts[i];
|
SceneObjectPart childpart = parts[i];
|
||||||
if (childpart != m_rootPart)
|
if (childpart != m_rootPart)
|
||||||
{
|
{
|
||||||
childpart.IgnoreUndoUpdate = false;
|
// childpart.IgnoreUndoUpdate = false;
|
||||||
childpart.StoreUndoState();
|
// childpart.StoreUndoState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_rootPart.ScheduleTerseUpdate();
|
m_rootPart.ScheduleTerseUpdate();
|
||||||
|
|
||||||
|
m_log.DebugFormat(
|
||||||
|
"[SCENE OBJECT GROUP]: Updated root rotation of {0} {1} to {2}",
|
||||||
|
Name, LocalId, rot);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -150,8 +150,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
"[UNDO STATE]: Undoing rotation {0} to {1} for root part {2} {3}",
|
"[UNDO STATE]: Undoing rotation {0} to {1} for root part {2} {3}",
|
||||||
part.RotationOffset, Rotation, part.Name, part.LocalId);
|
part.RotationOffset, Rotation, part.Name, part.LocalId);
|
||||||
|
|
||||||
|
if (ForGroup)
|
||||||
part.UpdateRotation(Rotation);
|
part.UpdateRotation(Rotation);
|
||||||
//part.RotationOffset = Rotation;
|
else
|
||||||
|
part.ParentGroup.UpdateRootRotation(Rotation);
|
||||||
|
|
||||||
if (Scale != Vector3.Zero)
|
if (Scale != Vector3.Zero)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue