aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcharacter
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:01 -0500
committerJacek Antonelli2008-08-15 23:45:01 -0500
commit28d8d4e7664bcd6c8369cc18832e42096af7cad2 (patch)
tree069020fe66339aff2ca4176370ff743b14713f2d /linden/indra/llcharacter
parentSecond Life viewer sources 1.17.2.0 (diff)
downloadmeta-impy-28d8d4e7664bcd6c8369cc18832e42096af7cad2.zip
meta-impy-28d8d4e7664bcd6c8369cc18832e42096af7cad2.tar.gz
meta-impy-28d8d4e7664bcd6c8369cc18832e42096af7cad2.tar.bz2
meta-impy-28d8d4e7664bcd6c8369cc18832e42096af7cad2.tar.xz
Second Life viewer sources 1.17.3.0
Diffstat (limited to 'linden/indra/llcharacter')
-rw-r--r--linden/indra/llcharacter/llheadrotmotion.cpp20
-rw-r--r--linden/indra/llcharacter/lljointstate.h2
-rw-r--r--linden/indra/llcharacter/llmotioncontroller.cpp21
-rw-r--r--linden/indra/llcharacter/llmotioncontroller.h2
-rw-r--r--linden/indra/llcharacter/llvisualparam.h4
5 files changed, 24 insertions, 25 deletions
diff --git a/linden/indra/llcharacter/llheadrotmotion.cpp b/linden/indra/llcharacter/llheadrotmotion.cpp
index cfab048..73f8e8b 100644
--- a/linden/indra/llcharacter/llheadrotmotion.cpp
+++ b/linden/indra/llcharacter/llheadrotmotion.cpp
@@ -438,6 +438,10 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
438 up.setVec(eye_look_at % left); 438 up.setVec(eye_look_at % left);
439 439
440 target_eye_rot = LLQuaternion(eye_look_at, left, up); 440 target_eye_rot = LLQuaternion(eye_look_at, left, up);
441 // convert target rotation to head-local coordinates
442 target_eye_rot *= ~mHeadJoint->getWorldRotation();
443 // constrain target orientation to be in front of avatar's face
444 target_eye_rot.constrain(EYE_ROT_LIMIT_ANGLE);
441 445
442 // calculate vergence 446 // calculate vergence
443 F32 interocular_dist = (mLeftEyeState.getJoint()->getWorldPosition() - mRightEyeState.getJoint()->getWorldPosition()).magVec(); 447 F32 interocular_dist = (mLeftEyeState.getJoint()->getWorldPosition() - mRightEyeState.getJoint()->getWorldPosition()).magVec();
@@ -446,7 +450,7 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
446 } 450 }
447 else 451 else
448 { 452 {
449 target_eye_rot = mHeadJoint->getWorldRotation(); 453 target_eye_rot = LLQuaternion::DEFAULT;
450 vergence = 0.f; 454 vergence = 0.f;
451 } 455 }
452 456
@@ -488,18 +492,8 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
488 vergence_quat.transQuat(); 492 vergence_quat.transQuat();
489 right_eye_rot = vergence_quat * eye_jitter_rot * right_eye_rot; 493 right_eye_rot = vergence_quat * eye_jitter_rot * right_eye_rot;
490 494
491 //set final eye rotations 495 mLeftEyeState.setRotation( left_eye_rot );
492 // start with left 496 mRightEyeState.setRotation( right_eye_rot );
493 LLQuaternion tQw = mLeftEyeState.getJoint()->getParent()->getWorldRotation();
494 LLQuaternion tQh = left_eye_rot * ~tQw;
495 tQh.constrain(EYE_ROT_LIMIT_ANGLE);
496 mLeftEyeState.setRotation( tQh );
497
498 // now do right eye
499 tQw = mRightEyeState.getJoint()->getParent()->getWorldRotation();
500 tQh = right_eye_rot * ~tQw;
501 tQh.constrain(EYE_ROT_LIMIT_ANGLE);
502 mRightEyeState.setRotation( tQh );
503 497
504 return TRUE; 498 return TRUE;
505} 499}
diff --git a/linden/indra/llcharacter/lljointstate.h b/linden/indra/llcharacter/lljointstate.h
index 8b55410..5311374 100644
--- a/linden/indra/llcharacter/lljointstate.h
+++ b/linden/indra/llcharacter/lljointstate.h
@@ -118,7 +118,7 @@ public:
118 void setScale( const LLVector3& scale ) { llassert(mUsage & SCALE); mScale = scale; } 118 void setScale( const LLVector3& scale ) { llassert(mUsage & SCALE); mScale = scale; }
119 119
120 // get/set priority 120 // get/set priority
121 const LLJoint::JointPriority getPriority() { return mPriority; } 121 LLJoint::JointPriority getPriority() { return mPriority; }
122 void setPriority( const LLJoint::JointPriority priority ) { mPriority = priority; } 122 void setPriority( const LLJoint::JointPriority priority ) { mPriority = priority; }
123}; 123};
124 124
diff --git a/linden/indra/llcharacter/llmotioncontroller.cpp b/linden/indra/llcharacter/llmotioncontroller.cpp
index 3ef35ec..2427fd8 100644
--- a/linden/indra/llcharacter/llmotioncontroller.cpp
+++ b/linden/indra/llcharacter/llmotioncontroller.cpp
@@ -360,7 +360,7 @@ BOOL LLMotionController::startMotion(const LLUUID &id, F32 start_offset)
360 { 360 {
361 if (motion->isStopped()) // motion has been stopped 361 if (motion->isStopped()) // motion has been stopped
362 { 362 {
363 deactivateMotion(motion); 363 deactivateMotion(motion, false);
364 } 364 }
365 else if (mTime < motion->mSendStopTimestamp) // motion is still active 365 else if (mTime < motion->mSendStopTimestamp) // motion is still active
366 { 366 {
@@ -396,7 +396,7 @@ BOOL LLMotionController::stopMotionLocally(const LLUUID &id, BOOL stop_immediate
396 396
397 if (stop_immediate) 397 if (stop_immediate)
398 { 398 {
399 deactivateMotion(motion); 399 deactivateMotion(motion, false);
400 } 400 }
401 return TRUE; 401 return TRUE;
402 } 402 }
@@ -492,7 +492,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
492 { 492 {
493 if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration()) 493 if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration())
494 { 494 {
495 deactivateMotion(motionp); 495 deactivateMotion(motionp, false);
496 } 496 }
497 else if (motionp->isStopped() && mTime > motionp->getStopTime()) 497 else if (motionp->isStopped() && mTime > motionp->getStopTime())
498 { 498 {
@@ -546,8 +546,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
546 { 546 {
547 if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration()) 547 if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration())
548 { 548 {
549 posep->setWeight(0.f); 549 deactivateMotion(motionp, true);
550 deactivateMotion(motionp);
551 } 550 }
552 continue; 551 continue;
553 } 552 }
@@ -573,8 +572,7 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
573 } 572 }
574 else 573 else
575 { 574 {
576 posep->setWeight(0.f); 575 deactivateMotion(motionp, true);
577 deactivateMotion(motionp);
578 continue; 576 continue;
579 } 577 }
580 } 578 }
@@ -822,8 +820,15 @@ BOOL LLMotionController::activateMotion(LLMotion *motion, F32 time)
822//----------------------------------------------------------------------------- 820//-----------------------------------------------------------------------------
823// deactivateMotion() 821// deactivateMotion()
824//----------------------------------------------------------------------------- 822//-----------------------------------------------------------------------------
825BOOL LLMotionController::deactivateMotion(LLMotion *motion) 823BOOL LLMotionController::deactivateMotion(LLMotion *motion, bool remove_weight)
826{ 824{
825 if( remove_weight )
826 {
827 // immediately remove pose weighting instead of letting it time out
828 LLPose *posep = motion->getPose();
829 posep->setWeight(0.f);
830 }
831
827 motion->deactivate(); 832 motion->deactivate();
828 mActiveMotions.remove(motion); 833 mActiveMotions.remove(motion);
829 834
diff --git a/linden/indra/llcharacter/llmotioncontroller.h b/linden/indra/llcharacter/llmotioncontroller.h
index 94149da..959a16a 100644
--- a/linden/indra/llcharacter/llmotioncontroller.h
+++ b/linden/indra/llcharacter/llmotioncontroller.h
@@ -182,7 +182,7 @@ protected:
182 void deleteAllMotions(); 182 void deleteAllMotions();
183 void addLoadedMotion(LLMotion *motion); 183 void addLoadedMotion(LLMotion *motion);
184 BOOL activateMotion(LLMotion *motion, F32 time); 184 BOOL activateMotion(LLMotion *motion, F32 time);
185 BOOL deactivateMotion(LLMotion *motion); 185 BOOL deactivateMotion(LLMotion *motion, bool remove_weight);
186 void updateRegularMotions(); 186 void updateRegularMotions();
187 void updateAdditiveMotions(); 187 void updateAdditiveMotions();
188 void resetJointSignatures(); 188 void resetJointSignatures();
diff --git a/linden/indra/llcharacter/llvisualparam.h b/linden/indra/llcharacter/llvisualparam.h
index ec19fa0..ddd0469 100644
--- a/linden/indra/llcharacter/llvisualparam.h
+++ b/linden/indra/llcharacter/llvisualparam.h
@@ -108,7 +108,7 @@ public:
108 virtual void stopAnimating(BOOL set_by_user); 108 virtual void stopAnimating(BOOL set_by_user);
109 109
110 // Interface methods 110 // Interface methods
111 const S32 getID() { return mID; } 111 S32 getID() { return mID; }
112 void setID(S32 id) { llassert(!mInfo); mID = id; } 112 void setID(S32 id) { llassert(!mInfo); mID = id; }
113 113
114 const LLString& getName() const { return mInfo->mName; } 114 const LLString& getName() const { return mInfo->mName; }
@@ -120,7 +120,7 @@ public:
120 void setMaxDisplayName(const char* s) { mInfo->mMaxName = s; } 120 void setMaxDisplayName(const char* s) { mInfo->mMaxName = s; }
121 void setMinDisplayName(const char* s) { mInfo->mMinName = s; } 121 void setMinDisplayName(const char* s) { mInfo->mMinName = s; }
122 122
123 const EVisualParamGroup getGroup() { return mInfo->mGroup; } 123 EVisualParamGroup getGroup() { return mInfo->mGroup; }
124 F32 getMinWeight() { return mInfo->mMinWeight; } 124 F32 getMinWeight() { return mInfo->mMinWeight; }
125 F32 getMaxWeight() { return mInfo->mMaxWeight; } 125 F32 getMaxWeight() { return mInfo->mMaxWeight; }
126 F32 getDefaultWeight() { return mInfo->mDefaultWeight; } 126 F32 getDefaultWeight() { return mInfo->mDefaultWeight; }