-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEstruturasBasicas.h
95 lines (80 loc) · 1.45 KB
/
EstruturasBasicas.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#ifndef ESTRUTURASBASICAS_H
#define ESTRUTURASBASICAS_H
#include <string>
#include <cstring>
#include <math.h>
#include <GL/glut.h>
#include <iostream>
#include "imageloader.h"
enum {
EM_ANDAMENTO,
GANHOU,
PERDEU,
PAUSADO
};
enum {
DRAW_2D,
DRAW_3D
};
enum {
WITH_STROKE = true,
NO_STROKE = false
};
class Ponto
{
public:
Ponto();
Ponto(float _x, float _y, float _z = 0) : x(_x), y(_y), z(_z) {};
void print();
GLfloat x;
GLfloat y;
GLfloat z;
protected:
private:
};
class Cor
{
public:
Cor();
Cor(std::string color_name);
Cor(int _r, int _g, int _b);
GLfloat r;
GLfloat g;
GLfloat b;
inline bool operator==(const Cor& c){ return (this->r == c.r && this->g == c.g && this->b == c.b); }
protected:
private:
};
class Textura
{
public:
Textura();
Textura(std::string texture_name);
GLuint get() { return this->t; };
private:
GLuint LoadTextureRAW(const char * filename);
GLuint t;
};
double calculaDistancia(Ponto p1, Ponto p2);
typedef struct
{
//Vertex coordinate
double X;
double Y;
double Z;
//Vertex normal
double nX;
double nY;
double nZ;
//Vertex texture coordinate
double U;
double V;
} VERTICES;
typedef struct
{
VERTICES *vtx;
int numVtx;
double radius;
} OBJ;
void drawBox(GLfloat tamanho, GLfloat textureS = 1);
#endif // ESTRUTURASBASICAS_H