aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcharacter/llkeyframefallmotion.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:27 -0500
committerJacek Antonelli2008-08-15 23:45:27 -0500
commita8a62201ba762e98dff92cf49033e577fc34d8d4 (patch)
tree11f8513c5cdc222f2fac0c93eb724c089803c200 /linden/indra/llcharacter/llkeyframefallmotion.cpp
parentSecond Life viewer sources 1.18.6.4-RC (diff)
downloadmeta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.zip
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.gz
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.bz2
meta-impy-a8a62201ba762e98dff92cf49033e577fc34d8d4.tar.xz
Second Life viewer sources 1.19.0.0
Diffstat (limited to 'linden/indra/llcharacter/llkeyframefallmotion.cpp')
-rw-r--r--linden/indra/llcharacter/llkeyframefallmotion.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/linden/indra/llcharacter/llkeyframefallmotion.cpp b/linden/indra/llcharacter/llkeyframefallmotion.cpp
index d3113fa..4a1f525 100644
--- a/linden/indra/llcharacter/llkeyframefallmotion.cpp
+++ b/linden/indra/llcharacter/llkeyframefallmotion.cpp
@@ -12,12 +12,12 @@
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlife.com/developers/opensource/gplv2 15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 * 16 *
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlife.com/developers/opensource/flossexception 20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 21 *
22 * By copying, modifying or distributing this software, you acknowledge 22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 23 * that you have read and understood your obligations described above,
@@ -75,13 +75,13 @@ LLMotion::LLMotionInitStatus LLKeyframeFallMotion::onInitialize(LLCharacter *cha
75 // load keyframe data, setup pose and joint states 75 // load keyframe data, setup pose and joint states
76 LLMotion::LLMotionInitStatus result = LLKeyframeMotion::onInitialize(character); 76 LLMotion::LLMotionInitStatus result = LLKeyframeMotion::onInitialize(character);
77 77
78 for (U32 jm=0; jm<mJointMotionList->mNumJointMotions; jm++) 78 for (U32 jm=0; jm<mJointMotionList->getNumJointMotions(); jm++)
79 { 79 {
80 if (!mJointStates[jm].getJoint()) 80 if (!mJointStates[jm]->getJoint())
81 continue; 81 continue;
82 if (mJointStates[jm].getJoint()->getName() == std::string("mPelvis")) 82 if (mJointStates[jm]->getJoint()->getName() == std::string("mPelvis"))
83 { 83 {
84 mPelvisStatep = &mJointStates[jm]; 84 mPelvisState = mJointStates[jm];
85 } 85 }
86 } 86 }
87 87
@@ -124,8 +124,11 @@ BOOL LLKeyframeFallMotion::onUpdate(F32 activeTime, U8* joint_mask)
124 BOOL result = LLKeyframeMotion::onUpdate(activeTime, joint_mask); 124 BOOL result = LLKeyframeMotion::onUpdate(activeTime, joint_mask);
125 F32 slerp_amt = clamp_rescale(activeTime / getDuration(), 0.5f, 0.75f, 0.f, 1.f); 125 F32 slerp_amt = clamp_rescale(activeTime / getDuration(), 0.5f, 0.75f, 0.f, 1.f);
126 126
127 mPelvisStatep->setRotation(mPelvisStatep->getRotation() * slerp(slerp_amt, mRotationToGroundNormal, LLQuaternion())); 127 if (mPelvisState.notNull())
128 128 {
129 mPelvisState->setRotation(mPelvisState->getRotation() * slerp(slerp_amt, mRotationToGroundNormal, LLQuaternion()));
130 }
131
129 return result; 132 return result;
130} 133}
131 134