aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llmanipscale.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llmanipscale.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llmanipscale.cpp40
1 files changed, 17 insertions, 23 deletions
diff --git a/linden/indra/newview/llmanipscale.cpp b/linden/indra/newview/llmanipscale.cpp
index d5ab7a1..0fa5fa5 100644
--- a/linden/indra/newview/llmanipscale.cpp
+++ b/linden/indra/newview/llmanipscale.cpp
@@ -166,19 +166,11 @@ void LLManipScale::handleSelect()
166 LLManip::handleSelect(); 166 LLManip::handleSelect();
167} 167}
168 168
169void LLManipScale::handleDeselect()
170{
171 mHighlightedPart = LL_NO_PART;
172 mManipPart = LL_NO_PART;
173 LLManip::handleDeselect();
174}
175
176LLManipScale::LLManipScale( LLToolComposite* composite ) 169LLManipScale::LLManipScale( LLToolComposite* composite )
177 : 170 :
178 LLManip( "Scale", composite ), 171 LLManip( std::string("Scale"), composite ),
179 mBoxHandleSize( 1.f ), 172 mBoxHandleSize( 1.f ),
180 mScaledBoxHandleSize( 1.f ), 173 mScaledBoxHandleSize( 1.f ),
181 mManipPart( LL_NO_PART ),
182 mLastMouseX( -1 ), 174 mLastMouseX( -1 ),
183 mLastMouseY( -1 ), 175 mLastMouseY( -1 ),
184 mSendUpdateOnMouseUp( FALSE ), 176 mSendUpdateOnMouseUp( FALSE ),
@@ -216,7 +208,7 @@ void LLManipScale::render()
216 glPushMatrix(); 208 glPushMatrix();
217 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) 209 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
218 { 210 {
219 F32 zoom = gAgent.getAvatarObject()->mHUDCurZoom; 211 F32 zoom = gAgent.mHUDCurZoom;
220 glScalef(zoom, zoom, zoom); 212 glScalef(zoom, zoom, zoom);
221 } 213 }
222 214
@@ -233,7 +225,7 @@ void LLManipScale::render()
233 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) 225 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
234 { 226 {
235 mBoxHandleSize = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels(); 227 mBoxHandleSize = BOX_HANDLE_BASE_SIZE * BOX_HANDLE_BASE_FACTOR / (F32) LLViewerCamera::getInstance()->getViewHeightInPixels();
236 mBoxHandleSize /= gAgent.getAvatarObject()->mHUDCurZoom; 228 mBoxHandleSize /= gAgent.mHUDCurZoom;
237 } 229 }
238 else 230 else
239 { 231 {
@@ -316,9 +308,7 @@ BOOL LLManipScale::handleMouseDown(S32 x, S32 y, MASK mask)
316{ 308{
317 BOOL handled = FALSE; 309 BOOL handled = FALSE;
318 310
319 LLViewerObject* hit_obj = gViewerWindow->lastObjectHit(); 311 if(mHighlightedPart != LL_NO_PART)
320 if( hit_obj ||
321 (mHighlightedPart != LL_NO_PART) )
322 { 312 {
323 handled = handleMouseDownOnPart( x, y, mask ); 313 handled = handleMouseDownOnPart( x, y, mask );
324 } 314 }
@@ -446,7 +436,7 @@ void LLManipScale::highlightManipulators(S32 x, S32 y)
446 LLMatrix4 cfr(OGL_TO_CFR_ROTATION); 436 LLMatrix4 cfr(OGL_TO_CFR_ROTATION);
447 transform *= cfr; 437 transform *= cfr;
448 LLMatrix4 window_scale; 438 LLMatrix4 window_scale;
449 F32 zoom_level = 2.f * gAgent.getAvatarObject()->mHUDCurZoom; 439 F32 zoom_level = 2.f * gAgent.mHUDCurZoom;
450 window_scale.initAll(LLVector3(zoom_level / LLViewerCamera::getInstance()->getAspect(), zoom_level, 0.f), 440 window_scale.initAll(LLVector3(zoom_level / LLViewerCamera::getInstance()->getAspect(), zoom_level, 0.f),
451 LLQuaternion::DEFAULT, 441 LLQuaternion::DEFAULT,
452 LLVector3::zero); 442 LLVector3::zero);
@@ -1013,9 +1003,11 @@ void LLManipScale::dragCorner( S32 x, S32 y )
1013 if (selectNode->mIndividualSelection) 1003 if (selectNode->mIndividualSelection)
1014 { 1004 {
1015 // counter-translate child objects if we are moving the root as an individual 1005 // counter-translate child objects if we are moving the root as an individual
1016 for (U32 child_num = 0; child_num < cur->mChildList.size(); child_num++) 1006 LLViewerObject::const_child_list_t& child_list = cur->getChildren();
1007 for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
1008 iter != child_list.end(); iter++)
1017 { 1009 {
1018 LLViewerObject* childp = cur->mChildList[child_num]; 1010 LLViewerObject* childp = *iter;
1019 1011
1020 if (cur->isAttachment()) 1012 if (cur->isAttachment())
1021 { 1013 {
@@ -1311,9 +1303,11 @@ void LLManipScale::stretchFace( const LLVector3& drag_start_agent, const LLVecto
1311 if (cur->isRootEdit() && selectNode->mIndividualSelection) 1303 if (cur->isRootEdit() && selectNode->mIndividualSelection)
1312 { 1304 {
1313 // counter-translate child objects if we are moving the root as an individual 1305 // counter-translate child objects if we are moving the root as an individual
1314 for (U32 child_num = 0; child_num < cur->mChildList.size(); child_num++) 1306 LLViewerObject::const_child_list_t& child_list = cur->getChildren();
1307 for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin();
1308 iter != child_list.end(); iter++)
1315 { 1309 {
1316 LLViewerObject* childp = cur->mChildList[child_num]; 1310 LLViewerObject* childp = *iter;
1317 if (!getUniform()) 1311 if (!getUniform())
1318 { 1312 {
1319 LLVector3 child_pos = childp->getPosition() - (delta_pos * ~cur->getRotationEdit()); 1313 LLVector3 child_pos = childp->getPosition() - (delta_pos * ~cur->getRotationEdit());
@@ -1367,7 +1361,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
1367 1361
1368 if(mObjectSelection->getSelectType() == SELECT_TYPE_HUD) 1362 if(mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1369 { 1363 {
1370 mSnapRegimeOffset = SNAP_GUIDE_SCREEN_OFFSET / gAgent.getAvatarObject()->mHUDCurZoom; 1364 mSnapRegimeOffset = SNAP_GUIDE_SCREEN_OFFSET / gAgent.mHUDCurZoom;
1371 1365
1372 } 1366 }
1373 else 1367 else
@@ -1380,7 +1374,7 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
1380 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD) 1374 if (mObjectSelection->getSelectType() == SELECT_TYPE_HUD)
1381 { 1375 {
1382 cam_at_axis.setVec(1.f, 0.f, 0.f); 1376 cam_at_axis.setVec(1.f, 0.f, 0.f);
1383 snap_guide_length = SNAP_GUIDE_SCREEN_LENGTH / gAgent.getAvatarObject()->mHUDCurZoom; 1377 snap_guide_length = SNAP_GUIDE_SCREEN_LENGTH / gAgent.mHUDCurZoom;
1384 } 1378 }
1385 else 1379 else
1386 { 1380 {
@@ -1751,7 +1745,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
1751 text_highlight = 1.f; 1745 text_highlight = 1.f;
1752 } 1746 }
1753 1747
1754 renderTickValue(text_origin, tick_val, grid_mode == GRID_MODE_WORLD ? "m" : "x", LLColor4(text_highlight, text_highlight, text_highlight, alpha)); 1748 renderTickValue(text_origin, tick_val, grid_mode == GRID_MODE_WORLD ? std::string("m") : std::string("x"), LLColor4(text_highlight, text_highlight, text_highlight, alpha));
1755 } 1749 }
1756 } 1750 }
1757 1751
@@ -1803,7 +1797,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
1803 text_highlight = 1.f; 1797 text_highlight = 1.f;
1804 } 1798 }
1805 1799
1806 renderTickValue(text_origin, tick_val, grid_mode == GRID_MODE_WORLD ? "m" : "x", LLColor4(text_highlight, text_highlight, text_highlight, alpha)); 1800 renderTickValue(text_origin, tick_val, grid_mode == GRID_MODE_WORLD ? std::string("m") : std::string("x"), LLColor4(text_highlight, text_highlight, text_highlight, alpha));
1807 } 1801 }
1808 } 1802 }
1809 } 1803 }