17/include/Scene.h

40 lines
1.8 KiB
C++
Raw Permalink 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 SCENE_H
#define SCENE_H
#include <list>
#include "Model.h"
#include "Camera.h"
#define DEFAULT_MTL_DIR "./"
class Scene loadOBJtoScene(const char* filename, const char* mtl_directory = DEFAULT_MTL_DIR, const char* texture_directory = DEFAULT_MTL_DIR);
// Класс сцены
class Scene
{
public:
Scene(); // Конструктор пустой сцены
Scene(const Scene &copy); // Конструктор копирования
Scene& operator=(const Scene& other); // Оператор присваивания
void render(ShaderProgram &shaderProgram, UBO &material_buffer); // Рендер сцены
void set_group_id(GLuint64 id, GLuint etc = 0); // Изменение флага записи идентификатора для всех моделей
Node root; // Корневой узел
// Списки объектов, выступающих узлами
std::list<Node> nodes; // Список пустых узлов
std::list<Model> models; // Список моделей для рендера
std::list<Camera> cameras; // Список камер
protected:
void rebuld_tree(const Scene& from); // Перестройка дерева после копирования или присваивания
template <class T>
void rebuild_Nodes_list(T& nodes, const Scene& from); // Перестройка узлов выбранного списка
template <class T>
void move_parent(Node& for_node, const std::list<T>& from_nodes, std::list<T>& this_nodes); // Сдвигает родителя узла между двумя списками при условии его принадлежности к оригинальному
};
#endif // SCENE_H