blob: 000afa14a8f5ab6984f761142b09f146b78f5b07 (
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
|
#include "rotate_screen_task.hpp"
#include "framework.hpp"
RotateScreenTask::RotateScreenTask(Framework * framework,
double startAngle,
double endAngle,
double speed)
: anim::AngleInterpolation(startAngle,
endAngle,
speed,
m_outAngle),
m_framework(framework)
{
}
void RotateScreenTask::OnStep(double ts)
{
double prevAngle = m_outAngle;
anim::AngleInterpolation::OnStep(ts);
Navigator & nav = m_framework->GetNavigator();
nav.SetAngle(nav.Screen().GetAngle() + m_outAngle - prevAngle);
m_framework->Invalidate();
}
void RotateScreenTask::OnEnd(double ts)
{
anim::AngleInterpolation::OnEnd(ts);
Navigator & nav = m_framework->GetNavigator();
nav.SetAngle(m_outAngle);
m_framework->Invalidate();
}
bool RotateScreenTask::IsVisual() const
{
return true;
}
|