diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-05-28 03:15:43 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-05-28 18:16:43 +0300 |
| commit | 0be27809566c1378fa613aa7c42bfd2406a9f764 (patch) | |
| tree | c2fea1e46237c991a26d8aa763272ea60704865d /indra/newview/llviewerobject.cpp | |
| parent | a1b68fb8ed6c2589dd13bd9ba1fab7050ba38226 (diff) | |
#5855 Added a way to check triangles for all lods
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 |
