diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-08-12 17:29:50 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-08-12 17:29:50 +0000 |
commit | 80be4c1d2d73982ea2df6dd7ef3fc3465416c882 (patch) | |
tree | 9c5958572368be494b6302db8b03967a2c67b7ad /indra/newview/llpanelobject.cpp | |
parent | a09f7d41efdb945755efaeb07f7418c1f6e2a78b (diff) |
QAR-767 Combined maint-render-7 and maint-viewer-9 merge
merge release@93398 viewer-merge-1@94007 -> release
dataserver-is-deprecated
Diffstat (limited to 'indra/newview/llpanelobject.cpp')
-rw-r--r-- | indra/newview/llpanelobject.cpp | 60 |
1 files changed, 49 insertions, 11 deletions
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index b181aff62d..d3fb041bad 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -1546,7 +1546,7 @@ void LLPanelObject::getVolumeParams(LLVolumeParams& volume_params) } // BUG: Make work with multiple objects -void LLPanelObject::sendRotation() +void LLPanelObject::sendRotation(BOOL btn_down) { if (mObject.isNull()) return; @@ -1570,16 +1570,34 @@ void LLPanelObject::sendRotation() { rotation = rotation * ~mRootObject->getRotationRegion(); } + std::vector<LLVector3>& child_positions = mObject->mUnselectedChildrenPositions ; + std::vector<LLQuaternion> child_rotations; + if (mObject->isRootEdit()) + { + mObject->saveUnselectedChildrenRotation(child_rotations) ; + mObject->saveUnselectedChildrenPosition(child_positions) ; + } - mObject->setRotation(rotation, TRUE ); + mObject->setRotation(rotation); + LLManip::rebuild(mObject) ; + + // for individually selected roots, we need to counterrotate all the children + if (mObject->isRootEdit()) + { + mObject->resetChildrenRotationAndPosition(child_rotations, child_positions) ; + } - LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_ROTATION); + if(!btn_down) + { + child_positions.clear() ; + LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_ROTATION | UPD_POSITION); + } } } // BUG: Make work with multiple objects -void LLPanelObject::sendScale() +void LLPanelObject::sendScale(BOOL btn_down) { if (mObject.isNull()) return; @@ -1599,7 +1617,11 @@ void LLPanelObject::sendScale() } mObject->setScale(newscale, TRUE); - LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_SCALE | UPD_POSITION); + + if(!btn_down) + { + LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_SCALE | UPD_POSITION); + } LLSelectMgr::getInstance()->adjustTexturesByScale(TRUE, !dont_stretch_textures); // llinfos << "scale sent" << llendl; @@ -1611,7 +1633,7 @@ void LLPanelObject::sendScale() } -void LLPanelObject::sendPosition() +void LLPanelObject::sendPosition(BOOL btn_down) { if (mObject.isNull()) return; @@ -1654,7 +1676,7 @@ void LLPanelObject::sendPosition() LLVector3d delta = new_pos_global - old_pos_global; // moved more than 1/2 millimeter if (delta.magVec() >= 0.0005f) - { + { if (mRootObject != mObject) { newpos = newpos - mRootObject->getPositionRegion(); @@ -1664,8 +1686,21 @@ void LLPanelObject::sendPosition() else { mObject->setPositionEdit(newpos); + } + + LLManip::rebuild(mObject) ; + + // for individually selected roots, we need to counter-translate all unselected children + if (mObject->isRootEdit()) + { + // only offset by parent's translation + mObject->resetChildrenPosition(LLVector3(-delta), TRUE) ; + } + + if(!btn_down) + { + LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION); } - LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION); LLSelectMgr::getInstance()->updateSelectionCenter(); } @@ -1846,21 +1881,24 @@ void LLPanelObject::onCommitLock(LLUICtrl *ctrl, void *data) void LLPanelObject::onCommitPosition( LLUICtrl* ctrl, void* userdata ) { LLPanelObject* self = (LLPanelObject*) userdata; - self->sendPosition(); + BOOL btn_down = ((LLSpinCtrl*)ctrl)->isMouseHeldDown() ; + self->sendPosition(btn_down); } // static void LLPanelObject::onCommitScale( LLUICtrl* ctrl, void* userdata ) { LLPanelObject* self = (LLPanelObject*) userdata; - self->sendScale(); + BOOL btn_down = ((LLSpinCtrl*)ctrl)->isMouseHeldDown() ; + self->sendScale(btn_down); } // static void LLPanelObject::onCommitRotation( LLUICtrl* ctrl, void* userdata ) { LLPanelObject* self = (LLPanelObject*) userdata; - self->sendRotation(); + BOOL btn_down = ((LLSpinCtrl*)ctrl)->isMouseHeldDown() ; + self->sendRotation(btn_down); } // static |