summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolmorph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltoolmorph.cpp')
-rw-r--r--indra/newview/lltoolmorph.cpp91
1 files changed, 48 insertions, 43 deletions
diff --git a/indra/newview/lltoolmorph.cpp b/indra/newview/lltoolmorph.cpp
index ca80a1db79..969049ee65 100644
--- a/indra/newview/lltoolmorph.cpp
+++ b/indra/newview/lltoolmorph.cpp
@@ -2,25 +2,31 @@
* @file lltoolmorph.cpp
* @brief A tool to manipulate faces..
*
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2001&license=viewergpl$
+ *
+ * Copyright (c) 2001-2009, Linden Research, Inc.
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
*
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
@@ -43,6 +49,7 @@
#include "lldrawable.h"
#include "lldrawpoolavatar.h"
#include "llface.h"
+#include "llfloatercustomize.h"
#include "llmorphview.h"
#include "llresmgr.h"
#include "llselectmgr.h"
@@ -72,25 +79,22 @@ LLVisualParamHint::LLVisualParamHint(
S32 width, S32 height,
LLViewerJointMesh *mesh,
LLViewerVisualParam *param,
- LLWearable *wearable,
- F32 param_weight,
- LLJoint* jointp)
+ F32 param_weight)
:
LLViewerDynamicTexture(width, height, 3, LLViewerDynamicTexture::ORDER_MIDDLE, TRUE ),
mNeedsUpdate( TRUE ),
mIsVisible( FALSE ),
mJointMesh( mesh ),
mVisualParam( param ),
- mWearablePtr( wearable ),
mVisualParamWeight( param_weight ),
mAllowsUpdates( TRUE ),
mDelayFrames( 0 ),
mRect( pos_x, pos_y + height, pos_x + width, pos_y ),
- mLastParamWeight(0.f),
- mCamTargetJoint(jointp)
+ mLastParamWeight(0.f)
{
LLVisualParamHint::sInstances.insert( this );
- mBackgroundp = LLUI::getUIImage("avatar_thumb_bkgrnd.png");
+ mBackgroundp = LLUI::getUIImage("avatar_thumb_bkgrnd.j2c");
+
llassert(width != 0);
llassert(height != 0);
@@ -104,12 +108,6 @@ LLVisualParamHint::~LLVisualParamHint()
LLVisualParamHint::sInstances.erase( this );
}
-//virtual
-S8 LLVisualParamHint::getType() const
-{
- return LLViewerDynamicTexture::LL_VISUAL_PARAM_HINT ;
-}
-
//-----------------------------------------------------------------------------
// static
// requestHintUpdates()
@@ -141,13 +139,13 @@ void LLVisualParamHint::requestHintUpdates( LLVisualParamHint* exception1, LLVis
BOOL LLVisualParamHint::needsRender()
{
- return mNeedsUpdate && mDelayFrames-- <= 0 && !gAgentAvatarp->getIsAppearanceAnimating() && mAllowsUpdates;
+ return mNeedsUpdate && mDelayFrames-- <= 0 && !gAgentAvatarp->mAppearanceAnimating && mAllowsUpdates;
}
void LLVisualParamHint::preRender(BOOL clear_depth)
{
mLastParamWeight = mVisualParam->getWeight();
- mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE);
+ mVisualParam->setWeight(mVisualParamWeight, FALSE);
gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mVisualParamWeight, FALSE);
gAgentAvatarp->setVisualParamWeight("Blink_Left", 0.f);
gAgentAvatarp->setVisualParamWeight("Blink_Right", 0.f);
@@ -191,6 +189,21 @@ 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 )
@@ -198,7 +211,7 @@ BOOL LLVisualParamHint::render()
avatar_rotation = root_joint->getWorldRotation();
}
- LLVector3 target_joint_pos = mCamTargetJoint->getWorldPosition();
+ LLVector3 target_joint_pos = cam_target_joint->getWorldPosition();
LLVector3 target_offset( 0, 0, mVisualParam->getCameraElevation() );
LLVector3 target_pos = target_joint_pos + (target_offset * avatar_rotation);
@@ -214,9 +227,9 @@ BOOL LLVisualParamHint::render()
LLViewerCamera::getInstance()->setAspect((F32)mFullWidth / (F32)mFullHeight);
LLViewerCamera::getInstance()->setOriginAndLookAt(
- camera_pos, // camera
- LLVector3::z_axis, // up
- target_pos ); // point of interest
+ camera_pos, // camera
+ LLVector3(0.f, 0.f, 1.f), // up
+ target_pos ); // point of interest
LLViewerCamera::getInstance()->setPerspective(FALSE, mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight, FALSE);
@@ -231,12 +244,10 @@ BOOL LLVisualParamHint::render()
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
}
gAgentAvatarp->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight);
- mWearablePtr->setVisualParamWeight(mVisualParam->getID(), mLastParamWeight, FALSE);
- gAgentAvatarp->updateVisualParams();
+ mVisualParam->setWeight(mLastParamWeight, FALSE);
gGL.color4f(1,1,1,1);
mGLTexturep->setGLTextureCreated(true);
gGL.popUIMatrix();
-
return TRUE;
}
@@ -276,12 +287,6 @@ LLVisualParamReset::LLVisualParamReset() : LLViewerDynamicTexture(1, 1, 1, ORDER
{
}
-//virtual
-S8 LLVisualParamReset::getType() const
-{
- return LLViewerDynamicTexture::LL_VISUAL_PARAM_RESET ;
-}
-
//-----------------------------------------------------------------------------
// render()
//-----------------------------------------------------------------------------