FInertialScrollManager

A helper class to calculate inertial scrolling.

Windows
MacOS
Linux

References

Module

Slate

Header

/Engine/Source/Runtime/Slate/Public/Framework/Layout/InertialScrollManager.h

Include

#include "Framework/Layout/InertialScrollManager.h"

Syntax

class FInertialScrollManager

Remarks

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.

Constructors

Name Description

Public function

FInertialScrollManager

(
    double SampleTimeout
)

Constructor

Functions

Name Description

Public function

void

 

AddScrollSample

(
    float Delta,
    double CurrentTime
)

Adds a scroll velocity sample to help calculate a smooth velocity

Public function

void

 

ClearScrollVelocity()

Instantly end the inertial scroll

Public function Const

float

 

GetScrollVelocity()

Gets the calculated velocity of the scroll.

Public function

void

 

UpdateScrollVelocity

(
    const float InDeltaTime
)

Updates the current scroll velocity. Call every frame.

Constants

Name

Description

FrictionCoefficient

This is the percentage of velocity loss per second.

StaticVelocityDrag

This is a constant amount of velocity lost per second.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss