-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPiece.h
59 lines (51 loc) · 1.2 KB
/
Piece.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
#ifndef PIECE_H
#define PIECE_H
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <string>
#include "Model.h"
#include "Shader.h"
#include "Light.h"
#include "Camera.h"
enum Type {
Rook,
Knight,
Bishop,
Queen,
King,
Pawn
};
enum Color {
Black,
White
};
class Piece {
public:
// Piece Information
Type m_Type;
Color m_Color;
bool m_HasMoved = false;
int m_NumMoves = 0;
// OpenGL Information
Model m_GL_Model;
glm::vec3 m_GL_Position;
bool m_GL_IsSelected;
float m_GL_HitboxRadius = 0.25f;
glm::mat4 m_GL_ModelMatrix;
glm::mat4 m_GL_ViewMatrix;
glm::mat4* m_GL_ProjectionMatrix;
Camera* m_GL_Camera;
Light* m_GL_Light;
Material* m_GL_Material;
Shader m_GL_Shader;
Shader m_GL_OutlineShader;
Piece(const char* vertexShaderPath, const char* fragmentShaderPath, const char* outlineVertexShaderPath, const char* outlineFragmentShaderPath, Color color, Type type, glm::mat4 *projectionMatrix, Camera* camera, Light* light, Material* material);
Piece() = default;
void Draw(glm::vec3 mouseRay, glm::vec3 position);
bool IsSelected(glm::vec3 mouseRay);
private:
Model loadModel();
void move(glm::vec3 mouseRay, glm::mat4 modelMatrix);
};
#endif