diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-12-05 09:36:41 -0800 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-12-05 09:36:41 -0800 |
commit | 837e4e5165cc3e6595577e90bae240e676be8ffe (patch) | |
tree | 85c8e8a8cb6adf8abc87fe3a70d4513a1ab625e5 /indra/llmath/llvolume.cpp | |
parent | 570d02dc7e41c3e08477e7f759d632db78690eb4 (diff) | |
parent | 71974461114d81f818f69a4344ce4071c20f331f (diff) |
Merge with viewer-experience
Diffstat (limited to 'indra/llmath/llvolume.cpp')
-rw-r--r-- | indra/llmath/llvolume.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 1a95f9cd46..da0fa32963 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4305,15 +4305,25 @@ S32 LLVolume::getNumTriangleIndices() const } -S32 LLVolume::getNumTriangles() const +S32 LLVolume::getNumTriangles(S32* vcount) const { U32 triangle_count = 0; + U32 vertex_count = 0; for (S32 i = 0; i < getNumVolumeFaces(); ++i) { - triangle_count += getVolumeFace(i).mNumIndices/3; + const LLVolumeFace& face = getVolumeFace(i); + triangle_count += face.mNumIndices/3; + + vertex_count += face.mNumVertices; } + + if (vcount) + { + *vcount = vertex_count; + } + return triangle_count; } |