UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InertialScrollManager.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
6#include "CoreMinimal.h"
7
15{
16
17public:
23 SLATE_API FInertialScrollManager(double SampleTimeout = 0.1f);
24
26 SLATE_API void AddScrollSample(float Delta, double CurrentTime);
27
30
36
38 float GetScrollVelocity() const { return ScrollVelocity; }
39
41 bool GetShouldStopScrollNow() const { return bShouldStopScrollNow; }
42
44 void ResetShouldStopScrollNow() { bShouldStopScrollNow = false; }
45
46private:
47 struct FScrollSample
48 {
49 double Time;
50 float Delta;
51
52 FScrollSample(float InDelta, double InTime)
53 : Time(InTime)
54 , Delta(InDelta)
55 {}
56 };
57
59 TArray<FScrollSample> ScrollSamples;
60
62 float ScrollVelocity;
63
65 bool bShouldStopScrollNow = false;
66
68 double SampleTimeout;
69};
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition InertialScrollManager.h:15
void ResetShouldStopScrollNow()
Definition InertialScrollManager.h:44
SLATE_API void AddScrollSample(float Delta, double CurrentTime)
Definition InertialScrollManager.cpp:26
float GetScrollVelocity() const
Definition InertialScrollManager.h:38
SLATE_API void ClearScrollVelocity(bool bInShouldStopScrollNow=false)
Definition InertialScrollManager.cpp:78
bool GetShouldStopScrollNow() const
Definition InertialScrollManager.h:41
SLATE_API void UpdateScrollVelocity(const float InDeltaTime)
Definition InertialScrollManager.cpp:63
Definition Array.h:670