aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lltoolplacer.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/lltoolplacer.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 'linden/indra/newview/lltoolplacer.cpp')
-rw-r--r--linden/indra/newview/lltoolplacer.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/linden/indra/newview/lltoolplacer.cpp b/linden/indra/newview/lltoolplacer.cpp
index a319236..30347be 100644
--- a/linden/indra/newview/lltoolplacer.cpp
+++ b/linden/indra/newview/lltoolplacer.cpp
@@ -70,7 +70,7 @@ const LLVector3 DEFAULT_OBJECT_SCALE(0.5f, 0.5f, 0.5f);
70LLPCode LLToolPlacer::sObjectType = LL_PCODE_CUBE; 70LLPCode LLToolPlacer::sObjectType = LL_PCODE_CUBE;
71 71
72LLToolPlacer::LLToolPlacer() 72LLToolPlacer::LLToolPlacer()
73: LLTool( "Create" ) 73: LLTool( std::string("Create") )
74{ 74{
75} 75}
76 76
@@ -81,14 +81,22 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj,
81 81
82 // Viewer-side pick to find the right sim to create the object on. 82 // Viewer-side pick to find the right sim to create the object on.
83 // First find the surface the object will be created on. 83 // First find the surface the object will be created on.
84 gViewerWindow->hitObjectOrLandGlobalImmediate(x, y, NULL, FALSE); 84 LLPickInfo pick = gViewerWindow->pickImmediate(x, y, FALSE);
85 85
86 // Note: use the frontmost non-flora version because (a) plants usually have lots of alpha and (b) pants' Havok 86 // Note: use the frontmost non-flora version because (a) plants usually have lots of alpha and (b) pants' Havok
87 // representations (if any) are NOT the same as their viewer representation. 87 // representations (if any) are NOT the same as their viewer representation.
88 *hit_obj = gObjectList.findObject( gLastHitNonFloraObjectID ); 88 if (pick.mPickType == LLPickInfo::PICK_FLORA)
89 *hit_face = gLastHitNonFloraObjectFace; 89 {
90 *b_hit_land = !(*hit_obj) && !gLastHitNonFloraPosGlobal.isExactlyZero(); 90 *hit_obj = NULL;
91 LLVector3d land_pos_global = gLastHitNonFloraPosGlobal; 91 *hit_face = -1;
92 }
93 else
94 {
95 *hit_obj = pick.getObject();
96 *hit_face = pick.mObjectFace;
97 }
98 *b_hit_land = !(*hit_obj) && !pick.mPosGlobal.isExactlyZero();
99 LLVector3d land_pos_global = pick.mPosGlobal;
92 100
93 // Make sure there's a surface to place the new object on. 101 // Make sure there's a surface to place the new object on.
94 BOOL bypass_sim_raycast = FALSE; 102 BOOL bypass_sim_raycast = FALSE;
@@ -570,7 +578,7 @@ LLToolPlacerPanel::LLToolPlacerPanel(const std::string& name, const LLRect& rect
570 */ 578 */
571} 579}
572 580
573void LLToolPlacerPanel::addButton( const LLString& up_state, const LLString& down_state, LLPCode* pcode ) 581void LLToolPlacerPanel::addButton( const std::string& up_state, const std::string& down_state, LLPCode* pcode )
574{ 582{
575 const S32 TOOL_SIZE = 32; 583 const S32 TOOL_SIZE = 32;
576 const S32 HORIZ_SPACING = TOOL_SIZE + 5; 584 const S32 HORIZ_SPACING = TOOL_SIZE + 5;
@@ -593,11 +601,11 @@ void LLToolPlacerPanel::addButton( const LLString& up_state, const LLString& dow
593 TOOL_SIZE ); 601 TOOL_SIZE );
594 602
595 LLButton* btn = new LLButton( 603 LLButton* btn = new LLButton(
596 "ToolPlacerOptBtn", 604 std::string("ToolPlacerOptBtn"),
597 rect, 605 rect,
598 up_state, 606 up_state,
599 down_state, 607 down_state,
600 "", &LLToolPlacerPanel::setObjectType, 608 LLStringUtil::null, &LLToolPlacerPanel::setObjectType,
601 pcode, 609 pcode,
602 LLFontGL::sSansSerif); 610 LLFontGL::sSansSerif);
603 btn->setFollowsBottom(); 611 btn->setFollowsBottom();