summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llmodel.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-05-07 17:20:33 -0500
committerDave Parks <davep@lindenlab.com>2013-05-07 17:20:33 -0500
commitdbfcd6c9c5709b74365c2538ba312685b09d22bf (patch)
tree378a109c6094afea0bb32a8a7334b226ab2fc60b /indra/llprimitive/llmodel.cpp
parent2a8ec731c93bb3c119cea166057a027aa37e383b (diff)
Optimization -- don't draw glow in alpha pool unless needed
Diffstat (limited to 'indra/llprimitive/llmodel.cpp')
-rw-r--r--indra/llprimitive/llmodel.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index ef6eb75a6b..e236f98fe6 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1122,6 +1122,43 @@ void LLModel::getNormalizedScaleTranslation(LLVector3& scale_out, LLVector3& tra
translation_out = mNormalizedTranslation;
}
+LLVector3 LLModel::getTransformedCenter(const LLMatrix4& mat)
+{
+ LLVector3 ret;
+
+ if (!mVolumeFaces.empty())
+ {
+ LLMatrix4a m;
+ m.loadu(mat);
+
+ LLVector4a minv,maxv;
+
+ LLVector4a t;
+ m.affineTransform(mVolumeFaces[0].mPositions[0], t);
+ minv = maxv = t;
+
+ for (S32 i = 0; i < mVolumeFaces.size(); ++i)
+ {
+ LLVolumeFace& face = mVolumeFaces[i];
+
+ for (U32 j = 0; j < face.mNumVertices; ++j)
+ {
+ m.affineTransform(face.mPositions[j],t);
+ update_min_max(minv, maxv, t);
+ }
+ }
+
+ minv.add(maxv);
+ minv.mul(0.5f);
+
+ ret.set(minv.getF32ptr());
+ }
+
+ return ret;
+}
+
+
+
void LLModel::setNumVolumeFaces(S32 count)
{
mVolumeFaces.resize(count);