diff options
40 files changed, 827 insertions, 219 deletions
diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp index 0d0b85ba60..ff7ad1c289 100644 --- a/indra/llcharacter/lleditingmotion.cpp +++ b/indra/llcharacter/lleditingmotion.cpp @@ -232,7 +232,7 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask) mIKSolver.solve(); // use blending... - F32 slerp_amt = LLCriticalDamp::getInterpolant(TARGET_LAG_HALF_LIFE); + F32 slerp_amt = LLSmoothInterpolation::getInterpolant(TARGET_LAG_HALF_LIFE); shoulderRot = slerp(slerp_amt, mShoulderJoint.getRotation(), shoulderRot); elbowRot = slerp(slerp_amt, mElbowJoint.getRotation(), elbowRot); diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp index 15a58a8389..4a8af2f00c 100644 --- a/indra/llcharacter/llheadrotmotion.cpp +++ b/indra/llcharacter/llheadrotmotion.cpp @@ -182,8 +182,8 @@ BOOL LLHeadRotMotion::onUpdate(F32 time, U8* joint_mask) LLQuaternion currentRootRotWorld = mRootJoint->getWorldRotation(); LLQuaternion currentInvRootRotWorld = ~currentRootRotWorld; - F32 head_slerp_amt = LLCriticalDamp::getInterpolant(HEAD_LOOKAT_LAG_HALF_LIFE); - F32 torso_slerp_amt = LLCriticalDamp::getInterpolant(TORSO_LOOKAT_LAG_HALF_LIFE); + F32 head_slerp_amt = LLSmoothInterpolation::getInterpolant(HEAD_LOOKAT_LAG_HALF_LIFE); + F32 torso_slerp_amt = LLSmoothInterpolation::getInterpolant(TORSO_LOOKAT_LAG_HALF_LIFE); LLVector3* targetPos = (LLVector3*)mCharacter->getAnimationData("LookAtPoint"); diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index c6f45bffa2..831a0a6719 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -1031,11 +1031,11 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 if (constraint->mSharedData->mChainLength != 0 && dist_vec_squared(root_pos, target_pos) * 0.95f > constraint->mTotalLength * constraint->mTotalLength) { - constraint->mWeight = lerp(constraint->mWeight, 0.f, LLCriticalDamp::getInterpolant(0.1f)); + constraint->mWeight = LLSmoothInterpolation::lerp(constraint->mWeight, 0.f, 0.1f); } else { - constraint->mWeight = lerp(constraint->mWeight, 1.f, LLCriticalDamp::getInterpolant(0.3f)); + constraint->mWeight = LLSmoothInterpolation::lerp(constraint->mWeight, 1.f, 0.3f); } F32 weight = constraint->mWeight * ((shared_data->mEaseOutStopTime == 0.f) ? 1.f : @@ -1082,9 +1082,9 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 // convert intermediate joint positions to world coordinates positions[joint_num] = ( constraint->mPositions[joint_num] * mPelvisp->getWorldRotation()) + mPelvisp->getWorldPosition(); F32 time_constant = 1.f / clamp_rescale(constraint->mFixupDistanceRMS, 0.f, 0.5f, 0.2f, 8.f); -// llinfos << "Interpolant " << LLCriticalDamp::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl; +// llinfos << "Interpolant " << LLSmoothInterpolation::getInterpolant(time_constant, FALSE) << " and fixup distance " << constraint->mFixupDistanceRMS << " on " << mCharacter->findCollisionVolume(shared_data->mSourceConstraintVolume)->getName() << llendl; positions[joint_num] = lerp(positions[joint_num], kinematic_position, - LLCriticalDamp::getInterpolant(time_constant, FALSE)); + LLSmoothInterpolation::getInterpolant(time_constant, FALSE)); } S32 iteration_count; diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index d52eb89a5c..e188b06c03 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -258,7 +258,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) // but this will cause the animation playback rate calculation below to // kick in too slowly and sometimes start playing the animation in reverse. - //mPelvisOffset -= PELVIS_COMPENSATION_WIEGHT * (foot_slip_vector * world_to_avatar_rot);//lerp(LLVector3::zero, -1.f * (foot_slip_vector * world_to_avatar_rot), LLCriticalDamp::getInterpolant(0.1f)); + //mPelvisOffset -= PELVIS_COMPENSATION_WIEGHT * (foot_slip_vector * world_to_avatar_rot);//lerp(LLVector3::zero, -1.f * (foot_slip_vector * world_to_avatar_rot), LLSmoothInterpolation::getInterpolant(0.1f)); ////F32 drift_comp_max = DRIFT_COMP_MAX_TOTAL * (llclamp(speed, 0.f, DRIFT_COMP_MAX_SPEED) / DRIFT_COMP_MAX_SPEED); //F32 drift_comp_max = DRIFT_COMP_MAX_TOTAL; @@ -287,7 +287,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) F32 desired_speed_multiplier = llclamp(speed / foot_speed, min_speed_multiplier, ANIM_SPEED_MAX); // blend towards new speed adjustment value - F32 new_speed_adjust = lerp(mAdjustedSpeed, desired_speed_multiplier, LLCriticalDamp::getInterpolant(SPEED_ADJUST_TIME_CONSTANT)); + F32 new_speed_adjust = LLSmoothInterpolation::lerp(mAdjustedSpeed, desired_speed_multiplier, SPEED_ADJUST_TIME_CONSTANT); // limit that rate at which the speed adjustment changes F32 speedDelta = llclamp(new_speed_adjust - mAdjustedSpeed, -SPEED_ADJUST_MAX_SEC * delta_time, SPEED_ADJUST_MAX_SEC * delta_time); @@ -305,8 +305,8 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) { // standing/turning // damp out speed adjustment to 0 - mAnimSpeed = lerp(mAnimSpeed, 1.f, LLCriticalDamp::getInterpolant(0.2f)); - //mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLCriticalDamp::getInterpolant(0.2f)); + mAnimSpeed = LLSmoothInterpolation::lerp(mAnimSpeed, 1.f, 0.2f); + //mPelvisOffset = lerp(mPelvisOffset, LLVector3::zero, LLSmoothInterpolation::getInterpolant(0.2f)); } // broadcast walk speed change @@ -383,7 +383,7 @@ BOOL LLFlyAdjustMotion::onUpdate(F32 time, U8* joint_mask) F32 target_roll = llclamp(ang_vel.mV[VZ], -4.f, 4.f) * roll_factor; // roll is critically damped interpolation between current roll and angular velocity-derived target roll - mRoll = lerp(mRoll, target_roll, LLCriticalDamp::getInterpolant(0.1f)); + mRoll = LLSmoothInterpolation::lerp(mRoll, target_roll, LLUnit<LLUnits::Milliseconds, F32>(100)); LLQuaternion roll(mRoll, LLVector3(0.f, 0.f, 1.f)); mPelvisState->setRotation(roll); diff --git a/indra/llcharacter/llmotion.cpp b/indra/llcharacter/llmotion.cpp index 2551f125d0..af2e10220a 100644 --- a/indra/llcharacter/llmotion.cpp +++ b/indra/llcharacter/llmotion.cpp @@ -73,7 +73,7 @@ void LLMotion::fadeOut() { if (mFadeWeight > 0.01f) { - mFadeWeight = lerp(mFadeWeight, 0.f, LLCriticalDamp::getInterpolant(0.15f)); + mFadeWeight = lerp(mFadeWeight, 0.f, LLSmoothInterpolation::getInterpolant(0.15f)); } else { @@ -88,7 +88,7 @@ void LLMotion::fadeIn() { if (mFadeWeight < 0.99f) { - mFadeWeight = lerp(mFadeWeight, 1.f, LLCriticalDamp::getInterpolant(0.15f)); + mFadeWeight = lerp(mFadeWeight, 1.f, LLSmoothInterpolation::getInterpolant(0.15f)); } else { diff --git a/indra/llcharacter/lltargetingmotion.cpp b/indra/llcharacter/lltargetingmotion.cpp index 489aef923c..633c1d51eb 100644 --- a/indra/llcharacter/lltargetingmotion.cpp +++ b/indra/llcharacter/lltargetingmotion.cpp @@ -106,7 +106,7 @@ BOOL LLTargetingMotion::onActivate() //----------------------------------------------------------------------------- BOOL LLTargetingMotion::onUpdate(F32 time, U8* joint_mask) { - F32 slerp_amt = LLCriticalDamp::getInterpolant(TORSO_TARGET_HALF_LIFE); + F32 slerp_amt = LLSmoothInterpolation::getInterpolant(TORSO_TARGET_HALF_LIFE); LLVector3 target; LLVector3* lookAtPoint = (LLVector3*)mCharacter->getAnimationData("LookAtPoint"); diff --git a/indra/llcommon/llcriticaldamp.cpp b/indra/llcommon/llcriticaldamp.cpp index 87d79b1ee0..59a31bf9df 100644 --- a/indra/llcommon/llcriticaldamp.cpp +++ b/indra/llcommon/llcriticaldamp.cpp @@ -27,18 +27,38 @@ #include "linden_common.h" #include "llcriticaldamp.h" +#include <algorithm> //----------------------------------------------------------------------------- // static members //----------------------------------------------------------------------------- -LLFrameTimer LLCriticalDamp::sInternalTimer; -std::map<F32, F32> LLCriticalDamp::sInterpolants; -F32 LLCriticalDamp::sTimeDelta; +LLFrameTimer LLSmoothInterpolation::sInternalTimer; +std::vector<LLSmoothInterpolation::Interpolant> LLSmoothInterpolation::sInterpolants; +F32 LLSmoothInterpolation::sTimeDelta; + +// helper functors +struct LLSmoothInterpolation::CompareTimeConstants +{ + bool operator()(const F32& a, const LLSmoothInterpolation::Interpolant& b) const + { + return a < b.mTimeScale; + } + + bool operator()(const LLSmoothInterpolation::Interpolant& a, const F32& b) const + { + return a.mTimeScale < b; // bottom of a is higher than bottom of b + } + + bool operator()(const LLSmoothInterpolation::Interpolant& a, const LLSmoothInterpolation::Interpolant& b) const + { + return a.mTimeScale < b.mTimeScale; // bottom of a is higher than bottom of b + } +}; //----------------------------------------------------------------------------- -// LLCriticalDamp() +// LLSmoothInterpolation() //----------------------------------------------------------------------------- -LLCriticalDamp::LLCriticalDamp() +LLSmoothInterpolation::LLSmoothInterpolation() { sTimeDelta = 0.f; } @@ -47,43 +67,54 @@ LLCriticalDamp::LLCriticalDamp() //----------------------------------------------------------------------------- // updateInterpolants() //----------------------------------------------------------------------------- -void LLCriticalDamp::updateInterpolants() +void LLSmoothInterpolation::updateInterpolants() { sTimeDelta = sInternalTimer.getElapsedTimeAndResetF32(); - F32 time_constant; - - for (std::map<F32, F32>::iterator iter = sInterpolants.begin(); - iter != sInterpolants.end(); iter++) + for (S32 i = 0; i < sInterpolants.size(); i++) { - time_constant = iter->first; - F32 new_interpolant = 1.f - pow(2.f, -sTimeDelta / time_constant); - new_interpolant = llclamp(new_interpolant, 0.f, 1.f); - sInterpolants[time_constant] = new_interpolant; + Interpolant& interp = sInterpolants[i]; + interp.mInterpolant = calcInterpolant(interp.mTimeScale); } } //----------------------------------------------------------------------------- // getInterpolant() //----------------------------------------------------------------------------- -F32 LLCriticalDamp::getInterpolant(const F32 time_constant, BOOL use_cache) +F32 LLSmoothInterpolation::getInterpolant(LLUnit<LLUnits::Seconds, F32> time_constant, bool use_cache) { if (time_constant == 0.f) { return 1.f; } - if (use_cache && sInterpolants.count(time_constant)) + if (use_cache) { - return sInterpolants[time_constant]; + interpolant_vec_t::iterator find_it = std::lower_bound(sInterpolants.begin(), sInterpolants.end(), time_constant.value(), CompareTimeConstants()); + if (find_it != sInterpolants.end() && find_it->mTimeScale == time_constant) + { + return find_it->mInterpolant; + } + else + { + Interpolant interp; + interp.mTimeScale = time_constant.value(); + interp.mInterpolant = calcInterpolant(time_constant.value()); + sInterpolants.insert(find_it, interp); + return interp.mInterpolant; + } } - - F32 interpolant = 1.f - pow(2.f, -sTimeDelta / time_constant); - interpolant = llclamp(interpolant, 0.f, 1.f); - if (use_cache) + else { - sInterpolants[time_constant] = interpolant; + return calcInterpolant(time_constant.value()); + } +} - return interpolant; +//----------------------------------------------------------------------------- +// getInterpolant() +//----------------------------------------------------------------------------- +F32 LLSmoothInterpolation::calcInterpolant(F32 time_constant) +{ + return llclamp(1.f - pow(2.f, -sTimeDelta / time_constant), 0.f, 1.f); } diff --git a/indra/llcommon/llcriticaldamp.h b/indra/llcommon/llcriticaldamp.h index 52f052ae25..ab5d4ba6e2 100644 --- a/indra/llcommon/llcriticaldamp.h +++ b/indra/llcommon/llcriticaldamp.h @@ -28,26 +28,46 @@ #ifndef LL_LLCRITICALDAMP_H #define LL_LLCRITICALDAMP_H -#include <map> +#include <vector> #include "llframetimer.h" +#include "llunit.h" -class LL_COMMON_API LLCriticalDamp +class LL_COMMON_API LLSmoothInterpolation { public: - LLCriticalDamp(); + LLSmoothInterpolation(); // MANIPULATORS static void updateInterpolants(); // ACCESSORS - static F32 getInterpolant(const F32 time_constant, BOOL use_cache = TRUE); + static F32 getInterpolant(LLUnit<LLUnits::Seconds, F32> time_constant, bool use_cache = true); -protected: + template<typename T> + static T lerp(T a, T b, LLUnit<LLUnits::Seconds, F32> time_constant, bool use_cache = true) + { + F32 interpolant = getInterpolant(time_constant, use_cache); + return ((a * (1.f - interpolant)) + + (b * interpolant)); + } + +protected: + static F32 calcInterpolant(F32 time_constant); + + struct CompareTimeConstants; static LLFrameTimer sInternalTimer; // frame timer for calculating deltas - static std::map<F32, F32> sInterpolants; + struct Interpolant + { + F32 mTimeScale; + F32 mInterpolant; + }; + typedef std::vector<Interpolant> interpolant_vec_t; + static interpolant_vec_t sInterpolants; static F32 sTimeDelta; }; +typedef LLSmoothInterpolation LLCriticalDamp; + #endif // LL_LLCRITICALDAMP_H diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp index 6695ebeaca..259f5a7a27 100644 --- a/indra/llcommon/lltracerecording.cpp +++ b/indra/llcommon/lltracerecording.cpp @@ -291,23 +291,6 @@ U32 Recording::getSampleCount( const TraceType<CountAccumulator<S64> >& stat ) c return (*mMeasurementsFloat)[stat.getIndex()].getSampleCount(); } - -F64 Recording::getPerSec( const TraceType<MeasurementAccumulator<F64> >& stat ) const -{ - F64 sum = (*mMeasurementsFloat)[stat.getIndex()].getSum(); - return (sum != 0.0) - ? (sum / mElapsedSeconds) - : 0.0; -} - -F64 Recording::getPerSec( const TraceType<MeasurementAccumulator<S64> >& stat ) const -{ - S64 sum = (*mMeasurements)[stat.getIndex()].getSum(); - return (sum != 0) - ? ((F64)sum / mElapsedSeconds) - : 0.0; -} - F64 Recording::getMin( const TraceType<MeasurementAccumulator<F64> >& stat ) const { return (*mMeasurementsFloat)[stat.getIndex()].getMin(); diff --git a/indra/llcommon/lltracerecording.h b/indra/llcommon/lltracerecording.h index 70afe51d6e..751ff298ce 100644 --- a/indra/llcommon/lltracerecording.h +++ b/indra/llcommon/lltracerecording.h @@ -184,14 +184,6 @@ namespace LLTrace return (T)getSum(static_cast<const TraceType<MeasurementAccumulator<typename LLUnits::HighestPrecisionType<T>::type_t> >&> (stat)); } - F64 getPerSec(const TraceType<MeasurementAccumulator<F64> >& stat) const; - F64 getPerSec(const TraceType<MeasurementAccumulator<S64> >& stat) const; - template <typename T> - T getPerSec(const MeasurementStatHandle<T>& stat) const - { - return (T)getPerSec(static_cast<const TraceType<MeasurementAccumulator<typename LLUnits::HighestPrecisionType<T>::type_t> >&> (stat)); - } - F64 getMin(const TraceType<MeasurementAccumulator<F64> >& stat) const; S64 getMin(const TraceType<MeasurementAccumulator<S64> >& stat) const; template <typename T> diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 705fe16559..93ffa7b70d 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -758,11 +758,11 @@ void LLButton::draw() mCurGlowStrength = lerp(mCurGlowStrength, mFlashing ? (flash? 1.0 : 0.0) : mHoverGlowStrength, - LLCriticalDamp::getInterpolant(0.05f)); + LLSmoothInterpolation::getInterpolant(0.05f)); } else { - mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); + mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLSmoothInterpolation::getInterpolant(0.05f)); } // Draw button image, if available. diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 194d2b700c..d4a310b8cf 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -586,7 +586,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant)); + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLSmoothInterpolation::getInterpolant(mOpenTimeConstant)); if (panelp->mVisibleAmt > 0.99f) { panelp->mVisibleAmt = 1.f; @@ -611,7 +611,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLSmoothInterpolation::getInterpolant(mCloseTimeConstant)); if (panelp->mVisibleAmt < 0.001f) { panelp->mVisibleAmt = 0.f; @@ -638,7 +638,7 @@ bool LLLayoutStack::animatePanels() { if (!mAnimatedThisFrame) { - panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLSmoothInterpolation::getInterpolant(mCloseTimeConstant)); } if (llabs(panelp->mCollapseAmt - collapse_state) < 0.001f) diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index cd6cc6a75e..13888920f9 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3673,7 +3673,7 @@ void LLTearOffMenu::draw() if (getRect().getHeight() != mTargetHeight) { // animate towards target height - reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLCriticalDamp::getInterpolant(0.05f)))); + reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLSmoothInterpolation::getInterpolant(0.05f)))); } LLFloater::draw(); } diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 5d3bf7a670..92a80c73fe 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -493,11 +493,11 @@ void LLScrollbar::draw() BOOL hovered = getEnabled() && !other_captor && (hasMouseCapture() || mThumbRect.pointInRect(local_mouse_x, local_mouse_y)); if (hovered) { - mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLCriticalDamp::getInterpolant(0.05f)); + mCurGlowStrength = lerp(mCurGlowStrength, mHoverGlowStrength, LLSmoothInterpolation::getInterpolant(0.05f)); } else { - mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLCriticalDamp::getInterpolant(0.05f)); + mCurGlowStrength = lerp(mCurGlowStrength, 0.f, LLSmoothInterpolation::getInterpolant(0.05f)); } // Draw background and thumb. diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index 2bc385061a..219ddad452 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -36,6 +36,7 @@ #include "lluictrlfactory.h" #include "lltracerecording.h" +#include "llcriticaldamp.h" /////////////////////////////////////////////////////////////////////////////////// @@ -45,6 +46,7 @@ LLStatBar::LLStatBar(const Params& p) mUnitLabel(p.unit_label), mMinBar(p.bar_min), mMaxBar(p.bar_max), + mCurMaxBar(p.bar_max), mCountFloatp(LLTrace::CountStatHandle<>::getInstance(p.stat)), mCountIntp(LLTrace::CountStatHandle<S64>::getInstance(p.stat)), mMeasurementFloatp(LLTrace::MeasurementStatHandle<>::getInstance(p.stat)), @@ -54,11 +56,14 @@ LLStatBar::LLStatBar(const Params& p) mPrecision(p.precision), mUpdatesPerSec(p.update_rate), mUnitScale(p.unit_scale), + mNumFrames(p.num_frames), + mMaxHeight(p.max_height), mPerSec(p.show_per_sec), mDisplayBar(p.show_bar), mDisplayHistory(p.show_history), mDisplayMean(p.show_mean), - mOrientation(p.orientation) + mOrientation(p.orientation), + mScaleRange(p.scale_range) {} BOOL LLStatBar::handleMouseDown(S32 x, S32 y, MASK mask) @@ -171,24 +176,38 @@ void LLStatBar::draw() S32 bar_top, bar_left, bar_right, bar_bottom; if (mOrientation == HORIZONTAL) { - bar_top = getRect().getHeight() - 15; + bar_top = llmax(5, getRect().getHeight() - 15); bar_left = 0; - bar_right = getRect().getWidth() - 80; - bar_bottom = 0; + bar_right = getRect().getWidth() - 40; + bar_bottom = llmin(bar_top - 5, 0); } else // VERTICAL { - bar_top = getRect().getHeight() - 15; // 16 pixels from top. + bar_top = llmax(5, getRect().getHeight() - 15); bar_left = 0; bar_right = getRect().getWidth(); - bar_bottom = 20; + bar_bottom = llmin(bar_top - 5, 20); } const S32 tick_length = 4; const S32 tick_width = 1; + if (mScaleRange) + { + F32 cur_max = mLabelSpacing; + while(max > cur_max) + { + cur_max += mLabelSpacing; + } + mCurMaxBar = LLSmoothInterpolation::lerp(mCurMaxBar, cur_max, 0.05f); + } + else + { + mCurMaxBar = mMaxBar; + } + F32 value_scale = (mOrientation == HORIZONTAL) - ? (bar_top - bar_bottom)/(mMaxBar - mMinBar) - : (bar_right - bar_left)/(mMaxBar - mMinBar); + ? (bar_top - bar_bottom)/(mCurMaxBar - mMinBar) + : (bar_right - bar_left)/(mCurMaxBar - mMinBar); LLFontGL::getFontMonospace()->renderUTF8(mLabel, 0, 0, getRect().getHeight(), LLColor4(1.f, 1.f, 1.f, 1.f), LLFontGL::LEFT, LLFontGL::TOP); @@ -209,7 +228,9 @@ void LLStatBar::draw() // Draw the value. if (mOrientation == HORIZONTAL) { - + LLFontGL::getFontMonospace()->renderUTF8(value_str, 0, bar_right, getRect().getHeight(), + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::RIGHT, LLFontGL::TOP); } else { @@ -227,12 +248,13 @@ void LLStatBar::draw() LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - for (F32 tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mTickSpacing) + for (F32 tick_value = mMinBar + mLabelSpacing; tick_value <= mCurMaxBar; tick_value += mTickSpacing) { const S32 begin = llfloor((tick_value - mMinBar)*value_scale); const S32 end = begin + tick_width; if (mOrientation == HORIZONTAL) { + gl_rect_2d(bar_left, end, bar_right - tick_length/2, begin, LLColor4(1.f, 1.f, 1.f, 0.1f)); } else { @@ -241,7 +263,7 @@ void LLStatBar::draw() } // Draw the tick labels (and big ticks). - for (F32 tick_value = mMinBar; tick_value <= mMaxBar; tick_value += mLabelSpacing) + for (F32 tick_value = mMinBar + mLabelSpacing; tick_value <= mCurMaxBar; tick_value += mLabelSpacing) { const S32 begin = llfloor((tick_value - mMinBar)*value_scale); const S32 end = begin + tick_width; @@ -250,13 +272,17 @@ void LLStatBar::draw() // draw labels for the tick marks if (mOrientation == HORIZONTAL) { + gl_rect_2d(bar_left, end, bar_right - tick_length, begin, LLColor4(1.f, 1.f, 1.f, 0.25f)); + LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, bar_right, begin, + LLColor4(1.f, 1.f, 1.f, 0.5f), + LLFontGL::LEFT, LLFontGL::VCENTER); } else { gl_rect_2d(begin, bar_top, end, bar_bottom - tick_length, LLColor4(1.f, 1.f, 1.f, 0.25f)); LLFontGL::getFontMonospace()->renderUTF8(tick_label, 0, begin - 1, bar_bottom - tick_length, LLColor4(1.f, 1.f, 1.f, 0.5f), - LLFontGL::LEFT, LLFontGL::TOP); + LLFontGL::RIGHT, LLFontGL::TOP); } } @@ -288,69 +314,99 @@ void LLStatBar::draw() gl_rect_2d(begin, bar_top, end, bar_bottom, LLColor4(1.f, 0.f, 0.f, 0.25f)); } + F32 span = (mOrientation == HORIZONTAL) + ? (bar_right - bar_left) + : (bar_top - bar_bottom); + if (mDisplayHistory && (mCountFloatp || mCountIntp || mMeasurementFloatp || mMeasurementIntp)) { const S32 num_values = frame_recording.getNumPeriods() - 1; - S32 begin = 0; - S32 end = 0; + F32 begin = 0; + F32 end = 0; S32 i; - for (i = 1; i <= num_values; i++) + gGL.color4f( 1.f, 0.f, 0.f, 1.f ); + gGL.begin( LLRender::QUADS ); + const S32 max_frame = llmin(mNumFrames, num_values); + U32 num_samples = 0; + for (i = 1; i <= max_frame; i++) { + F32 offset = ((F32)i / (F32)mNumFrames) * span; + LLTrace::Recording& recording = frame_recording.getPrevRecordingPeriod(i); if (mPerSec) { if (mCountFloatp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountFloatp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getPerSec(*mCountFloatp) - mMinBar) * value_scale); + end = ((recording.getPerSec(*mCountFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mCountFloatp); } else if (mCountIntp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountIntp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mCountIntp) - mMinBar) * value_scale) + 1; + begin = ((recording.getPerSec(*mCountIntp) - mMinBar) * value_scale); + end = ((recording.getPerSec(*mCountIntp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mCountIntp); } else if (mMeasurementFloatp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementFloatp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + //rate isn't defined for measurement stats, so use mean + begin = ((recording.getMean(*mMeasurementFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mMeasurementFloatp); } else if (mMeasurementIntp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementIntp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getPerSec(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + //rate isn't defined for measurement stats, so use mean + begin = ((recording.getMean(*mMeasurementIntp) - mMinBar) * value_scale); + end = ((recording.getMean(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mMeasurementIntp); } } else { if (mCountFloatp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountFloatp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getSum(*mCountFloatp) - mMinBar) * value_scale); + end = ((recording.getSum(*mCountFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mCountFloatp); } else if (mCountIntp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountIntp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mCountIntp) - mMinBar) * value_scale) + 1; + begin = ((recording.getSum(*mCountIntp) - mMinBar) * value_scale); + end = ((recording.getSum(*mCountIntp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mCountIntp); } else if (mMeasurementFloatp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementFloatp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + begin = ((recording.getMean(*mMeasurementFloatp) - mMinBar) * value_scale); + end = ((recording.getMean(*mMeasurementFloatp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mMeasurementFloatp); } else if (mMeasurementIntp) { - begin = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementIntp) - mMinBar) * value_scale); - end = (S32)((frame_recording.getPrevRecordingPeriod(i).getSum(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + begin = ((recording.getMean(*mMeasurementIntp) - mMinBar) * value_scale); + end = ((recording.getMean(*mMeasurementIntp) - mMinBar) * value_scale) + 1; + num_samples = recording.getSampleCount(*mMeasurementIntp); } } + + if (!num_samples) continue; + if (mOrientation == HORIZONTAL) { - gl_rect_2d(bar_right - i, end, bar_right - i - 1, begin, LLColor4(1.f, 0.f, 0.f, 1.f)); + gGL.vertex2f((F32)bar_right - offset, end); + gGL.vertex2f((F32)bar_right - offset, begin); + gGL.vertex2f((F32)bar_right - offset - 1.f, begin); + gGL.vertex2f((F32)bar_right - offset - 1.f, end); } else { - gl_rect_2d(begin, bar_bottom+i+1, end, bar_bottom+i, LLColor4(1.f, 0.f, 0.f, 1.f)); + gGL.vertex2i(begin, (F32)bar_bottom+offset+1.f); + gGL.vertex2i(begin, (F32)bar_bottom+offset); + gGL.vertex2i(end, (F32)bar_bottom+offset); + gGL.vertex2i(end, (F32)bar_bottom+offset+1.f); } } + gGL.end(); } else { @@ -410,7 +466,14 @@ LLRect LLStatBar::getRequiredRect() { if (mDisplayHistory) { - rect.mTop = 35 + LLTrace::get_frame_recording().getNumPeriods(); + if (mOrientation == HORIZONTAL) + { + rect.mTop = mMaxHeight; + } + else + { + rect.mTop = 35 + llmin(mMaxHeight, llmin(mNumFrames, LLTrace::get_frame_recording().getNumPeriods())); + } } else { diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h index 0ec8aaeaa9..a83ccbe9e5 100644 --- a/indra/llui/llstatbar.h +++ b/indra/llui/llstatbar.h @@ -52,8 +52,11 @@ public: Optional<bool> show_per_sec, show_bar, show_history, - show_mean; + show_mean, + scale_range; + Optional<S32> num_frames, + max_height; Optional<std::string> stat; Optional<EOrientation> orientation; @@ -71,6 +74,9 @@ public: show_bar("show_bar", TRUE), show_history("show_history", false), show_mean("show_mean", true), + scale_range("scale_range", true), + num_frames("num_frames", 300), + max_height("max_height", 200), stat("stat"), orientation("orientation", VERTICAL) { @@ -92,15 +98,19 @@ public: private: F32 mMinBar; F32 mMaxBar; + F32 mCurMaxBar; F32 mTickSpacing; F32 mLabelSpacing; U32 mPrecision; F32 mUpdatesPerSec; F32 mUnitScale; + S32 mNumFrames; + S32 mMaxHeight; bool mPerSec; // Use the per sec stats. bool mDisplayBar; // Display the bar graph. bool mDisplayHistory; bool mDisplayMean; // If true, display mean, if false, display current value + bool mScaleRange; EOrientation mOrientation; LLTrace::TraceType<LLTrace::CountAccumulator<F64> >* mCountFloatp; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 5fc2cc350d..4df35f77a5 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -406,7 +406,7 @@ void LLTabContainer::draw() } } - setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLCriticalDamp::getInterpolant(0.08f))); + setScrollPosPixels((S32)lerp((F32)getScrollPosPixels(), (F32)target_pixel_scroll, LLSmoothInterpolation::getInterpolant(0.08f))); BOOL has_scroll_arrows = !getTabsHidden() && ((mMaxScrollPos > 0) || (mScrollPosPixels > 0)); if (!mIsVertical) diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 4e6079e3f2..6648431459 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -336,7 +336,7 @@ void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera) LLVector3 agent_at_axis = gAgent.getAtAxis(); agent_at_axis -= projected_vec(agent_at_axis, gAgent.getReferenceUpVector()); agent_at_axis.normalize(); - gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLCriticalDamp::getInterpolant(0.3f))); + gAgent.resetAxes(lerp(gAgent.getAtAxis(), agent_at_axis, LLSmoothInterpolation::getInterpolant(0.3f))); } setFocusOnAvatar(TRUE, ANIMATE); @@ -1246,7 +1246,7 @@ void LLAgentCamera::updateCamera() gAgentCamera.clearPanKeys(); // lerp camera focus offset - mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLCriticalDamp::getInterpolant(CAMERA_FOCUS_HALF_LIFE)); + mCameraFocusOffset = lerp(mCameraFocusOffset, mCameraFocusOffsetTarget, LLSmoothInterpolation::getInterpolant(CAMERA_FOCUS_HALF_LIFE)); if ( mCameraMode == CAMERA_MODE_FOLLOW ) { @@ -1364,7 +1364,7 @@ void LLAgentCamera::updateCamera() { const F32 SMOOTHING_HALF_LIFE = 0.02f; - F32 smoothing = LLCriticalDamp::getInterpolant(gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE, FALSE); + F32 smoothing = LLSmoothInterpolation::getInterpolant(gSavedSettings.getF32("CameraPositionSmoothing") * SMOOTHING_HALF_LIFE, FALSE); if (!mFocusObject) // we differentiate on avatar mode { @@ -1394,7 +1394,7 @@ void LLAgentCamera::updateCamera() } - mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLCriticalDamp::getInterpolant(FOV_ZOOM_HALF_LIFE)); + mCameraCurrentFOVZoomFactor = lerp(mCameraCurrentFOVZoomFactor, mCameraFOVZoomFactor, LLSmoothInterpolation::getInterpolant(FOV_ZOOM_HALF_LIFE)); // llinfos << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << llendl; @@ -1809,7 +1809,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (mTargetCameraDistance != mCurrentCameraDistance) { - F32 camera_lerp_amt = LLCriticalDamp::getInterpolant(CAMERA_ZOOM_HALF_LIFE); + F32 camera_lerp_amt = LLSmoothInterpolation::getInterpolant(CAMERA_ZOOM_HALF_LIFE); mCurrentCameraDistance = lerp(mCurrentCameraDistance, mTargetCameraDistance, camera_lerp_amt); } @@ -1827,7 +1827,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) if (isAgentAvatarValid()) { LLVector3d camera_lag_d; - F32 lag_interp = LLCriticalDamp::getInterpolant(CAMERA_LAG_HALF_LIFE); + F32 lag_interp = LLSmoothInterpolation::getInterpolant(CAMERA_LAG_HALF_LIFE); LLVector3 target_lag; LLVector3 vel = gAgent.getVelocity(); @@ -1872,7 +1872,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) } else { - mCameraLag = lerp(mCameraLag, LLVector3::zero, LLCriticalDamp::getInterpolant(0.15f)); + mCameraLag = lerp(mCameraLag, LLVector3::zero, LLSmoothInterpolation::getInterpolant(0.15f)); } camera_lag_d.setVec(mCameraLag); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c00fddbb24..0cb7c7b030 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4210,7 +4210,7 @@ void LLAppViewer::idle() LLFrameTimer::updateFrameCount(); LLEventTimer::updateClass(); LLNotificationsUI::LLToast::updateClass(); - LLCriticalDamp::updateInterpolants(); + LLSmoothInterpolation::updateInterpolants(); LLMortician::updateClass(); LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify() @@ -4865,7 +4865,7 @@ void LLAppViewer::idleNetwork() gPrintMessagesThisFrame = FALSE; } } - sample(LLStatViewer::NUM_NEW_OBJECTS, gObjectList.mNumNewObjects); + add(LLStatViewer::NUM_NEW_OBJECTS, gObjectList.mNumNewObjects); // Retransmit unacknowledged packets. gXferManager->retransmitUnackedPackets(); diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 9c3d9f4d34..a0c71b0f73 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -557,7 +557,7 @@ F32 LLDrawable::updateXform(BOOL undamped) if (damped && isVisible()) { - F32 lerp_amt = llclamp(LLCriticalDamp::getInterpolant(OBJECT_DAMPING_TIME_CONSTANT), 0.f, 1.f); + F32 lerp_amt = llclamp(LLSmoothInterpolation::getInterpolant(OBJECT_DAMPING_TIME_CONSTANT), 0.f, 1.f); LLVector3 new_pos = lerp(old_pos, target_pos, lerp_amt); dist_squared = dist_vec_squared(new_pos, target_pos); diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 3893b0e772..f55535b6e3 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -1128,13 +1128,13 @@ void LLFastTimerView::drawLineGraph() } //interpolate towards new maximum - max_time = lerp(max_time.value(), cur_max.value(), LLCriticalDamp::getInterpolant(0.1f)); + max_time = lerp(max_time.value(), cur_max.value(), LLSmoothInterpolation::getInterpolant(0.1f)); if (max_time - cur_max <= 1 || cur_max - max_time <= 1) { max_time = llmax(LLUnit<LLUnits::Microseconds, F32>(1), LLUnit<LLUnits::Microseconds, F32>(cur_max)); } - max_calls = llround(lerp((F32)max_calls, (F32) cur_max_calls, LLCriticalDamp::getInterpolant(0.1f))); + max_calls = llround(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f))); if (llabs((S32)(max_calls - cur_max_calls)) <= 1) { max_calls = cur_max_calls; @@ -1144,7 +1144,7 @@ void LLFastTimerView::drawLineGraph() F32 alpha_target = (max_time > cur_max) ? llmin(max_time / cur_max - 1.f,1.f) : llmin(cur_max/ max_time - 1.f,1.f); - alpha_interp = lerp(alpha_interp, alpha_target, LLCriticalDamp::getInterpolant(0.1f)); + alpha_interp = lerp(alpha_interp, alpha_target, LLSmoothInterpolation::getInterpolant(0.1f)); if (mHoverID != NULL) { diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 05d73c2416..e2beb272e6 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -525,11 +525,11 @@ void LLFloaterColorPicker::draw() if (gFocusMgr.childHasMouseCapture(getDragHandle())) { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); } else { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); } mPipetteBtn->setToggleState(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 04fc572220..285f52fcd6 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -478,7 +478,7 @@ void LLSnapshotLivePreview::draw() { if (mFlashAlpha < 1.f) { - mFlashAlpha = lerp(mFlashAlpha, 1.f, LLCriticalDamp::getInterpolant(0.02f)); + mFlashAlpha = lerp(mFlashAlpha, 1.f, LLSmoothInterpolation::getInterpolant(0.02f)); } else { @@ -487,7 +487,7 @@ void LLSnapshotLivePreview::draw() } else { - mFlashAlpha = lerp(mFlashAlpha, 0.f, LLCriticalDamp::getInterpolant(0.15f)); + mFlashAlpha = lerp(mFlashAlpha, 0.f, LLSmoothInterpolation::getInterpolant(0.15f)); } // Draw shining animation if appropriate. diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 3aa16b4413..4eb84224bc 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1293,7 +1293,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) // animate current height towards target height if (llabs(mCurHeight - mTargetHeight) > 1.f) { - mCurHeight = lerp(mCurHeight, mTargetHeight, LLCriticalDamp::getInterpolant(mIsOpen ? FOLDER_OPEN_TIME_CONSTANT : FOLDER_CLOSE_TIME_CONSTANT)); + mCurHeight = lerp(mCurHeight, mTargetHeight, LLSmoothInterpolation::getInterpolant(mIsOpen ? FOLDER_OPEN_TIME_CONSTANT : FOLDER_CLOSE_TIME_CONSTANT)); requestArrange(); @@ -2538,11 +2538,11 @@ void LLFolderViewFolder::draw() } else if (mIsOpen) { - mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLCriticalDamp::getInterpolant(0.04f)); + mControlLabelRotation = lerp(mControlLabelRotation, -90.f, LLSmoothInterpolation::getInterpolant(0.04f)); } else { - mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLCriticalDamp::getInterpolant(0.025f)); + mControlLabelRotation = lerp(mControlLabelRotation, 0.f, LLSmoothInterpolation::getInterpolant(0.025f)); } bool possibly_has_children = false; diff --git a/indra/newview/llfollowcam.cpp b/indra/newview/llfollowcam.cpp index b670af1782..d6dc964802 100644 --- a/indra/newview/llfollowcam.cpp +++ b/indra/newview/llfollowcam.cpp @@ -328,11 +328,11 @@ void LLFollowCam::update() F32 force = focusOffsetDistance - focusThresholdNormalizedByDistance; */ - F32 focusLagLerp = LLCriticalDamp::getInterpolant( mFocusLag ); + F32 focusLagLerp = LLSmoothInterpolation::getInterpolant( mFocusLag ); focus_pt_agent = lerp( focus_pt_agent, whereFocusWantsToBe, focusLagLerp ); mSimulatedFocusGlobal = gAgent.getPosGlobalFromAgent(focus_pt_agent); } - mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f)); + mRelativeFocus = lerp(mRelativeFocus, (focus_pt_agent - mSubjectPosition) * ~mSubjectRotation, LLSmoothInterpolation::getInterpolant(0.05f)); }// if focus is not locked --------------------------------------------- @@ -415,7 +415,7 @@ void LLFollowCam::update() //------------------------------------------------------------------------------------------------- if ( distanceFromPositionToIdealPosition > mPositionThreshold ) { - F32 positionPullLerp = LLCriticalDamp::getInterpolant( mPositionLag ); + F32 positionPullLerp = LLSmoothInterpolation::getInterpolant( mPositionLag ); simulated_pos_agent = lerp( simulated_pos_agent, whereCameraPositionWantsToBe, positionPullLerp ); } @@ -435,7 +435,7 @@ void LLFollowCam::update() updateBehindnessConstraint(gAgent.getPosAgentFromGlobal(mSimulatedFocusGlobal), simulated_pos_agent); mSimulatedPositionGlobal = gAgent.getPosGlobalFromAgent(simulated_pos_agent); - mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLCriticalDamp::getInterpolant(0.05f)); + mRelativePos = lerp(mRelativePos, (simulated_pos_agent - mSubjectPosition) * ~mSubjectRotation, LLSmoothInterpolation::getInterpolant(0.05f)); } // if position is not locked ----------------------------------------------------------- @@ -490,7 +490,7 @@ BOOL LLFollowCam::updateBehindnessConstraint(LLVector3 focus, LLVector3& cam_pos if ( cameraOffsetAngle > mBehindnessMaxAngle ) { - F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLCriticalDamp::getInterpolant(mBehindnessLag); + F32 fraction = ((cameraOffsetAngle - mBehindnessMaxAngle) / cameraOffsetAngle) * LLSmoothInterpolation::getInterpolant(mBehindnessLag); cam_position = focus + horizontalSubjectBack * (slerp(fraction, camera_offset_rotation, LLQuaternion::DEFAULT)); cam_position.mV[VZ] = cameraZ; // clamp z value back to what it was before we started messing with it constraint_active = TRUE; diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index c12916ec6b..3ac11f906b 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -981,7 +981,7 @@ void LLHUDNameTag::updateAll() // { // continue; // } - (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(POSITION_DAMPING_TC)); + (*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLSmoothInterpolation::getInterpolant(POSITION_DAMPING_TC)); } } diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp index 826e8d560a..0468560e96 100644 --- a/indra/newview/llmaniprotate.cpp +++ b/indra/newview/llmaniprotate.cpp @@ -240,7 +240,7 @@ void LLManipRotate::render() if (mManipPart == LL_ROT_Z) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { // selected part @@ -251,7 +251,7 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_Y) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); @@ -262,7 +262,7 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_X) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.pushMatrix(); { gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); @@ -273,13 +273,13 @@ void LLManipRotate::render() } else if (mManipPart == LL_ROT_ROLL) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } else if (mManipPart == LL_NO_PART) { if (mHighlightedPart == LL_NO_PART) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } LLGLEnable cull_face(GL_CULL_FACE); @@ -294,7 +294,7 @@ void LLManipRotate::render() { if (mHighlightedPart == LL_ROT_Z) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, SELECTED_MANIPULATOR_SCALE, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ], mManipulatorScales.mV[VZ]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 0.f, 1.f, 1.f ), LLColor4( 0.f, 0.f, 1.f, 0.5f ), CIRCLE_STEPS, i); @@ -312,7 +312,7 @@ void LLManipRotate::render() gGL.rotatef( 90.f, 1.f, 0.f, 0.f ); if (mHighlightedPart == LL_ROT_Y) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, SELECTED_MANIPULATOR_SCALE, 1.f, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VY], mManipulatorScales.mV[VY], mManipulatorScales.mV[VY]); // hovering over part gl_ring( mRadiusMeters, width_meters, LLColor4( 0.f, 1.f, 0.f, 1.f ), LLColor4( 0.f, 1.f, 0.f, 0.5f ), CIRCLE_STEPS, i); @@ -330,7 +330,7 @@ void LLManipRotate::render() gGL.rotatef( 90.f, 0.f, 1.f, 0.f ); if (mHighlightedPart == LL_ROT_X) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(SELECTED_MANIPULATOR_SCALE, 1.f, 1.f, 1.f), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); gGL.scalef(mManipulatorScales.mV[VX], mManipulatorScales.mV[VX], mManipulatorScales.mV[VX]); // hovering over part @@ -346,7 +346,7 @@ void LLManipRotate::render() if (mHighlightedPart == LL_ROT_ROLL) { - mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); + mManipulatorScales = lerp(mManipulatorScales, LLVector4(1.f, 1.f, 1.f, SELECTED_MANIPULATOR_SCALE), LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } } diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 00a0bf8894..2d09fb6fe5 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -535,11 +535,11 @@ void LLManipScale::highlightManipulators(S32 x, S32 y) { if (mHighlightedPart == MANIPULATOR_IDS[i]) { - mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); + mManipulatorScales[i] = lerp(mManipulatorScales[i], SELECTED_MANIPULATOR_SCALE, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } else { - mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); + mManipulatorScales[i] = lerp(mManipulatorScales[i], 1.f, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE)); } } diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index 362308c176..cf5c646893 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -1921,18 +1921,18 @@ void LLManipTranslate::renderTranslationHandles() { if (index == mManipPart - LL_X_ARROW || index == mHighlightedPart - LL_X_ARROW) { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], SELECTED_ARROW_SCALE, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } else if (index == mManipPart - LL_YZ_PLANE || index == mHighlightedPart - LL_YZ_PLANE) { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], SELECTED_ARROW_SCALE, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } else { - mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); - mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLCriticalDamp::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mArrowScales.mV[index] = lerp(mArrowScales.mV[index], 1.f, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); + mPlaneScales.mV[index] = lerp(mPlaneScales.mV[index], 1.f, LLSmoothInterpolation::getInterpolant(MANIPULATOR_SCALE_HALF_LIFE )); } } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 1bda7640bd..0abfb59ffd 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -162,7 +162,7 @@ void LLNetMap::draw() static LLUICachedControl<bool> auto_center("MiniMapAutoCenter", true); if (auto_center) { - mCurPan = lerp(mCurPan, mTargetPan, LLCriticalDamp::getInterpolant(0.1f)); + mCurPan = lerp(mCurPan, mTargetPan, LLSmoothInterpolation::getInterpolant(0.1f)); } // Prepare a scissor region diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index ec36cf48c2..e227722b29 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -549,11 +549,11 @@ void LLFloaterTexturePicker::draw() if (gFocusMgr.childHasMouseCapture(getDragHandle())) { - mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); + mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); } else { - mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); + mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); } updateImageStats(); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 2aec25b7aa..0889c3ec6c 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -1041,7 +1041,7 @@ void render_hud_attachments() // clamp target zoom level to reasonable values gAgentCamera.mHUDTargetZoom = llclamp(gAgentCamera.mHUDTargetZoom, 0.1f, 1.f); // smoothly interpolate current zoom level - gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLCriticalDamp::getInterpolant(0.03f)); + gAgentCamera.mHUDCurZoom = lerp(gAgentCamera.mHUDCurZoom, gAgentCamera.mHUDTargetZoom, LLSmoothInterpolation::getInterpolant(0.03f)); if (LLPipeline::sShowHUDAttachments && !gDisconnected && setup_hud_matrices()) { diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 69586e3634..e72ea4b826 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -297,6 +297,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsDebug>); LLFloaterReg::add("sound_devices", "floater_sound_devices.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSoundDevices>); LLFloaterReg::add("stats", "floater_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>); + LLFloaterReg::add("scene_load_stats", "floater_scene_load_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>); LLFloaterReg::add("start_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterRunQueue>); LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotRunQueue>); LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSnapshot>); diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 921c681e2a..0e2c53ee5b 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -88,7 +88,8 @@ LLTrace::CountStatHandle<> FPS("fpsstat"), KILLED("killed", "Number of times killed"), FRAMETIME_DOUBLED("frametimedoubled", "Ratio of frames 2x longer than previous"), TEX_BAKES("texbakes"), - TEX_REBAKES("texrebakes"); + TEX_REBAKES("texrebakes"), + NUM_NEW_OBJECTS("numnewobjectsstat"); LLTrace::CountStatHandle<LLTrace::Kilobits> KBIT("kbitstat"), LAYERS_KBIT("layerskbitstat"), OBJECT_KBIT("objectkbitstat"), @@ -133,7 +134,6 @@ LLTrace::MeasurementStatHandle<> FPS_SAMPLE("fpssample"), NUM_RAW_IMAGES("numrawimagesstat"), NUM_OBJECTS("numobjectsstat"), NUM_ACTIVE_OBJECTS("numactiveobjectsstat"), - NUM_NEW_OBJECTS("numnewobjectsstat"), NUM_SIZE_CULLED("numsizeculledstat"), NUM_VIS_CULLED("numvisculledstat"), ENABLE_VBO("enablevbo", "Vertex Buffers Enabled"), diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 069a726e5e..00e8c66b54 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -90,7 +90,8 @@ extern LLTrace::CountStatHandle<> FPS, KILLED, FRAMETIME_DOUBLED, TEX_BAKES, - TEX_REBAKES; + TEX_REBAKES, + NUM_NEW_OBJECTS; extern LLTrace::CountStatHandle<LLTrace::Kilobits> KBIT, @@ -137,7 +138,6 @@ extern LLTrace::MeasurementStatHandle<> FPS_SAMPLE, NUM_RAW_IMAGES, NUM_OBJECTS, NUM_ACTIVE_OBJECTS, - NUM_NEW_OBJECTS, NUM_SIZE_CULLED, NUM_VIS_CULLED, ENABLE_VBO, diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1d43f96fb7..5a07cdf7c9 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2917,7 +2917,7 @@ void LLVOAvatar::idleUpdateWindEffect() LLVector3 velocity = getVelocity(); F32 speed = velocity.length(); //RN: velocity varies too much frame to frame for this to work - mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLCriticalDamp::getInterpolant(0.02f)); + mRippleAccel.clearVec();//lerp(mRippleAccel, (velocity - mLastVel) * time_delta, LLSmoothInterpolation::getInterpolant(0.02f)); mLastVel = velocity; LLVector4 wind; wind.setVec(getRegion()->mWind.getVelocityNoisy(getPositionAgent(), 4.f) - velocity); @@ -2940,11 +2940,11 @@ void LLVOAvatar::idleUpdateWindEffect() F32 interp; if (wind.mV[VW] > mWindVec.mV[VW]) { - interp = LLCriticalDamp::getInterpolant(0.2f); + interp = LLSmoothInterpolation::getInterpolant(0.2f); } else { - interp = LLCriticalDamp::getInterpolant(0.4f); + interp = LLSmoothInterpolation::getInterpolant(0.4f); } mWindVec = lerp(mWindVec, wind, interp); @@ -3794,7 +3794,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) // Set the root rotation, but do so incrementally so that it // lags in time by some fixed amount. - //F32 u = LLCriticalDamp::getInterpolant(PELVIS_LAG); + //F32 u = LLSmoothInterpolation::getInterpolant(PELVIS_LAG); F32 pelvis_lag_time = 0.f; if (self_in_mouselook) { diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index ccc513b80d..f821cb1ec1 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -302,8 +302,8 @@ void LLWorldMapView::draw() mVisibleRegions.clear(); // animate pan if necessary - sPanX = lerp(sPanX, sTargetPanX, LLCriticalDamp::getInterpolant(0.1f)); - sPanY = lerp(sPanY, sTargetPanY, LLCriticalDamp::getInterpolant(0.1f)); + sPanX = lerp(sPanX, sTargetPanX, LLSmoothInterpolation::getInterpolant(0.1f)); + sPanY = lerp(sPanY, sTargetPanY, LLSmoothInterpolation::getInterpolant(0.1f)); const S32 width = getRect().getWidth(); const S32 height = getRect().getHeight(); diff --git a/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml b/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml new file mode 100644 index 0000000000..fd3cb37f8f --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_scene_load_stats.xml @@ -0,0 +1,549 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + can_resize="true" + height="400" + layout="topleft" + name="Scene Load Statistics" + save_rect="true" + save_visibility="true" + title="SCENE LOAD STATISTICS" + width="260"> + <scroll_container + follows="top|left|bottom|right" + height="380" + layout="topleft" + left="0" + name="statistics_scroll" + reserve_scroll_corner="true" + top="20" + width="260"> + <container_view + follows="top|left|bottom|right" + height="378" + layout="topleft" + left="2" + name="statistics_view" + top="20" + width="245" > + <!--Basic Section--> + <stat_view + name="basic" + label="Basic" + show_label="true" + setting="OpenDebugStatBasic"> + <stat_bar + name="bandwidth" + label="Bandwidth" + unit_label="kbps" + orientation="horizontal" + stat="kbitstat" + bar_max="5000" + tick_spacing="500" + label_spacing="1000" + precision="0" + show_bar="true" + show_history="false"> + </stat_bar> + <stat_bar + name="packet_loss" + label="Packet Loss" + unit_label=" %" + stat="packetslostpercentstat" + bar_max="5" + tick_spacing="0.5" + label_spacing="1" + precision="3" + show_bar="false" + show_mean="true"> + </stat_bar> + </stat_view> + <!--Advanced Section--> + <stat_view + name="advanced" + label="Advanced" + show_label="true" + setting="OpenDebugStatAdvanced"> + <stat_view + name="render" + label="Render" + show_label="true" + setting="OpenDebugStatRender"> + <stat_bar + name="objs" + label="Total Objects" + unit_label="" + stat="numobjectsstat" + bar_max="50000" + tick_spacing="5000" + label_spacing="10000" + precision="0" + show_bar="false"> + </stat_bar> + <stat_bar + name="newobjs" + label="New Objects" + unit_label="/sec" + stat="numnewobjectsstat" + bar_max="2000" + tick_spacing="200" + label_spacing="400" + show_bar="false"> + </stat_bar> + <stat_bar + name="object_cache_hits" + label="Object Cache Hit Rate" + stat="object_cache_hits" + bar_max="100" + unit_label="%" + tick_spacing="20" + label_spacing="20" + show_history="true" + show_bar="false"> + </stat_bar> + </stat_view> + <!--Texture Stats--> + <stat_view + name="texture" + label="Texture" + show_label="true"> + <stat_bar + name="texture_cache_hits" + label="Cache Hit Rate" + stat="texture_cache_hits" + bar_max="100.f" + unit_label="%" + tick_spacing="20" + label_spacing="20" + show_history="true" + show_bar="false"> + </stat_bar> + <stat_bar + name="texture_cache_read_latency" + label="Cache Read Latency" + unit_label="msec" + stat="texture_cache_read_latency" + bar_max="1000.f" + tick_spacing="100" + label_spacing="200" + show_history="true" + show_bar="false"> + </stat_bar> + <stat_bar + name="numimagesstat" + label="Count" + stat="numimagesstat" + bar_max="8000.f" + tick_spacing="2000.f" + label_spacing="4000.f" + show_bar="false"> + </stat_bar> + + <stat_bar + name="numrawimagesstat" + label="Raw Count" + stat="numrawimagesstat" + bar_max="8000.f" + tick_spacing="2000.f" + label_spacing="4000.f" + show_bar="false"> + </stat_bar> + </stat_view> + <!--Network Stats--> + <stat_view + name="network" + label="Network" + show_label="true" + setting="OpenDebugStatNet"> + <stat_bar + name="packetsinstat" + label="Packets In" + stat="packetsinstat" + unit_label="/sec" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" + show_bar="false"> + </stat_bar> + + <stat_bar + name="packetsoutstat" + label="Packets Out" + stat="packetsoutstat" + unit_label="/sec" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" + show_bar="false" > + </stat_bar> + + <stat_bar + name="objectkbitstat" + label="Objects" + stat="objectkbitstat" + unit_label="kbps" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" + show_bar="false" > + </stat_bar> + + <stat_bar + name="texturekbitstat" + label="Texture" + stat="texturekbitstat" + unit_label="kbps" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" + show_bar="false" > + </stat_bar> + + <stat_bar + name="assetkbitstat" + label="Asset" + stat="assetkbitstat" + unit_label="kbps" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" + show_bar="false" > + </stat_bar> + + <stat_bar + name="layerskbitstat" + label="Layers" + stat="layerskbitstat" + unit_label="kbps" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" + show_bar="false" > + </stat_bar> + + <stat_bar + name="actualinkbitstat" + label="Actual In" + stat="actualinkbitstat" + unit_label="kbps" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" + show_bar="false" + show_history="false" > + </stat_bar> + + <stat_bar + name="actualoutkbitstat" + label="Actual Out" + stat="actualoutkbitstat" + unit_label="kbps" + bar_max="1024.f" + tick_spacing="128.f" + label_spacing="256.f" + precision="1" + show_bar="false" + show_history="false"> + </stat_bar> + + <stat_bar + name="vfspendingoperations" + label="VFS Pending Operations" + stat="vfspendingoperations" + unit_label=" Ops." + show_bar="false" > + </stat_bar> + </stat_view> + </stat_view> + <!--Sim Stats--> + <stat_view + name="sim" + label="Simulator" + show_label="true" + setting="OpenDebugStatSim"> + + <stat_bar + name="simobjects" + label="Objects" + stat="simobjects" + precision="0" + bar_max="30000.f" + tick_spacing="5000.f" + label_spacing="10000.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simactiveobjects" + label="Active Objects" + stat="simactiveobjects" + precision="0" + bar_max="5000.f" + tick_spacing="750.f" + label_spacing="1250.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simactivescripts" + label="Active Scripts" + stat="simactivescripts" + precision="0" + bar_max="15000.f" + tick_spacing="1875.f" + label_spacing="3750.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + + <stat_bar + name="siminpps" + label="Packets In" + stat="siminpps" + unit_label="pps" + precision="0" + bar_max="2000.f" + tick_spacing="250.f" + label_spacing="1000.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simoutpps" + label="Packets Out" + stat="simoutpps" + unit_label="pps" + precision="0" + bar_max="2000.f" + tick_spacing="250.f" + label_spacing="1000.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simpendingdownloads" + label="Pending Downloads" + stat="simpendingdownloads" + precision="0" + bar_max="800.f" + tick_spacing="100.f" + label_spacing="200.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simpendinguploads" + label="Pending Uploads" + stat="simpendinguploads" + precision="0" + bar_max="100.f" + tick_spacing="25.f" + label_spacing="50.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simtotalunackedbytes" + label="Total Unacked Bytes" + stat="simtotalunackedbytes" + unit_label="kb" + precision="1" + bar_max="100000.f" + tick_spacing="25000.f" + label_spacing="50000.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_view + name="simperf" + label="Time (ms)" + show_label="true"> + <stat_bar + name="simframemsec" + label="Total Frame Time" + stat="simframemsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simnetmsec" + label="Net Time" + stat="simnetmsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simsimphysicsmsec" + label="Physics Time" + stat="simsimphysicsmsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simsimothermsec" + label="Simulation Time" + stat="simsimothermsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simagentmsec" + label="Agent Time" + stat="simagentmsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simimagesmsec" + label="Images Time" + stat="simimagesmsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simscriptmsec" + label="Script Time" + stat="simscriptmsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + + <stat_bar + name="simsparemsec" + label="Spare Time" + stat="simsparemsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + <!--2nd level time blocks under 'Details' second--> + <stat_view + name="timedetails" + label="Time Details (ms)" + show_label="true"> + <stat_bar + name="simsimphysicsstepmsec" + label=" Physics Step" + stat="simsimphysicsstepmsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + <stat_bar + name="simsimphysicsshapeupdatemsec" + label=" Update Phys Shapes" + stat="simsimphysicsshapeupdatemsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + <stat_bar + name="simsimphysicsothermsec" + label=" Physics Other" + stat="simsimphysicsothermsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + <stat_bar + name="simsleepmsec" + label=" Sleep Time" + stat="simsleepmsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + <stat_bar + name="simpumpiomsec" + label=" Pump IO" + stat="simpumpiomsec" + unit_label="ms" + precision="3" + bar_max="40.f" + tick_spacing="10.f" + label_spacing="20.f" + show_bar="false" + show_mean="false" > + </stat_bar> + </stat_view> + </stat_view> + </stat_view> + </container_view> + </scroll_container> +</floater> diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index 93d9945800..a3f2fb0b9c 100644 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -70,7 +70,6 @@ tick_spacing="0.5" label_spacing="1" precision="3" - show_per_sec="false" show_bar="false" show_mean="true"> </stat_bar> @@ -85,7 +84,6 @@ label_spacing="1000" precision="0" show_bar="false" - show_per_sec="false" show_mean="false"> </stat_bar> </stat_view> @@ -137,7 +135,6 @@ tick_spacing="5000" label_spacing="10000" precision="0" - show_per_sec="false" show_bar="false"> </stat_bar> <stat_bar @@ -149,7 +146,6 @@ bar_max="2000" tick_spacing="200" label_spacing="400" - show_per_sec="true" show_bar="false"> </stat_bar> <stat_bar @@ -162,7 +158,6 @@ tick_spacing="20" label_spacing="20" show_history="true" - show_per_sec="false" show_bar="false"> </stat_bar> </stat_view> @@ -181,7 +176,6 @@ tick_spacing="20" label_spacing="20" show_history="true" - show_per_sec="false" show_bar="false"> </stat_bar> <stat_bar @@ -194,7 +188,6 @@ tick_spacing="100" label_spacing="200" show_history="true" - show_per_sec="false" show_bar="false"> </stat_bar> <stat_bar @@ -205,7 +198,6 @@ bar_max="8000.f" tick_spacing="2000.f" label_spacing="4000.f" - show_per_sec="false" show_bar="false"> </stat_bar> @@ -217,7 +209,6 @@ bar_max="8000.f" tick_spacing="2000.f" label_spacing="4000.f" - show_per_sec="false" show_bar="false"> </stat_bar> @@ -232,7 +223,6 @@ tick_spacing="100.f" label_spacing="200.f" precision="1" - show_per_sec="false" show_bar="false"> </stat_bar> @@ -247,7 +237,6 @@ tick_spacing="100.f" label_spacing="200.f" precision="3" - show_per_sec="false" show_bar="false"> </stat_bar> @@ -262,7 +251,6 @@ tick_spacing="100.f" label_spacing="200.f" precision="3" - show_per_sec="false" show_bar="false"> </stat_bar> @@ -277,7 +265,6 @@ tick_spacing="100.f" label_spacing="200.f" precision="3" - show_per_sec="false" show_bar="false"> </stat_bar> </stat_view> @@ -398,7 +385,6 @@ label="VFS Pending Operations" stat="vfspendingoperations" unit_label=" Ops." - show_per_sec="false" show_bar="false" > </stat_bar> </stat_view> @@ -418,7 +404,6 @@ bar_max="1.f" tick_spacing="0.16666f" label_spacing="0.33333f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -432,7 +417,6 @@ bar_max="45.f" tick_spacing="7.5f" label_spacing="15.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -446,7 +430,6 @@ bar_max="45.f" tick_spacing="7.5.f" label_spacing="15.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -464,7 +447,6 @@ bar_max="500.f" tick_spacing="50.f" label_spacing="100.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -478,7 +460,6 @@ bar_max="500.f" tick_spacing="50.f" label_spacing="100.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -493,7 +474,6 @@ bar_max="1024.f" tick_spacing="128.f" label_spacing="256.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -508,7 +488,6 @@ bar_max="100.f" tick_spacing="25.f" label_spacing="50.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -522,7 +501,6 @@ bar_max="80.f" tick_spacing="10.f" label_spacing="40.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -536,7 +514,6 @@ bar_max="40.f" tick_spacing="5.f" label_spacing="10.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -550,7 +527,6 @@ bar_max="30000.f" tick_spacing="5000.f" label_spacing="10000.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -564,7 +540,6 @@ bar_max="5000.f" tick_spacing="750.f" label_spacing="1250.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -578,7 +553,6 @@ bar_max="15000.f" tick_spacing="1875.f" label_spacing="3750.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -592,7 +566,6 @@ tick_spacing="10" label_spacing="20" precision="3" - show_per_sec="false" show_bar="false" show_mean="true"> </stat_bar> @@ -607,7 +580,6 @@ bar_max="5000.f" tick_spacing="750.f" label_spacing="1250.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -626,7 +598,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -640,7 +611,6 @@ bar_max="45" tick_spacing="4" label_spacing="8" - show_per_sec="false" show_bar="false"> </stat_bar> <stat_bar @@ -653,7 +623,6 @@ tick_spacing="10" label_spacing="20" precision="1" - show_per_sec="false" show_bar="false" show_mean="true"> </stat_bar> @@ -669,7 +638,6 @@ bar_max="2000.f" tick_spacing="250.f" label_spacing="1000.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -684,7 +652,6 @@ bar_max="2000.f" tick_spacing="250.f" label_spacing="1000.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -698,7 +665,6 @@ bar_max="800.f" tick_spacing="100.f" label_spacing="200.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -712,7 +678,6 @@ bar_max="100.f" tick_spacing="25.f" label_spacing="50.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -727,7 +692,6 @@ bar_max="100000.f" tick_spacing="25000.f" label_spacing="50000.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -746,7 +710,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -761,7 +724,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -776,7 +738,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -791,7 +752,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -806,7 +766,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -821,7 +780,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -836,7 +794,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -851,7 +808,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -870,7 +826,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -884,7 +839,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -898,7 +852,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -912,7 +865,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> @@ -926,7 +878,6 @@ bar_max="40.f" tick_spacing="10.f" label_spacing="20.f" - show_per_sec="false" show_bar="false" show_mean="false" > </stat_bar> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 8fe955aed8..5b6a6f908a 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1384,6 +1384,14 @@ function="Floater.Toggle" parameter="stats" /> </menu_item_check> + <menu_item_call + label="Scene Load Statistics" + name="Scene Load Statistics" + shortcut="control|shift|2"> + <on_click + function="Floater.Show" + parameter="scene_load_stats" /> + </menu_item_call> <menu_item_check label="Show Draw Weight for Avatars" name="Avatar Rendering Cost"> |