summaryrefslogtreecommitdiff
path: root/indra/llmath/llvolume.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-09-25 09:27:49 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-09-25 09:27:49 -0700
commit73870cb0b41144dc9932947d13d6aa27952d8849 (patch)
treef712491a5baffb2e7be797d4d9110602687865d8 /indra/llmath/llvolume.cpp
parent3ff3e1a3537a5d051180aaf6223f5ddd8b540d35 (diff)
parent3da26ee8df6cc7e57ba3acbb91437ec97e151002 (diff)
Merge branch 'DRTVWR-559' into DRTVWR-583
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rw-r--r--indra/llmath/llvolume.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 0e3792fda3..6d36daa92a 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -5626,29 +5626,29 @@ bool LLVolumeFace::cacheOptimize(bool gen_tangents)
mWeights[dst_idx].loadua(data.w[src_idx].mV);
}
}
+
+ // put back in normalized coordinate frame
+ LLVector4a inv_scale(1.f/mNormalizedScale.mV[0], 1.f / mNormalizedScale.mV[1], 1.f / mNormalizedScale.mV[2]);
+ LLVector4a scale;
+ scale.load3(mNormalizedScale.mV);
+ scale.getF32ptr()[3] = 1.f;
+
+ for (int i = 0; i < mNumVertices; ++i)
+ {
+ mPositions[i].mul(inv_scale);
+ mNormals[i].mul(scale);
+ mNormals[i].normalize3();
+ F32 w = mTangents[i].getF32ptr()[3];
+ mTangents[i].mul(scale);
+ mTangents[i].normalize3();
+ mTangents[i].getF32ptr()[3] = w;
+ }
}
else
{
// blew past the max vertex size limit, use legacy tangent generation which never adds verts
createTangents();
}
-
- // put back in normalized coordinate frame
- LLVector4a inv_scale(1.f/mNormalizedScale.mV[0], 1.f / mNormalizedScale.mV[1], 1.f / mNormalizedScale.mV[2]);
- LLVector4a scale;
- scale.load3(mNormalizedScale.mV);
- scale.getF32ptr()[3] = 1.f;
-
- for (int i = 0; i < mNumVertices; ++i)
- {
- mPositions[i].mul(inv_scale);
- mNormals[i].mul(scale);
- mNormals[i].normalize3();
- F32 w = mTangents[i].getF32ptr()[3];
- mTangents[i].mul(scale);
- mTangents[i].normalize3();
- mTangents[i].getF32ptr()[3] = w;
- }
}
// cache optimize index buffer