From dc3831c86b6294d9a9ffa874f7cf5710976f0ea2 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 23 Nov 2011 23:04:54 -0600 Subject: [PATCH] llmath v3 merge. --- indra/llmath/llvolume.cpp | 14 ++++++++++++-- indra/llmath/llvolume.h | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index abe1cd402..c1dec6f95 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -4320,15 +4320,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; } diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index a20e9a5c9..cff68b600 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -1016,7 +1016,7 @@ public: S32 getNumTriangleIndices() const; static void getLoDTriangleCounts(const LLVolumeParams& params, S32* counts); - S32 getNumTriangles() const; + S32 getNumTriangles(S32* vcount = NULL) const; void generateSilhouetteVertices(std::vector &vertices, std::vector &normals,