27#ifndef GUI_ANIMATION_FLUID_SCROLL_H
28#define GUI_ANIMATION_FLUID_SCROLL_H
30#include "common/scummsys.h"
45 void setBounds(
float maxScroll,
int viewportHeight,
float stepSize);
63 void startFling(
float velocity);
66 void feedWheel(uint32 time,
float deltaY);
76 bool isAnimating()
const {
return _mode != kModeNone; }
84 bool update(uint32 time,
float &outVisualPos);
86 float setPosition(
float pos,
bool checkBound =
false);
89 float getVisualPosition()
const;
92 void checkBoundaries();
102 struct VelocityTracker {
107 static const int kHistorySize = 20;
108 Point samples[kHistorySize];
114 void addPoint(uint32 time,
float position);
115 float calculateVelocity()
const;
118 VelocityTracker _velocityTracker;
119 uint32 _lastWheelTime;
126 float _animationOffset;
132 float _initialVelocity;
136 float _stretchDistance;
137 float _impactVelocity;
140 float getVelocityAt(
float timeInSeconds)
const;
143 void absorb(
float velocity,
float distance);
146 static float calculateRubberBandOffset(
float offset,
float range);
148 static const float kRubberBandStretchFraction;
149 static const float kDecelerationRate;
150 static const float kVelocityThreshold;
151 static const float kValueThreshold;
152 static const float kDefaultSpringResponse;
153 static const float kRubberBandCoefficient;