diff options
-rw-r--r-- | indra/llcharacter/llkeyframewalkmotion.cpp | 26 | ||||
-rw-r--r-- | indra/llcharacter/llmotioncontroller.cpp | 2 | ||||
-rw-r--r-- | indra/llcharacter/llmotioncontroller.h | 4 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 12 |
5 files changed, 48 insertions, 7 deletions
diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index f6c43effdf..3cf4d695dd 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -50,7 +50,8 @@ const F32 MIN_WALK_SPEED = 0.1f; // minimum speed at which we use velocity for d const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation F32 SPEED_ADJUST_MAX = 2.5f; // maximum adjustment of walk animation playback speed F32 SPEED_ADJUST_MAX_SEC = 3.f; // maximum adjustment to walk animation playback speed for a second -F32 ANIM_SPEED_MAX = 5.0f; // absolute limit on animation speed +F32 ANIM_SPEED_MAX = 10.0f; // absolute upper limit on animation speed +F32 ANIM_SPEED_MIN = 0.0f; // absolute lower limit on animation speed const F32 DRIFT_COMP_MAX_TOTAL = 0.07f;//0.55f; // maximum drift compensation overall, in any direction const F32 DRIFT_COMP_MAX_SPEED = 4.f; // speed at which drift compensation total maxes out const F32 MAX_ROLL = 0.6f; @@ -320,7 +321,14 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) } mAnimSpeed = (mAvgSpeed + mSpeedAdjust) * mRelativeDir; - mAnimSpeed = llclamp(mAnimSpeed, -ANIM_SPEED_MAX, ANIM_SPEED_MAX); + if (mAnimSpeed>0) + { + mAnimSpeed = llclamp(mAnimSpeed, ANIM_SPEED_MIN, ANIM_SPEED_MAX); + } + else + { + mAnimSpeed = llclamp(mAnimSpeed, -ANIM_SPEED_MAX, -ANIM_SPEED_MIN); + } char debug_text[64]; sprintf(debug_text, "Foot slip vel: %.2f", footSlipVelocity); mCharacter->addDebugText(debug_text); @@ -331,6 +339,20 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) sprintf(debug_text, "Animation Playback Speed: %.2f", mAnimSpeed); mCharacter->addDebugText(debug_text); mCharacter->setAnimationData("Walk Speed", &mAnimSpeed); + if (mCharacter->getMotionController().mIsSelf) + { + F32 elapsed = mCharacter->getMotionController().getFrameTimer().getElapsedTimeF32(); + llinfos << "PLOT elapsed: " << elapsed +// << " footSlipVelocity: " << footSlipVelocity +// << " speed: " << speed +// << " mAvgCorrection: " << mAvgCorrection + << " mAvgSpeed: " << mAvgSpeed +// << " mSpeedAdjust: " << mSpeedAdjust + << " mAnimSpeed: " << mAnimSpeed + << " ANIM_SPEED_MAX: " << ANIM_SPEED_MAX + << " ANIM_SPEED_MIN: " << ANIM_SPEED_MIN + << llendl; + } // clamp pelvis offset to a 90 degree arc behind the nominal position F32 drift_comp_max = llclamp(speed, 0.f, DRIFT_COMP_MAX_SPEED) / DRIFT_COMP_MAX_SPEED; diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp index ca10f5f572..51a9120cbb 100644 --- a/indra/llcharacter/llmotioncontroller.cpp +++ b/indra/llcharacter/llmotioncontroller.cpp @@ -567,7 +567,7 @@ void breakWalkIf(LLMotion *motionp, BOOL flag) { if (flag) { - llinfos << "break here" << llendl; +// llinfos << "break here" << llendl; } } } diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index 30ab0cbdc9..f8bf5ac289 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -171,7 +171,9 @@ public: LLMotion *findMotion( const LLUUID& id ) const; void dumpMotions(); - + + const LLFrameTimer& getFrameTimer() { return mTimer; } + protected: // internal operations act on motion instances directly // as there can be duplicate motions per id during blending overlap diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6f08cd7579..fa9dc2d3c1 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10194,6 +10194,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>ShowWalkSliders</key> + <map> + <key>Comment</key> + <string>Allow walk params to be adjusted on the fly.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>UseStartScreen</key> <map> <key>Comment</key> diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e9de29ff56..3e6ec21017 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -99,6 +99,7 @@ extern F32 SPEED_ADJUST_MAX; extern F32 SPEED_ADJUST_MAX_SEC; extern F32 ANIM_SPEED_MAX; +extern F32 ANIM_SPEED_MIN; #if LL_MSVC // disable boost::lexical_cast warning @@ -3038,9 +3039,14 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { if (!LLApp::isExiting()) { - LLDebugVarMessageBox::show("Adj Max", &SPEED_ADJUST_MAX, 5.0f, 0.1f); - LLDebugVarMessageBox::show("Adj Max Sec", &SPEED_ADJUST_MAX_SEC, 5.0f, 0.1f); - LLDebugVarMessageBox::show("Anim Max", &ANIM_SPEED_MAX, 10.0f, 0.1f); + BOOL show_walk_sliders = gSavedSettings.getBOOL("ShowWalkSliders"); + if (show_walk_sliders) + { + LLDebugVarMessageBox::show("Adj Max", &SPEED_ADJUST_MAX, 5.0f, 0.1f); + LLDebugVarMessageBox::show("Adj Max Sec", &SPEED_ADJUST_MAX_SEC, 5.0f, 0.1f); + LLDebugVarMessageBox::show("Anim Max", &ANIM_SPEED_MAX, 10.0f, 0.1f); + LLDebugVarMessageBox::show("Anim Min", &ANIM_SPEED_MIN, 10.0f, 0.1f); + } } LLMemType mt(LLMemType::MTYPE_AVATAR); |