UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FInertialScrollManager Class Reference

#include <InertialScrollManager.h>

Public Member Functions

SLATE_API FInertialScrollManager (double SampleTimeout=0.1f)
 
SLATE_API void AddScrollSample (float Delta, double CurrentTime)
 
SLATE_API void UpdateScrollVelocity (const float InDeltaTime)
 
SLATE_API void ClearScrollVelocity (bool bInShouldStopScrollNow=false)
 
float GetScrollVelocity () const
 
bool GetShouldStopScrollNow () const
 
void ResetShouldStopScrollNow ()
 

Detailed Description

A helper class to calculate inertial scrolling. This class combines a percentage of velocity lost per second coupled with a static amount of velocity lost per second in order to achieve a quick decay when the velocity grows small enough, and the percentage of friction lost prevents large velocities from scrolling forever.

Constructor & Destructor Documentation

◆ FInertialScrollManager()

FInertialScrollManager::FInertialScrollManager ( double  SampleTimeout = 0.1f)

Constructor

Parameters
ScrollDeccelerationThe acceleration against the velocity causing it to decay.
SampleTimeoutSamples older than this amount of time will be discarded.

Member Function Documentation

◆ AddScrollSample()

void FInertialScrollManager::AddScrollSample ( float  Delta,
double  CurrentTime 
)

Adds a scroll velocity sample to help calculate a smooth velocity

◆ ClearScrollVelocity()

void FInertialScrollManager::ClearScrollVelocity ( bool  bInShouldStopScrollNow = false)

Stop the accumulation of inertial scroll.

Parameters
bInShouldStopScrollNowtrue implies the scroll will stop instantly, else the list will scroll until any accumulated scroll offset is cleared.

◆ GetScrollVelocity()

float FInertialScrollManager::GetScrollVelocity ( ) const
inline

Gets the calculated velocity of the scroll.

◆ GetShouldStopScrollNow()

bool FInertialScrollManager::GetShouldStopScrollNow ( ) const
inline

Gets the the value of bShouldStopScrollNow.

◆ ResetShouldStopScrollNow()

void FInertialScrollManager::ResetShouldStopScrollNow ( )
inline

Set the value of bShouldStopScrollNow to false.

◆ UpdateScrollVelocity()

void FInertialScrollManager::UpdateScrollVelocity ( const float  InDeltaTime)

Updates the current scroll velocity. Call every frame.


The documentation for this class was generated from the following files: