diff options
author | McCabe Maxsted | 2010-06-05 09:41:30 -0700 |
---|---|---|
committer | Jacek Antonelli | 2010-06-19 02:43:30 -0500 |
commit | b6cc06db968ecf29de89415fe10d81fdea760ed3 (patch) | |
tree | 37b6297c550eecf9e7aab9d2e53eae47a4a5a24d /linden/indra/llcharacter/llhandmotion.cpp | |
parent | Applied patch by Armin Weatherwax for #79: move AllowIdleAFK from advanced to... (diff) | |
download | meta-impy-b6cc06db968ecf29de89415fe10d81fdea760ed3.zip meta-impy-b6cc06db968ecf29de89415fe10d81fdea760ed3.tar.gz meta-impy-b6cc06db968ecf29de89415fe10d81fdea760ed3.tar.bz2 meta-impy-b6cc06db968ecf29de89415fe10d81fdea760ed3.tar.xz |
Updated llcharacter with some bits from Emerald and SnowGlobe
Diffstat (limited to 'linden/indra/llcharacter/llhandmotion.cpp')
-rw-r--r-- | linden/indra/llcharacter/llhandmotion.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/linden/indra/llcharacter/llhandmotion.cpp b/linden/indra/llcharacter/llhandmotion.cpp index 4c97fcd..2499bb5 100644 --- a/linden/indra/llcharacter/llhandmotion.cpp +++ b/linden/indra/llcharacter/llhandmotion.cpp | |||
@@ -113,9 +113,9 @@ BOOL LLHandMotion::onActivate() | |||
113 | // Note: 0 is the default | 113 | // Note: 0 is the default |
114 | for (S32 i = 1; i < LLHandMotion::NUM_HAND_POSES; i++) | 114 | for (S32 i = 1; i < LLHandMotion::NUM_HAND_POSES; i++) |
115 | { | 115 | { |
116 | mCharacter->setVisualParamWeight(gHandPoseNames[i], 0.f); | 116 | mCharacter->setVisualParamWeight(getHandPoseName((eHandPose)i).c_str(), 0.f); |
117 | } | 117 | } |
118 | mCharacter->setVisualParamWeight(gHandPoseNames[mCurrentPose], 1.f); | 118 | mCharacter->setVisualParamWeight(getHandPoseName(mCurrentPose).c_str(), 1.f); |
119 | mCharacter->updateVisualParams(); | 119 | mCharacter->updateVisualParams(); |
120 | } | 120 | } |
121 | return TRUE; | 121 | return TRUE; |
@@ -138,7 +138,7 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask) | |||
138 | { | 138 | { |
139 | if (mNewPose != HAND_POSE_RELAXED && mNewPose != mCurrentPose) | 139 | if (mNewPose != HAND_POSE_RELAXED && mNewPose != mCurrentPose) |
140 | { | 140 | { |
141 | mCharacter->setVisualParamWeight(gHandPoseNames[mNewPose], 0.f); | 141 | mCharacter->setVisualParamWeight(getHandPoseName(mNewPose).c_str(), 0.f); |
142 | } | 142 | } |
143 | mNewPose = HAND_POSE_RELAXED; | 143 | mNewPose = HAND_POSE_RELAXED; |
144 | } | 144 | } |
@@ -147,7 +147,7 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask) | |||
147 | // this is a new morph we didn't know about before | 147 | // this is a new morph we didn't know about before |
148 | if (*requestedHandPose != mNewPose && mNewPose != mCurrentPose && mNewPose != HAND_POSE_SPREAD) | 148 | if (*requestedHandPose != mNewPose && mNewPose != mCurrentPose && mNewPose != HAND_POSE_SPREAD) |
149 | { | 149 | { |
150 | mCharacter->setVisualParamWeight(gHandPoseNames[mNewPose], 0.f); | 150 | mCharacter->setVisualParamWeight(getHandPoseName(mNewPose).c_str(), 0.f); |
151 | } | 151 | } |
152 | mNewPose = *requestedHandPose; | 152 | mNewPose = *requestedHandPose; |
153 | } | 153 | } |
@@ -166,18 +166,18 @@ BOOL LLHandMotion::onUpdate(F32 time, U8* joint_mask) | |||
166 | 166 | ||
167 | if (mNewPose != HAND_POSE_SPREAD) | 167 | if (mNewPose != HAND_POSE_SPREAD) |
168 | { | 168 | { |
169 | incomingWeight = mCharacter->getVisualParamWeight(gHandPoseNames[mNewPose]); | 169 | incomingWeight = mCharacter->getVisualParamWeight(getHandPoseName(mNewPose).c_str()); |
170 | incomingWeight += (timeDelta / HAND_MORPH_BLEND_TIME); | 170 | incomingWeight += (timeDelta / HAND_MORPH_BLEND_TIME); |
171 | incomingWeight = llclamp(incomingWeight, 0.f, 1.f); | 171 | incomingWeight = llclamp(incomingWeight, 0.f, 1.f); |
172 | mCharacter->setVisualParamWeight(gHandPoseNames[mNewPose], incomingWeight); | 172 | mCharacter->setVisualParamWeight(getHandPoseName(mNewPose).c_str(), incomingWeight); |
173 | } | 173 | } |
174 | 174 | ||
175 | if (mCurrentPose != HAND_POSE_SPREAD) | 175 | if (mCurrentPose != HAND_POSE_SPREAD) |
176 | { | 176 | { |
177 | outgoingWeight = mCharacter->getVisualParamWeight(gHandPoseNames[mCurrentPose]); | 177 | outgoingWeight = mCharacter->getVisualParamWeight(getHandPoseName(mCurrentPose).c_str()); |
178 | outgoingWeight -= (timeDelta / HAND_MORPH_BLEND_TIME); | 178 | outgoingWeight -= (timeDelta / HAND_MORPH_BLEND_TIME); |
179 | outgoingWeight = llclamp(outgoingWeight, 0.f, 1.f); | 179 | outgoingWeight = llclamp(outgoingWeight, 0.f, 1.f); |
180 | mCharacter->setVisualParamWeight(gHandPoseNames[mCurrentPose], outgoingWeight); | 180 | mCharacter->setVisualParamWeight(getHandPoseName(mCurrentPose).c_str(), outgoingWeight); |
181 | } | 181 | } |
182 | 182 | ||
183 | mCharacter->updateVisualParams(); | 183 | mCharacter->updateVisualParams(); |
@@ -199,6 +199,8 @@ void LLHandMotion::onDeactivate() | |||
199 | { | 199 | { |
200 | } | 200 | } |
201 | 201 | ||
202 | //Zwag: Changed the defaults here so things look right. Otherwise the hand ends up | ||
203 | // in a pose that nobody is used to when something messes up. | ||
202 | //----------------------------------------------------------------------------- | 204 | //----------------------------------------------------------------------------- |
203 | // LLHandMotion::getHandPoseName() | 205 | // LLHandMotion::getHandPoseName() |
204 | //----------------------------------------------------------------------------- | 206 | //----------------------------------------------------------------------------- |
@@ -208,7 +210,8 @@ std::string LLHandMotion::getHandPoseName(eHandPose pose) | |||
208 | { | 210 | { |
209 | return std::string(gHandPoseNames[pose]); | 211 | return std::string(gHandPoseNames[pose]); |
210 | } | 212 | } |
211 | return LLStringUtil::null; | 213 | LL_WARNS("Bounds") << "Was passed an invalid hand pose: " << (S32)pose << LL_ENDL; |
214 | return std::string("Hands_Relaxed"); | ||
212 | } | 215 | } |
213 | 216 | ||
214 | LLHandMotion::eHandPose LLHandMotion::getHandPose(std::string posename) | 217 | LLHandMotion::eHandPose LLHandMotion::getHandPose(std::string posename) |
@@ -220,7 +223,7 @@ LLHandMotion::eHandPose LLHandMotion::getHandPose(std::string posename) | |||
220 | return (eHandPose)pose; | 223 | return (eHandPose)pose; |
221 | } | 224 | } |
222 | } | 225 | } |
223 | return (eHandPose)0; | 226 | return (eHandPose)1; |
224 | } | 227 | } |
225 | 228 | ||
226 | // End | 229 | // End |