summaryrefslogtreecommitdiff
path: root/indra/llmath/llvolume.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2016-06-03 08:08:41 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2016-06-03 08:08:41 -0400
commitbd09297b8ec465a52f294092998812745ec6c566 (patch)
tree8e5b4b5d6e0a8b8ddc8f6f8232dc6a5ff03a3618 /indra/llmath/llvolume.cpp
parent32d28317d4c88013974fa0551fae01bc332fae4a (diff)
SL-220 - handle case that a weighted vertex includes no skin weights
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rw-r--r--indra/llmath/llvolume.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 2918e2e272..ac6f77b5ab 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2563,11 +2563,13 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
{
wght = LLVector4(0.999f,0.f,0.f,0.f);
}
- for (U32 k=0; k<cur_influence; k++)
+ for (U32 k=0; k<4; k++)
{
F32 f_combined = (F32) joints[k] + wght[k];
- llassert(f_combined-(S32)f_combined>0); // If this fails, we have a floating point precision error.
joints_with_weights[k] = f_combined;
+ // Any weights we added above should wind up non-zero and applied to a specific bone.
+ // A failure here would indicate a floating point precision error in the math.
+ llassert((k >= cur_influence) || (f_combined - S32(f_combined) > 0.0f));
}
face.mWeights[cur_vertex].loadua(joints_with_weights.mV);