summaryrefslogtreecommitdiff
path: root/indra/llprimitive
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2011-06-01 15:44:46 -0700
committerLeyla Farazha <leyla@lindenlab.com>2011-06-01 15:44:46 -0700
commit926a9dcb58106650e8efda7a8a32b58bb6fcbd9e (patch)
tree6d569bbcee6f8448f3307149e4394e9dee9b20b8 /indra/llprimitive
parentfe9eccdbae9af3c61bff4637c1a61cdc09068a32 (diff)
parent5093f604cb04e8de54750498fd7fa01538f4b22c (diff)
merge
Diffstat (limited to 'indra/llprimitive')
-rw-r--r--indra/llprimitive/llmodel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 794cdb83d5..57ac7a143f 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -991,6 +991,9 @@ void LLModel::normalizeVolumeFaces()
scale.splat(1.f);
scale.div(size);
+ LLVector4a inv_scale(1.f);
+ inv_scale.div(scale);
+
for (U32 i = 0; i < mVolumeFaces.size(); ++i)
{
LLVolumeFace& face = mVolumeFaces[i];
@@ -1007,10 +1010,14 @@ void LLModel::normalizeVolumeFaces()
// For all the positions, we scale
// the positions to fit within the unit cube.
LLVector4a* pos = (LLVector4a*) face.mPositions;
+ LLVector4a* norm = (LLVector4a*) face.mNormals;
+
for (U32 j = 0; j < face.mNumVertices; ++j)
{
pos[j].add(trans);
pos[j].mul(scale);
+ norm[j].mul(inv_scale);
+ norm[j].normalize3();
}
}