diff options
author | Roxie Linden <roxie@lindenlab.com> | 2024-05-06 16:40:12 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-05-06 16:40:12 -0700 |
commit | 4af9128db1fb65ff99d1e8086352698f46e049b4 (patch) | |
tree | 4b98d8afb138a4a1ac9f2d4b01a7d83dce314d17 /indra/llprimitive/llmodel.cpp | |
parent | 05b2dd913fcb1c5485ce19885e4e60f26752e6b0 (diff) | |
parent | 10aa7f4254fd04c24f15f507188705146f92ee60 (diff) |
Merge branch 'main' of https://github.com/secondlife/viewer into roxie/webrtc-voice
Diffstat (limited to 'indra/llprimitive/llmodel.cpp')
-rw-r--r-- | indra/llprimitive/llmodel.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 99a5697a84..7b0d2632aa 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -68,6 +68,7 @@ LLModel::~LLModel() { LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID); } + mPhysics.mMesh.clear(); } //static @@ -1041,7 +1042,12 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos) weight_map::iterator iterPos = mSkinWeights.begin(); weight_map::iterator iterEnd = mSkinWeights.end(); - llassert(!mSkinWeights.empty()); + if (mSkinWeights.empty()) + { + // function calls iter->second on all return paths + // everything that calls this function should precheck that there is data. + LL_ERRS() << "called getJointInfluences with empty weights list" << LL_ENDL; + } for ( ; iterPos!=iterEnd; ++iterPos ) { @@ -1068,11 +1074,16 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos) const F32 epsilon = 1e-5f; weight_map::iterator iter_up = mSkinWeights.lower_bound(pos); weight_map::iterator iter_down = iter_up; - if (iter_up != mSkinWeights.end()) - { - iter_down = ++iter_up; - } - weight_map::iterator best = iter_up; + weight_map::iterator best = iter_up; + if (iter_up != mSkinWeights.end()) + { + iter_down = ++iter_up; + } + else + { + // Assumes that there is at least one element + --best; + } F32 min_dist = (iter->first - pos).magVec(); |