Skip to main content

Module kinetic_scroll

Module kinetic_scroll 

Source
Expand description

Kinetic Momentum Scrolling, Touch Physics, Rubber-Banding, and Scrollbar Geometry.

Provides a 120 FPS inertial physics simulation with exponential velocity decay, critically damped overscroll spring recovery, and draggable scrollbar state machines.

Structs§

KineticScrollController
Interactive 2D Kinetic Momentum Scroll Controller.
ScrollAxis
State machine for a single 1D scrolling dimension (horizontal or vertical).

Constants§

DEFAULT_FRICTION
Deceleration constant $\lambda$ for exponential velocity decay ($v(t) = v_0 e^{-\lambda t}$).
REST_VELOCITY_THRESHOLD
Velocity cutoff threshold in pixels per second.
RUBBER_BAND_MAX_LIMIT
Maximum rubber-band displacement limit in pixels.
SPRING_DAMPING
Damped harmonic spring damping coefficient (critically damped: $2 \sqrt{k \cdot m}$).
SPRING_STIFFNESS
Damped harmonic spring stiffness coefficient for boundary snapback.