05/include/Model.h

37 lines
1.7 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef MODEL_H
#define MODEL_H
#include "Buffers.h"
#include "Texture.h"
#include <GLM/glm.hpp>
class Model
{
public:
Model(); // Конструктор без параметров
Model(const Model& copy); // Конструктор копирования
~Model();
void render(const GLuint &mvp_uniform); // Вызов отрисовки
void load_verteces(glm::vec3* verteces, GLuint count); // Загрузка вершин в буфер
void load_indices(GLuint* indices, GLuint count); // Загрузка индексов в буфер
void load_texCoords(glm::vec2* texCoords, GLuint count); // Загрузка текстурных координат в буфер
void load_normals(glm::vec3* normals, GLuint count); // Загрузка нормалей в буфер
void set_texture(Texture& texture); // Привязка текстуры к модели
glm::vec3 position; // позиция модели
glm::vec3 rotation; // поворот модели
glm::vec3 scale; // мастабирование модели
glm::mat4 getTransformMatrix(); // Матрица трансформации модели
private:
VAO vao;
BO vertex_vbo, index_vbo; // вершинный и индексный буферы
BO normals_vbo, texCoords_vbo; // буферы с нормалями и текстурными координатами
GLuint verteces_count; // Количество вершин
GLuint indices_count; // Количество индексов
Texture texture_diffuse; // Диффузная текстура
};
#endif // MODEL_H