diff options
author | Dave SIMmONs <simon@lindenlab.com> | 2011-04-05 10:36:41 -0700 |
---|---|---|
committer | Dave SIMmONs <simon@lindenlab.com> | 2011-04-05 10:36:41 -0700 |
commit | 37c15d211b55d979ecea78237b22513ee663eb7a (patch) | |
tree | 26fd8866ddc859ad7845d4da056b86ffbc5fdc71 /indra/newview/llpolymorph.cpp | |
parent | 5e486cf21bf8bcd4a40b44d024a19f8318e596bc (diff) | |
parent | aeac73e45ec6210706dfaee959d8d798c6161c98 (diff) |
Merge
Diffstat (limited to 'indra/newview/llpolymorph.cpp')
-rw-r--r-- | indra/newview/llpolymorph.cpp | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/indra/newview/llpolymorph.cpp b/indra/newview/llpolymorph.cpp index 0ffe1c635f..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() //----------------------------------------------------------------------------- @@ -287,10 +318,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; |