![]() |
Middle Europe Productions Library
alpha 1.3.3
|
MEP::AnimationPosition provides a basic implementation of a modification of the position. More...
#include <AnimationPosition.h>
Public Member Functions | |
| AnimationPosition ()=default | |
| AnimationPosition (const AnimationPosition &x) | |
| AnimationPosition (const double entry, const double exit, sf::Time length, const float frameRate=120, const double begin=0, const double end=100, std::function< double(double x)> function=[](double x) ->double{ return x;}) | |
| virtual void | run (const Direction direc, sf::Time currentTime=sf::Time::Zero) |
| const double & | getFixedVariable () const |
| unsigned int | getFixedUintVariable () const |
| const double & | getEntry () const |
| const double & | getExit () const |
| bool | draw (sf::RenderWindow &) override |
| virtual void | update (sf::Time ¤tTime) |
| void | entryUpdate (sf::Time ¤tTime, bool low=false) override |
| void | exitUpdate (sf::Time ¤tTime, bool low=false) override |
| bool | isActive () const override |
| bool | reset () override |
| virtual sf::Color | getFrameAsColor () const |
| void | delayOutput (std::ostream &out) const |
| virtual void | debugOutput (std::ostream &out) const |
| virtual | ~AnimationPosition () |
Public Member Functions inherited from MEP::Drawable | |
| void | _link (std::shared_ptr< bool > _li) |
| std::shared_ptr< bool > | _linkAddr () |
| const std::shared_ptr< bool > | _linkAddr () const |
| bool | _isLinked () const |
| U_int32 | getDrawTag () const |
| void | setDrawTag (const U_int32 tag) |
| bool | addDrawTag (const U_int32 tag) |
| bool | removeDrawTag (const U_int32 tag) |
| virtual void | onResize () |
| Drawable ()=default | |
| virtual | ~Drawable () |
Public Member Functions inherited from MEP::Animation | |
| Animation ()=default | |
| Animation (const AnimationInit initType, const float frameRate) | |
| Animation (const AnimationInit initType, const sf::Time towait) | |
| Animation (const Animation &x) | |
| void | changeStatus () |
| bool | getStatus () const |
| void | changeTag (MEP::U_int32 tag) |
| sf::Time | getToWait () const |
| AnimationInit | getInit () const |
| const Direction & | getDirection () const |
| void | setDirection (MEP::Direction dir) |
Public Member Functions inherited from MEPtools::AnimationDelay | |
| void | setDelay (const sf::Time &delay, bool permaDelay=false) |
| void | setEntryDelay (const sf::Time &delay) |
| void | setExitDelay (const sf::Time &delay) |
| void | setLowEntryDelay (const sf::Time &delay) |
| void | setLowExitDelay (const sf::Time &delay) |
| void | setGeneralDelay (const sf::Time &delay, bool permaDelay=false) |
| void | resetDelay () |
Protected Member Functions | |
| void | init () |
| void | updatePositionAnimation (sf::Time ¤tTime) |
Protected Member Functions inherited from MEP::Drawable | |
| void | notify () |
| void | drawTagDebug (std::ostream &out) const |
Protected Member Functions inherited from MEP::Animation | |
| void | animationDebug (std::ostream &out) const |
Protected Member Functions inherited from MEPtools::AnimationDelay | |
| const sf::Time & | delay () const |
| bool | updateDelay (const sf::Time ¤tTime) |
| void | newCycle () |
| void | changeState (State newState) |
Protected Attributes | |
| std::function< double(double x)> | m_function |
| unsigned int | nofFrames |
| std::list< double > | frames |
| std::list< double >::iterator | currentFrame |
| unsigned int | current_frame = 0 |
| const double | m_begin = 0 |
| const double | m_end = 0 |
| double | m_entry = 0 |
| double | m_exit = 0 |
Protected Attributes inherited from MEP::Animation | |
| MEP::U_int32 | m_tag = AdditionalTag::AdditionalTagDisabled |
| AnimationInit | isInit = AnimationInit::NotInit |
| sf::Time | updateTime = sf::Time::Zero |
| sf::Time | toWait = sf::Time::Zero |
| bool | isRunning = false |
| Direction | direction = Direction::Backwards |
Protected Attributes inherited from MEPtools::AnimationDelay | |
| State | state = State::Base |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const AnimationPosition &x) |
Additional Inherited Members | |
Public Types inherited from MEP::Animation | |
| enum | AnimationInit { AnimationInit::NotInit = 0, AnimationInit::ObjectAnimation = 1, AnimationInit::PositionAnimation = 2 } |
Protected Types inherited from MEPtools::AnimationDelay | |
| enum | State { State::Entry, State::Exit, State::Base, State::LowExit, State::LowEntry } |
MEP::AnimationPosition provides a basic implementation of a modification of the position.
The idea here is simple. We take a function f. Then min(<f(begin), ..., f(end)>) where min is a minimal value. Becomes our entry position. And max(<f(begin), ..., f(end)>) where max is a maximal value. Becomes our exit position. Please keep in mind that f(begin) and minimal value are 2 seperate things, but of course f(begin) can be equal to minimal value. After all of that we generate points according to the given framerate and animation lenght.
|
default |
|
inline |
Vopy constructor of an animation.
| [in] | x | : MEP::AnimationPosition object |
|
inline |
Contructor of an animation. It is taking a part of a from f(begin) to f(end) then calculation the position accoring to the formula. Fmax(F(begin), F(end)) = exit, and Fmin(F(begin), F(end) = min.
| [in] | begin | : Begining point on a graph, |
| [in] | end | : End point of a graph. |
| [in] | length | : Animation lenght in ms. |
| [in] | frameRate | : Frame rate of an animation. |
| [in] | entry | : Entry position of an Object (before the animation) |
| [in] | exit | : Exit position of an Object (after the animation) |
| [in] | fun | : Function graph. Method with the return type double. |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inlineoverridevirtual |
Override of a MEP::Drawable draw.
Reimplemented from MEP::Drawable.
|
inlineoverridevirtual |
Override of a MEP::Drawable entryUpdate.
Reimplemented from MEP::Drawable.
|
inlineoverridevirtual |
Override of a MEP::Drawable exitUpate.
Reimplemented from MEP::Drawable.
|
inline |
Outputs the entry position of an animation.
|
inline |
Outputs the exit position of an animation.
|
inline |
Outputs the current position of an animation.
|
inline |
Outputs the current position of an animation.
|
inlinevirtual |
Outputs the current frame as a Color Warning For color animation it is recommended to use MEP::AnimationColor
Reimplemented in MEP::AnimationColor.
|
inlineprotected |
|
inlineoverridevirtual |
Outputs the activation status of an animation.
Reimplemented from MEP::Drawable.
|
inlineoverridevirtual |
Resets the parameters of the animation if the animation is not active. Reset means changing it's current frame to begin or end depending of the direction. If direction is forward changes to begin otherwise to end.
Reimplemented from MEP::Animation.
|
inlinevirtual |
Sets the running tag to true and changes the direction of a movement, furthermore, it is capable of setting a current time.
| [in] | direc | : MEP::Animation::Direction. |
| [in] | currentTime | : sf::Time = sf::Time::Zero. |
Reimplemented from MEP::Animation.
|
inlinevirtual |
Override of a MEP::Drawable update.
Reimplemented from MEP::Drawable.
Reimplemented in MEP::AnimationColor.
|
inlineprotected |
Core updates for position animation.
Core updates for position animation. This method is needed in order to avoid CTRL-C/V.
|
friend |
Overrdie of the << operator for diagnostic purposes.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |