summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llcharacter/llkeyframewalkmotion.cpp25
-rw-r--r--indra/llcharacter/llmotioncontroller.cpp2
-rw-r--r--indra/newview/llvoavatar.cpp12
3 files changed, 27 insertions, 12 deletions
diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp
index 461309bee9..f6c43effdf 100644
--- a/indra/llcharacter/llkeyframewalkmotion.cpp
+++ b/indra/llcharacter/llkeyframewalkmotion.cpp
@@ -48,8 +48,9 @@ const F32 MAX_WALK_PLAYBACK_SPEED = 8.f; // max m/s for which we adjust walk cyc
const F32 MIN_WALK_SPEED = 0.1f; // minimum speed at which we use velocity for down foot detection
const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation
-const F32 SPEED_ADJUST_MAX = 2.5f; // maximum adjustment of walk animation playback speed
-const F32 SPEED_ADJUST_MAX_SEC = 3.f; // maximum adjustment to walk animation playback speed for a second
+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
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;
@@ -300,6 +301,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
// and if we're moving backward, we walk backward
F32 directional_factor = localVel.mV[VX] * mRelativeDir;
+
if (speed > 0.1f)
{
// calculate ratio of desired foot velocity to detected foot velocity
@@ -318,15 +320,16 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask)
}
mAnimSpeed = (mAvgSpeed + mSpeedAdjust) * mRelativeDir;
-// char debug_text[64];
-// sprintf(debug_text, "Foot slip vel: %.2f", footSlipVelocity);
-// mCharacter->addDebugText(debug_text);
-// sprintf(debug_text, "Speed: %.2f", mAvgSpeed);
-// mCharacter->addDebugText(debug_text);
-// sprintf(debug_text, "Speed Adjust: %.2f", mSpeedAdjust);
-// mCharacter->addDebugText(debug_text);
-// sprintf(debug_text, "Animation Playback Speed: %.2f", mAnimSpeed);
-// mCharacter->addDebugText(debug_text);
+ mAnimSpeed = llclamp(mAnimSpeed, -ANIM_SPEED_MAX, ANIM_SPEED_MAX);
+ char debug_text[64];
+ sprintf(debug_text, "Foot slip vel: %.2f", footSlipVelocity);
+ mCharacter->addDebugText(debug_text);
+ sprintf(debug_text, "Speed: %.2f", mAvgSpeed);
+ mCharacter->addDebugText(debug_text);
+ sprintf(debug_text, "Speed Adjust: %.2f", mSpeedAdjust);
+ mCharacter->addDebugText(debug_text);
+ sprintf(debug_text, "Animation Playback Speed: %.2f", mAnimSpeed);
+ mCharacter->addDebugText(debug_text);
mCharacter->setAnimationData("Walk Speed", &mAnimSpeed);
// clamp pelvis offset to a 90 degree arc behind the nominal position
diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index 80d98a1cee..ca10f5f572 100644
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -559,8 +559,8 @@ void breakWalkIf(LLMotion *motionp, BOOL flag)
(motionp->getID() == ANIM_AGENT_FEMALE_WALK) ||
(motionp->getID() == ANIM_AGENT_FEMALE_WALK_NEW) ||
(motionp->getID() == ANIM_AGENT_FEMALE_RUN_NEW) ||
- (motionp->getID() == ANIM_AGENT_FEMALE_WALK_NEW) ||
(motionp->getID() == ANIM_AGENT_WALK) ||
+ (motionp->getID() == ANIM_AGENT_WALK_NEW) ||
(motionp->getID() == ANIM_AGENT_RUN) ||
(motionp->getID() == ANIM_AGENT_RUN_NEW)
)
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 05583c0944..e9de29ff56 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -95,6 +95,11 @@
#include "llvoiceclient.h"
#include "llvoicevisualizer.h" // Ventrella
+#include "lldebugmessagebox.h"
+extern F32 SPEED_ADJUST_MAX;
+extern F32 SPEED_ADJUST_MAX_SEC;
+extern F32 ANIM_SPEED_MAX;
+
#if LL_MSVC
// disable boost::lexical_cast warning
#pragma warning (disable:4702)
@@ -3031,6 +3036,13 @@ void LLVOAvatar::slamPosition()
//------------------------------------------------------------------------
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);
+ }
+
LLMemType mt(LLMemType::MTYPE_AVATAR);
// clear debug text