From 27c855149e657cebda863e279c8545f7816e1c18 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Mon, 23 Aug 2010 13:36:28 -0400 Subject: First pass commit for breast physics. --- indra/newview/llpolymorph.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'indra/newview/llpolymorph.cpp') diff --git a/indra/newview/llpolymorph.cpp b/indra/newview/llpolymorph.cpp index 0ffe1c635f..ec41ef08f5 100644 --- a/indra/newview/llpolymorph.cpp +++ b/indra/newview/llpolymorph.cpp @@ -287,10 +287,22 @@ BOOL LLPolyMorphTarget::setInfo(LLPolyMorphTargetInfo* info) } } - mMorphData = mMesh->getMorphData(getInfo()->mMorphName); + std::string morph_param_name = getInfo()->mMorphName; + + mMorphData = mMesh->getMorphData(morph_param_name); + if (!mMorphData) + { + const std::string driven_tag = "_Driven"; + U32 pos = morph_param_name.find(driven_tag); + if (pos > 0) + { + morph_param_name = morph_param_name.substr(0,pos); + mMorphData = mMesh->getMorphData(morph_param_name); + } + } if (!mMorphData) { - llwarns << "No morph target named " << getInfo()->mMorphName << " found in mesh." << llendl; + llwarns << "No morph target named " << morph_param_name << " found in mesh." << llendl; return FALSE; // Continue, ignoring this tag } return TRUE; -- cgit v1.2.3 From 3825ee503ddab29cf408ae35f5a43bcc154353f2 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 17 Mar 2011 17:36:01 -0400 Subject: Work in progress. Big code cleanup ported from TheShining/avatar-physics (defunct branch). Added butt and belly. --- indra/newview/llpolymorph.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'indra/newview/llpolymorph.cpp') diff --git a/indra/newview/llpolymorph.cpp b/indra/newview/llpolymorph.cpp index ec41ef08f5..5a67fd482a 100644 --- a/indra/newview/llpolymorph.cpp +++ b/indra/newview/llpolymorph.cpp @@ -59,6 +59,37 @@ LLPolyMorphData::LLPolyMorphData(const std::string& morph_name) mMesh = NULL; } +LLPolyMorphData::LLPolyMorphData(const LLPolyMorphData &rhs) : + mName(rhs.mName), + mNumIndices(rhs.mNumIndices), + mTotalDistortion(rhs.mTotalDistortion), + mAvgDistortion(rhs.mAvgDistortion), + mMaxDistortion(rhs.mMaxDistortion), + mVertexIndices(NULL), + mCoords(NULL), + mNormals(NULL), + mBinormals(NULL), + mTexCoords(NULL) +{ + const S32 numVertices = mNumIndices; + + mCoords = new LLVector3[numVertices]; + mNormals = new LLVector3[numVertices]; + mBinormals = new LLVector3[numVertices]; + mTexCoords = new LLVector2[numVertices]; + mVertexIndices = new U32[numVertices]; + + for (S32 v=0; v < numVertices; v++) + { + mCoords[v] = rhs.mCoords[v]; + mNormals[v] = rhs.mNormals[v]; + mBinormals[v] = rhs.mBinormals[v]; + mTexCoords[v] = rhs.mTexCoords[v]; + mVertexIndices[v] = rhs.mVertexIndices[v]; + } +} + + //----------------------------------------------------------------------------- // ~LLPolyMorphData() //----------------------------------------------------------------------------- -- cgit v1.2.3