diff options
author | UbitUmarov | 2012-03-09 01:53:58 +0000 |
---|---|---|
committer | UbitUmarov | 2012-03-09 01:53:58 +0000 |
commit | 05cdf9bda910ced0da29474b8b40a58e8a423d69 (patch) | |
tree | f436b0dbfe714f50bc8bf6491e6e0e576b9ac744 | |
parent | Hold a ref to the prim we're sat on rather than querying scene each time (diff) | |
download | opensim-SC-05cdf9bda910ced0da29474b8b40a58e8a423d69.zip opensim-SC-05cdf9bda910ced0da29474b8b40a58e8a423d69.tar.gz opensim-SC-05cdf9bda910ced0da29474b8b40a58e8a423d69.tar.bz2 opensim-SC-05cdf9bda910ced0da29474b8b40a58e8a423d69.tar.xz |
more changes in undo/redo. Basicly moved control to llclientview.cs. later we can move back to a dispatcher function on SOG that handles the several cases( in a viwer independent way (?)) and calls current exec funtions. made cosmetic changes replacing decimals by hexs so bits are easier to read. Changed behavour of case 12 and 28 ( 0x0c and 0x1c) to make identical to 0x0d and 0x1d ( scale only and scale plus position). DOn't see 12 and 28 in use... cases 1c and 1d still broken
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 221 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 62 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 |
3 files changed, 187 insertions, 100 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index f835e56..c7fc827 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -11518,183 +11518,269 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11518 | // } | 11518 | // } |
11519 | 11519 | ||
11520 | UpdatePrimGroupRotation handlerUpdatePrimGroupRotation; | 11520 | UpdatePrimGroupRotation handlerUpdatePrimGroupRotation; |
11521 | UpdateVector handlerUpdatePrimGroupScale; | ||
11522 | |||
11523 | Quaternion arot; | ||
11524 | Vector3 ascale; | ||
11525 | Vector3 apos; | ||
11526 | /*ubit from ll JIRA: | ||
11527 | * 0x01 position | ||
11528 | * 0x02 rotation | ||
11529 | * 0x04 scale | ||
11530 | |||
11531 | * 0x08 LINK_SET | ||
11532 | * 0x10 UNIFORM for scale | ||
11533 | */ | ||
11534 | |||
11521 | 11535 | ||
11522 | switch (block.Type) | 11536 | switch (block.Type) |
11523 | { | 11537 | { |
11524 | case 1: | 11538 | case 1: //change position sp |
11525 | Vector3 pos1 = new Vector3(block.Data, 0); | 11539 | apos = new Vector3(block.Data, 0); |
11526 | 11540 | ||
11527 | UpdateVector handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; | 11541 | UpdateVector handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; |
11528 | if (handlerUpdatePrimSinglePosition != null) | 11542 | if (handlerUpdatePrimSinglePosition != null) |
11529 | { | 11543 | { |
11544 | part.StoreUndoState(); | ||
11545 | part.IgnoreUndoUpdate = true; | ||
11546 | |||
11530 | // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); | 11547 | // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); |
11531 | handlerUpdatePrimSinglePosition(localId, pos1, this); | 11548 | handlerUpdatePrimSinglePosition(localId, apos, this); |
11549 | |||
11550 | part.IgnoreUndoUpdate = false; | ||
11532 | } | 11551 | } |
11533 | break; | 11552 | break; |
11534 | 11553 | ||
11535 | case 2: | 11554 | case 2: // rotation sp |
11536 | Quaternion rot1 = new Quaternion(block.Data, 0, true); | 11555 | arot = new Quaternion(block.Data, 0, true); |
11537 | 11556 | ||
11538 | UpdatePrimSingleRotation handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; | 11557 | UpdatePrimSingleRotation handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; |
11539 | if (handlerUpdatePrimSingleRotation != null) | 11558 | if (handlerUpdatePrimSingleRotation != null) |
11540 | { | 11559 | { |
11541 | // m_log.Info("new tab rotation is " + rot1.X + " , " + rot1.Y + " , " + rot1.Z + " , " + rot1.W); | 11560 | part.StoreUndoState(); |
11542 | handlerUpdatePrimSingleRotation(localId, rot1, this); | 11561 | part.IgnoreUndoUpdate = true; |
11562 | |||
11563 | handlerUpdatePrimSingleRotation(localId, arot, this); | ||
11564 | |||
11565 | part.IgnoreUndoUpdate = false; | ||
11543 | } | 11566 | } |
11544 | break; | 11567 | break; |
11545 | 11568 | ||
11546 | case 3: | 11569 | case 3: // position plus rotation |
11547 | Vector3 rotPos = new Vector3(block.Data, 0); | 11570 | apos = new Vector3(block.Data, 0); |
11548 | Quaternion rot2 = new Quaternion(block.Data, 12, true); | 11571 | arot = new Quaternion(block.Data, 12, true); |
11549 | 11572 | ||
11550 | UpdatePrimSingleRotationPosition handlerUpdatePrimSingleRotationPosition = OnUpdatePrimSingleRotationPosition; | 11573 | UpdatePrimSingleRotationPosition handlerUpdatePrimSingleRotationPosition = OnUpdatePrimSingleRotationPosition; |
11551 | if (handlerUpdatePrimSingleRotationPosition != null) | 11574 | if (handlerUpdatePrimSingleRotationPosition != null) |
11552 | { | 11575 | { |
11553 | // m_log.Debug("new mouse rotation position is " + rotPos.X + " , " + rotPos.Y + " , " + rotPos.Z); | 11576 | part.StoreUndoState(); |
11554 | // m_log.Info("new mouse rotation is " + rot2.X + " , " + rot2.Y + " , " + rot2.Z + " , " + rot2.W); | 11577 | part.IgnoreUndoUpdate = true; |
11555 | handlerUpdatePrimSingleRotationPosition(localId, rot2, rotPos, this); | 11578 | |
11579 | handlerUpdatePrimSingleRotationPosition(localId, arot, apos, this); | ||
11580 | |||
11581 | part.IgnoreUndoUpdate = false; | ||
11556 | } | 11582 | } |
11557 | break; | 11583 | break; |
11558 | 11584 | ||
11559 | case 4: | 11585 | case 4: // scale sp |
11560 | case 20: | 11586 | case 0x14: // uniform scale sp |
11561 | Vector3 scale4 = new Vector3(block.Data, 0); | 11587 | ascale = new Vector3(block.Data, 0); |
11562 | 11588 | ||
11563 | UpdateVector handlerUpdatePrimScale = OnUpdatePrimScale; | 11589 | UpdateVector handlerUpdatePrimScale = OnUpdatePrimScale; |
11564 | if (handlerUpdatePrimScale != null) | 11590 | if (handlerUpdatePrimScale != null) |
11565 | { | 11591 | { |
11566 | // m_log.Debug("new scale is " + scale4.X + " , " + scale4.Y + " , " + scale4.Z); | 11592 | part.StoreUndoState(); |
11567 | handlerUpdatePrimScale(localId, scale4, this); | 11593 | part.IgnoreUndoUpdate = true; |
11594 | |||
11595 | handlerUpdatePrimScale(localId, ascale, this); | ||
11596 | |||
11597 | part.IgnoreUndoUpdate = false; | ||
11568 | } | 11598 | } |
11569 | break; | 11599 | break; |
11570 | 11600 | ||
11571 | case 5: | 11601 | case 5: // scale and position sp |
11572 | Vector3 scale1 = new Vector3(block.Data, 12); | 11602 | apos = new Vector3(block.Data, 0); |
11573 | Vector3 pos11 = new Vector3(block.Data, 0); | 11603 | ascale = new Vector3(block.Data, 12); |
11604 | |||
11574 | 11605 | ||
11575 | handlerUpdatePrimScale = OnUpdatePrimScale; | 11606 | handlerUpdatePrimScale = OnUpdatePrimScale; |
11576 | if (handlerUpdatePrimScale != null) | 11607 | if (handlerUpdatePrimScale != null) |
11577 | { | 11608 | { |
11578 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 11609 | part.StoreUndoState(); |
11579 | handlerUpdatePrimScale(localId, scale1, this); | 11610 | part.IgnoreUndoUpdate = true; |
11611 | |||
11612 | handlerUpdatePrimScale(localId, ascale, this); | ||
11580 | 11613 | ||
11581 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; | 11614 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; |
11615 | |||
11582 | if (handlerUpdatePrimSinglePosition != null) | 11616 | if (handlerUpdatePrimSinglePosition != null) |
11583 | { | 11617 | { |
11584 | handlerUpdatePrimSinglePosition(localId, pos11, this); | 11618 | handlerUpdatePrimSinglePosition(localId, apos, this); |
11585 | } | 11619 | } |
11620 | part.IgnoreUndoUpdate = false; | ||
11586 | } | 11621 | } |
11587 | break; | 11622 | break; |
11588 | 11623 | ||
11589 | case 9: | 11624 | case 0x15: //uniform scale and position |
11590 | Vector3 pos2 = new Vector3(block.Data, 0); | 11625 | apos = new Vector3(block.Data, 0); |
11626 | ascale = new Vector3(block.Data, 12); | ||
11627 | |||
11628 | |||
11629 | handlerUpdatePrimScale = OnUpdatePrimScale; | ||
11630 | if (handlerUpdatePrimScale != null) | ||
11631 | { | ||
11632 | part.StoreUndoState(false); | ||
11633 | part.IgnoreUndoUpdate = true; | ||
11634 | |||
11635 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | ||
11636 | handlerUpdatePrimScale(localId, ascale, this); | ||
11637 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; | ||
11638 | if (handlerUpdatePrimSinglePosition != null) | ||
11639 | { | ||
11640 | handlerUpdatePrimSinglePosition(localId, apos, this); | ||
11641 | } | ||
11642 | |||
11643 | part.IgnoreUndoUpdate = false; | ||
11644 | } | ||
11645 | break; | ||
11646 | |||
11647 | // now group related (bit 4) | ||
11648 | case 9: //( 8 + 1 )group position | ||
11649 | apos = new Vector3(block.Data, 0); | ||
11591 | 11650 | ||
11592 | UpdateVector handlerUpdateVector = OnUpdatePrimGroupPosition; | 11651 | UpdateVector handlerUpdateVector = OnUpdatePrimGroupPosition; |
11593 | 11652 | ||
11594 | if (handlerUpdateVector != null) | 11653 | if (handlerUpdateVector != null) |
11595 | { | 11654 | { |
11596 | handlerUpdateVector(localId, pos2, this); | 11655 | part.StoreUndoState(true); |
11656 | part.IgnoreUndoUpdate = true; | ||
11657 | |||
11658 | handlerUpdateVector(localId, apos, this); | ||
11659 | |||
11660 | part.IgnoreUndoUpdate = false; | ||
11597 | } | 11661 | } |
11598 | break; | 11662 | break; |
11599 | 11663 | ||
11600 | case 10: | 11664 | case 0x0A: // (8 + 2) group rotation |
11601 | Quaternion rot3 = new Quaternion(block.Data, 0, true); | 11665 | arot = new Quaternion(block.Data, 0, true); |
11602 | 11666 | ||
11603 | UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; | 11667 | UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; |
11604 | if (handlerUpdatePrimRotation != null) | 11668 | if (handlerUpdatePrimRotation != null) |
11605 | { | 11669 | { |
11606 | // Console.WriteLine("new rotation is " + rot3.X + " , " + rot3.Y + " , " + rot3.Z + " , " + rot3.W); | 11670 | // Console.WriteLine("new rotation is " + rot3.X + " , " + rot3.Y + " , " + rot3.Z + " , " + rot3.W); |
11607 | handlerUpdatePrimRotation(localId, rot3, this); | 11671 | part.StoreUndoState(true); |
11672 | part.IgnoreUndoUpdate = true; | ||
11673 | |||
11674 | handlerUpdatePrimRotation(localId, arot, this); | ||
11675 | |||
11676 | part.IgnoreUndoUpdate = false; | ||
11608 | } | 11677 | } |
11609 | break; | 11678 | break; |
11610 | 11679 | ||
11611 | case 11: | 11680 | case 0x0B: //( 8 + 2 + 1) group rotation and position |
11612 | Vector3 pos3 = new Vector3(block.Data, 0); | 11681 | apos = new Vector3(block.Data, 0); |
11613 | Quaternion rot4 = new Quaternion(block.Data, 12, true); | 11682 | arot = new Quaternion(block.Data, 12, true); |
11614 | 11683 | ||
11615 | handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation; | 11684 | handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation; |
11616 | if (handlerUpdatePrimGroupRotation != null) | 11685 | if (handlerUpdatePrimGroupRotation != null) |
11617 | { | 11686 | { |
11618 | // m_log.Debug("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); | 11687 | // m_log.Debug("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); |
11619 | // m_log.Debug("new group mouse rotation is " + rot4.X + " , " + rot4.Y + " , " + rot4.Z + " , " + rot4.W); | 11688 | // m_log.Debug("new group mouse rotation is " + rot4.X + " , " + rot4.Y + " , " + rot4.Z + " , " + rot4.W); |
11620 | handlerUpdatePrimGroupRotation(localId, pos3, rot4, this); | 11689 | part.StoreUndoState(true); |
11690 | part.IgnoreUndoUpdate = true; | ||
11691 | |||
11692 | handlerUpdatePrimGroupRotation(localId, apos, arot, this); | ||
11693 | |||
11694 | part.IgnoreUndoUpdate = false; | ||
11621 | } | 11695 | } |
11622 | break; | 11696 | break; |
11623 | case 12: | ||
11624 | case 28: | ||
11625 | Vector3 scale7 = new Vector3(block.Data, 0); | ||
11626 | 11697 | ||
11627 | UpdateVector handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; | 11698 | case 0x0C: // (8 + 4) group scale |
11628 | if (handlerUpdatePrimGroupScale != null) | 11699 | // only afects root prim and only sent by viewer editor object tab scaling |
11700 | // mouse edition only allows uniform scaling | ||
11701 | // SL MAY CHANGE THIS in viewers | ||
11702 | |||
11703 | ascale = new Vector3(block.Data, 0); | ||
11704 | |||
11705 | handlerUpdatePrimScale = OnUpdatePrimScale; | ||
11706 | if (handlerUpdatePrimScale != null) | ||
11629 | { | 11707 | { |
11630 | // m_log.Debug("new scale is " + scale7.X + " , " + scale7.Y + " , " + scale7.Z); | 11708 | // m_log.Debug("new scale is " + scale7.X + " , " + scale7.Y + " , " + scale7.Z); |
11631 | handlerUpdatePrimGroupScale(localId, scale7, this); | 11709 | part.StoreUndoState(false); // <- SL Exception make it apply to root prim and not group |
11710 | part.IgnoreUndoUpdate = true; | ||
11711 | |||
11712 | handlerUpdatePrimScale(localId, ascale, this); | ||
11713 | |||
11714 | part.IgnoreUndoUpdate = false; | ||
11632 | } | 11715 | } |
11633 | break; | 11716 | break; |
11634 | 11717 | ||
11635 | case 13: | 11718 | case 0x0D: //(8 + 4 + 1) group scale and position |
11636 | Vector3 scale2 = new Vector3(block.Data, 12); | 11719 | // exception as above |
11637 | Vector3 pos4 = new Vector3(block.Data, 0); | ||
11638 | 11720 | ||
11721 | apos = new Vector3(block.Data, 0); | ||
11722 | ascale = new Vector3(block.Data, 12); | ||
11723 | |||
11639 | handlerUpdatePrimScale = OnUpdatePrimScale; | 11724 | handlerUpdatePrimScale = OnUpdatePrimScale; |
11640 | if (handlerUpdatePrimScale != null) | 11725 | if (handlerUpdatePrimScale != null) |
11641 | { | 11726 | { |
11642 | //m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 11727 | //m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); |
11643 | handlerUpdatePrimScale(localId, scale2, this); | 11728 | part.StoreUndoState(false); // <- make it apply to root prim and not group |
11729 | part.IgnoreUndoUpdate = true; | ||
11730 | |||
11731 | handlerUpdatePrimScale(localId, ascale, this); | ||
11644 | 11732 | ||
11645 | // Change the position based on scale (for bug number 246) | 11733 | // Change the position based on scale (for bug number 246) |
11646 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; | 11734 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; |
11647 | // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); | 11735 | // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); |
11648 | if (handlerUpdatePrimSinglePosition != null) | 11736 | if (handlerUpdatePrimSinglePosition != null) |
11649 | { | 11737 | { |
11650 | handlerUpdatePrimSinglePosition(localId, pos4, this); | 11738 | handlerUpdatePrimSinglePosition(localId, apos, this); |
11651 | } | 11739 | } |
11740 | |||
11741 | part.IgnoreUndoUpdate = false; | ||
11652 | } | 11742 | } |
11653 | break; | 11743 | break; |
11654 | 11744 | ||
11655 | case 29: | 11745 | case 0x1C: // (0x10 + 8 + 4 ) group scale UNIFORM |
11656 | Vector3 scale5 = new Vector3(block.Data, 12); | 11746 | ascale = new Vector3(block.Data, 0); |
11657 | Vector3 pos5 = new Vector3(block.Data, 0); | ||
11658 | 11747 | ||
11659 | handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; | 11748 | handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; |
11660 | if (handlerUpdatePrimGroupScale != null) | 11749 | if (handlerUpdatePrimGroupScale != null) |
11661 | { | 11750 | { |
11662 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 11751 | // m_log.Debug("new scale is " + scale7.X + " , " + scale7.Y + " , " + scale7.Z); |
11663 | part.StoreUndoState(true); | 11752 | part.StoreUndoState(true); |
11664 | part.IgnoreUndoUpdate = true; | 11753 | part.IgnoreUndoUpdate = true; |
11665 | handlerUpdatePrimGroupScale(localId, scale5, this); | ||
11666 | handlerUpdateVector = OnUpdatePrimGroupPosition; | ||
11667 | 11754 | ||
11668 | if (handlerUpdateVector != null) | 11755 | handlerUpdatePrimGroupScale(localId, ascale, this); |
11669 | { | ||
11670 | handlerUpdateVector(localId, pos5, this); | ||
11671 | } | ||
11672 | 11756 | ||
11673 | part.IgnoreUndoUpdate = false; | 11757 | part.IgnoreUndoUpdate = false; |
11674 | } | 11758 | } |
11675 | |||
11676 | break; | 11759 | break; |
11677 | 11760 | ||
11678 | case 21: | 11761 | case 0x1D: // (UNIFORM + GROUP + SCALE + POS) |
11679 | Vector3 scale6 = new Vector3(block.Data, 12); | 11762 | apos = new Vector3(block.Data, 0); |
11680 | Vector3 pos6 = new Vector3(block.Data, 0); | 11763 | Vector3 scale5 = new Vector3(block.Data, 12); |
11764 | |||
11681 | 11765 | ||
11682 | handlerUpdatePrimScale = OnUpdatePrimScale; | 11766 | handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; |
11683 | if (handlerUpdatePrimScale != null) | 11767 | if (handlerUpdatePrimGroupScale != null) |
11684 | { | 11768 | { |
11685 | part.StoreUndoState(false); | 11769 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); |
11770 | part.StoreUndoState(true); | ||
11686 | part.IgnoreUndoUpdate = true; | 11771 | part.IgnoreUndoUpdate = true; |
11687 | 11772 | ||
11688 | // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); | 11773 | handlerUpdatePrimGroupScale(localId, scale5, this); |
11689 | handlerUpdatePrimScale(localId, scale6, this); | 11774 | handlerUpdateVector = OnUpdatePrimGroupPosition; |
11690 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; | 11775 | |
11691 | if (handlerUpdatePrimSinglePosition != null) | 11776 | if (handlerUpdateVector != null) |
11692 | { | 11777 | { |
11693 | handlerUpdatePrimSinglePosition(localId, pos6, this); | 11778 | handlerUpdateVector(localId, apos, this); |
11694 | } | 11779 | } |
11695 | 11780 | ||
11696 | part.IgnoreUndoUpdate = false; | 11781 | part.IgnoreUndoUpdate = false; |
11697 | } | 11782 | } |
11783 | |||
11698 | break; | 11784 | break; |
11699 | 11785 | ||
11700 | default: | 11786 | default: |
@@ -11704,6 +11790,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11704 | 11790 | ||
11705 | // for (int j = 0; j < parts.Length; j++) | 11791 | // for (int j = 0; j < parts.Length; j++) |
11706 | // parts[j].IgnoreUndoUpdate = false; | 11792 | // parts[j].IgnoreUndoUpdate = false; |
11793 | |||
11707 | } | 11794 | } |
11708 | } | 11795 | } |
11709 | } | 11796 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 038eaa4..2d71372 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1569,7 +1569,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1569 | // "[SCENE OBJECT GROUP]: Processing OnGrabPart for {0} on {1} {2}, offsetPos {3}", | 1569 | // "[SCENE OBJECT GROUP]: Processing OnGrabPart for {0} on {1} {2}, offsetPos {3}", |
1570 | // remoteClient.Name, part.Name, part.LocalId, offsetPos); | 1570 | // remoteClient.Name, part.Name, part.LocalId, offsetPos); |
1571 | 1571 | ||
1572 | part.StoreUndoState(); | 1572 | // part.StoreUndoState(); |
1573 | part.OnGrab(offsetPos, remoteClient); | 1573 | part.OnGrab(offsetPos, remoteClient); |
1574 | } | 1574 | } |
1575 | 1575 | ||
@@ -3119,7 +3119,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3119 | { | 3119 | { |
3120 | // m_log.DebugFormat( | 3120 | // m_log.DebugFormat( |
3121 | // "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale); | 3121 | // "[SCENE OBJECT GROUP]: Group resizing {0} {1} from {2} to {3}", Name, LocalId, RootPart.Scale, scale); |
3122 | RootPart.StoreUndoState(true); | 3122 | // RootPart.StoreUndoState(true); |
3123 | 3123 | ||
3124 | scale.X = Math.Min(scale.X, Scene.m_maxNonphys); | 3124 | scale.X = Math.Min(scale.X, Scene.m_maxNonphys); |
3125 | scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); | 3125 | scale.Y = Math.Min(scale.Y, Scene.m_maxNonphys); |
@@ -3230,7 +3230,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3230 | 3230 | ||
3231 | if (obPart.UUID != m_rootPart.UUID) | 3231 | if (obPart.UUID != m_rootPart.UUID) |
3232 | { | 3232 | { |
3233 | obPart.IgnoreUndoUpdate = true; | 3233 | // obPart.IgnoreUndoUpdate = true; |
3234 | 3234 | ||
3235 | Vector3 currentpos = new Vector3(obPart.OffsetPosition); | 3235 | Vector3 currentpos = new Vector3(obPart.OffsetPosition); |
3236 | currentpos.X *= x; | 3236 | currentpos.X *= x; |
@@ -3245,7 +3245,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3245 | obPart.Resize(newSize); | 3245 | obPart.Resize(newSize); |
3246 | obPart.UpdateOffSet(currentpos); | 3246 | obPart.UpdateOffSet(currentpos); |
3247 | 3247 | ||
3248 | obPart.IgnoreUndoUpdate = false; | 3248 | // obPart.IgnoreUndoUpdate = false; |
3249 | } | 3249 | } |
3250 | 3250 | ||
3251 | // obPart.IgnoreUndoUpdate = false; | 3251 | // obPart.IgnoreUndoUpdate = false; |
@@ -3270,7 +3270,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3270 | { | 3270 | { |
3271 | // m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos); | 3271 | // m_log.DebugFormat("[SCENE OBJECT GROUP]: Updating group position on {0} {1} to {2}", Name, LocalId, pos); |
3272 | 3272 | ||
3273 | RootPart.StoreUndoState(true); | 3273 | // RootPart.StoreUndoState(true); |
3274 | 3274 | ||
3275 | // SceneObjectPart[] parts = m_parts.GetArray(); | 3275 | // SceneObjectPart[] parts = m_parts.GetArray(); |
3276 | // for (int i = 0; i < parts.Length; i++) | 3276 | // for (int i = 0; i < parts.Length; i++) |
@@ -3311,17 +3311,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
3311 | { | 3311 | { |
3312 | SceneObjectPart part = GetChildPart(localID); | 3312 | SceneObjectPart part = GetChildPart(localID); |
3313 | 3313 | ||
3314 | SceneObjectPart[] parts = m_parts.GetArray(); | 3314 | // SceneObjectPart[] parts = m_parts.GetArray(); |
3315 | for (int i = 0; i < parts.Length; i++) | 3315 | // for (int i = 0; i < parts.Length; i++) |
3316 | parts[i].StoreUndoState(); | 3316 | // parts[i].StoreUndoState(); |
3317 | 3317 | ||
3318 | if (part != null) | 3318 | if (part != null) |
3319 | { | 3319 | { |
3320 | // m_log.DebugFormat( | 3320 | // m_log.DebugFormat( |
3321 | // "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos); | 3321 | // "[SCENE OBJECT GROUP]: Updating single position of {0} {1} to {2}", part.Name, part.LocalId, pos); |
3322 | 3322 | ||
3323 | part.StoreUndoState(false); | 3323 | // part.StoreUndoState(false); |
3324 | part.IgnoreUndoUpdate = true; | 3324 | // part.IgnoreUndoUpdate = true; |
3325 | 3325 | ||
3326 | // unlock parts position change | 3326 | // unlock parts position change |
3327 | if (m_rootPart.PhysActor != null) | 3327 | if (m_rootPart.PhysActor != null) |
@@ -3340,7 +3340,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3340 | m_rootPart.PhysActor.Building = false; | 3340 | m_rootPart.PhysActor.Building = false; |
3341 | 3341 | ||
3342 | HasGroupChanged = true; | 3342 | HasGroupChanged = true; |
3343 | part.IgnoreUndoUpdate = false; | 3343 | // part.IgnoreUndoUpdate = false; |
3344 | } | 3344 | } |
3345 | } | 3345 | } |
3346 | 3346 | ||
@@ -3377,16 +3377,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
3377 | } | 3377 | } |
3378 | 3378 | ||
3379 | //We have to set undoing here because otherwise an undo state will be saved | 3379 | //We have to set undoing here because otherwise an undo state will be saved |
3380 | if (!m_rootPart.Undoing) | 3380 | // if (!m_rootPart.Undoing) |
3381 | { | 3381 | // { |
3382 | m_rootPart.Undoing = true; | 3382 | // m_rootPart.Undoing = true; |
3383 | AbsolutePosition = newPos; | ||
3384 | m_rootPart.Undoing = false; | ||
3385 | } | ||
3386 | else | ||
3387 | { | ||
3388 | AbsolutePosition = newPos; | 3383 | AbsolutePosition = newPos; |
3389 | } | 3384 | // m_rootPart.Undoing = false; |
3385 | // } | ||
3386 | // else | ||
3387 | // { | ||
3388 | // AbsolutePosition = newPos; | ||
3389 | // } | ||
3390 | 3390 | ||
3391 | HasGroupChanged = true; | 3391 | HasGroupChanged = true; |
3392 | if (m_rootPart.Undoing) | 3392 | if (m_rootPart.Undoing) |
@@ -3416,9 +3416,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3416 | // for (int i = 0; i < parts.Length; i++) | 3416 | // for (int i = 0; i < parts.Length; i++) |
3417 | // parts[i].StoreUndoState(); | 3417 | // parts[i].StoreUndoState(); |
3418 | 3418 | ||
3419 | m_rootPart.StoreUndoState(true); | 3419 | // m_rootPart.StoreUndoState(true); |
3420 | 3420 | ||
3421 | m_rootPart.UpdateRotation(rot); | 3421 | // m_rootPart.UpdateRotation(rot); |
3422 | 3422 | ||
3423 | PhysicsActor actor = m_rootPart.PhysActor; | 3423 | PhysicsActor actor = m_rootPart.PhysActor; |
3424 | if (actor != null) | 3424 | if (actor != null) |
@@ -3445,8 +3445,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3445 | // for (int i = 0; i < parts.Length; i++) | 3445 | // for (int i = 0; i < parts.Length; i++) |
3446 | // parts[i].StoreUndoState(); | 3446 | // parts[i].StoreUndoState(); |
3447 | 3447 | ||
3448 | RootPart.StoreUndoState(true); | 3448 | // RootPart.StoreUndoState(true); |
3449 | RootPart.IgnoreUndoUpdate = true; | 3449 | // RootPart.IgnoreUndoUpdate = true; |
3450 | 3450 | ||
3451 | m_rootPart.UpdateRotation(rot); | 3451 | m_rootPart.UpdateRotation(rot); |
3452 | 3452 | ||
@@ -3462,7 +3462,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3462 | HasGroupChanged = true; | 3462 | HasGroupChanged = true; |
3463 | ScheduleGroupForTerseUpdate(); | 3463 | ScheduleGroupForTerseUpdate(); |
3464 | 3464 | ||
3465 | RootPart.IgnoreUndoUpdate = false; | 3465 | // RootPart.IgnoreUndoUpdate = false; |
3466 | } | 3466 | } |
3467 | 3467 | ||
3468 | /// <summary> | 3468 | /// <summary> |
@@ -3511,8 +3511,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3511 | // "[SCENE OBJECT GROUP]: Updating single position and rotation of {0} {1} to {2}", | 3511 | // "[SCENE OBJECT GROUP]: Updating single position and rotation of {0} {1} to {2}", |
3512 | // part.Name, part.LocalId, rot); | 3512 | // part.Name, part.LocalId, rot); |
3513 | 3513 | ||
3514 | part.StoreUndoState(); | 3514 | // part.StoreUndoState(); |
3515 | part.IgnoreUndoUpdate = true; | 3515 | // part.IgnoreUndoUpdate = true; |
3516 | 3516 | ||
3517 | if (m_rootPart.PhysActor != null) | 3517 | if (m_rootPart.PhysActor != null) |
3518 | m_rootPart.PhysActor.Building = true; | 3518 | m_rootPart.PhysActor.Building = true; |
@@ -3541,7 +3541,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3541 | if (m_rootPart.PhysActor != null) | 3541 | if (m_rootPart.PhysActor != null) |
3542 | m_rootPart.PhysActor.Building = false; | 3542 | m_rootPart.PhysActor.Building = false; |
3543 | 3543 | ||
3544 | part.IgnoreUndoUpdate = false; | 3544 | // part.IgnoreUndoUpdate = false; |
3545 | } | 3545 | } |
3546 | } | 3546 | } |
3547 | 3547 | ||
@@ -3557,7 +3557,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3557 | 3557 | ||
3558 | Quaternion axRot = rot; | 3558 | Quaternion axRot = rot; |
3559 | Quaternion oldParentRot = m_rootPart.RotationOffset; | 3559 | Quaternion oldParentRot = m_rootPart.RotationOffset; |
3560 | m_rootPart.StoreUndoState(); | 3560 | // m_rootPart.StoreUndoState(); |
3561 | 3561 | ||
3562 | //Don't use UpdateRotation because it schedules an update prematurely | 3562 | //Don't use UpdateRotation because it schedules an update prematurely |
3563 | m_rootPart.RotationOffset = rot; | 3563 | m_rootPart.RotationOffset = rot; |
@@ -3573,7 +3573,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3573 | SceneObjectPart prim = parts[i]; | 3573 | SceneObjectPart prim = parts[i]; |
3574 | if (prim.UUID != m_rootPart.UUID) | 3574 | if (prim.UUID != m_rootPart.UUID) |
3575 | { | 3575 | { |
3576 | prim.IgnoreUndoUpdate = true; | 3576 | // prim.IgnoreUndoUpdate = true; |
3577 | 3577 | ||
3578 | Quaternion NewRot = oldParentRot * prim.RotationOffset; | 3578 | Quaternion NewRot = oldParentRot * prim.RotationOffset; |
3579 | NewRot = Quaternion.Inverse(axRot) * NewRot; | 3579 | NewRot = Quaternion.Inverse(axRot) * NewRot; |
@@ -3585,7 +3585,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3585 | axPos *= Quaternion.Inverse(axRot); | 3585 | axPos *= Quaternion.Inverse(axRot); |
3586 | prim.OffsetPosition = axPos; | 3586 | prim.OffsetPosition = axPos; |
3587 | 3587 | ||
3588 | prim.IgnoreUndoUpdate = false; | 3588 | // prim.IgnoreUndoUpdate = false; |
3589 | } | 3589 | } |
3590 | } | 3590 | } |
3591 | 3591 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 8dd2c76..4ba04c1 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -828,7 +828,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
828 | 828 | ||
829 | set | 829 | set |
830 | { | 830 | { |
831 | StoreUndoState(); | 831 | // StoreUndoState(); |
832 | m_rotationOffset = value; | 832 | m_rotationOffset = value; |
833 | 833 | ||
834 | PhysicsActor actor = PhysActor; | 834 | PhysicsActor actor = PhysActor; |
@@ -1007,7 +1007,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1007 | { | 1007 | { |
1008 | if (m_shape != null) | 1008 | if (m_shape != null) |
1009 | { | 1009 | { |
1010 | StoreUndoState(); | 1010 | // StoreUndoState(); |
1011 | 1011 | ||
1012 | m_shape.Scale = value; | 1012 | m_shape.Scale = value; |
1013 | 1013 | ||