summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2011-04-08 15:58:11 -0400
committerNyx (Neal Orman) <nyx@lindenlab.com>2011-04-08 15:58:11 -0400
commit2deea74cf6f08376e14e2f7e5333fc6959d2af19 (patch)
tree80429812cfb4f88a151627830dceb4a8f2e278dd /indra/newview/llvovolume.cpp
parent534ac19ed5a6abe68ea654a5444b7e486f8ce06a (diff)
parent8807496ed78b36658f488d901842852d63f73cb9 (diff)
merging mesh-development into nyx's mesh development
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp38
1 files changed, 34 insertions, 4 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 7c772ce835..6b7c53f465 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3216,15 +3216,15 @@ U32 LLVOVolume::getRenderCost(texture_cost_t &textures) const
return (U32)shame;
}
-F32 LLVOVolume::getStreamingCost()
+F32 LLVOVolume::getStreamingCost(S32* bytes, S32* visible_bytes)
{
if (isMesh())
{
- const LLSD& header = gMeshRepo.getMeshHeader(getVolume()->getParams().getSculptID());
+ LLSD& header = gMeshRepo.getMeshHeader(getVolume()->getParams().getSculptID());
F32 radius = getScale().length();
- return LLMeshRepository::getStreamingCost(header, radius);
+ return LLMeshRepository::getStreamingCost(header, radius, bytes, visible_bytes, mLOD);
}
return 0.f;
@@ -3249,6 +3249,36 @@ U32 LLVOVolume::getTriangleCount() const
return count;
}
+U32 LLVOVolume::getHighLODTriangleCount()
+{
+ U32 ret = 0;
+
+ LLVolume* volume = getVolume();
+
+ if (!isSculpted())
+ {
+ LLVolume* ref = LLPrimitive::getVolumeManager()->refVolume(volume->getParams(), 3);
+ ret = ref->getNumTriangles();
+ LLPrimitive::getVolumeManager()->unrefVolume(ref);
+ }
+ else if (isMesh())
+ {
+ LLVolume* ref = LLPrimitive::getVolumeManager()->refVolume(volume->getParams(), 3);
+ if (ref->isTetrahedron() || ref->getNumVolumeFaces() == 0)
+ {
+ gMeshRepo.loadMesh(this, volume->getParams(), LLModel::LOD_HIGH);
+ }
+ ret = ref->getNumTriangles();
+ LLPrimitive::getVolumeManager()->unrefVolume(ref);
+ }
+ else
+ { //default sculpts have a constant number of triangles
+ ret = 31*2*31; //31 rows of 31 columns of quads for a 32x32 vertex patch
+ }
+
+ return ret;
+}
+
//static
void LLVOVolume::preUpdateGeom()
{
@@ -4082,7 +4112,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
if ( bindCnt > 0 )
{
const int jointCnt = pSkinData->mJointNames.size();
- const int pelvisZOffset = (int)pSkinData->mPelvisOffset;
+ const F32 pelvisZOffset = pSkinData->mPelvisOffset;
bool fullRig = (jointCnt>=20) ? true : false;
if ( fullRig )
{