diff options
Diffstat (limited to 'linden/indra/llcharacter')
-rw-r--r-- | linden/indra/llcharacter/llanimationstates.cpp | 139 | ||||
-rw-r--r-- | linden/indra/llcharacter/llanimationstates.h | 13 | ||||
-rw-r--r-- | linden/indra/llcharacter/llcharacter.cpp | 21 | ||||
-rw-r--r-- | linden/indra/llcharacter/llcharacter.h | 3 | ||||
-rw-r--r-- | linden/indra/llcharacter/llmotion.cpp | 28 | ||||
-rw-r--r-- | linden/indra/llcharacter/llmotion.h | 4 |
6 files changed, 118 insertions, 90 deletions
diff --git a/linden/indra/llcharacter/llanimationstates.cpp b/linden/indra/llcharacter/llanimationstates.cpp index 81e15c7..2b13b0a 100644 --- a/linden/indra/llcharacter/llanimationstates.cpp +++ b/linden/indra/llcharacter/llanimationstates.cpp | |||
@@ -260,76 +260,77 @@ LLUUID LLAnimationLibrary::stringToAnimState( const char *name, BOOL allow_ids ) | |||
260 | } | 260 | } |
261 | 261 | ||
262 | // Animation states that the user can trigger as part of a gesture | 262 | // Animation states that the user can trigger as part of a gesture |
263 | // See struct LLAnimStateEntry in header for label location information | ||
263 | const LLAnimStateEntry gUserAnimStates[] = { | 264 | const LLAnimStateEntry gUserAnimStates[] = { |
264 | LLAnimStateEntry("Afraid", "express_afraid", ANIM_AGENT_AFRAID), | 265 | LLAnimStateEntry("express_afraid", ANIM_AGENT_AFRAID), |
265 | LLAnimStateEntry("Angry", "express_anger", ANIM_AGENT_ANGRY), | 266 | LLAnimStateEntry("express_anger", ANIM_AGENT_ANGRY), |
266 | LLAnimStateEntry("Away", "away", ANIM_AGENT_AWAY), | 267 | LLAnimStateEntry("away", ANIM_AGENT_AWAY), |
267 | LLAnimStateEntry("Backflip", "backflip", ANIM_AGENT_BACKFLIP), | 268 | LLAnimStateEntry("backflip", ANIM_AGENT_BACKFLIP), |
268 | LLAnimStateEntry("Belly Laugh", "express_laugh", ANIM_AGENT_BELLY_LAUGH), | 269 | LLAnimStateEntry("express_laugh", ANIM_AGENT_BELLY_LAUGH), |
269 | LLAnimStateEntry("BigSmile", "express_toothsmile", ANIM_AGENT_EXPRESS_TOOTHSMILE), | 270 | LLAnimStateEntry("express_toothsmile", ANIM_AGENT_EXPRESS_TOOTHSMILE), |
270 | LLAnimStateEntry("Blow Kiss", "blowkiss", ANIM_AGENT_BLOW_KISS), | 271 | LLAnimStateEntry("blowkiss", ANIM_AGENT_BLOW_KISS), |
271 | LLAnimStateEntry("Bored", "express_bored", ANIM_AGENT_BORED), | 272 | LLAnimStateEntry("express_bored", ANIM_AGENT_BORED), |
272 | LLAnimStateEntry("Bow", "bow", ANIM_AGENT_BOW), | 273 | LLAnimStateEntry("bow", ANIM_AGENT_BOW), |
273 | LLAnimStateEntry("Clap", "clap", ANIM_AGENT_CLAP), | 274 | LLAnimStateEntry("clap", ANIM_AGENT_CLAP), |
274 | LLAnimStateEntry("Court Bow", "courtbow", ANIM_AGENT_COURTBOW), | 275 | LLAnimStateEntry("courtbow", ANIM_AGENT_COURTBOW), |
275 | LLAnimStateEntry("Cry", "express_cry", ANIM_AGENT_CRY), | 276 | LLAnimStateEntry("express_cry", ANIM_AGENT_CRY), |
276 | LLAnimStateEntry("Dance 1", "dance1", ANIM_AGENT_DANCE1), | 277 | LLAnimStateEntry("dance1", ANIM_AGENT_DANCE1), |
277 | LLAnimStateEntry("Dance 2", "dance2", ANIM_AGENT_DANCE2), | 278 | LLAnimStateEntry("dance2", ANIM_AGENT_DANCE2), |
278 | LLAnimStateEntry("Dance 3", "dance3", ANIM_AGENT_DANCE3), | 279 | LLAnimStateEntry("dance3", ANIM_AGENT_DANCE3), |
279 | LLAnimStateEntry("Dance 4", "dance4", ANIM_AGENT_DANCE4), | 280 | LLAnimStateEntry("dance4", ANIM_AGENT_DANCE4), |
280 | LLAnimStateEntry("Dance 5", "dance5", ANIM_AGENT_DANCE5), | 281 | LLAnimStateEntry("dance5", ANIM_AGENT_DANCE5), |
281 | LLAnimStateEntry("Dance 6", "dance6", ANIM_AGENT_DANCE6), | 282 | LLAnimStateEntry("dance6", ANIM_AGENT_DANCE6), |
282 | LLAnimStateEntry("Dance 7", "dance7", ANIM_AGENT_DANCE7), | 283 | LLAnimStateEntry("dance7", ANIM_AGENT_DANCE7), |
283 | LLAnimStateEntry("Dance 8", "dance8", ANIM_AGENT_DANCE8), | 284 | LLAnimStateEntry("dance8", ANIM_AGENT_DANCE8), |
284 | LLAnimStateEntry("Disdain", "express_disdain", ANIM_AGENT_EXPRESS_DISDAIN), | 285 | LLAnimStateEntry("express_disdain", ANIM_AGENT_EXPRESS_DISDAIN), |
285 | LLAnimStateEntry("Drink", "drink", ANIM_AGENT_DRINK), | 286 | LLAnimStateEntry("drink", ANIM_AGENT_DRINK), |
286 | LLAnimStateEntry("Embarrassed", "express_embarrased", ANIM_AGENT_EMBARRASSED), | 287 | LLAnimStateEntry("express_embarrased", ANIM_AGENT_EMBARRASSED), |
287 | LLAnimStateEntry("Finger Wag", "angry_fingerwag", ANIM_AGENT_FINGER_WAG), | 288 | LLAnimStateEntry("angry_fingerwag", ANIM_AGENT_FINGER_WAG), |
288 | LLAnimStateEntry("Fist Pump", "fist_pump", ANIM_AGENT_FIST_PUMP), | 289 | LLAnimStateEntry("fist_pump", ANIM_AGENT_FIST_PUMP), |
289 | LLAnimStateEntry("Floating Yoga", "yoga_float", ANIM_AGENT_YOGA_FLOAT), | 290 | LLAnimStateEntry("yoga_float", ANIM_AGENT_YOGA_FLOAT), |
290 | LLAnimStateEntry("Frown", "express_frown", ANIM_AGENT_EXPRESS_FROWN), | 291 | LLAnimStateEntry("express_frown", ANIM_AGENT_EXPRESS_FROWN), |
291 | LLAnimStateEntry("Impatient", "impatient", ANIM_AGENT_IMPATIENT), | 292 | LLAnimStateEntry("impatient", ANIM_AGENT_IMPATIENT), |
292 | LLAnimStateEntry("Jump For Joy", "jumpforjoy", ANIM_AGENT_JUMP_FOR_JOY), | 293 | LLAnimStateEntry("jumpforjoy", ANIM_AGENT_JUMP_FOR_JOY), |
293 | LLAnimStateEntry("Kiss My Butt", "kissmybutt", ANIM_AGENT_KISS_MY_BUTT), | 294 | LLAnimStateEntry("kissmybutt", ANIM_AGENT_KISS_MY_BUTT), |
294 | LLAnimStateEntry("Kiss", "express_kiss", ANIM_AGENT_EXPRESS_KISS), | 295 | LLAnimStateEntry("express_kiss", ANIM_AGENT_EXPRESS_KISS), |
295 | LLAnimStateEntry("Laugh", "laugh_short", ANIM_AGENT_LAUGH_SHORT), | 296 | LLAnimStateEntry("laugh_short", ANIM_AGENT_LAUGH_SHORT), |
296 | LLAnimStateEntry("Muscle Beach", "musclebeach", ANIM_AGENT_MUSCLE_BEACH), | 297 | LLAnimStateEntry("musclebeach", ANIM_AGENT_MUSCLE_BEACH), |
297 | LLAnimStateEntry("No (Unhappy)", "no_unhappy", ANIM_AGENT_NO_UNHAPPY), | 298 | LLAnimStateEntry("no_unhappy", ANIM_AGENT_NO_UNHAPPY), |
298 | LLAnimStateEntry("No", "no_head", ANIM_AGENT_NO), | 299 | LLAnimStateEntry("no_head", ANIM_AGENT_NO), |
299 | LLAnimStateEntry("Nya-nya-nya", "nyanya", ANIM_AGENT_NYAH_NYAH), | 300 | LLAnimStateEntry("nyanya", ANIM_AGENT_NYAH_NYAH), |
300 | LLAnimStateEntry("One-Two Punch", "punch_onetwo", ANIM_AGENT_ONETWO_PUNCH), | 301 | LLAnimStateEntry("punch_onetwo", ANIM_AGENT_ONETWO_PUNCH), |
301 | LLAnimStateEntry("Open Mouth", "express_open_mouth", ANIM_AGENT_EXPRESS_OPEN_MOUTH), | 302 | LLAnimStateEntry("express_open_mouth", ANIM_AGENT_EXPRESS_OPEN_MOUTH), |
302 | LLAnimStateEntry("Peace", "peace", ANIM_AGENT_PEACE), | 303 | LLAnimStateEntry("peace", ANIM_AGENT_PEACE), |
303 | LLAnimStateEntry("Point at Other", "point_you", ANIM_AGENT_POINT_YOU), | 304 | LLAnimStateEntry("point_you", ANIM_AGENT_POINT_YOU), |
304 | LLAnimStateEntry("Point at Self", "point_me", ANIM_AGENT_POINT_ME), | 305 | LLAnimStateEntry("point_me", ANIM_AGENT_POINT_ME), |
305 | LLAnimStateEntry("Punch Left", "punch_l", ANIM_AGENT_PUNCH_LEFT), | 306 | LLAnimStateEntry("punch_l", ANIM_AGENT_PUNCH_LEFT), |
306 | LLAnimStateEntry("Punch Right", "punch_r", ANIM_AGENT_PUNCH_RIGHT), | 307 | LLAnimStateEntry("punch_r", ANIM_AGENT_PUNCH_RIGHT), |
307 | LLAnimStateEntry("RPS count", "rps_countdown", ANIM_AGENT_RPS_COUNTDOWN), | 308 | LLAnimStateEntry("rps_countdown", ANIM_AGENT_RPS_COUNTDOWN), |
308 | LLAnimStateEntry("RPS paper", "rps_paper", ANIM_AGENT_RPS_PAPER), | 309 | LLAnimStateEntry("rps_paper", ANIM_AGENT_RPS_PAPER), |
309 | LLAnimStateEntry("RPS rock", "rps_rock", ANIM_AGENT_RPS_ROCK), | 310 | LLAnimStateEntry("rps_rock", ANIM_AGENT_RPS_ROCK), |
310 | LLAnimStateEntry("RPS scissors", "rps_scissors", ANIM_AGENT_RPS_SCISSORS), | 311 | LLAnimStateEntry("rps_scissors", ANIM_AGENT_RPS_SCISSORS), |
311 | LLAnimStateEntry("Repulsed", "express_repulsed", ANIM_AGENT_EXPRESS_REPULSED), | 312 | LLAnimStateEntry("express_repulsed", ANIM_AGENT_EXPRESS_REPULSED), |
312 | LLAnimStateEntry("Roundhouse Kick", "kick_roundhouse_r", ANIM_AGENT_ROUNDHOUSE_KICK), | 313 | LLAnimStateEntry("kick_roundhouse_r", ANIM_AGENT_ROUNDHOUSE_KICK), |
313 | LLAnimStateEntry("Sad", "express_sad", ANIM_AGENT_SAD), | 314 | LLAnimStateEntry("express_sad", ANIM_AGENT_SAD), |
314 | LLAnimStateEntry("Salute", "salute", ANIM_AGENT_SALUTE), | 315 | LLAnimStateEntry("salute", ANIM_AGENT_SALUTE), |
315 | LLAnimStateEntry("Shout", "shout", ANIM_AGENT_SHOUT), | 316 | LLAnimStateEntry("shout", ANIM_AGENT_SHOUT), |
316 | LLAnimStateEntry("Shrug", "express_shrug", ANIM_AGENT_SHRUG), | 317 | LLAnimStateEntry("express_shrug", ANIM_AGENT_SHRUG), |
317 | LLAnimStateEntry("Smile", "express_smile", ANIM_AGENT_EXPRESS_SMILE), | 318 | LLAnimStateEntry("express_smile", ANIM_AGENT_EXPRESS_SMILE), |
318 | LLAnimStateEntry("Smoke Idle", "smoke_idle", ANIM_AGENT_SMOKE_IDLE), | 319 | LLAnimStateEntry("smoke_idle", ANIM_AGENT_SMOKE_IDLE), |
319 | LLAnimStateEntry("Smoke Inhale", "smoke_inhale", ANIM_AGENT_SMOKE_INHALE), | 320 | LLAnimStateEntry("smoke_inhale", ANIM_AGENT_SMOKE_INHALE), |
320 | LLAnimStateEntry("Smoke Throw Down","smoke_throw_down", ANIM_AGENT_SMOKE_THROW_DOWN), | 321 | LLAnimStateEntry("smoke_throw_down", ANIM_AGENT_SMOKE_THROW_DOWN), |
321 | LLAnimStateEntry("Surprise", "express_surprise", ANIM_AGENT_SURPRISE), | 322 | LLAnimStateEntry("express_surprise", ANIM_AGENT_SURPRISE), |
322 | LLAnimStateEntry("Sword Strike", "sword_strike_r", ANIM_AGENT_SWORD_STRIKE), | 323 | LLAnimStateEntry("sword_strike_r", ANIM_AGENT_SWORD_STRIKE), |
323 | LLAnimStateEntry("Tantrum", "angry_tantrum", ANIM_AGENT_TANTRUM), | 324 | LLAnimStateEntry("angry_tantrum", ANIM_AGENT_TANTRUM), |
324 | LLAnimStateEntry("TongueOut", "express_tongue_out", ANIM_AGENT_EXPRESS_TONGUE_OUT), | 325 | LLAnimStateEntry("express_tongue_out", ANIM_AGENT_EXPRESS_TONGUE_OUT), |
325 | LLAnimStateEntry("Wave", "hello", ANIM_AGENT_HELLO), | 326 | LLAnimStateEntry("hello", ANIM_AGENT_HELLO), |
326 | LLAnimStateEntry("Whisper", "whisper", ANIM_AGENT_WHISPER), | 327 | LLAnimStateEntry("whisper", ANIM_AGENT_WHISPER), |
327 | LLAnimStateEntry("Whistle", "whistle", ANIM_AGENT_WHISTLE), | 328 | LLAnimStateEntry("whistle", ANIM_AGENT_WHISTLE), |
328 | LLAnimStateEntry("Wink", "express_wink", ANIM_AGENT_WINK), | 329 | LLAnimStateEntry("express_wink", ANIM_AGENT_WINK), |
329 | LLAnimStateEntry("Wink (Hollywood)","wink_hollywood", ANIM_AGENT_WINK_HOLLYWOOD), | 330 | LLAnimStateEntry("wink_hollywood", ANIM_AGENT_WINK_HOLLYWOOD), |
330 | LLAnimStateEntry("Worry", "express_worry", ANIM_AGENT_EXPRESS_WORRY), | 331 | LLAnimStateEntry("express_worry", ANIM_AGENT_EXPRESS_WORRY), |
331 | LLAnimStateEntry("Yes (Happy)", "yes_happy", ANIM_AGENT_YES_HAPPY), | 332 | LLAnimStateEntry("yes_happy", ANIM_AGENT_YES_HAPPY), |
332 | LLAnimStateEntry("Yes", "yes_head", ANIM_AGENT_YES), | 333 | LLAnimStateEntry("yes_head", ANIM_AGENT_YES), |
333 | }; | 334 | }; |
334 | 335 | ||
335 | const S32 gUserAnimStatesCount = sizeof(gUserAnimStates) / sizeof(gUserAnimStates[0]); | 336 | const S32 gUserAnimStatesCount = sizeof(gUserAnimStates) / sizeof(gUserAnimStates[0]); |
diff --git a/linden/indra/llcharacter/llanimationstates.h b/linden/indra/llcharacter/llanimationstates.h index b2ed27a..dd269de 100644 --- a/linden/indra/llcharacter/llanimationstates.h +++ b/linden/indra/llcharacter/llanimationstates.h | |||
@@ -227,13 +227,18 @@ public: | |||
227 | 227 | ||
228 | struct LLAnimStateEntry | 228 | struct LLAnimStateEntry |
229 | { | 229 | { |
230 | LLAnimStateEntry(const char* label, const char* name, const LLUUID& id) | 230 | LLAnimStateEntry(const char* name, const LLUUID& id) : |
231 | : mLabel(label), | ||
232 | mName(name), | 231 | mName(name), |
233 | mID(id) | 232 | mID(id) |
234 | { } | 233 | { |
234 | // LABELS: | ||
235 | // Look to newview/LLAnimStateLabels.* for how to get the labels. | ||
236 | // The labels should no longer be stored in this structure. The server | ||
237 | // shouldn't care about the local friendly name of an animation, and | ||
238 | // this is common code. | ||
239 | } | ||
240 | |||
235 | 241 | ||
236 | const char* mLabel; | ||
237 | const char* mName; | 242 | const char* mName; |
238 | const LLUUID mID; | 243 | const LLUUID mID; |
239 | }; | 244 | }; |
diff --git a/linden/indra/llcharacter/llcharacter.cpp b/linden/indra/llcharacter/llcharacter.cpp index 0339cf0..ad648f8 100644 --- a/linden/indra/llcharacter/llcharacter.cpp +++ b/linden/indra/llcharacter/llcharacter.cpp | |||
@@ -377,6 +377,27 @@ void LLCharacter::clearVisualParamWeights() | |||
377 | } | 377 | } |
378 | 378 | ||
379 | //----------------------------------------------------------------------------- | 379 | //----------------------------------------------------------------------------- |
380 | // BOOL visualParamWeightsAreDefault() | ||
381 | //----------------------------------------------------------------------------- | ||
382 | BOOL LLCharacter::visualParamWeightsAreDefault() | ||
383 | { | ||
384 | for (LLVisualParam *param = getFirstVisualParam(); | ||
385 | param; | ||
386 | param = getNextVisualParam()) | ||
387 | { | ||
388 | if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) | ||
389 | { | ||
390 | if (param->getWeight() != param->getDefaultWeight()) | ||
391 | return false; | ||
392 | } | ||
393 | } | ||
394 | |||
395 | return true; | ||
396 | } | ||
397 | |||
398 | |||
399 | |||
400 | //----------------------------------------------------------------------------- | ||
380 | // getVisualParam() | 401 | // getVisualParam() |
381 | //----------------------------------------------------------------------------- | 402 | //----------------------------------------------------------------------------- |
382 | LLVisualParam* LLCharacter::getVisualParam(const char *param_name) | 403 | LLVisualParam* LLCharacter::getVisualParam(const char *param_name) |
diff --git a/linden/indra/llcharacter/llcharacter.h b/linden/indra/llcharacter/llcharacter.h index 46faab1..7a841ef 100644 --- a/linden/indra/llcharacter/llcharacter.h +++ b/linden/indra/llcharacter/llcharacter.h | |||
@@ -207,6 +207,9 @@ public: | |||
207 | // set all morph weights to 0 | 207 | // set all morph weights to 0 |
208 | void clearVisualParamWeights(); | 208 | void clearVisualParamWeights(); |
209 | 209 | ||
210 | // see if all the weights are default | ||
211 | BOOL visualParamWeightsAreDefault(); | ||
212 | |||
210 | // visual parameter accessors | 213 | // visual parameter accessors |
211 | LLVisualParam* getFirstVisualParam() | 214 | LLVisualParam* getFirstVisualParam() |
212 | { | 215 | { |
diff --git a/linden/indra/llcharacter/llmotion.cpp b/linden/indra/llcharacter/llmotion.cpp index 899796c..f7b8f1f 100644 --- a/linden/indra/llcharacter/llmotion.cpp +++ b/linden/indra/llcharacter/llmotion.cpp | |||
@@ -47,22 +47,20 @@ | |||
47 | // LLMotion() | 47 | // LLMotion() |
48 | // Class Constructor | 48 | // Class Constructor |
49 | //----------------------------------------------------------------------------- | 49 | //----------------------------------------------------------------------------- |
50 | LLMotion::LLMotion( const LLUUID &id ) | 50 | LLMotion::LLMotion( const LLUUID &id ) : |
51 | mStopped(TRUE), | ||
52 | mActive(FALSE), | ||
53 | mID(id), | ||
54 | mActivationTimestamp(0.f), | ||
55 | mStopTimestamp(0.f), | ||
56 | mSendStopTimestamp(F32_MAX), | ||
57 | mResidualWeight(0.f), | ||
58 | mFadeWeight(1.f), | ||
59 | mDeactivateCallback(NULL), | ||
60 | mDeactivateCallbackUserData(NULL) | ||
51 | { | 61 | { |
52 | mActivationTimestamp = 0.f; | 62 | for (int i=0; i<3; ++i) |
53 | mStopTimestamp = 0.f; | 63 | memset(&mJointSignature[i][0], 0, sizeof(U8) * LL_CHARACTER_MAX_JOINTS); |
54 | mSendStopTimestamp = F32_MAX; | ||
55 | mResidualWeight = 0.f; | ||
56 | mFadeWeight = 1.f; | ||
57 | mStopped = TRUE; | ||
58 | mActive = FALSE; | ||
59 | mDeactivateCallback = NULL; | ||
60 | |||
61 | memset(&mJointSignature[0][0], 0, sizeof(U8) * LL_CHARACTER_MAX_JOINTS); | ||
62 | memset(&mJointSignature[1][0], 0, sizeof(U8) * LL_CHARACTER_MAX_JOINTS); | ||
63 | memset(&mJointSignature[2][0], 0, sizeof(U8) * LL_CHARACTER_MAX_JOINTS); | ||
64 | |||
65 | mID = id; | ||
66 | } | 64 | } |
67 | 65 | ||
68 | //----------------------------------------------------------------------------- | 66 | //----------------------------------------------------------------------------- |
diff --git a/linden/indra/llcharacter/llmotion.h b/linden/indra/llcharacter/llmotion.h index 188937d..c7bb55d 100644 --- a/linden/indra/llcharacter/llmotion.h +++ b/linden/indra/llcharacter/llmotion.h | |||
@@ -49,13 +49,13 @@ class LLCharacter; | |||
49 | class LLMotion | 49 | class LLMotion |
50 | { | 50 | { |
51 | public: | 51 | public: |
52 | enum LLMotionBlendType | 52 | typedef enum LLMotionBlendType |
53 | { | 53 | { |
54 | NORMAL_BLEND, | 54 | NORMAL_BLEND, |
55 | ADDITIVE_BLEND | 55 | ADDITIVE_BLEND |
56 | }; | 56 | }; |
57 | 57 | ||
58 | enum LLMotionInitStatus | 58 | typedef enum LLMotionInitStatus |
59 | { | 59 | { |
60 | STATUS_FAILURE, | 60 | STATUS_FAILURE, |
61 | STATUS_SUCCESS, | 61 | STATUS_SUCCESS, |