DDNet documentation
Loading...
Searching...
No Matches
smooth_value.h
Go to the documentation of this file.
1#ifndef GAME_EDITOR_SMOOTH_VALUE_H
2#define GAME_EDITOR_SMOOTH_VALUE_H
3
4#include "editor_object.h"
5
6#include <base/bezier.h>
7
12{
13public:
14 CSmoothValue() = default;
15 CSmoothValue(float InitialValue, float MinValue, float MaxValue);
16
20 void SetValue(float Target);
21
25 void ScaleValue(float Factor);
26
31 void SetValueInstant(float Target);
32
33 bool UpdateValue();
34
35 float GetValue() const;
36 void SetValueRange(float MinValue, float MaxValue);
37 float GetMinValue() const;
38 float GetMaxValue() const;
39
40private:
41 float Progress(float CurrentTime) const;
42
44 float m_Value;
49
52};
53
54#endif
Definition bezier.h:10
Definition editor_object.h:19
CSmoothValue()=default
void SetValue(float Target)
Definition smooth_value.cpp:9
bool UpdateValue()
Definition smooth_value.cpp:40
float m_ValueSmoothingEnd
Definition smooth_value.h:48
float m_MaxValue
Definition smooth_value.h:51
void SetValueRange(float MinValue, float MaxValue)
Definition smooth_value.cpp:84
float m_MinValue
Definition smooth_value.h:50
float m_Value
Definition smooth_value.h:44
float m_ValueSmoothingTarget
Definition smooth_value.h:46
void ScaleValue(float Factor)
Definition smooth_value.cpp:34
float GetValue() const
Definition smooth_value.cpp:73
void SetValueInstant(float Target)
Definition smooth_value.cpp:78
float Progress(float CurrentTime) const
Definition smooth_value.cpp:68
float GetMinValue() const
Definition smooth_value.cpp:90
CCubicBezier m_ValueSmoothing
Definition smooth_value.h:45
float m_ValueSmoothingStart
Definition smooth_value.h:47
bool m_Smoothing
Definition smooth_value.h:43
float GetMaxValue() const
Definition smooth_value.cpp:95