From 69789e40d9df7a13913a88bc02316e8bbc4a4dac Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 30 Mar 2011 16:04:36 -0400 Subject: Moved joint reset flag into model preview --- indra/newview/llfloatermodelpreview.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloatermodelpreview.cpp') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 99256e1dc1..3da0c795d5 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -386,7 +386,8 @@ LLFloaterModelPreview::~LLFloaterModelPreview() sInstance = NULL; const LLModelLoader *model_loader = mModelPreview->mModelLoader; - if (model_loader && model_loader->mResetJoints) + + if ( mModelPreview && mModelPreview->getResetJointFlag() ) { gAgentAvatarp->resetJointPositions(); } @@ -394,7 +395,7 @@ LLFloaterModelPreview::~LLFloaterModelPreview() if ( mModelPreview ) { - delete mModelPreview; + delete mModelPreview; } if (mGLName) @@ -992,7 +993,7 @@ void LLFloaterModelPreview::onMouseCaptureLostModelPreview(LLMouseHandler* handl // LLModelLoader //----------------------------------------------------------------------------- LLModelLoader::LLModelLoader(std::string filename, S32 lod, LLModelPreview* preview) -: LLThread("Model Loader"), mFilename(filename), mLod(lod), mPreview(preview), mFirstTransform(TRUE), mResetJoints( FALSE ) +: LLThread("Model Loader"), mFilename(filename), mLod(lod), mPreview(preview), mFirstTransform(TRUE) { mJointMap["mPelvis"] = "mPelvis"; mJointMap["mTorso"] = "mTorso"; @@ -1566,14 +1567,14 @@ bool LLModelLoader::doLoadModel() mPreview->setRigValid( doesJointArrayContainACompleteRig( model->mSkinInfo.mJointNames ) ); if ( !skeletonWithNoRootNode && !model->mSkinInfo.mJointNames.empty() && mPreview->isRigValid() ) { - mResetJoints = true; + mPreview->setResetJointFlag( true ); } if ( !missingSkeletonOrScene ) { //Set the joint translations on the avatar - if it's a full mapping //The joints are reset in the dtor - if ( mResetJoints ) + if ( mPreview->getResetJointFlag() ) { std::map :: const_iterator masterJointIt = mJointMap.begin(); std::map :: const_iterator masterJointItEnd = mJointMap.end(); @@ -2438,6 +2439,7 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE), LLMutex(NULL) , mPelvisZOffset( 0.0f ) , mRigValid( false ) +, mResetJoints( false ) { mNeedsUpdate = TRUE; mCameraDistance = 0.f; -- cgit v1.2.3