Raylib Bubbles
C++11 Raylib bubble shooter game.
LissajousView Class Reference

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...
 

Detailed Description

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).

https://en.wikipedia.org/wiki/Lissajous_curve

Constructor & Destructor Documentation

◆ LissajousView()

LissajousView::LissajousView ( const LissajousInit  params,
const LissajousDims  dims 
)
inline

Constructs a Lissajous curve view.

Parameters
paramsThe initial parameters for the Lissajous curve.
viewportThe 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.

See also
LissajousView

Member Function Documentation

◆ change()

void LissajousView::change ( const LissajousDims  dims)

Changes the viewport and background dimensions.

Parameters
viewportThe new viewport and background dimensions.

◆ getX()

float LissajousView::getX ( ) const
inline

Get the x coordinate of the Lissajous view, the top-left corner of the viewport.

Returns
Absolute x coordinate.

◆ getY()

float LissajousView::getY ( ) const
inline

Get the y coordinate of the Lissajous view, the top-left corner of the viewport.

Returns
Absolute y coordinate.

◆ step()

void LissajousView::step ( const float  scale = 1.0f)

Steps the Lissajous curve.

Parameters
scaleThe scale of the step.

The documentation for this class was generated from the following files: