blob: 3e1c30102e850b2b3b2e4578ece39b4d480a03a0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#pragma once
#include "anim/task.hpp"
namespace anim
{
class AngleInterpolation : public Task
{
double m_startAngle;
double m_curAngle;
double & m_outAngle;
double m_startTime;
double m_endAngle;
double m_interval;
double m_speed;
public:
AngleInterpolation(double start,
double end,
double speed,
double & out);
void Reset(double start, double end, double speed);
void OnStart(double ts);
void OnStep(double ts);
void OnEnd(double ts);
void SetEndAngle(double val);
private:
void CalcParams(double start, double end, double speed);
};
class SafeAngleInterpolation : public AngleInterpolation
{
typedef AngleInterpolation TBase;
public:
SafeAngleInterpolation(double start, double end, double speed);
void ResetDestParams(double dstAngle, double speed);
double GetCurrentValue() const;
private:
double m_angle;
};
}
|