Use easing within the carousel view sliding

This commit is contained in:
Tobias Loose
2013-12-06 21:04:21 +01:00
parent 0d350af1b6
commit 31b353c5ec
3 changed files with 38 additions and 57 deletions

View File

@@ -7,13 +7,7 @@
class CarouselDeckView : public DeckView
{
private:
enum AnimationStage{
NONE = 0,
SLIDE_UP,
SLIDE_DOWN
};
static const float scroll_speed;
static const float slide_animation_duration;
public:
CarouselDeckView();
@@ -40,9 +34,8 @@ public:
//maintains the current rotation for fluid animations
private:
InOutQuadEasing mScrollOffset; //[-1,1]. defines the current rotation of the cards
float mSlide; //[-1,1]. defines, the y-offset of the cards
InOutQuadEasing mSlide; //[-1,1]. defines, the y-offset of the cards
int mScrollTarget; //0 <= mScrollTarget < mCards.size(). defines where to scroll to if the current animation is a scroll animation
AnimationStage mStage; // state machine state. for animation purposes
};
#endif //_CAROUSEL_DECK_VIEW_H_