diff options
Diffstat (limited to 'indra/newview/llviewerobject.cpp')
| -rw-r--r-- | indra/newview/llviewerobject.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 7c26cb3c9f..57915cca85 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4034,6 +4034,11 @@ U32 LLViewerObject::getTriangleCount(S32* vcount) const return 0; } +U32 LLViewerObject::getLODTriangleCount(S32 lod) +{ + return 0; +} + U32 LLViewerObject::getHighLODTriangleCount() { return 0; @@ -4055,6 +4060,27 @@ U32 LLViewerObject::recursiveGetTriangleCount(S32* vcount) const return total_tris; } +void LLViewerObject::recursiveGetLODTriangleCount(S32& high_lod, S32& medium_lod, S32& low_lod, S32& lowest_lod) +{ + high_lod = (S32)getLODTriangleCount(LLModel::LOD_HIGH); + medium_lod = (S32)getLODTriangleCount(LLModel::LOD_MEDIUM); + low_lod = (S32)getLODTriangleCount(LLModel::LOD_LOW); + lowest_lod = (S32)getLODTriangleCount(LLModel::LOD_IMPOSTOR); + LLViewerObject::const_child_list_t& child_list = getChildren(); + for (LLViewerObject::const_child_list_t::const_iterator iter = child_list.begin(); + iter != child_list.end(); ++iter) + { + LLViewerObject* childp = *iter; + if (childp) + { + high_lod += (S32)childp->getLODTriangleCount(LLModel::LOD_HIGH); + medium_lod += (S32)childp->getLODTriangleCount(LLModel::LOD_MEDIUM); + low_lod += (S32)childp->getLODTriangleCount(LLModel::LOD_LOW); + lowest_lod += (S32)childp->getLODTriangleCount(LLModel::LOD_IMPOSTOR); + } + } +} + // This is using the stored surface area for each volume (which // defaults to 1.0 for the case of everything except a sculpt) and // then scaling it linearly based on the largest dimension in the |
