summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp68
1 files changed, 68 insertions, 0 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 4ef050e71f..8eabe8ed90 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1354,6 +1354,9 @@ BOOL LLVOVolume::genBBoxes(BOOL force_global)
LLVector4a min,max;
+ min.clear();
+ max.clear();
+
BOOL rebuild = mDrawable->isState(LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION | LLDrawable::REBUILD_RIGGED);
// bool rigged = false;
@@ -3204,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()
{
@@ -4024,6 +4066,32 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
//get drawpool of avatar with rigged face
LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj);
+ //Determine if we've received skininfo that contains an
+ //alternate bind matrix - if it does then apply the translational component
+ //to the joints of the avatar.
+ const LLVOAvatar* pAvatarVO = vobj->getAvatar();
+ if ( pAvatarVO )
+ {
+ const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( vobj->getVolume()->getParams().getSculptID() );
+ if ( pSkinData )
+ {
+ const int bindCnt = pSkinData->mAlternateBindMatrix.size();
+ if ( bindCnt > 0 )
+ {
+ const int jointCnt = pSkinData->mJointNames.size();
+ for ( int i=0; i<jointCnt; ++i )
+ {
+ std::string lookingForJoint = pSkinData->mJointNames[i].c_str();
+ LLJoint* pJoint = vobj->getAvatar()->getJoint( lookingForJoint );
+ if ( pJoint )
+ {
+ pJoint->storeCurrentXform( pSkinData->mAlternateBindMatrix[i].getTranslation() );
+ }
+ }
+ }
+ }
+ }
+
if (pool)
{
const LLTextureEntry* te = facep->getTextureEntry();