diff options
author | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-09-25 19:20:46 -0700 |
---|---|---|
committer | Jonathan "Geenz" Goodman <geenz@geenzo.com> | 2023-09-25 19:20:46 -0700 |
commit | 18b219cf83a1cd405cf36b9f58fc48f717409598 (patch) | |
tree | e50c6ac1ae9a6b8017f4a1333245cb3ab77e35bc /indra/newview/llface.cpp | |
parent | d092f3e1dc1c322a0c3c1e55b9b6e1792d6b0f59 (diff) |
Start removing the concept of placement mode - it's either a mirror or not.
DRTVWR-583
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r-- | indra/newview/llface.cpp | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 4dd991ee60..2c04224fa0 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -490,28 +490,6 @@ U16 LLFace::getGeometry(LLStrider<LLVector3> &vertices, LLStrider<LLVector3> &no LLVector3 LLFace::getAverageNormal() { - if (!mHasAverageNormal) - { - if (mVertexBuffer.notNull()) - { - if (mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) - { - LLStrider<LLVector3> normals; - mVertexBuffer->getNormalStrider(normals, mGeomIndex, mGeomCount); - LLVector3 normal_total; - - for (int i = 0; i < mVertexBuffer->getNumVerts(); i++) - { - normal_total += *normals.get(); - normals++; - } - - mAverageNormal = normal_total / mVertexBuffer->getNumVerts(); - mHasAverageNormal = true; - } - } - } - return mAverageNormal; } @@ -1916,14 +1894,21 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, F32* normals = (F32*) norm.get(); LLVector4a* src = vf.mNormals; LLVector4a* end = src+num_vertices; - + + LLVector4a normal_total; + while (src < end) { LLVector4a normal; mat_normal.rotate(*src++, normal); normal.store4a(normals); + normal_total.add(normal); normals += 4; } + + normal_total.div(LLVector4a(num_vertices)); + + mAverageNormal = LLVector3(normal_total[0], normal_total[1], normal_total[2]); } if (rebuild_tangent) |