X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=blobdiff_plain;f=universe.h;h=07cf7f02b28b50de0731fdca10ad52f41451ecc2;hb=599bf3fa2eb01b05ec677b628e65adb2fe4f91c3;hp=a521f5981b9a996455e47816507159fb9eff2793;hpb=6408d9fe6e1b82ad9aa71d6e1702ec100a8c3ca1;p=universe.git diff --git a/universe.h b/universe.h index a521f59..07cf7f0 100644 --- a/universe.h +++ b/universe.h @@ -31,7 +31,7 @@ public: // The destructor deletes all the added polygons ~Universe(); - void initialize(Polygon *p); + void initialize_polygon(Polygon *p); void clear(); void add_polygon(Polygon *p); bool collide(Polygon *p); @@ -39,6 +39,7 @@ public: // Compute collisions between projections of the polygons on a few // axis to speed up the computation void compute_pseudo_collisions(int nb_axis, int *nb_colliding_axis); + void apply_gravity(scalar_t dt, scalar_t fx, scalar_t fy); void apply_collision_forces(scalar_t dt); bool update(scalar_t dt); @@ -52,7 +53,9 @@ public: void draw(SimpleWindow *window); #endif +#ifdef CAIRO_SUPPORT void draw(Canvas *canvas); }; +#endif #endif