Added random color generation to the polygons, also made so that the

color of the vector indicating speed is the same as the color of the
polygon, but a little lighter
This commit is contained in:
Karma Riuk
2023-06-13 13:50:07 +02:00
parent 79ac43f05c
commit 082acc4451
7 changed files with 209 additions and 25 deletions

View File

@ -1,6 +1,7 @@
#ifndef POLYGONS_H_INCLUDED
#define POLYGONS_H_INCLUDED
#include "color.h"
#include "vec2d.h"
#include <cmath>
@ -22,6 +23,7 @@ class polygon {
double mass;
std::string label;
color_t color;
std::vector<vec2d> global_points = points;
vec2d speed;
@ -118,6 +120,8 @@ class polygon {
extern polygon* polygons;
extern uint n_polygons;
extern bool draw_speed;
extern void polygons_init_state();
extern void polygons_update_state();
extern void polygons_draw(cairo_t* cr);