diff options
author | Melanie | 2012-03-09 02:11:25 +0100 |
---|---|---|
committer | Melanie | 2012-03-09 02:11:25 +0100 |
commit | e1be1c5263e1a758fa96ecd62209413bc4d1ee86 (patch) | |
tree | 8efe359172acc45e69d10a966eda1b116e3d90de /OpenSim/Region/ClientStack | |
parent | Fix a merge artefact (diff) | |
parent | more changes on undo/redo group scaling seems to work better (diff) | |
download | opensim-SC_OLD-e1be1c5263e1a758fa96ecd62209413bc4d1ee86.zip opensim-SC_OLD-e1be1c5263e1a758fa96ecd62209413bc4d1ee86.tar.gz opensim-SC_OLD-e1be1c5263e1a758fa96ecd62209413bc4d1ee86.tar.bz2 opensim-SC_OLD-e1be1c5263e1a758fa96ecd62209413bc4d1ee86.tar.xz |
Merge branch 'ubitwork'
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 222 |
1 files changed, 155 insertions, 67 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index f835e56..051c4fa 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -11518,183 +11518,270 @@ 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); | ||
11613 | |||
11614 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; | ||
11580 | 11615 | ||
11616 | if (handlerUpdatePrimSinglePosition != null) | ||
11617 | { | ||
11618 | handlerUpdatePrimSinglePosition(localId, apos, this); | ||
11619 | } | ||
11620 | part.IgnoreUndoUpdate = false; | ||
11621 | } | ||
11622 | break; | ||
11623 | |||
11624 | case 0x15: //uniform scale and position | ||
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); | ||
11581 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; | 11637 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; |
11582 | if (handlerUpdatePrimSinglePosition != null) | 11638 | if (handlerUpdatePrimSinglePosition != null) |
11583 | { | 11639 | { |
11584 | handlerUpdatePrimSinglePosition(localId, pos11, this); | 11640 | handlerUpdatePrimSinglePosition(localId, apos, this); |
11585 | } | 11641 | } |
11642 | |||
11643 | part.IgnoreUndoUpdate = false; | ||
11586 | } | 11644 | } |
11587 | break; | 11645 | break; |
11588 | 11646 | ||
11589 | case 9: | 11647 | // now group related (bit 4) |
11590 | Vector3 pos2 = new Vector3(block.Data, 0); | 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 | ascale = 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, ascale, this); |
11689 | handlerUpdatePrimScale(localId, scale6, this); | 11774 | |
11690 | handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; | 11775 | handlerUpdateVector = OnUpdatePrimGroupPosition; |
11691 | if (handlerUpdatePrimSinglePosition != null) | 11776 | |
11777 | if (handlerUpdateVector != null) | ||
11692 | { | 11778 | { |
11693 | handlerUpdatePrimSinglePosition(localId, pos6, this); | 11779 | handlerUpdateVector(localId, apos, this); |
11694 | } | 11780 | } |
11695 | 11781 | ||
11696 | part.IgnoreUndoUpdate = false; | 11782 | part.IgnoreUndoUpdate = false; |
11697 | } | 11783 | } |
11784 | |||
11698 | break; | 11785 | break; |
11699 | 11786 | ||
11700 | default: | 11787 | default: |
@@ -11704,6 +11791,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11704 | 11791 | ||
11705 | // for (int j = 0; j < parts.Length; j++) | 11792 | // for (int j = 0; j < parts.Length; j++) |
11706 | // parts[j].IgnoreUndoUpdate = false; | 11793 | // parts[j].IgnoreUndoUpdate = false; |
11794 | |||
11707 | } | 11795 | } |
11708 | } | 11796 | } |
11709 | } | 11797 | } |