Another part of the pelvis fix. Sh-634

meow-7.2.2
prep 2011-02-17 13:01:29 -05:00
parent c15dc4faf3
commit 800e931104
1 changed files with 17 additions and 5 deletions

View File

@ -1332,14 +1332,26 @@ const LLVector3 LLVOAvatar::getRenderPosition() const
}
else if (isRoot())
{
//Rebase the pelvis position if the avatar contains a pelvis offset
if ( mHasPelvisOffset )
{
LLVector3 returnVec( mDrawable->getPositionAgent() );
//1. Move the pelvis down by the old amount
returnVec[VZ] -= (mLastPelvisToFoot);
//2. Now move the pelvis up by the new amount
returnVec[VZ] += mPelvisToFoot;
//3. Return the fixed up pelvis position
if ( mLastPelvisToFoot > mPelvisToFoot )
{
F32 diff = mLastPelvisToFoot - mPelvisToFoot;
//1. Move the pelvis down by the difference of the old amount and the new pelvis to foot amount
returnVec[VZ] -= (diff);
//2. Now move the pelvis up by the new pelvis to foot amount
returnVec[VZ] += mPelvisToFoot;
}
else
{
//1. Move the pelvis down by the old pelvis to foot amount
returnVec[VZ] -= (mLastPelvisToFoot);
//2. Now move the pelvis up by the new pelvis to foot amount
returnVec[VZ] += mPelvisToFoot;
}
//Return the fixed up pelvis position
return returnVec;
}
else