-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
42 lines (38 loc) · 863 Bytes
/
main.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
35
36
37
38
39
40
41
42
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <cmath>
#include <opencv2/opencv.hpp>
class Ball
{
public:
int pos_x;
int pos_y;
int force;
int autonation_factor;
int radius;
int velocity_x;
int velocity_y;
int current_applied_force_x;
int current_applied_force_y;
int drag_coefficient;
float direction_x;
float direction_y;
float distance;
Ball(int pos_x, int pos_y, int force, int autonation_factor, int radius);
void apply_force(Ball ball, int force_threshold);
void step(float step_size);
};
class Display
{
public:
int size_x;
int size_y;
Ball *ball_array;
int number_of_balls;
cv::Mat display;
Display(int size_x, int size_y, Ball *ball_array, int number_of_balls);
void draw_display();
void step(int step_size);
void show_image();
};