sculpto
meshes_load.h
Go to the documentation of this file.
1/*!****************************************************************//*!*
2 * \file models_load.h
3 * \brief Assets manager model load functions defintion modulule.
4 *
5 * \author Sabitov Kirill
6 * \date 09 July 2022
7 *********************************************************************/
8
9#pragma once
10
11#include "base.h"
12
14struct aiScene;
15struct aiMesh;
16struct aiNode;
17namespace scl {
18 template <typename Tvertex> struct submesh_props;
19 class mesh;
20 struct vertex;
21 class material_phong;
22}
23
24namespace scl::assets_manager
25{
28 {
29 private:
30 const aiScene *Scene;
31 std::mutex OutSubmeshesPushMutex;
32 std::vector<submesh_props<vertex>> &OutSubmeshes;
33 std::string DirectoryPath;
34
35 void GenerateSubmesh(aiMesh *Mesh, submesh_props<vertex> &OutSubmeshProps);
36 shared<material_phong> GenerateSubmeshMaterial(aiMesh *Mesh);
37
38 public:
39 mesh_loader_phong(const aiScene *Scene, const std::string &DirectoryPath, std::vector<submesh_props<vertex>> &OutSubmeshes);
40 void ProcessNode(aiNode *Node);
41
42 };
43
44 /*!*
45 * Load model (all meshes with materials) from file function.
46 *
47 * \param ModelFilePath - model file path.
48 * \return loaded mesh pointer.
49 */
50 shared<mesh> LoadMeshes(const std::filesystem::path &ModelFilePath);
51}
Topology object basis class for mesh creating implementation module.
mesh_loader_phong(const aiScene *Scene, const std::string &DirectoryPath, std::vector< submesh_props< vertex > > &OutSubmeshes)
Definition: meshes_load.cpp:94
shared< mesh > LoadMeshes(const std::filesystem::path &ModelFilePath)
Definition: meshes_load.cpp:99
Definition: base.h:33
std::shared_ptr< T > shared
Definition: smart_ptr.h:15