summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-08-17 14:59:22 -0500
committerDave Parks <davep@lindenlab.com>2011-08-17 14:59:22 -0500
commite0bf0e3e2150304e7b26c18c274273c18653965b (patch)
tree659ca3610576703ec909dce77442db73a43260b5 /indra/newview
parentdb951c60adb265c7b72bd5caaf599174e4fd2688 (diff)
SH-2217 Fix for large models not getting properly clampled by importer (odd that server seems to need 240m limit instead of 256m limit)
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 0ce8dcd46b..0c8fd33113 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -3173,11 +3173,6 @@ void LLModelPreview::rebuildUploadData()
LLSpinCtrl* scale_spinner = mFMP->getChild<LLSpinCtrl>("import_scale");
- if (!scale_spinner)
- {
- llerrs << "floater_model_preview.xml MUST contain import_scale spinner." << llendl;
- }
-
F32 scale = scale_spinner->getValue().asReal();
LLMatrix4 scale_mat;
@@ -3262,7 +3257,14 @@ void LLModelPreview::rebuildUploadData()
}
}
- F32 max_import_scale = DEFAULT_MAX_PRIM_SCALE/max_scale;
+ F32 max_import_scale = (DEFAULT_MAX_PRIM_SCALE-0.1f)/max_scale;
+
+ F32 max_axis = llmax(mPreviewScale.mV[0], mPreviewScale.mV[1]);
+ max_axis = llmax(max_axis, mPreviewScale.mV[2]);
+ max_axis *= 2.f;
+
+ //clamp scale so that total imported model bounding box is smaller than 240m on a side
+ max_import_scale = llmin(max_import_scale, 240.f/max_axis);
scale_spinner->setMaxValue(max_import_scale);