summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llvoavatar.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 439584c7e8..b90c136b21 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -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