summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorprep <prep@lindenlab.com>2011-02-17 13:01:29 -0500
committerprep <prep@lindenlab.com>2011-02-17 13:01:29 -0500
commit800e93110462e1d6b91c09f1efe3164733006fc6 (patch)
tree4d6e10adf90bd961604d6beb64b833a7154dc4ed
parentc15dc4faf35e8a0b3ec713fe0da0a489e77580bd (diff)
Another part of the pelvis fix. Sh-634
-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