summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2014-08-29 14:03:09 -0700
committerGraham Linden <graham@lindenlab.com>2014-08-29 14:03:09 -0700
commit6004ad167458914c3b85438b96e81ea8796e368b (patch)
tree580a5810253c407919be175dcea43abf18d1042e /indra
parent96a3a858b4ce49a83b18493854abd88f4b14d629 (diff)
Fix for degen phys tris from falling back to non-hull geo
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp63
1 files changed, 28 insertions, 35 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 6aa41ef768..cfe2ea0307 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1441,31 +1441,35 @@ void LLModelPreview::rebuildUploadData()
}
else
{
- int searchLOD = (i > LLModel::LOD_HIGH) ? LLModel::LOD_HIGH : i;
- while ((searchLOD <= LLModel::LOD_HIGH) && !lod_model)
- {
- std::string name_to_match = instance.mLabel;
- llassert(!name_to_match.empty());
- std::string toAdd;
- switch (searchLOD)
+ if (i != LLModel::LOD_PHYSICS)
+ {
+ int searchLOD = (i > LLModel::LOD_HIGH) ? LLModel::LOD_HIGH : i;
+ while ((searchLOD <= LLModel::LOD_HIGH) && !lod_model)
{
- case LLModel::LOD_IMPOSTOR: toAdd = "_LOD0"; break;
- case LLModel::LOD_LOW: toAdd = "_LOD1"; break;
- case LLModel::LOD_MEDIUM: toAdd = "_LOD2"; break;
- case LLModel::LOD_PHYSICS: toAdd = "_PHYS"; break;
- case LLModel::LOD_HIGH: break;
- }
+ std::string name_to_match = instance.mLabel;
+ llassert(!name_to_match.empty());
- if (name_to_match.find(toAdd) == -1)
- {
- name_to_match += toAdd;
- }
+ std::string toAdd;
+ switch (searchLOD)
+ {
+ case LLModel::LOD_IMPOSTOR: toAdd = "_LOD0"; break;
+ case LLModel::LOD_LOW: toAdd = "_LOD1"; break;
+ case LLModel::LOD_MEDIUM: toAdd = "_LOD2"; break;
+ case LLModel::LOD_PHYSICS: toAdd = "_PHYS"; break;
+ case LLModel::LOD_HIGH: break;
+ }
- // See if we can find an appropriately named model in LOD 'searchLOD'
- //
- FindModel(mScene[searchLOD], name_to_match, lod_model, transform);
- searchLOD++;
+ if (name_to_match.find(toAdd) == -1)
+ {
+ name_to_match += toAdd;
+ }
+
+ // See if we can find an appropriately named model in LOD 'searchLOD'
+ //
+ FindModel(mScene[searchLOD], name_to_match, lod_model, transform);
+ searchLOD++;
+ }
}
// Fall back to old method of index-based association if
@@ -1473,22 +1477,11 @@ void LLModelPreview::rebuildUploadData()
//
if (lod_model)
{
- if (i == LLModel::LOD_PHYSICS)
- {
- if (importerDebug)
- {
- LL_INFOS() << "Falling back collision for " << instance.mLabel << " to " << lod_model->mLabel << LL_ENDL;
- }
- instance.mLOD[i] = lod_model;
- }
- else
+ if (importerDebug)
{
- if (importerDebug)
- {
- LL_INFOS() << "Falling back LOD" << i << " for " << instance.mLabel << " to found " << lod_model->mLabel << LL_ENDL;
- }
- instance.mLOD[i] = lod_model;
+ LL_INFOS() << "Falling back LOD" << i << " for " << instance.mLabel << " to found " << lod_model->mLabel << LL_ENDL;
}
+ instance.mLOD[i] = lod_model;
}
else
{