diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/llcharacter/llkeyframemotion.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llcharacter/llkeyframemotion.cpp | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/linden/indra/llcharacter/llkeyframemotion.cpp b/linden/indra/llcharacter/llkeyframemotion.cpp index 34decd6..f53b01f 100644 --- a/linden/indra/llcharacter/llkeyframemotion.cpp +++ b/linden/indra/llcharacter/llkeyframemotion.cpp | |||
@@ -71,6 +71,15 @@ static F32 MAX_CONSTRAINTS = 10; | |||
71 | // JointMotionList | 71 | // JointMotionList |
72 | //----------------------------------------------------------------------------- | 72 | //----------------------------------------------------------------------------- |
73 | LLKeyframeMotion::JointMotionList::JointMotionList() | 73 | LLKeyframeMotion::JointMotionList::JointMotionList() |
74 | : mDuration(0.f), | ||
75 | mLoop(FALSE), | ||
76 | mLoopInPoint(0.f), | ||
77 | mLoopOutPoint(0.f), | ||
78 | mEaseInDuration(0.f), | ||
79 | mEaseOutDuration(0.f), | ||
80 | mBasePriority(LLJoint::LOW_PRIORITY), | ||
81 | mHandPose(LLHandMotion::HAND_POSE_SPREAD), | ||
82 | mMaxPriority(LLJoint::LOW_PRIORITY) | ||
74 | { | 83 | { |
75 | } | 84 | } |
76 | 85 | ||
@@ -646,9 +655,9 @@ BOOL LLKeyframeMotion::setupPose() | |||
646 | BOOL LLKeyframeMotion::onActivate() | 655 | BOOL LLKeyframeMotion::onActivate() |
647 | { | 656 | { |
648 | // If the keyframe anim has an associated emote, trigger it. | 657 | // If the keyframe anim has an associated emote, trigger it. |
649 | if( mEmoteName.length() > 0 ) | 658 | if( mJointMotionList->mEmoteName.length() > 0 ) |
650 | { | 659 | { |
651 | mCharacter->startMotion( gAnimLibrary.stringToAnimState(mEmoteName.c_str()) ); | 660 | mCharacter->startMotion( gAnimLibrary.stringToAnimState(mJointMotionList->mEmoteName) ); |
652 | } | 661 | } |
653 | 662 | ||
654 | mLastLoopedTime = 0.f; | 663 | mLastLoopedTime = 0.f; |
@@ -1221,7 +1230,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1221 | //------------------------------------------------------------------------- | 1230 | //------------------------------------------------------------------------- |
1222 | // get emote (optional) | 1231 | // get emote (optional) |
1223 | //------------------------------------------------------------------------- | 1232 | //------------------------------------------------------------------------- |
1224 | if (!dp.unpackString(mEmoteName, "emote_name")) | 1233 | if (!dp.unpackString(mJointMotionList->mEmoteName, "emote_name")) |
1225 | { | 1234 | { |
1226 | llwarns << "can't read optional_emote_animation" << llendl; | 1235 | llwarns << "can't read optional_emote_animation" << llendl; |
1227 | return FALSE; | 1236 | return FALSE; |
@@ -1663,7 +1672,7 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) | |||
1663 | if (!parent) | 1672 | if (!parent) |
1664 | { | 1673 | { |
1665 | llwarns << "Joint with no parent: " << joint->getName() | 1674 | llwarns << "Joint with no parent: " << joint->getName() |
1666 | << " Emote: " << mEmoteName << llendl; | 1675 | << " Emote: " << mJointMotionList->mEmoteName << llendl; |
1667 | return FALSE; | 1676 | return FALSE; |
1668 | } | 1677 | } |
1669 | joint = parent; | 1678 | joint = parent; |
@@ -1701,7 +1710,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const | |||
1701 | success &= dp.packU16(KEYFRAME_MOTION_SUBVERSION, "sub_version"); | 1710 | success &= dp.packU16(KEYFRAME_MOTION_SUBVERSION, "sub_version"); |
1702 | success &= dp.packS32(mJointMotionList->mBasePriority, "base_priority"); | 1711 | success &= dp.packS32(mJointMotionList->mBasePriority, "base_priority"); |
1703 | success &= dp.packF32(mJointMotionList->mDuration, "duration"); | 1712 | success &= dp.packF32(mJointMotionList->mDuration, "duration"); |
1704 | success &= dp.packString(mEmoteName.c_str(), "emote_name"); | 1713 | success &= dp.packString(mJointMotionList->mEmoteName, "emote_name"); |
1705 | success &= dp.packF32(mJointMotionList->mLoopInPoint, "loop_in_point"); | 1714 | success &= dp.packF32(mJointMotionList->mLoopInPoint, "loop_in_point"); |
1706 | success &= dp.packF32(mJointMotionList->mLoopOutPoint, "loop_out_point"); | 1715 | success &= dp.packF32(mJointMotionList->mLoopOutPoint, "loop_out_point"); |
1707 | success &= dp.packS32(mJointMotionList->mLoop, "loop"); | 1716 | success &= dp.packS32(mJointMotionList->mLoop, "loop"); |
@@ -1713,7 +1722,7 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const | |||
1713 | for (U32 i = 0; i < mJointMotionList->getNumJointMotions(); i++) | 1722 | for (U32 i = 0; i < mJointMotionList->getNumJointMotions(); i++) |
1714 | { | 1723 | { |
1715 | JointMotion* joint_motionp = mJointMotionList->getJointMotion(i); | 1724 | JointMotion* joint_motionp = mJointMotionList->getJointMotion(i); |
1716 | success &= dp.packString(joint_motionp->mJointName.c_str(), "joint_name"); | 1725 | success &= dp.packString(joint_motionp->mJointName, "joint_name"); |
1717 | success &= dp.packS32(joint_motionp->mPriority, "joint_priority"); | 1726 | success &= dp.packS32(joint_motionp->mPriority, "joint_priority"); |
1718 | success &= dp.packS32(joint_motionp->mRotationCurve.mNumKeys, "num_rot_keys"); | 1727 | success &= dp.packS32(joint_motionp->mRotationCurve.mNumKeys, "num_rot_keys"); |
1719 | 1728 | ||
@@ -1839,11 +1848,11 @@ void LLKeyframeMotion::setEmote(const LLUUID& emote_id) | |||
1839 | const char* emote_name = gAnimLibrary.animStateToString(emote_id); | 1848 | const char* emote_name = gAnimLibrary.animStateToString(emote_id); |
1840 | if (emote_name) | 1849 | if (emote_name) |
1841 | { | 1850 | { |
1842 | mEmoteName = emote_name; | 1851 | mJointMotionList->mEmoteName = emote_name; |
1843 | } | 1852 | } |
1844 | else | 1853 | else |
1845 | { | 1854 | { |
1846 | mEmoteName = ""; | 1855 | mJointMotionList->mEmoteName = ""; |
1847 | } | 1856 | } |
1848 | } | 1857 | } |
1849 | 1858 | ||
@@ -2114,11 +2123,19 @@ void LLKeyframeDataCache::clear() | |||
2114 | //----------------------------------------------------------------------------- | 2123 | //----------------------------------------------------------------------------- |
2115 | LLKeyframeMotion::JointConstraint::JointConstraint(JointConstraintSharedData* shared_data) : mSharedData(shared_data) | 2124 | LLKeyframeMotion::JointConstraint::JointConstraint(JointConstraintSharedData* shared_data) : mSharedData(shared_data) |
2116 | { | 2125 | { |
2126 | mWeight = 0.f; | ||
2117 | mTotalLength = 0.f; | 2127 | mTotalLength = 0.f; |
2118 | mActive = FALSE; | 2128 | mActive = FALSE; |
2119 | mSourceVolume = NULL; | 2129 | mSourceVolume = NULL; |
2120 | mTargetVolume = NULL; | 2130 | mTargetVolume = NULL; |
2121 | mFixupDistanceRMS = 0.f; | 2131 | mFixupDistanceRMS = 0.f; |
2132 | |||
2133 | int i; | ||
2134 | for (i=0; i<MAX_CHAIN_LENGTH; ++i) | ||
2135 | { | ||
2136 | mJointLengths[i] = 0.f; | ||
2137 | mJointLengthFractions[i] = 0.f; | ||
2138 | } | ||
2122 | } | 2139 | } |
2123 | 2140 | ||
2124 | //----------------------------------------------------------------------------- | 2141 | //----------------------------------------------------------------------------- |