diff options
author | Dave Parks <davep@lindenlab.com> | 2011-11-10 14:48:48 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-11-10 14:48:48 -0600 |
commit | 76bd8cee1120ac531d56b9897b135e9c1af1bb16 (patch) | |
tree | 11878ae7f4cf36d38bcaa119478e5aadeaffdd66 /indra/llmath | |
parent | c8f558f6775d62f03d6caab19668df80e95e8a8b (diff) |
SH-2644 Fix debug display that shows selection triangle count and streaming cost
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/llvolume.cpp | 14 | ||||
-rw-r--r-- | 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 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; } diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index f0e59a3c00..afd1ec5eed 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -990,7 +990,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<LLVector3> &vertices, std::vector<LLVector3> &normals, |