-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpaceController.h
34 lines (30 loc) · 955 Bytes
/
SpaceController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef GravitySim_space_controller_h
#define GravitySim_space_controller_h
#include "SpaceView.h"
#include "SpaceModel.h"
#include "Object.h"
typedef struct {
size_t loop_times;
RectangleD view_bounds;
RectangleD model_bounds;
size_t objects_n;
size_t galaxies_n;
GS_FLOAT galaxy_size;
} SimulationConfig;
class SpaceController {
private:
size_t loop_times;
SpaceView *view;
std::vector<Object> objects;
public:
size_t get_loop_times();
SpaceController(SimulationConfig config);
~SpaceController();
void update(GS_FLOAT dt, SpaceModel *model);
void generate_objects(RectangleD galaxies_bounds, size_t n_galaxies,
size_t objects_per_galaxy, GS_FLOAT galaxy_size);
void add_galaxy(Point2D position, GS_FLOAT size, size_t n);
std::vector<Object>& get_objects();
SpaceView* getSpaceView();
};
#endif