2 // Written and (C) by Francois Fleuret
3 // Contact <francois.fleuret@idiap.ch> for comments & bug reports
14 #include "simple_window.h"
18 scalar_t _xmax, _ymax;
20 int _nb_max_polygons, _nb_polygons;
22 Universe(int nb_max_polygons, scalar_t xmax, scalar_t ymax);
23 // The destructor deletes all the added polygons
25 void initialize(Polygon *p);
27 void add_polygon(Polygon *p);
28 bool collide(Polygon *p);
29 // Compute collisions between projections of the polygons on a few
30 // axis to speed up the computation
31 void compute_pseudo_collisions(int nb_axis, int *nb_colliding_axis);
32 void apply_collision_forces(scalar_t dt);
33 bool update(scalar_t dt);
34 Polygon *pick_polygon(scalar_t x, scalar_t y);
35 void print_xfig(XFigTracer *tracer);
36 void draw(SimpleWindow *window);