14 std::vector<glm::vec2> positions;
15 std::vector<int> zIndices;
16 std::vector<int> rotations;
23 MovingAnimation(
int ix,
int iy,
int f,
float s,
const std::string _type,
int dx,
int dy,
int _reps = 0) :
Animation(ix, iy, f, s, _type)
29 glm::vec2 distanceXY(dx, dy);
30 positions.push_back(distanceXY);
31 zIndices.push_back(0);
32 rotations.push_back(0);
37 MovingAnimation(
int ix,
int iy,
int f,
float s,
const animType _type,
int dx,
int dy,
int _reps = 0) :
Animation(ix, iy, f, s, _type)
43 glm::vec2 distanceXY(dx, dy);
44 positions.push_back(distanceXY);
45 zIndices.push_back(0);
46 rotations.push_back(0);
52 int ix,
int iy,
int f,
float s,
const std::string _type,
const std::vector<glm::vec2>& _positions,
const std::vector<int>& _zIndices,
const std::vector<int>& _rotations,
int _reps = 0)
58 positions = _positions;
60 rotations = _rotations;
62 Animation(ix, iy, positions.size(), s, _type);
69 int ix,
int iy,
size_t f,
float s,
const animType _type,
const std::vector<glm::vec2>& _positions,
const std::vector<int>& _zIndices,
const std::vector<int>& _rotations,
int _reps = 0)
75 positions = _positions;
77 rotations = _rotations;
79 Animation(ix, iy, positions.size(), s, _type);
86 void validateVectors()
const {
88 if (positions.size() != zIndices.size() || positions.size() != rotations.size()) {
89 throw std::invalid_argument(
"All vectors (positions, zIndices, rotations) must have the same length.");