2021-12-01 20:18:19 +01:00
|
|
|
#ifndef BALLS_H_INCLUDED
|
|
|
|
#define BALLS_H_INCLUDED
|
|
|
|
|
2021-12-11 21:32:48 +01:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
2021-12-01 20:18:19 +01:00
|
|
|
struct ball_face;
|
|
|
|
|
|
|
|
struct ball {
|
|
|
|
double x;
|
|
|
|
double y;
|
|
|
|
unsigned int radius;
|
|
|
|
|
|
|
|
double v_x;
|
|
|
|
double v_y;
|
|
|
|
|
|
|
|
double angle;
|
|
|
|
double v_angle;
|
|
|
|
|
|
|
|
struct ball_face * face;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct ball * balls;
|
|
|
|
extern unsigned int n_balls;
|
|
|
|
|
2021-12-11 21:32:48 +01:00
|
|
|
extern unsigned int radius_min;
|
|
|
|
extern unsigned int radius_max;
|
|
|
|
|
|
|
|
extern unsigned int v_max;
|
|
|
|
extern unsigned int v_min;
|
|
|
|
|
|
|
|
extern unsigned int v_angle_min;
|
|
|
|
extern unsigned int v_angle_max;
|
|
|
|
|
|
|
|
extern const char * face_filename;
|
|
|
|
extern int face_rotation;
|
|
|
|
|
|
|
|
extern void balls_init ();
|
|
|
|
extern void balls_destroy ();
|
|
|
|
extern void ball_update_state (struct ball * p);
|
|
|
|
extern void ball_elastic_collision (struct ball * p, struct ball * q);
|
|
|
|
extern void ball_reposition (struct ball * b);
|
|
|
|
extern void balls_draw (cairo_t * cr);
|
2021-12-01 20:18:19 +01:00
|
|
|
|
|
|
|
#endif
|