-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMesh.h
54 lines (42 loc) · 1.04 KB
/
Mesh.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
#ifndef MESH_CLASS_H
#define MESH_CLASS_H
#include <string>
#include "VAO.h"
#include "EBO.h"
#include "Camera.h"
#include "Texture.h"
class Mesh
{
public:
int triangleCount;
std::vector <Vertex> vertices;
std::vector <GLuint> indices;
std::vector <Texture> textures;
glm::mat4 matrix;
glm::vec3 translation;
glm::quat rotation;
glm::vec3 scale;
// glm::vec3 pivot;
VAO vao;
Mesh
(
std::vector <Vertex>& vertices,
std::vector <GLuint>& indices,
std::vector <Texture>& textures
);
void DrawInstance
(
Shader& shader,
Camera& camera,
glm::mat4 matrix = glm::mat4(1.0f),
glm::vec3 translation = glm::vec3(0.0f, 0.0f, 0.0f),
glm::quat rotation = glm::quat(1.0f, 0.0f, 0.0f, 0.0f),
glm::vec3 scale = glm::vec3(1.0f, 1.0f, 1.0f),
glm::vec3 pivot = glm::vec3(0.0f, 0.0f, 0.0f),
bool isWire = false
);
std::vector<glm::vec3> GetTransformedCoordinates( int triangleIndex ) const;
std::vector<glm::vec3> GetTransformedTriangles() const;
glm::vec3 GetTriangleCentroid( int triangleIndex ) const;
};
#endif // !HEAD_CLASS_H