aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcharacter
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llcharacter')
-rw-r--r--linden/indra/llcharacter/llcharacter.cpp9
-rw-r--r--linden/indra/llcharacter/llcharacter.h3
-rw-r--r--linden/indra/llcharacter/llheadrotmotion.cpp1
-rw-r--r--linden/indra/llcharacter/llmotioncontroller.cpp20
-rw-r--r--linden/indra/llcharacter/llmotioncontroller.h3
5 files changed, 34 insertions, 2 deletions
diff --git a/linden/indra/llcharacter/llcharacter.cpp b/linden/indra/llcharacter/llcharacter.cpp
index 90a3cc6..29872f7 100644
--- a/linden/indra/llcharacter/llcharacter.cpp
+++ b/linden/indra/llcharacter/llcharacter.cpp
@@ -190,6 +190,15 @@ void LLCharacter::updateMotion(BOOL force_update)
190 190
191 191
192//----------------------------------------------------------------------------- 192//-----------------------------------------------------------------------------
193// deactivateAllMotions()
194//-----------------------------------------------------------------------------
195void LLCharacter::deactivateAllMotions()
196{
197 mMotionController.deactivateAllMotions();
198}
199
200
201//-----------------------------------------------------------------------------
193// flushAllMotions() 202// flushAllMotions()
194//----------------------------------------------------------------------------- 203//-----------------------------------------------------------------------------
195void LLCharacter::flushAllMotions() 204void LLCharacter::flushAllMotions()
diff --git a/linden/indra/llcharacter/llcharacter.h b/linden/indra/llcharacter/llcharacter.h
index 90824aa..666beb2 100644
--- a/linden/indra/llcharacter/llcharacter.h
+++ b/linden/indra/llcharacter/llcharacter.h
@@ -170,6 +170,9 @@ public:
170 // no cached references to character joint data. This is 170 // no cached references to character joint data. This is
171 // useful if a character wants to rebuild it's skeleton. 171 // useful if a character wants to rebuild it's skeleton.
172 virtual void flushAllMotions(); 172 virtual void flushAllMotions();
173
174 // Flush only wipes active animations.
175 virtual void deactivateAllMotions();
173 176
174 // dumps information for debugging 177 // dumps information for debugging
175 virtual void dumpCharacter( LLJoint *joint = NULL ); 178 virtual void dumpCharacter( LLJoint *joint = NULL );
diff --git a/linden/indra/llcharacter/llheadrotmotion.cpp b/linden/indra/llcharacter/llheadrotmotion.cpp
index be0b55d..cfab048 100644
--- a/linden/indra/llcharacter/llheadrotmotion.cpp
+++ b/linden/indra/llcharacter/llheadrotmotion.cpp
@@ -431,6 +431,7 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
431 LLVector3 up; 431 LLVector3 up;
432 432
433 eye_look_at = *targetPos; 433 eye_look_at = *targetPos;
434 has_eye_target = TRUE;
434 F32 lookAtDistance = eye_look_at.normVec(); 435 F32 lookAtDistance = eye_look_at.normVec();
435 436
436 left.setVec(skyward % eye_look_at); 437 left.setVec(skyward % eye_look_at);
diff --git a/linden/indra/llcharacter/llmotioncontroller.cpp b/linden/indra/llcharacter/llmotioncontroller.cpp
index 5545841..e2453c9 100644
--- a/linden/indra/llcharacter/llmotioncontroller.cpp
+++ b/linden/indra/llcharacter/llmotioncontroller.cpp
@@ -546,7 +546,6 @@ 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);
550 deactivateMotion(motionp); 549 deactivateMotion(motionp);
551 } 550 }
552 continue; 551 continue;
@@ -573,7 +572,6 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
573 } 572 }
574 else 573 else
575 { 574 {
576 posep->setWeight(0.f);
577 deactivateMotion(motionp); 575 deactivateMotion(motionp);
578 continue; 576 continue;
579 } 577 }
@@ -824,6 +822,7 @@ BOOL LLMotionController::activateMotion(LLMotion *motion, F32 time)
824//----------------------------------------------------------------------------- 822//-----------------------------------------------------------------------------
825BOOL LLMotionController::deactivateMotion(LLMotion *motion) 823BOOL LLMotionController::deactivateMotion(LLMotion *motion)
826{ 824{
825 motion->getPose()->setWeight(0.f);
827 motion->deactivate(); 826 motion->deactivate();
828 mActiveMotions.remove(motion); 827 mActiveMotions.remove(motion);
829 828
@@ -855,6 +854,23 @@ LLMotion *LLMotionController::findMotion(const LLUUID& id)
855 return mAllMotions[id]; 854 return mAllMotions[id];
856} 855}
857 856
857//-----------------------------------------------------------------------------
858// deactivateAllMotions()
859//-----------------------------------------------------------------------------
860void LLMotionController::deactivateAllMotions()
861{
862 //They must all die, precious.
863 for (std::map<LLUUID, LLMotion*>::iterator iter = mAllMotions.begin();
864 iter != mAllMotions.end(); iter++)
865 {
866 LLMotion* motionp = iter->second;
867 if (motionp) motionp->deactivate();
868 }
869
870 // delete all motion instances
871 deleteAllMotions();
872}
873
858 874
859//----------------------------------------------------------------------------- 875//-----------------------------------------------------------------------------
860// flushAllMotions() 876// flushAllMotions()
diff --git a/linden/indra/llcharacter/llmotioncontroller.h b/linden/indra/llcharacter/llmotioncontroller.h
index e4c7b3f..94149da 100644
--- a/linden/indra/llcharacter/llmotioncontroller.h
+++ b/linden/indra/llcharacter/llmotioncontroller.h
@@ -158,6 +158,9 @@ public:
158 // releases all motion instances 158 // releases all motion instances
159 void flushAllMotions(); 159 void flushAllMotions();
160 160
161 //Flush is a liar.
162 void deactivateAllMotions();
163
161 // pause and continue all motions 164 // pause and continue all motions
162 void pause(); 165 void pause();
163 void unpause(); 166 void unpause();