X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=flatland.git;a=blobdiff_plain;f=universe.h;h=2758ad6610e42155d16644c93eb1696ded7ffdbb;hp=11dacc719ff08b446dcea535e4c465b7e839497a;hb=90d1c5704c30e7f1d041e32eacbc2893741110e1;hpb=26abc735ca75a78974c7ced091035e8c27ca1c00 diff --git a/universe.h b/universe.h index 11dacc7..2758ad6 100644 --- a/universe.h +++ b/universe.h @@ -50,13 +50,17 @@ public: void initialize_polygon(Polygon *p); void clear(); void add_polygon(Polygon *p); + + bool collide_with_borders(Polygon *p, scalar_t padding); bool collide(Polygon *p); // 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); + bool update(scalar_t dt, scalar_t padding); Polygon *pick_polygon(scalar_t x, scalar_t y);