Raylib Bubbles
C++11 Raylib bubble shooter game.
lissajous.hpp
1 #ifndef LISSAJOUS_HPP_
2 #define LISSAJOUS_HPP_
3 
4 #include <cmath>
5 
20 public:
21 
26  struct LissajousInit {
27  float a;
28  float b;
29  float delta;
30  float speed;
31  };
32 
37  struct LissajousDims {
38  float viewportWidth;
39  float viewportHeight;
40  float backgroundWidth;
41  float backgroundHeight;
42  };
43 
55  LissajousView(const LissajousInit params, const LissajousDims dims)
56  : params(params), dims(dims), t(0.0f) {}
57 
58  LissajousView() = default;
59 
64  void step(const float scale = 1.0f);
65 
70  inline float getX() const {
71  return x;
72  }
73 
78  inline float getY() const {
79  return y;
80  }
81 
86  void change(const LissajousDims dims);
87 
88 private:
89  LissajousInit params;
90  LissajousDims dims;
91 
92  float x;
93  float y;
94  float t;
95 };
96 
97 #endif
Provides a view of a Lissajous curve.
Definition: lissajous.hpp:19
void change(const LissajousDims dims)
Changes the viewport and background dimensions.
Definition: lissajous.cpp:14
LissajousView(const LissajousInit params, const LissajousDims dims)
Constructs a Lissajous curve view.
Definition: lissajous.hpp:55
float getY() const
Get the y coordinate of the Lissajous view, the top-left corner of the viewport.
Definition: lissajous.hpp:78
void step(const float scale=1.0f)
Steps the Lissajous curve.
Definition: lissajous.cpp:5
float getX() const
Get the x coordinate of the Lissajous view, the top-left corner of the viewport.
Definition: lissajous.hpp:70
Dimensions to set up the curve view.
Definition: lissajous.hpp:37
Initial parameters for a Lissajous curve.
Definition: lissajous.hpp:26