summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermodelpreview.cpp
diff options
context:
space:
mode:
authorleyla_linden <none@none>2010-12-31 12:55:04 -0800
committerleyla_linden <none@none>2010-12-31 12:55:04 -0800
commit350a736d37de282e1e3c22627400d957f0e00dc5 (patch)
tree7427e593ce39ad2c50e1f217bad5b211a9eb3928 /indra/newview/llfloatermodelpreview.cpp
parentd196348d0f4bd542eee3702329dab28952b8a5e5 (diff)
parente3204165b9bb9b36cb11a8d0a4a4040634e707fc (diff)
Merge
Diffstat (limited to 'indra/newview/llfloatermodelpreview.cpp')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 41fbdab2de..a1c2265f62 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -397,7 +397,7 @@ LLFloaterModelPreview::~LLFloaterModelPreview()
void LLFloaterModelPreview::onViewOptionChecked(const LLSD& userdata)
{
if (mModelPreview)
- {
+ {
mModelPreview->mViewOption[userdata.asString()] = !mModelPreview->mViewOption[userdata.asString()];
mModelPreview->refresh();
@@ -1569,11 +1569,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);
}
}
}
@@ -2024,7 +2036,7 @@ LLModelPreview::LLModelPreview(S32 width, S32 height, LLFloater* fmp)
mBuildShareTolerance = 0.f;
mBuildQueueMode = GLOD_QUEUE_GREEDY;
mBuildBorderMode = GLOD_BORDER_UNLOCK;
- mBuildOperator = GLOD_OPERATOR_HALF_EDGE_COLLAPSE;
+ mBuildOperator = GLOD_OPERATOR_HALF_EDGE_COLLAPSE;
mViewOption["show_textures"] = false;
@@ -2064,6 +2076,7 @@ U32 LLModelPreview::calcResourceCost()
F32 debug_scale = mFMP->childGetValue("import_scale").asReal();
F32 streaming_cost = 0.f;
+ F32 physics_cost = 0.f;
for (U32 i = 0; i < mUploadData.size(); ++i)
{
LLModelInstance& instance = mUploadData[i];
@@ -2118,6 +2131,7 @@ U32 LLModelPreview::calcResourceCost()
//mFMP->childSetTextArg(info_name[LLModel::LOD_PHYSICS], "[HULLS]", llformat("%d",num_hulls));
//mFMP->childSetTextArg(info_name[LLModel::LOD_PHYSICS], "[POINTS]", llformat("%d",num_points));
mFMP->childSetTextArg("streaming cost", "[COST]", llformat("%.3f", streaming_cost));
+ mFMP->childSetTextArg("physics cost", "[COST]", llformat("%.3f", physics_cost));
F32 scale = mFMP->childGetValue("import_scale").asReal()*2.f;
mFMP->childSetTextArg("import_dimensions", "[X]", llformat("%.3f", mPreviewScale[0]*scale));
mFMP->childSetTextArg("import_dimensions", "[Y]", llformat("%.3f", mPreviewScale[1]*scale));
@@ -2888,6 +2902,13 @@ void LLModelPreview::genLODs(S32 which_lod, U32 decimation)
{
start = end = which_lod;
}
+ else
+ {
+ //SH-632 -- incremenet triangle count to avoid removing any triangles from
+ //highest LoD when auto-generating LoD
+ triangle_count++;
+ }
+
mMaxTriangleLimit = base_triangle_count;