diff options
Diffstat (limited to 'indra/llcharacter/llmotioncontroller.cpp')
-rwxr-xr-x[-rw-r--r--] | indra/llcharacter/llmotioncontroller.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index bb892f4a7f..e9fb91ad73 100644..100755 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -29,8 +29,6 @@ //----------------------------------------------------------------------------- #include "linden_common.h" -#include "llmemtype.h" - #include "llmotioncontroller.h" #include "llkeyframemotion.h" #include "llmath.h" @@ -44,6 +42,7 @@ const U32 MAX_MOTION_INSTANCES = 32; //----------------------------------------------------------------------------- // Constants and statics //----------------------------------------------------------------------------- +F32 LLMotionController::sCurrentTimeFactor = 1.f; LLMotionRegistry LLMotionController::sRegistry; //----------------------------------------------------------------------------- @@ -127,7 +126,7 @@ LLMotion *LLMotionRegistry::createMotion( const LLUUID &id ) // Class Constructor //----------------------------------------------------------------------------- LLMotionController::LLMotionController() - : mTimeFactor(1.f), + : mTimeFactor(sCurrentTimeFactor), mCharacter(NULL), mAnimTime(0.f), mPrevTimerElapsed(0.f), @@ -335,7 +334,6 @@ void LLMotionController::removeMotionInstance(LLMotion* motionp) //----------------------------------------------------------------------------- LLMotion* LLMotionController::createMotion( const LLUUID &id ) { - LLMemType mt(LLMemType::MTYPE_ANIMATION); // do we have an instance of this motion for this character? LLMotion *motion = findMotion(id); @@ -542,6 +540,8 @@ void LLMotionController::updateIdleActiveMotions() //----------------------------------------------------------------------------- // updateMotionsByType() //----------------------------------------------------------------------------- +static LLFastTimer::DeclareTimer FTM_MOTION_ON_UPDATE("Motion onUpdate"); + void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_type) { BOOL update_result = TRUE; @@ -699,7 +699,10 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty } // perform motion update - update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature); + { + LLFastTimer t(FTM_MOTION_ON_UPDATE); + update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature); + } } //********************** @@ -810,7 +813,7 @@ void LLMotionController::updateMotions(bool force_update) // Always cap the number of loaded motions purgeExcessMotions(); - + // Update timing info for this time step. if (!mPaused) { @@ -832,6 +835,7 @@ void LLMotionController::updateMotions(bool force_update) } updateLoadingMotions(); + return; } @@ -850,7 +854,7 @@ void LLMotionController::updateMotions(bool force_update) } updateLoadingMotions(); - + resetJointSignatures(); if (mPaused && !force_update) @@ -861,11 +865,12 @@ void LLMotionController::updateMotions(bool force_update) { // update additive motions updateAdditiveMotions(); + resetJointSignatures(); - + // update all regular motions updateRegularMotions(); - + if (use_quantum) { mPoseBlender.blendAndCache(TRUE); |