summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Stearns <howard.stearns@gmail.com>2022-02-25 18:32:55 -0800
committerHoward Stearns <howard.stearns@gmail.com>2022-02-25 18:32:55 -0800
commit9210ec8a82226bd0786d309fcf9e056d08ed1b0f (patch)
treec06ded3311bb5933193c917c8d8d2e6c03a215ec
parent1abc02ed6b5578f758e37abb5858a24408be4c68 (diff)
SL-9748 - Apply explicitly given physics shape only if the usual rules do not.
-rw-r--r--indra/newview/llmodelpreview.cpp16
-rw-r--r--indra/newview/llmodelpreview.h2
2 files changed, 17 insertions, 1 deletions
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index a9e80ab5da..a1420fba17 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -529,6 +529,16 @@ void LLModelPreview::rebuildUploadData()
LLFloaterModelPreview::addStringToLog(out, false);
}
}
+ if (!mLastSpecifiedPhysicsModelOriginalName.empty() && !lod_model && (i == LLModel::LOD_PHYSICS))
+ {
+ // Despite the various strategies above, if we don't now have a physics model, we're going to end up with decomposition.
+ // That's ok, but in the case where someone supplied a physics file, that's probably not what they wanted.
+ std::ostringstream out;
+ out << "Reusing previously matched physics model " << mLastSpecifiedPhysicsModelOriginalName;
+ LL_INFOS() << out.str() << LL_ENDL;
+ LLFloaterModelPreview::addStringToLog(out, false);
+ lod_model = mLastSpecifiedPhysicsP;
+ }
if (lod_model)
{
@@ -1185,7 +1195,11 @@ void LLModelPreview::loadModelCallback(S32 loaded_lod)
LL_WARNS() << out.str() << LL_ENDL;
LLFloaterModelPreview::addStringToLog(out, false);
}
-
+ if (loaded_lod == LLModel::LOD_PHYSICS)
+ {
+ mLastSpecifiedPhysicsModelOriginalName = loaded_name;
+ mLastSpecifiedPhysicsP = mModel[loaded_lod][idx];
+ }
mModel[loaded_lod][idx]->mLabel = name;
}
}
diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h
index 3664a27a72..5a9fc93879 100644
--- a/indra/newview/llmodelpreview.h
+++ b/indra/newview/llmodelpreview.h
@@ -217,6 +217,8 @@ private:
LLVOAvatar* getPreviewAvatar(void) { return mPreviewAvatar; }
// Count amount of original models, excluding sub-models
static U32 countRootModels(LLModelLoader::model_list models);
+ LLModel* mLastSpecifiedPhysicsP{}; // As opposed to being found by name or LOD;
+ std::string mLastSpecifiedPhysicsModelOriginalName{""}; // Since the above will have it's label bashed.
protected:
friend class LLModelLoader;