summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAura Linden <aura@lindenlab.com>2016-02-17 17:02:27 -0800
committerAura Linden <aura@lindenlab.com>2016-02-17 17:02:27 -0800
commit4282de6e8572c4b6a9209bbea601c804406a49b8 (patch)
treedeef5b660299d098754b78beccd679259372547a /indra
parent62d14e1a33edf2df88761969f81e70ecd0081dab (diff)
SL-318 allow joint offset changes in BVH animations up to 5m.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llcharacter/llbvhloader.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp
index 8985dc9521..a6ab801cef 100755
--- a/indra/llcharacter/llbvhloader.cpp
+++ b/indra/llcharacter/llbvhloader.cpp
@@ -487,7 +487,7 @@ void LLBVHLoader::makeTranslation(std::string alias_name, std::string joint_name
newTrans.mFrameMatrix = fm;
- if (joint_name == "mPelvis")
+if (joint_name == "mPelvis")
{
newTrans.mRelativePositionKey = TRUE;
newTrans.mRelativeRotationKey = TRUE;
@@ -960,7 +960,7 @@ void LLBVHLoader::applyTranslations()
//----------------------------------------------------------------
if ( trans.mIgnore )
{
- //LL_INFOS() << "NOTE: Ignoring " << joint->mName.c_str() << LL_ENDL;
+ //LL_INFOS() << "NOTE: Ignoring " << joint->mName.c_str() << LL_ENDL;
joint->mIgnore = TRUE;
continue;
}
@@ -974,13 +974,8 @@ void LLBVHLoader::applyTranslations()
joint->mOutName = trans.mOutName;
}
- //----------------------------------------------------------------
- // Set the ignorepos flag if necessary
- //----------------------------------------------------------------
- if ( joint->mOutName == std::string("mPelvis") )
- {
- joint->mIgnorePositions = FALSE;
- }
+ //Allow joint position changes as of SL-318
+ joint->mIgnorePositions = FALSE;
//----------------------------------------------------------------
// Set the relativepos flags if necessary
@@ -1426,8 +1421,8 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
frame++;
}
- // output position keys (only for 1st joint)
- if ( ji == mJoints.begin() && !joint->mIgnorePositions )
+ // output position keys if joint has motion.
+ if ( !joint->mIgnorePositions )
{
dp.packS32(joint->mNumPosKeys, "num_pos_keys");
@@ -1457,6 +1452,7 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
outPos *= INCHES_TO_METERS;
+ //SL-318 Pelvis position can only move 5m. Limiting all joint position offsets to this dist.
outPos -= relPos;
outPos.clamp(-LL_MAX_PELVIS_OFFSET, LL_MAX_PELVIS_OFFSET);