llmath merge

This commit is contained in:
Shyotl
2016-04-06 01:56:39 -05:00
parent 6ced17242b
commit 8c946dc706
5 changed files with 54 additions and 4 deletions

View File

@@ -2532,6 +2532,8 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
U32 cur_influence = 0;
LLVector4 wght(0,0,0,0);
U32 joints[4] = {0,0,0,0};
LLVector4 joints_with_weights(0,0,0,0);
while (joint != END_INFLUENCES && idx < weights.size())
{
@@ -2539,7 +2541,9 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
influence |= ((U16) weights[idx++] << 8);
F32 w = llclamp((F32) influence / 65535.f, 0.f, 0.99999f);
wght.mV[cur_influence++] = (F32) joint + w;
wght.mV[cur_influence] = w;
joints[cur_influence] = joint;
cur_influence++;
if (cur_influence >= 4)
{
@@ -2550,8 +2554,16 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size)
joint = weights[idx++];
}
}
face.mWeights[cur_vertex].loadua(wght.mV);
F32 wsum = wght.mV[VX] + wght.mV[VY] + wght.mV[VZ] + wght.mV[VW];
if (wsum <= 0.f)
{
wght = LLVector4(0.99999f,0.f,0.f,0.f);
}
for (U32 k=0; k<4; k++)
{
joints_with_weights[k] = (F32) joints[k] + wght[k];
}
face.mWeights[cur_vertex].loadua(joints_with_weights.mV);
cur_vertex++;
}
@@ -6311,6 +6323,8 @@ BOOL LLVolumeFace::createSide(LLVolume* volume, BOOL partial_build)
num_vertices = mNumS*mNumT;
num_indices = (mNumS-1)*(mNumT-1)*6;
partial_build = (num_vertices > mNumVertices || num_indices > mNumIndices) ? FALSE : partial_build;
if (!partial_build)
{
resizeVertices(num_vertices);