TazGraph Project v0.1.0
Loading...
Searching...
No Matches
MovingAnimation.h
1#pragma once
2
3#include "Animation.h"
4#include <vector>
5#include <glm/glm.hpp>
6#include <stdexcept>
7
8class MovingAnimation : public Animation //todo moving animation can be moving sprite with of without transform
9{
10public:
11 // have a vector for the positions
12 // when given only dx and dy then add that to the same vector as first element
13 // sprite will check bool if it is about continious
14
15 glm::vec3 startingPosition = glm::vec3(0);
16 glm::vec3 distance = glm::vec3(0); // Stores the positions for the animation
17 glm::vec3 dest_rotation = glm::vec3(0);
18
20 {
21
22 }
23 // ix,iy is initial position (destX, destY), f is total frames to move, s is the speed to move frames, type as in animation, dx,dy distance to move
24 MovingAnimation(glm::vec3 m_startPos, int f, float s, const std::string _type, glm::vec3 m_distance, int _reps = 0)
25 : Animation(0, 0, f, s, _type) // Animation frames look the next number of frames from the index
26 {
27 startingPosition = m_startPos;
28 distance = m_distance;
29
30 reps = _reps;
31 }
32
33 MovingAnimation(glm::vec3 m_startPos, int f, float s, const animType _type, glm::vec3 m_distance, int _reps = 0)
34 : Animation(0, 0, f, s, _type) // Animation frames look the next number of frames from the index
35 {
36 startingPosition = m_startPos;
37
38 distance = m_distance;
39
40 reps = _reps;
41 }
42
44 glm::vec3 m_startPos, size_t f, float s, const animType _type, glm::vec3 m_distance, glm::vec3 m_dest_rotation, int _reps = 0)
45 : Animation(0, 0, f, s, _type)// Animation frames look the next number of frames from the index
46 {
47 startingPosition = m_startPos;
48
49 distance = m_distance;
50 dest_rotation = m_dest_rotation;
51
52 reps = _reps;
53 }
54};
Definition MovingAnimation.h:9
Definition Animation.h:6