diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpaneleditwearable.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llpaneleditwearable.h | 3 | ||||
-rw-r--r-- | indra/newview/llscrollingpanelparam.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llscrollingpanelparam.h | 3 | ||||
-rw-r--r-- | indra/newview/lltoolmorph.cpp | 30 | ||||
-rw-r--r-- | indra/newview/lltoolmorph.h | 5 | ||||
-rw-r--r-- | indra/newview/llviewervisualparam.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewervisualparam.h | 2 |
8 files changed, 29 insertions, 36 deletions
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 6a84886e3b..a1a9300ec2 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1015,8 +1015,14 @@ void LLPanelEditWearable::showWearable(LLWearable* wearable, BOOL show) // storage for ordered list of visual params value_map_t sorted_params; getSortedParams(sorted_params, edit_group); - - buildParamList(panel_list, sorted_params, tab); + + LLJoint* jointp = gAgentAvatarp->getJoint( subpart_entry->mTargetJoint ); + if (!jointp) + { + jointp = gAgentAvatarp->getJoint("mHead"); + } + + buildParamList(panel_list, sorted_params, tab, jointp); updateScrollingPanelUI(); } @@ -1253,7 +1259,7 @@ void LLPanelEditWearable::getSortedParams(value_map_t &sorted_params, const std: } } -void LLPanelEditWearable::buildParamList(LLScrollingPanelList *panel_list, value_map_t &sorted_params, LLAccordionCtrlTab *tab) +void LLPanelEditWearable::buildParamList(LLScrollingPanelList *panel_list, value_map_t &sorted_params, LLAccordionCtrlTab *tab, LLJoint* jointp) { // sorted_params is sorted according to magnitude of effect from // least to greatest. Adding to the front of the child list @@ -1267,7 +1273,7 @@ void LLPanelEditWearable::buildParamList(LLScrollingPanelList *panel_list, value { LLPanel::Params p; p.name("LLScrollingPanelParam"); - LLScrollingPanelParam* panel_param = new LLScrollingPanelParam( p, NULL, (*it).second, TRUE, this->getWearable()); + LLScrollingPanelParam* panel_param = new LLScrollingPanelParam( p, NULL, (*it).second, TRUE, this->getWearable(), jointp); height = panel_list->addPanel( panel_param ); } } diff --git a/indra/newview/llpaneleditwearable.h b/indra/newview/llpaneleditwearable.h index 1ee150621a..54f729fa7a 100644 --- a/indra/newview/llpaneleditwearable.h +++ b/indra/newview/llpaneleditwearable.h @@ -48,6 +48,7 @@ class LLViewerVisualParam; class LLVisualParamHint; class LLViewerJointMesh; class LLAccordionCtrlTab; +class LLJoint; class LLPanelEditWearable : public LLPanel { @@ -83,7 +84,7 @@ private: void updateScrollingPanelUI(); LLPanel* getPanel(LLWearableType::EType type); void getSortedParams(value_map_t &sorted_params, const std::string &edit_group); - void buildParamList(LLScrollingPanelList *panel_list, value_map_t &sorted_params, LLAccordionCtrlTab *tab); + void buildParamList(LLScrollingPanelList *panel_list, value_map_t &sorted_params, LLAccordionCtrlTab *tab, LLJoint* jointp); // update bottom bar buttons ("Save", "Revert", etc) void updateVerbs(); diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp index 242af6981c..6f5238f0a1 100644 --- a/indra/newview/llscrollingpanelparam.cpp +++ b/indra/newview/llscrollingpanelparam.cpp @@ -56,7 +56,7 @@ const S32 LLScrollingPanelParam::PARAM_HINT_HEIGHT = 128; S32 LLScrollingPanelParam::sUpdateDelayFrames = 0; LLScrollingPanelParam::LLScrollingPanelParam( const LLPanel::Params& panel_params, - LLViewerJointMesh* mesh, LLViewerVisualParam* param, BOOL allow_modify, LLWearable* wearable ) + LLViewerJointMesh* mesh, LLViewerVisualParam* param, BOOL allow_modify, LLWearable* wearable, LLJoint* jointp ) : LLScrollingPanel( panel_params ), mParam(param), mAllowModify(allow_modify), @@ -73,9 +73,9 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLPanel::Params& panel_param F32 min_weight = param->getMinWeight(); F32 max_weight = param->getMaxWeight(); - mHintMin = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, (LLViewerVisualParam*) wearable->getVisualParam(param->getID()), wearable, min_weight); + mHintMin = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, (LLViewerVisualParam*) wearable->getVisualParam(param->getID()), wearable, min_weight, jointp); pos_x = getChild<LLViewBorder>("right_border")->getRect().mLeft + left_border->getBorderWidth(); - mHintMax = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, (LLViewerVisualParam*) wearable->getVisualParam(param->getID()), wearable, max_weight ); + mHintMax = new LLVisualParamHint( pos_x, pos_y, PARAM_HINT_WIDTH, PARAM_HINT_HEIGHT, mesh, (LLViewerVisualParam*) wearable->getVisualParam(param->getID()), wearable, max_weight, jointp ); mHintMin->setAllowsUpdates( FALSE ); mHintMax->setAllowsUpdates( FALSE ); diff --git a/indra/newview/llscrollingpanelparam.h b/indra/newview/llscrollingpanelparam.h index fe4ce07166..3cdfd188a8 100644 --- a/indra/newview/llscrollingpanelparam.h +++ b/indra/newview/llscrollingpanelparam.h @@ -42,12 +42,13 @@ class LLViewerVisualParam; class LLWearable; class LLVisualParamHint; class LLViewerVisualParam; +class LLJoint; class LLScrollingPanelParam : public LLScrollingPanel { public: LLScrollingPanelParam( const LLPanel::Params& panel_params, - LLViewerJointMesh* mesh, LLViewerVisualParam* param, BOOL allow_modify, LLWearable* wearable ); + LLViewerJointMesh* mesh, LLViewerVisualParam* param, BOOL allow_modify, LLWearable* wearable, LLJoint* jointp ); virtual ~LLScrollingPanelParam(); virtual void draw(); diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp index c1dc1de5e5..8996157258 100644 --- a/indra/newview/lltoolmorph.cpp +++ b/indra/newview/lltoolmorph.cpp @@ -79,7 +79,8 @@ LLVisualParamHint::LLVisualParamHint( LLViewerJointMesh *mesh, LLViewerVisualParam *param, LLWearable *wearable, - F32 param_weight) + F32 param_weight, + LLJoint* jointp) : LLViewerDynamicTexture(width, height, 3, LLViewerDynamicTexture::ORDER_MIDDLE, TRUE ), mNeedsUpdate( TRUE ), @@ -91,12 +92,12 @@ LLVisualParamHint::LLVisualParamHint( mAllowsUpdates( TRUE ), mDelayFrames( 0 ), mRect( pos_x, pos_y + height, pos_x + width, pos_y ), - mLastParamWeight(0.f) + mLastParamWeight(0.f), + mCamTargetJoint(jointp) { LLVisualParamHint::sInstances.insert( this ); mBackgroundp = LLUI::getUIImage("avatar_thumb_bkgrnd.j2c"); - llassert(width != 0); llassert(height != 0); } @@ -196,21 +197,6 @@ BOOL LLVisualParamHint::render() mNeedsUpdate = FALSE; mIsVisible = TRUE; - LLViewerJointMesh* cam_target_joint = NULL; - const std::string& cam_target_mesh_name = mVisualParam->getCameraTargetName(); - if( !cam_target_mesh_name.empty() ) - { - cam_target_joint = (LLViewerJointMesh*)gAgentAvatarp->getJoint( cam_target_mesh_name ); - } - if( !cam_target_joint ) - { - cam_target_joint = (LLViewerJointMesh*)gMorphView->getCameraTargetJoint(); - } - if( !cam_target_joint ) - { - cam_target_joint = (LLViewerJointMesh*)gAgentAvatarp->getJoint("mHead"); - } - LLQuaternion avatar_rotation; LLJoint* root_joint = gAgentAvatarp->getRootJoint(); if( root_joint ) @@ -218,7 +204,7 @@ BOOL LLVisualParamHint::render() avatar_rotation = root_joint->getWorldRotation(); } - LLVector3 target_joint_pos = cam_target_joint->getWorldPosition(); + LLVector3 target_joint_pos = mCamTargetJoint->getWorldPosition(); LLVector3 target_offset( 0, 0, mVisualParam->getCameraElevation() ); LLVector3 target_pos = target_joint_pos + (target_offset * avatar_rotation); @@ -234,9 +220,9 @@ BOOL LLVisualParamHint::render() LLViewerCamera::getInstance()->setAspect((F32)mFullWidth / (F32)mFullHeight); LLViewerCamera::getInstance()->setOriginAndLookAt( - camera_pos, // camera - LLVector3(0.f, 0.f, 1.f), // up - target_pos ); // point of interest + camera_pos, // camera + LLVector3::z_axis, // up + target_pos ); // point of interest LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE); diff --git a/indra/newview/lltoolmorph.h b/indra/newview/lltoolmorph.h index 3bffefaa55..cbab5e765f 100644 --- a/indra/newview/lltoolmorph.h +++ b/indra/newview/lltoolmorph.h @@ -47,6 +47,7 @@ class LLViewerJointMesh; class LLPolyMesh; class LLViewerObject; +class LLJoint; //----------------------------------------------------------------------------- // LLVisualParamHint @@ -63,7 +64,8 @@ public: LLViewerJointMesh *mesh, LLViewerVisualParam *param, LLWearable *wearable, - F32 param_weight); + F32 param_weight, + LLJoint* jointp); /*virtual*/ S8 getType() const ; @@ -96,6 +98,7 @@ protected: S32 mDelayFrames; // updates are blocked for this many frames LLRect mRect; F32 mLastParamWeight; + LLJoint* mCamTargetJoint; // joint to target with preview camera LLUIImagePtr mBackgroundp; diff --git a/indra/newview/llviewervisualparam.cpp b/indra/newview/llviewervisualparam.cpp index 422e530dc6..1dc09a64ac 100644 --- a/indra/newview/llviewervisualparam.cpp +++ b/indra/newview/llviewervisualparam.cpp @@ -99,8 +99,6 @@ BOOL LLViewerVisualParamInfo::parseXml(LLXmlTreeNode *node) node->getFastAttributeF32( camera_angle_string, mCamAngle ); // in degrees static LLStdStringHandle camera_elevation_string = LLXmlTree::addAttributeString("camera_elevation"); node->getFastAttributeF32( camera_elevation_string, mCamElevation ); - static LLStdStringHandle camera_target_string = LLXmlTree::addAttributeString("camera_target"); - node->getFastAttributeString( camera_target_string, mCamTargetName ); mCamAngle += 180; diff --git a/indra/newview/llviewervisualparam.h b/indra/newview/llviewervisualparam.h index 1a3975eb99..f38c01fa6c 100644 --- a/indra/newview/llviewervisualparam.h +++ b/indra/newview/llviewervisualparam.h @@ -60,7 +60,6 @@ protected: F32 mCamDist; F32 mCamAngle; // degrees F32 mCamElevation; - std::string mCamTargetName; F32 mEditGroupDisplayOrder; BOOL mShowSimple; // show edit controls when in "simple ui" mode? F32 mSimpleMin; // when in simple UI, apply this minimum, range 0.f to 100.f @@ -104,7 +103,6 @@ public: F32 getCameraDistance() const { return getInfo()->mCamDist; } F32 getCameraAngle() const { return getInfo()->mCamAngle; } // degrees F32 getCameraElevation() const { return getInfo()->mCamElevation; } - const std::string& getCameraTargetName() const { return getInfo()->mCamTargetName; } BOOL getShowSimple() const { return getInfo()->mShowSimple; } F32 getSimpleMin() const { return getInfo()->mSimpleMin; } |