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/llmotioncontroller.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'linden/indra/llcharacter/llmotioncontroller.cpp') 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() -- cgit v1.1