forked from organicmaps/organicmaps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: drape_frontend/drape_engine.hpp drape_frontend/frontend_renderer.cpp drape_frontend/message.hpp drape_frontend/message_subclasses.hpp Conflicts: drape_frontend/message.hpp
- Loading branch information
Showing
16 changed files
with
279 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "perspective_animation.hpp" | ||
#include "drape_frontend/animation/interpolations.hpp" | ||
|
||
namespace df | ||
{ | ||
|
||
double PerspectiveAnimation::GetRotateDuration(double startAngle, double endAngle) | ||
{ | ||
return 0.5 * fabs(endAngle - startAngle) / math::pi4; | ||
} | ||
|
||
PerspectiveAnimation::PerspectiveAnimation(double duration, double startRotationAngle, double endRotationAngle) | ||
: PerspectiveAnimation(duration, 0.0, startRotationAngle, endRotationAngle) | ||
{ | ||
} | ||
|
||
PerspectiveAnimation::PerspectiveAnimation(double duration, double delay, double startRotationAngle, double endRotationAngle) | ||
: BaseInterpolator(duration, delay) | ||
, m_startRotationAngle(startRotationAngle) | ||
, m_endRotationAngle(endRotationAngle) | ||
, m_rotationAngle(startRotationAngle) | ||
{ | ||
} | ||
|
||
void PerspectiveAnimation::Advance(double elapsedSeconds) | ||
{ | ||
TBase::Advance(elapsedSeconds); | ||
m_rotationAngle = InterpolateDouble(m_startRotationAngle, m_endRotationAngle, GetT()); | ||
} | ||
|
||
} // namespace df |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include "drape_frontend/animation/base_interpolator.hpp" | ||
|
||
namespace df | ||
{ | ||
|
||
class PerspectiveAnimation : public BaseInterpolator | ||
{ | ||
using TBase = BaseInterpolator; | ||
|
||
public: | ||
static double GetRotateDuration(double startAngle, double endAngle); | ||
|
||
PerspectiveAnimation(double duration, double startRotationAngle, double endRotationAngle); | ||
PerspectiveAnimation(double duration, double delay, double startRotationAngle, double endRotationAngle); | ||
|
||
void Advance(double elapsedSeconds) override; | ||
double GetRotationAngle() const { return m_rotationAngle; } | ||
|
||
private: | ||
double m_startRotationAngle; | ||
double m_endRotationAngle; | ||
double m_rotationAngle; | ||
}; | ||
|
||
} // namespace df | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.