summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-09-29 16:09:21 -0500
committerDave Parks <davep@lindenlab.com>2010-09-29 16:09:21 -0500
commit0c93da0501ab1debd6fa11af29a215be81f7b803 (patch)
tree6000b7d56747ddc210c52f7fea55a99a8aee6414 /indra/newview/llvovolume.cpp
parent91a8d7a2191e670e160e64859792db390b5d1757 (diff)
SH-224 Add new streaming cost algorithm debug displays to viewer.
Add the ability to clear LOD slots. Make triangle count UI more responsive to Generate LOD button. Add triangle count debug display for current selection. Reviewed by Nyx
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 30bd981aa6..8eabe8ed90 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3207,6 +3207,45 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
}
+F32 LLVOVolume::getStreamingCost()
+{
+ std::string header_lod[] =
+ {
+ "lowest_lod",
+ "low_lod",
+ "medium_lod",
+ "high_lod"
+ };
+
+
+ if (isMesh())
+ {
+ const LLSD& header = gMeshRepo.getMeshHeader(getVolume()->getParams().getSculptID());
+
+ F32 radius = getRadius();
+
+ return LLMeshRepository::getStreamingCost(header, radius);
+ }
+
+
+ return 0.f;
+}
+
+U32 LLVOVolume::getTriangleCount()
+{
+ U32 count = 0;
+ LLVolume* volume = getVolume();
+ if (volume)
+ {
+ for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
+ {
+ count += volume->getVolumeFace(i).mNumIndices/3;
+ }
+ }
+
+ return count;
+}
+
//static
void LLVOVolume::preUpdateGeom()
{