aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llselectmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llselectmgr.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp
index 6ddae78..bb0ccde 100644
--- a/linden/indra/newview/llselectmgr.cpp
+++ b/linden/indra/newview/llselectmgr.cpp
@@ -3647,14 +3647,25 @@ void LLSelectMgr::saveSelectedObjectTransform(EActionType action_type)
3647 { 3647 {
3648 selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition()); 3648 selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition());
3649 } 3649 }
3650 else
3651 {
3652 selectNode->mSavedPositionGlobal = object->getPositionGlobal();
3653 }
3650 } 3654 }
3651 else 3655 else
3652 { 3656 {
3653 LLViewerObject* attachment_root = (LLViewerObject*)object->getParent(); 3657 LLViewerObject* attachment_root = (LLViewerObject*)object->getParent();
3654 LLXform* parent_xform = attachment_root->mDrawable->getXform()->getParent(); 3658 LLXform* parent_xform = attachment_root ? attachment_root->mDrawable->getXform()->getParent() : NULL;
3655 LLVector3 root_pos = (attachment_root->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); 3659 if (parent_xform)
3656 LLQuaternion root_rot = (attachment_root->getRotation() * parent_xform->getWorldRotation()); 3660 {
3657 selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * root_rot) + root_pos); 3661 LLVector3 root_pos = (attachment_root->getPosition() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition();
3662 LLQuaternion root_rot = (attachment_root->getRotation() * parent_xform->getWorldRotation());
3663 selectNode->mSavedPositionGlobal = gAgent.getPosGlobalFromAgent((object->getPosition() * root_rot) + root_pos);
3664 }
3665 else
3666 {
3667 selectNode->mSavedPositionGlobal = object->getPositionGlobal();
3668 }
3658 } 3669 }
3659 selectNode->mSavedRotation = object->getRenderRotation(); 3670 selectNode->mSavedRotation = object->getRenderRotation();
3660 } 3671 }