13 #include <string_view> 17 namespace MOVING_SPEED
28 EventCfg(
float acceleration,
float maxVelocity, uint32_t resetTimeout)
29 : m_acceleration{acceleration}, m_maxVelocity{maxVelocity}, m_resetTimeout{resetTimeout}
41 EventCfg(
float acceleration,
float maxVelocity, uint32_t resetTimeout,
float delta)
42 : m_acceleration{acceleration},
43 m_maxVelocity{maxVelocity},
44 m_resetTimeout{resetTimeout},
51 uint32_t m_resetTimeout;
64 typedef std::map<EventType, EventCfg> MapEventConfig;
83 void AddEventConfig(uint32_t eventId,
86 uint32_t resetTimeout);
93 void AddEventConfig(uint32_t eventId,
EventCfg event);
99 void AddEventMapConfig(MapEventConfig& configs);
111 void Reset(uint32_t eventId);
118 float GetUpdatedDistance(uint32_t eventId);
127 return GetUpdatedDistance(static_cast<uint32_t>(eventType));
136 float m_currentVelocity{1.0f};
137 uint32_t m_lastFrameTime{0};
140 uint32_t m_currentEventId{0};
141 std::map<uint32_t, EventData> m_eventsData;
149 EventType ParseEventType(std::string_view eventType);
Definition: deflate.c:123
Definition: ColorUtils.h:18
EventCfg(float acceleration, float maxVelocity, uint32_t resetTimeout, float delta)
Definition: MovingSpeed.h:41
Definition: MovingSpeed.h:20
Class to calculate the velocity for a motion effect. To ensure it works, the GetUpdatedDistance metho...
Definition: MovingSpeed.h:72
float GetUpdatedDistance(EventType eventType)
Get the updated distance based on acceleration speed.
Definition: MovingSpeed.h:125
EventCfg(float acceleration, float maxVelocity, uint32_t resetTimeout)
Definition: MovingSpeed.h:28