From 089fc07d207c71ce1401e72f09c31ad8c45872e2 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:58 -0500 Subject: Second Life viewer sources 1.17.0.12 --- linden/indra/llcharacter/llcharacter.cpp | 9 +++++++++ linden/indra/llcharacter/llcharacter.h | 3 +++ linden/indra/llcharacter/llheadrotmotion.cpp | 1 + linden/indra/llcharacter/llmotioncontroller.cpp | 20 ++++++++++++++++++-- linden/indra/llcharacter/llmotioncontroller.h | 3 +++ 5 files changed, 34 insertions(+), 2 deletions(-) (limited to 'linden/indra/llcharacter') 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) //----------------------------------------------------------------------------- +// deactivateAllMotions() +//----------------------------------------------------------------------------- +void LLCharacter::deactivateAllMotions() +{ + mMotionController.deactivateAllMotions(); +} + + +//----------------------------------------------------------------------------- // flushAllMotions() //----------------------------------------------------------------------------- void 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: // no cached references to character joint data. This is // useful if a character wants to rebuild it's skeleton. virtual void flushAllMotions(); + + // Flush only wipes active animations. + virtual void deactivateAllMotions(); // dumps information for debugging 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) LLVector3 up; eye_look_at = *targetPos; + has_eye_target = TRUE; F32 lookAtDistance = eye_look_at.normVec(); 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 { if (motionp->isStopped() && mTime > motionp->getStopTime() + motionp->getEaseOutDuration()) { - posep->setWeight(0.f); deactivateMotion(motionp); } continue; @@ -573,7 +572,6 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty } else { - posep->setWeight(0.f); deactivateMotion(motionp); continue; } @@ -824,6 +822,7 @@ BOOL LLMotionController::activateMotion(LLMotion *motion, F32 time) //----------------------------------------------------------------------------- BOOL LLMotionController::deactivateMotion(LLMotion *motion) { + motion->getPose()->setWeight(0.f); motion->deactivate(); mActiveMotions.remove(motion); @@ -855,6 +854,23 @@ LLMotion *LLMotionController::findMotion(const LLUUID& id) return mAllMotions[id]; } +//----------------------------------------------------------------------------- +// deactivateAllMotions() +//----------------------------------------------------------------------------- +void LLMotionController::deactivateAllMotions() +{ + //They must all die, precious. + for (std::map::iterator iter = mAllMotions.begin(); + iter != mAllMotions.end(); iter++) + { + LLMotion* motionp = iter->second; + if (motionp) motionp->deactivate(); + } + + // delete all motion instances + deleteAllMotions(); +} + //----------------------------------------------------------------------------- // 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: // releases all motion instances void flushAllMotions(); + //Flush is a liar. + void deactivateAllMotions(); + // pause and continue all motions void pause(); void unpause(); -- cgit v1.1