From 5a940793e19225c065f1e37c1be32edd936a5246 Mon Sep 17 00:00:00 2001 From: prep linden Date: Wed, 16 Mar 2011 10:15:06 -0400 Subject: WIP:Manual pelvis offset --- indra/newview/llfloatermodelpreview.cpp | 9 ++++++--- indra/newview/llfloatermodelpreview.h | 2 ++ indra/newview/llmeshrepository.cpp | 2 +- indra/newview/llvoavatar.cpp | 12 ++++++++---- indra/newview/llvoavatar.h | 3 ++- indra/newview/llvovolume.cpp | 3 ++- 6 files changed, 21 insertions(+), 10 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index d4ba039eeb..3a7732c7b3 100755 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -469,7 +469,7 @@ void LLFloaterModelPreview::onPelvisOffsetCommit( LLUICtrl*, void* userdata ) { return; } - + fp->mModelPreview->calcResourceCost(); fp->mModelPreview->refresh(); } @@ -2232,6 +2232,7 @@ LLColor4 LLModelLoader::getDaeColor(daeElement* element) LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp) : LLViewerDynamicTexture(width, height, 3, ORDER_MIDDLE, FALSE), LLMutex(NULL) +, mPelvisZOffset( 0.0f ) { mNeedsUpdate = TRUE; mCameraDistance = 0.f; @@ -2298,13 +2299,14 @@ U32 LLModelPreview::calcResourceCost() U32 num_hulls = 0; F32 debug_scale = mFMP ? mFMP->childGetValue("import_scale").asReal() : 1.f; - + mPelvisZOffset = mFMP ? mFMP->childGetValue("pelvis_offset").asReal() : 32.0f; + F32 streaming_cost = 0.f; F32 physics_cost = 0.f; for (U32 i = 0; i < mUploadData.size(); ++i) { LLModelInstance& instance = mUploadData[i]; - + if (accounted.find(instance.mModel) == accounted.end()) { accounted.insert(instance.mModel); @@ -3746,6 +3748,7 @@ BOOL LLModelPreview::render() { LLModelInstance& instance = *model_iter; LLModel* model = instance.mModel; + model->mPelvisOffset = mPelvisZOffset; if (!model->mSkinWeights.empty()) { has_skin_weights = true; diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h index aac20244cc..e3b0f7522e 100644 --- a/indra/newview/llfloatermodelpreview.h +++ b/indra/newview/llfloatermodelpreview.h @@ -359,6 +359,8 @@ public: LLVector3 mModelPivot; bool mHasPivot; + + float mPelvisZOffset; }; diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 8e869b2d5b..93e6c3aafc 100755 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1167,7 +1167,7 @@ bool LLMeshRepoThread::skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 dat { info.mPelvisOffset = skin["pelvis_offset"].asReal(); } - + llinfos<<"info pelvis offset"< 0 ) { const int jointCnt = pSkinData->mJointNames.size(); + const int pelvisZOffset = pSkinData->mPelvisOffset; bool fullRig = (jointCnt>=20) ? true : false; if ( fullRig ) { @@ -3961,7 +3962,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) pJoint->storeCurrentXform( jointPos ); if ( !pAvatarVO->hasPelvisOffset() ) { - pAvatarVO->setPelvisOffset( true, jointPos ); + pAvatarVO->setPelvisOffset( true, jointPos, pelvisZOffset ); //Trigger to rebuild viewer AV pelvisGotSet = true; } -- cgit v1.2.3