summaryrefslogtreecommitdiff
path: root/indra/newview/llpolymesh.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpolymesh.cpp')
-rw-r--r--indra/newview/llpolymesh.cpp82
1 files changed, 38 insertions, 44 deletions
diff --git a/indra/newview/llpolymesh.cpp b/indra/newview/llpolymesh.cpp
index 626b7ca1eb..a28357b4a9 100644
--- a/indra/newview/llpolymesh.cpp
+++ b/indra/newview/llpolymesh.cpp
@@ -46,6 +46,10 @@
extern LLControlGroup gSavedSettings; // read only
+LLPolyMorphData *clone_morph_param(const LLPolyMorphData *src_data,
+ const LLVector3 &direction,
+ const std::string &name);
+
//-----------------------------------------------------------------------------
// Global table of loaded LLPolyMeshes
//-----------------------------------------------------------------------------
@@ -605,62 +609,36 @@ BOOL LLPolyMeshSharedData::loadMesh( const std::string& fileName )
if (!strcmp(morphName, "Big_Belly_Torso"))
{
- LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data);
- cloned_morph_data->mName = std::string("Belly_Torso_Physics_UpDown_Driven");
- for (U32 v=0; v < morph_data->mNumIndices; v++)
- {
- cloned_morph_data->mCoords[v][0] = 0;
- cloned_morph_data->mCoords[v][1] = 0;
- cloned_morph_data->mCoords[v][2] = 0.05F;
- cloned_morph_data->mNormals[v] = LLVector3(0,0,0);
- cloned_morph_data->mBinormals[v] = LLVector3(0,0,0);
- }
- mMorphData.insert(cloned_morph_data);
+ mMorphData.insert(clone_morph_param(morph_data,
+ LLVector3(0,0,0.05f),
+ "Belly_Torso_Physics_UpDown_Driven"));
}
if (!strcmp(morphName, "Big_Belly_Legs"))
{
- LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data);
- cloned_morph_data->mName = std::string("Belly_Legs_Physics_UpDown_Driven");
- for (U32 v=0; v < cloned_morph_data->mNumIndices; v++)
- {
- cloned_morph_data->mCoords[v][0] = 0;
- cloned_morph_data->mCoords[v][1] = 0;
- cloned_morph_data->mCoords[v][2] = 0.05F;
- cloned_morph_data->mNormals[v] = LLVector3(0,0,0);
- cloned_morph_data->mBinormals[v] = LLVector3(0,0,0);
- }
- mMorphData.insert(cloned_morph_data);
+ mMorphData.insert(clone_morph_param(morph_data,
+ LLVector3(0,0,0.05f),
+ "Belly_Legs_Physics_UpDown_Driven"));
}
if (!strcmp(morphName, "skirt_belly"))
{
- LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data);
- cloned_morph_data->mName = std::string("Belly_Skirt_Physics_UpDown_Driven");
- for (U32 v=0; v < cloned_morph_data->mNumIndices; v++)
- {
- cloned_morph_data->mCoords[v][0] = 0;
- cloned_morph_data->mCoords[v][1] = 0;
- cloned_morph_data->mCoords[v][2] = 0.05F;
- cloned_morph_data->mNormals[v] = LLVector3(0,0,0);
- cloned_morph_data->mBinormals[v] = LLVector3(0,0,0);
- }
- mMorphData.insert(cloned_morph_data);
+ mMorphData.insert(clone_morph_param(morph_data,
+ LLVector3(0,0,0.05f),
+ "Belly_Skirt_Physics_UpDown_Driven"));
}
if (!strcmp(morphName, "Small_Butt"))
{
- LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*morph_data);
- cloned_morph_data->mName = std::string("Butt_Physics_UpDown_Driven");
- for (U32 v=0; v < cloned_morph_data->mNumIndices; v++)
- {
- cloned_morph_data->mCoords[v][0] = 0;
- cloned_morph_data->mCoords[v][1] = 0;
- cloned_morph_data->mCoords[v][2] = 0.01F;
- cloned_morph_data->mNormals[v] = LLVector3(0,0,0);
- cloned_morph_data->mBinormals[v] = LLVector3(0,0,0);
- }
- mMorphData.insert(cloned_morph_data);
+ mMorphData.insert(clone_morph_param(morph_data,
+ LLVector3(0,0,0.01f),
+ "Butt_Physics_UpDown_Driven"));
+ }
+ if (!strcmp(morphName, "Small_Butt"))
+ {
+ mMorphData.insert(clone_morph_param(morph_data,
+ LLVector3(0,0.01f,0),
+ "Butt_Physics_LeftRight_Driven"));
}
}
@@ -1218,4 +1196,20 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex )
mLastWeight = mCurWeight;
}
+
+LLPolyMorphData *clone_morph_param(const LLPolyMorphData *src_data,
+ const LLVector3 &direction,
+ const std::string &name)
+{
+ LLPolyMorphData* cloned_morph_data = new LLPolyMorphData(*src_data);
+ cloned_morph_data->mName = name;
+ for (U32 v=0; v < cloned_morph_data->mNumIndices; v++)
+ {
+ cloned_morph_data->mCoords[v] = direction;
+ cloned_morph_data->mNormals[v] = LLVector3(0,0,0);
+ cloned_morph_data->mBinormals[v] = LLVector3(0,0,0);
+ }
+ return cloned_morph_data;
+}
+
// End