Raylib Bubbles
C++11 Raylib bubble shooter game.
|
Provides a view of a Lissajous curve. More...
#include <lissajous.hpp>
Classes | |
struct | LissajousDims |
Dimensions to set up the curve view. More... | |
struct | LissajousInit |
Initial parameters for a Lissajous curve. More... | |
Public Member Functions | |
LissajousView (const LissajousInit params, const LissajousDims dims) | |
Constructs a Lissajous curve view. More... | |
void | step (const float scale=1.0f) |
Steps the Lissajous curve. More... | |
float | getX () const |
Get the x coordinate of the Lissajous view, the top-left corner of the viewport. More... | |
float | getY () const |
Get the y coordinate of the Lissajous view, the top-left corner of the viewport. More... | |
void | change (const LissajousDims dims) |
Changes the viewport and background dimensions. More... | |
Provides a view of a Lissajous curve.
This class provides a view (step-able state/set of coordinates) of a Lissajous curve, which is a parametric curve that describes complex harmonic motion.
To be more accurate, this class provides a set of coordinates that allows an image to be drawn following a Lissajous curve without going off the viewport. The size of the curve is appropriately scaled to make the image reach the very edges of the viewport (on the matching image borders, not the origin, so it won't go off screen).
|
inline |
Constructs a Lissajous curve view.
params | The initial parameters for the Lissajous curve. |
viewport | The dimensions of the viewport and background. |
Constructs a Lissajous curve view using the dimensions requested. The final curve will be scaled to make images moving along it reach the very edges of the viewport (on the matching image borders, not the origin). This is especially useful for animating a background image along a smaller viewport.
void LissajousView::change | ( | const LissajousDims | dims | ) |
Changes the viewport and background dimensions.
viewport | The new viewport and background dimensions. |
|
inline |
Get the x coordinate of the Lissajous view, the top-left corner of the viewport.
|
inline |
Get the y coordinate of the Lissajous view, the top-left corner of the viewport.
void LissajousView::step | ( | const float | scale = 1.0f | ) |
Steps the Lissajous curve.
scale | The scale of the step. |