-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCircle.h
64 lines (52 loc) · 1.67 KB
/
Circle.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef CIRCLE_CLASS_H
#define CIRCLE_CLASS_H
#include "Helpers/Utils.h"
#include "Mesh.h"
#include "Rectangle.h"
#include "NeuralNetwork.h"
#include "Line.h"
class Circle {
private:
Mesh *circleMesh;
glm::vec3 velocity = glm::vec3( 0.0f, 0.0f, 0.0f );
glm::vec3 initialPosition = glm::vec3(-3.3, 0, 0);
std::vector<Line> lines;
NeuralNetwork *brain;
float aliveTime = 0.0f;
int pillarsCrossed = 0;
void createSprite( float rad );
public:
bool isAlive;
int id = -1;
float radius = 1.0f;
glm::vec3 translation = glm::vec3( 0.0f, 0.0f, 0.0f );
glm::vec3 scale = glm::vec3( 1.0f, 1.0f, 1.0f );
bool hasBrain;
Circle( float rad );
Circle( Genome& genome, float rad );
void CreateTestBrain();
void CreateBrain( Genome& genome );
void MoveTo( glm::vec3 position );
void DrawInstance( Shader& shader, Camera& camera );
void ApplyForce( glm::vec3 force );
void Jump();
void Update();
void Translate( glm::vec3 translationVec );
void ResetPosition();
bool Predict(
float xDistance,
float yUpperPillarDistance,
float yLowerPillarDistance,
float yCeilDistance,
float yGroundDistance,
float yPillar
);
bool CheckCollision( const Rectangle& rect );
void CrossedPillar();
float CalculateFitness();
void DrawDebugView( Shader& shader, Camera& camera );
void DrawDebugView(
Shader& shader1, Shader& shader2, Shader& shader3, Camera& camera
);
};
#endif