-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathanimation.cpp
More file actions
42 lines (35 loc) · 1.11 KB
/
animation.cpp
File metadata and controls
42 lines (35 loc) · 1.11 KB
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
37
38
39
40
41
42
#include <fea/rendering/animation.hpp>
namespace fea
{
Animation::Animation() : mFrameAmount(0), mDelay(0), mLoop(true), mAnimBehavior(FORWARDS)
{
}
Animation::Animation(const glm::ivec2& frameStart, const glm::ivec2& frameSize, uint32_t fAmount, uint32_t d, bool l, AnimationBehavior ab) : mStart(frameStart), mFrameSize(frameSize), mFrameAmount(fAmount), mDelay(d), mLoop(l), mAnimBehavior(ab)
{
}
glm::ivec4 Animation::getConstraints(uint32_t frame) const
{
glm::ivec4 constraints;
constraints[0] = mStart.x + mFrameSize.x * frame;
constraints[1] = mStart.x + mFrameSize.x + mFrameSize.x * frame;
constraints[2] = mStart.y;
constraints[3] = mStart.y + mFrameSize.y;
return constraints;
}
uint32_t Animation::getFrameAmount() const
{
return mFrameAmount;
}
uint32_t Animation::getDelay() const
{
return mDelay;
}
bool Animation::getLoop() const
{
return mLoop;
}
AnimationBehavior Animation::getAnimationBehavior() const
{
return mAnimBehavior;
}
}