Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/anim
diff options
context:
space:
mode:
authorExMix <rahuba.youri@mapswithme.com>2014-09-25 14:57:16 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:28:49 +0300
commitb070547defc6fee38f14ccd37c432f72a53d16e1 (patch)
tree95adcd0adb1df2af917c2af1af7d201f21997212 /anim
parentadf22ba2662c9102c2be2ff1bb202dd3a3fca9e1 (diff)
[core] more powerfull logic of location state animations
Diffstat (limited to 'anim')
-rw-r--r--anim/angle_interpolation.cpp2
-rw-r--r--anim/angle_interpolation.hpp19
-rw-r--r--anim/segment_interpolation.cpp3
-rw-r--r--anim/segment_interpolation.hpp21
4 files changed, 42 insertions, 3 deletions
diff --git a/anim/angle_interpolation.cpp b/anim/angle_interpolation.cpp
index 2caa490102..fa30ba830b 100644
--- a/anim/angle_interpolation.cpp
+++ b/anim/angle_interpolation.cpp
@@ -19,8 +19,8 @@ namespace anim
{
CalcParams(start, end, speed);
m_startTime = GetController()->GetCurrentTime();
+ m_outAngle = m_startAngle;
SetState(EReady);
- Start();
}
void AngleInterpolation::OnStart(double ts)
diff --git a/anim/angle_interpolation.hpp b/anim/angle_interpolation.hpp
index 0e580183f5..463ae69a2a 100644
--- a/anim/angle_interpolation.hpp
+++ b/anim/angle_interpolation.hpp
@@ -36,4 +36,23 @@ namespace anim
private:
void CalcParams(double start, double end, double speed);
};
+
+ class SafeAngleInterpolation : public AngleInterpolation
+ {
+ typedef AngleInterpolation TBase;
+ public:
+ SafeAngleInterpolation(double start, double end, double speed)
+ : TBase(start, end, speed, m_angle)
+ {
+ m_angle = start;
+ }
+
+ double GetCurrentValue() const
+ {
+ return m_angle;
+ }
+
+ private:
+ double m_angle;
+ };
}
diff --git a/anim/segment_interpolation.cpp b/anim/segment_interpolation.cpp
index f0ddd57b81..e8c9307b69 100644
--- a/anim/segment_interpolation.cpp
+++ b/anim/segment_interpolation.cpp
@@ -17,12 +17,11 @@ namespace anim
void SegmentInterpolation::Reset(m2::PointD const & start, m2::PointD const & end, double interval)
{
m_startPt = start;
- m_outPt = start;
+ m_outPt = m_startPt;
m_endPt = end;
m_interval = interval;
m_startTime = GetController()->GetCurrentTime();
SetState(EReady);
- Start();
}
void SegmentInterpolation::OnStart(double ts)
diff --git a/anim/segment_interpolation.hpp b/anim/segment_interpolation.hpp
index b99c8c15ac..373f0bb638 100644
--- a/anim/segment_interpolation.hpp
+++ b/anim/segment_interpolation.hpp
@@ -28,5 +28,26 @@ namespace anim
void OnStep(double ts);
void OnEnd(double ts);
};
+
+ class SafeSegmentInterpolation : public SegmentInterpolation
+ {
+ typedef SegmentInterpolation TBase;
+ public:
+ SafeSegmentInterpolation(m2::PointD const & startPt,
+ m2::PointD const & endPt,
+ double interval)
+ : TBase(startPt, endPt, interval, m_pt)
+ {
+ m_pt = startPt;
+ }
+
+ m2::PointD const & GetCurrentValue() const
+ {
+ return m_pt;
+ }
+
+ private:
+ m2::PointD m_pt;
+ };
}