summaryrefslogtreecommitdiff
path: root/indra/llmath
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2015-10-13 08:43:03 -0400
committerOz Linden <oz@lindenlab.com>2015-10-13 08:43:03 -0400
commit69ff937e47248eca0a4f876efebe97ee57bd4da9 (patch)
tree4fde61ed0ed439b0bf033b15f6703d72bee6f561 /indra/llmath
parent9367a3787929dfff8b46763d9a7b4872c469e85a (diff)
parent4312629e7c5749b86add9d42e6e550602f34dbf5 (diff)
merge changes for 3.8.5-release
Diffstat (limited to 'indra/llmath')
-rwxr-xr-xindra/llmath/llvolume.cpp30
-rwxr-xr-xindra/llmath/llvolume.h4
2 files changed, 25 insertions, 9 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 994a9e79a6..d932eb53a0 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -2536,6 +2536,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())
{
@@ -2543,7 +2545,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)
{
@@ -2554,8 +2558,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++;
}
@@ -5584,7 +5596,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build)
{
resizeVertices(num_vertices+1);
- if (!partial_build)
+ //if (!partial_build)
{
resizeIndices(num_indices+3);
}
@@ -5592,7 +5604,7 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build)
else
{
resizeVertices(num_vertices);
- if (!partial_build)
+ //if (!partial_build)
{
resizeIndices(num_indices);
}
@@ -5714,10 +5726,10 @@ BOOL LLVolumeFace::createCap(LLVolume* volume, BOOL partial_build)
LL_CHECK_MEMORY
- if (partial_build)
- {
- return TRUE;
- }
+ //if (partial_build)
+ //{
+ // return TRUE;
+ //}
if (mTypeMask & HOLLOW_MASK)
{
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index 625f7cff02..1da2d0c6b1 100755
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -190,8 +190,12 @@ const U8 LL_SCULPT_TYPE_MESH = 5;
const U8 LL_SCULPT_TYPE_MASK = LL_SCULPT_TYPE_SPHERE | LL_SCULPT_TYPE_TORUS | LL_SCULPT_TYPE_PLANE |
LL_SCULPT_TYPE_CYLINDER | LL_SCULPT_TYPE_MESH;
+// for value checks, assign new value after adding new types
+const U8 LL_SCULPT_TYPE_MAX = LL_SCULPT_TYPE_MESH;
+
const U8 LL_SCULPT_FLAG_INVERT = 64;
const U8 LL_SCULPT_FLAG_MIRROR = 128;
+const U8 LL_SCULPT_FLAG_MASK = LL_SCULPT_FLAG_INVERT | LL_SCULPT_FLAG_MIRROR;
const S32 LL_SCULPT_MESH_MAX_FACES = 8;