diff options
Diffstat (limited to 'indra/llcharacter/llkeyframefallmotion.cpp')
-rw-r--r-- | indra/llcharacter/llkeyframefallmotion.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/indra/llcharacter/llkeyframefallmotion.cpp b/indra/llcharacter/llkeyframefallmotion.cpp index bcef7a3fda..13308f4e4a 100644 --- a/indra/llcharacter/llkeyframefallmotion.cpp +++ b/indra/llcharacter/llkeyframefallmotion.cpp @@ -75,13 +75,13 @@ LLMotion::LLMotionInitStatus LLKeyframeFallMotion::onInitialize(LLCharacter *cha // load keyframe data, setup pose and joint states LLMotion::LLMotionInitStatus result = LLKeyframeMotion::onInitialize(character); - for (U32 jm=0; jm<mJointMotionList->mNumJointMotions; jm++) + for (U32 jm=0; jm<mJointMotionList->getNumJointMotions(); jm++) { - if (!mJointStates[jm].getJoint()) + if (!mJointStates[jm]->getJoint()) continue; - if (mJointStates[jm].getJoint()->getName() == std::string("mPelvis")) + if (mJointStates[jm]->getJoint()->getName() == std::string("mPelvis")) { - mPelvisStatep = &mJointStates[jm]; + mPelvisState = mJointStates[jm]; } } @@ -124,8 +124,11 @@ BOOL LLKeyframeFallMotion::onUpdate(F32 activeTime, U8* joint_mask) BOOL result = LLKeyframeMotion::onUpdate(activeTime, joint_mask); F32 slerp_amt = clamp_rescale(activeTime / getDuration(), 0.5f, 0.75f, 0.f, 1.f); - mPelvisStatep->setRotation(mPelvisStatep->getRotation() * slerp(slerp_amt, mRotationToGroundNormal, LLQuaternion())); - + if (mPelvisState.notNull()) + { + mPelvisState->setRotation(mPelvisState->getRotation() * slerp(slerp_amt, mRotationToGroundNormal, LLQuaternion())); + } + return result; } |