-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharena.h
94 lines (87 loc) · 2.09 KB
/
arena.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
#ifndef ARENA_H
#define ARENA_H
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <string>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
//Classe que define a arena
class Arena
{
//Origem da arena
GLfloat gX;
GLfloat gY;
//largura e altura
GLdouble widthA;
GLdouble heightA;
//cor da arena
string colorA;
GLfloat altura;
//validade da arena
bool valid=false;
//textura chão
GLuint chaoText;
//textura cordas
GLuint cordaText;
//textura coluna
GLuint colunaText;
//ambiente textura
GLuint ambientText;
private:
//funções para desenhar a arena
void DesenhaParalepipedo(GLfloat sizex,GLfloat sizey,GLfloat sizez,float space,GLfloat R,GLfloat G,GLfloat B,GLuint text);
void DesenhaArena(GLdouble width,GLdouble height,GLfloat altura,string color);
public:
//inicializa a arena
Arena(GLfloat x, GLfloat y,GLdouble width,GLdouble height,string color){
gX = x;
gY = y;
widthA = width;
heightA = height;
colorA = color;
valid = true;
};
//permite criar objeto sem inicialização
Arena(){};
//desenha a arena
void Desenha(){
DesenhaArena(widthA,heightA,altura,colorA);
};
void defineAltura(GLfloat alturaPersonagem){
altura = 2*alturaPersonagem;
}
//retorna altura da arena
float returnAltura(){
return altura;
}
//retorna a altura e largura da arena
void obtemAlturaLargura(GLdouble &width,GLdouble &height){
width = widthA;
height = heightA;
}
//retorna origem da arena
void ObtemOrigem(GLfloat &x,GLfloat &y){
x=gX;
y=gY;
}
//retorna validade da arena
bool validArena(){
return valid;
}
//define textura do chão
void chaotexturaD(GLuint text){
chaoText=text;
}
void cordatesturaD(GLuint text){
cordaText=text;
}
void colunatesturaD(GLuint text){
colunaText=text;
}
void ambientetesturaD(GLuint text){
ambientText=text;
}
};
#endif /* ARENA_H*/