25#include <tiny_obj_loader.h>
82 explicit OBJLoader(
const std::string &filepath,
const std::string &mtlSearchPath =
"");
101 [[nodiscard]] std::vector<Resource::Shape>
GetShapes();
110 [[nodiscard]] std::vector<Component::Material>
GetMaterials();
125 size_t face_vertices,
size_t &index_offset)
noexcept;
void ProcessMeshFace(Component::Mesh &mesh, const std::vector< tinyobj::shape_t > &shapes, size_t shape, size_t face_vertices, size_t &index_offset) noexcept
Processes a single face of the mesh and populates the Mesh object.
Definition OBJLoader.cpp:123
std::vector< Component::Material > _materials
Definition OBJLoader.hpp:141
OBJLoader(const std::string &filepath, const std::string &mtlSearchPath="")
Constructs an OBJLoader for the specified file.
Definition OBJLoader.cpp:6
tinyobj::ObjReaderConfig _reader_config
Definition OBJLoader.hpp:137
std::vector< Resource::Shape > GetShapes()
Retrieves the loaded shapes data.
Definition OBJLoader.cpp:58
std::vector< Resource::Shape > _shapes
Definition OBJLoader.hpp:140
std::vector< Component::Material > GetMaterials()
Retrieves the loaded materials data.
Definition OBJLoader.cpp:104
tinyobj::ObjReader _reader
Definition OBJLoader.hpp:138
void SetMaterialProperties(Component::Material &material, const tinyobj::material_t &mat) noexcept
Sets the properties of a material according to the tinyobj::material_t structure.
Definition OBJLoader.cpp:174
Component::Mesh _mesh
Definition OBJLoader.hpp:139
Component::Mesh GetMesh()
Retrieves the loaded mesh data.
Definition OBJLoader.cpp:28
Definition AmbientLight.hpp:5
Material structure.
Definition Material.hpp:41
Mesh structure.
Definition Mesh.hpp:40