6#ifndef INCLUDE_VULKANENGINE_OBJMESH_H_
7#define INCLUDE_VULKANENGINE_OBJMESH_H_
9#include <VulkanEngine/BoundingBox.h>
10#include <VulkanEngine/GraphicsPipeline.h>
11#include <VulkanEngine/MeshBase.h>
12#include <VulkanEngine/SceneObject.h>
13#include <VulkanEngine/UniformBuffer.h>
19#include <unordered_map>
22#include "GraphicsPipeline.h"
32 OBJMesh(std::filesystem::path obj_file, std::filesystem::path mtl_path =
"",
33 const std::shared_ptr<Shader> _shader = std::shared_ptr<Shader>());
44 Eigen::Matrix4f model;
46 Eigen::Matrix4f projection;
50 std::array<float, 4> ambient = {0.8, 0.8, 0.8, 0.0};
51 std::array<float, 4> diffuse = {1.0, 1.0, 1.0, 0.0};
52 std::array<float, 4> specular = {1.0, 1.0, 1.0, 0.0};
58 void update(std::shared_ptr<SceneState> scene_state)
override;
63 void loadOBJ(
const char* obj_path,
const char* mtl_path);
67 const std::string getVertexShaderString()
const;
71 const std::string getFragmentShaderString(
bool has_texture)
const;
74 std::vector<std::shared_ptr<MeshBase>> meshes;
77 std::vector<std::shared_ptr<Shader>> shaders;
79 std::vector<std::shared_ptr<GraphicsPipeline>> graphics_pipelines;
82 std::vector<std::shared_ptr<UniformBuffer<MvpUbo>>> mvp_buffers;
84 std::vector<std::vector<std::shared_ptr<UniformBuffer<Material>>>>
88 std::unordered_map<std::string, std::shared_ptr<Descriptor>> textures;
91 bool graphics_pipeline_updated;
A SceneObject which represents an OBJMesh.
Definition: OBJMesh.h:27
virtual ~OBJMesh()
Destructor.
Definition: OBJMesh.cpp:259
const BoundingBox< Eigen::Vector3f > & getBoundingBox() const
Definition: OBJMesh.cpp:261
Represents an object in a scene.
Definition: SceneObject.h:17
TODO development of this class is in progress.
Definition: Attribute.h:13
Definition: BoundingBox.h:15