-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrubik.h
74 lines (57 loc) · 1.19 KB
/
rubik.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
#ifndef RUBIK_H
#define RUBIK_H
#include <minicube.h>
#include <sticker.h>
#include <cube.h>
#include <object.h>
#include <vao.h>
#include <GL/glew.h>
#include <GL/freeglut.h>
#include <glm/glm.hpp>
#include <glm/gtc/quaternion.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <string>
#include <vector>
#include <queue>
#include <iostream>
class Rubik : public Object
{
public:
// Pasos
/***
* Nomenclatura Singmaster
* U: Arriba M: Meridiano | Entre L y R
* D: Abajo E: Ecuador | Entre U y D
* L: Izquierda S: Centro | Entre F y B
* R: Derecha
* F: Frente 0: Sentido de las agujas del reloj
* B: Atras 1: Sentido contrario a las agujas del reloj
*/
enum STEP
{
U0, D0, L0, R0, F0, B0,
U1, D1, L1, R1, F1, B1
};
protected:
// Datos
GLsizei dim;
Cube *cube[27];
// Cola de rotaciones
std::queue<Cube::AXIS> move;
std::queue<std::vector<Cube *> > target;
public:
// Constructor
Rubik ();
// Dibujar
void draw () const;
// Animar cubo
void animate ();
// Jugar
void play (const Rubik::STEP &step);
bool win () const;
// Imprimir estado
void print () const;
// Destructor
~Rubik ();
};
#endif // RUBIK_H