diff options
Diffstat (limited to 'linden/indra/newview/llvoavatar.cpp')
-rw-r--r-- | linden/indra/newview/llvoavatar.cpp | 58 |
1 files changed, 37 insertions, 21 deletions
diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 53aae14..6798b4d 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.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, |
@@ -311,7 +311,13 @@ class LLBodyNoiseMotion : | |||
311 | { | 311 | { |
312 | public: | 312 | public: |
313 | // Constructor | 313 | // Constructor |
314 | LLBodyNoiseMotion(const LLUUID &id) : LLMotion(id) {mName = "body_noise";} | 314 | LLBodyNoiseMotion(const LLUUID &id) |
315 | : LLMotion(id) | ||
316 | { | ||
317 | mName = "body_noise"; | ||
318 | |||
319 | mTorsoState = new LLJointState; | ||
320 | } | ||
315 | 321 | ||
316 | // Destructor | 322 | // Destructor |
317 | virtual ~LLBodyNoiseMotion() { } | 323 | virtual ~LLBodyNoiseMotion() { } |
@@ -354,14 +360,14 @@ public: | |||
354 | // must return true to indicate success and be available for activation | 360 | // must return true to indicate success and be available for activation |
355 | virtual LLMotionInitStatus onInitialize(LLCharacter *character) | 361 | virtual LLMotionInitStatus onInitialize(LLCharacter *character) |
356 | { | 362 | { |
357 | if( !mTorsoState.setJoint( character->getJoint("mTorso") )) | 363 | if( !mTorsoState->setJoint( character->getJoint("mTorso") )) |
358 | { | 364 | { |
359 | return STATUS_FAILURE; | 365 | return STATUS_FAILURE; |
360 | } | 366 | } |
361 | 367 | ||
362 | mTorsoState.setUsage(LLJointState::ROT); | 368 | mTorsoState->setUsage(LLJointState::ROT); |
363 | 369 | ||
364 | addJointState( &mTorsoState ); | 370 | addJointState( mTorsoState ); |
365 | return STATUS_SUCCESS; | 371 | return STATUS_SUCCESS; |
366 | } | 372 | } |
367 | 373 | ||
@@ -388,7 +394,7 @@ public: | |||
388 | F32 ry = TORSO_NOISE_AMOUNT * DEG_TO_RAD * noiseY / 0.42f; | 394 | F32 ry = TORSO_NOISE_AMOUNT * DEG_TO_RAD * noiseY / 0.42f; |
389 | LLQuaternion tQn; | 395 | LLQuaternion tQn; |
390 | tQn.setQuat( rx, ry, 0.0f ); | 396 | tQn.setQuat( rx, ry, 0.0f ); |
391 | mTorsoState.setRotation( tQn ); | 397 | mTorsoState->setRotation( tQn ); |
392 | 398 | ||
393 | return TRUE; | 399 | return TRUE; |
394 | } | 400 | } |
@@ -400,7 +406,7 @@ public: | |||
400 | //------------------------------------------------------------------------- | 406 | //------------------------------------------------------------------------- |
401 | // joint states to be animated | 407 | // joint states to be animated |
402 | //------------------------------------------------------------------------- | 408 | //------------------------------------------------------------------------- |
403 | LLJointState mTorsoState; | 409 | LLPointer<LLJointState> mTorsoState; |
404 | }; | 410 | }; |
405 | 411 | ||
406 | //----------------------------------------------------------------------------- | 412 | //----------------------------------------------------------------------------- |
@@ -417,6 +423,8 @@ public: | |||
417 | mCharacter(NULL) | 423 | mCharacter(NULL) |
418 | { | 424 | { |
419 | mName = "breathe_rot"; | 425 | mName = "breathe_rot"; |
426 | |||
427 | mChestState = new LLJointState; | ||
420 | } | 428 | } |
421 | 429 | ||
422 | // Destructor | 430 | // Destructor |
@@ -463,12 +471,12 @@ public: | |||
463 | mCharacter = character; | 471 | mCharacter = character; |
464 | bool success = true; | 472 | bool success = true; |
465 | 473 | ||
466 | if ( !mChestState.setJoint( character->getJoint( "mChest" ) ) ) { success = false; } | 474 | if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) ) { success = false; } |
467 | 475 | ||
468 | if ( success ) | 476 | if ( success ) |
469 | { | 477 | { |
470 | mChestState.setUsage(LLJointState::ROT); | 478 | mChestState->setUsage(LLJointState::ROT); |
471 | addJointState( &mChestState ); | 479 | addJointState( mChestState ); |
472 | } | 480 | } |
473 | 481 | ||
474 | if ( success ) | 482 | if ( success ) |
@@ -495,7 +503,7 @@ public: | |||
495 | 503 | ||
496 | F32 breathe_amt = (sinf(mBreatheRate * time) * BREATHE_ROT_MOTION_STRENGTH); | 504 | F32 breathe_amt = (sinf(mBreatheRate * time) * BREATHE_ROT_MOTION_STRENGTH); |
497 | 505 | ||
498 | mChestState.setRotation(LLQuaternion(breathe_amt, LLVector3(0.f, 1.f, 0.f))); | 506 | mChestState->setRotation(LLQuaternion(breathe_amt, LLVector3(0.f, 1.f, 0.f))); |
499 | 507 | ||
500 | return TRUE; | 508 | return TRUE; |
501 | } | 509 | } |
@@ -507,7 +515,7 @@ public: | |||
507 | //------------------------------------------------------------------------- | 515 | //------------------------------------------------------------------------- |
508 | // joint states to be animated | 516 | // joint states to be animated |
509 | //------------------------------------------------------------------------- | 517 | //------------------------------------------------------------------------- |
510 | LLJointState mChestState; | 518 | LLPointer<LLJointState> mChestState; |
511 | F32 mBreatheRate; | 519 | F32 mBreatheRate; |
512 | LLCharacter* mCharacter; | 520 | LLCharacter* mCharacter; |
513 | }; | 521 | }; |
@@ -520,7 +528,13 @@ class LLPelvisFixMotion : | |||
520 | { | 528 | { |
521 | public: | 529 | public: |
522 | // Constructor | 530 | // Constructor |
523 | LLPelvisFixMotion(const LLUUID &id) : LLMotion(id), mCharacter(NULL) {mName = "pelvis_fix";} | 531 | LLPelvisFixMotion(const LLUUID &id) |
532 | : LLMotion(id), mCharacter(NULL) | ||
533 | { | ||
534 | mName = "pelvis_fix"; | ||
535 | |||
536 | mPelvisState = new LLJointState; | ||
537 | } | ||
524 | 538 | ||
525 | // Destructor | 539 | // Destructor |
526 | virtual ~LLPelvisFixMotion() { } | 540 | virtual ~LLPelvisFixMotion() { } |
@@ -565,14 +579,14 @@ public: | |||
565 | { | 579 | { |
566 | mCharacter = character; | 580 | mCharacter = character; |
567 | 581 | ||
568 | if (!mPelvisState.setJoint( character->getJoint("mPelvis"))) | 582 | if (!mPelvisState->setJoint( character->getJoint("mPelvis"))) |
569 | { | 583 | { |
570 | return STATUS_FAILURE; | 584 | return STATUS_FAILURE; |
571 | } | 585 | } |
572 | 586 | ||
573 | mPelvisState.setUsage(LLJointState::POS); | 587 | mPelvisState->setUsage(LLJointState::POS); |
574 | 588 | ||
575 | addJointState( &mPelvisState ); | 589 | addJointState( mPelvisState ); |
576 | return STATUS_SUCCESS; | 590 | return STATUS_SUCCESS; |
577 | } | 591 | } |
578 | 592 | ||
@@ -586,7 +600,7 @@ public: | |||
586 | // must return FALSE when the motion is completed. | 600 | // must return FALSE when the motion is completed. |
587 | virtual BOOL onUpdate(F32 time, U8* joint_mask) | 601 | virtual BOOL onUpdate(F32 time, U8* joint_mask) |
588 | { | 602 | { |
589 | mPelvisState.setPosition(LLVector3::zero); | 603 | mPelvisState->setPosition(LLVector3::zero); |
590 | 604 | ||
591 | return TRUE; | 605 | return TRUE; |
592 | } | 606 | } |
@@ -598,7 +612,7 @@ public: | |||
598 | //------------------------------------------------------------------------- | 612 | //------------------------------------------------------------------------- |
599 | // joint states to be animated | 613 | // joint states to be animated |
600 | //------------------------------------------------------------------------- | 614 | //------------------------------------------------------------------------- |
601 | LLJointState mPelvisState; | 615 | LLPointer<LLJointState> mPelvisState; |
602 | LLCharacter* mCharacter; | 616 | LLCharacter* mCharacter; |
603 | }; | 617 | }; |
604 | 618 | ||
@@ -3413,7 +3427,9 @@ void LLVOAvatar::updateCharacter(LLAgent &agent) | |||
3413 | // AUDIO_STEP_LO_GAIN, AUDIO_STEP_HI_GAIN ); | 3427 | // AUDIO_STEP_LO_GAIN, AUDIO_STEP_HI_GAIN ); |
3414 | 3428 | ||
3415 | F32 ambient_volume = gSavedSettings.getF32("AudioLevelAmbient"); | 3429 | F32 ambient_volume = gSavedSettings.getF32("AudioLevelAmbient"); |
3416 | F32 gain = .50f * ambient_volume * ambient_volume; | 3430 | F32 gain = gSavedSettings.getBOOL("MuteAmbient") |
3431 | ? 0.f | ||
3432 | : (.50f * ambient_volume * ambient_volume); | ||
3417 | LLUUID& step_sound_id = getStepSound(); | 3433 | LLUUID& step_sound_id = getStepSound(); |
3418 | 3434 | ||
3419 | LLVector3d foot_pos_global = gAgent.getPosGlobalFromAgent(foot_pos_agent); | 3435 | LLVector3d foot_pos_global = gAgent.getPosGlobalFromAgent(foot_pos_agent); |
@@ -4388,7 +4404,7 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL | |||
4388 | //else | 4404 | //else |
4389 | { | 4405 | { |
4390 | LLUUID sound_id = LLUUID(gSavedSettings.getString("UISndTyping")); | 4406 | LLUUID sound_id = LLUUID(gSavedSettings.getString("UISndTyping")); |
4391 | F32 volume = gSavedSettings.getF32("AudioLevelSFX"); | 4407 | F32 volume = gSavedSettings.getBOOL("MuteSounds") ? 0.f : gSavedSettings.getF32("AudioLevelSFX"); |
4392 | gAudiop->triggerSound(sound_id, getID(), volume, char_pos_global); | 4408 | gAudiop->triggerSound(sound_id, getID(), volume, char_pos_global); |
4393 | } | 4409 | } |
4394 | } | 4410 | } |