summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorprep <prep@lindenlab.com>2010-10-28 13:40:15 -0400
committerprep <prep@lindenlab.com>2010-10-28 13:40:15 -0400
commit53d5fd1e9bb59868b793f9bef0529cd62ca70126 (patch)
treeb0eaf1a4d504f6a51e416c0c57d241b580920e28 /indra/newview/llvovolume.cpp
parent7863674626bcf16ad26f3bb8e77a6ca41998c36b (diff)
- Pelvis offsets are now preserved
- Fix for CTS-261
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index e7e2830f25..0b2adc70d9 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -74,7 +74,6 @@
#include "llviewermediafocus.h"
#include "llvoavatar.h"
-
const S32 MIN_QUIET_FRAMES_COALESCE = 30;
const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
const F32 FORCE_CULL_AREA = 8.f;
@@ -4053,23 +4052,38 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
//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();
+ LLVOAvatar* pAvatarVO = vobj->getAvatar();
if ( pAvatarVO )
{
const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( vobj->getVolume()->getParams().getSculptID() );
+
if ( pSkinData )
{
- const int bindCnt = pSkinData->mAlternateBindMatrix.size();
+ 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 );
+ LLJoint* pJoint = pAvatarVO->getJoint( lookingForJoint );
if ( pJoint )
{
- pJoint->storeCurrentXform( pSkinData->mAlternateBindMatrix[i].getTranslation() );
+ const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation();
+ pJoint->storeCurrentXform( jointPos );
+ //If joint is a pelvis then handle by setting avPos+offset
+ //if ( !strcmp( lookingForJoint.c_str(),"mPelvis" ) )
+ if ( lookingForJoint == "mPelvis" )
+ {
+ //Apply av pos + offset
+ if ( !pAvatarVO->hasPelvisOffset() )
+ {
+ pAvatarVO->setPelvisOffset( true, jointPos );
+ pAvatarVO->setPosition( pAvatarVO->getCharacterPosition() + jointPos );
+ }
+ }
+
+
}
}
}