summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-12-30 16:07:18 -0600
committerDave Parks <davep@lindenlab.com>2010-12-30 16:07:18 -0600
commit13ec64e0e6a107d21108e817c5f9e33b6c929525 (patch)
treed8f809b360bd389d8eeae24d10dd4811aa4de134 /indra/newview
parentfad456e2b13fab83206240d7973dd2529b53de9e (diff)
SH-714 Fix for skinned meshes being incorrectly scaled.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 68b9e5d23d..8302befaad 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1562,11 +1562,23 @@ void LLModelLoader::run()
//add instance to scene for this model
- LLMatrix4 transform;
+ LLMatrix4 transformation = mTransform;
+ // adjust the transformation to compensate for mesh normalization
+
+ LLMatrix4 mesh_translation;
+ mesh_translation.setTranslation(mesh_translation_vector);
+ mesh_translation *= transformation;
+ transformation = mesh_translation;
+
+ LLMatrix4 mesh_scale;
+ mesh_scale.initScale(mesh_scale_vector);
+ mesh_scale *= transformation;
+ transformation = mesh_scale;
+
std::vector<LLImportMaterial> materials;
materials.resize(model->getNumVolumeFaces());
- mScene[transform].push_back(LLModelInstance(model, transform, materials));
- stretch_extents(model, transform, mExtents[0], mExtents[1], mFirstTransform);
+ mScene[transformation].push_back(LLModelInstance(model, transformation, materials));
+ stretch_extents(model, transformation, mExtents[0], mExtents[1], mFirstTransform);
}
}
}