ComputerGraphik TU WIEN
assimpLoader.hpp
Go to the documentation of this file.
1 #ifndef ASSIMPLOADER_HPP
2 #define ASSIMPLOADER_HPP
3 
4 #include <glm/mat4x4.hpp>
5 
6 #include <assimp/mesh.h>
7 #include <assimp/scene.h>
8 #include <assimp/Importer.hpp>
9 
10 #include <string>
11 #include <memory>
12 
13 class Scene;
14 class Model;
15 class SceneObject;
16 
18 
23 class AssimpLoader {
24 public:
25  AssimpLoader(const std::string& scenePath, Scene* scene);
26 
27  static void loadModel(const aiMesh* mesh, std::unique_ptr<Model>& model);
28  static void selectAdjacent(const aiMesh* mesh, std::vector<unsigned int>& indices);
29 
30 private:
32  const aiScene* iscene;
33  Assimp::Importer importer;
34 
35  glm::vec3 aiVec2glmVec(const aiColor3D& v);
36  glm::vec4 aiVec2glmVec(const aiColor4D& v);
37  glm::mat4 aiMat2glmMat(const aiMatrix4x4& m);
38  void nextNode(aiNode* iparent, std::shared_ptr<SceneObject> parent);
39 };
40 
41 #endif //ASSIMPLOADER_HPP
void nextNode(aiNode *iparent, std::shared_ptr< SceneObject > parent)
Definition: assimpLoader.cpp:253
The class which is responsible for loading all the details to build up a scene.
Definition: assimpLoader.hpp:23
Encapsulates a graphical object model in the GPU.
Definition: model.hpp:14
const aiScene * iscene
Definition: assimpLoader.hpp:32
AssimpLoader(const std::string &scenePath, Scene *scene)
Definition: assimpLoader.cpp:49
glm::vec3 aiVec2glmVec(const aiColor3D &v)
Definition: assimpLoader.cpp:236
Scene * scene
Definition: assimpLoader.hpp:31
Encapsulates the Rendering Engine, holds a complete scene and it's assets.
Definition: scene.hpp:71
static void loadModel(const aiMesh *mesh, std::unique_ptr< Model > &model)
Definition: assimpLoader.cpp:408
The base class of the objects which are rendered.
Definition: sceneObject.hpp:30
glm::mat4 aiMat2glmMat(const aiMatrix4x4 &m)
Definition: assimpLoader.cpp:244
static void selectAdjacent(const aiMesh *mesh, std::vector< unsigned int > &indices)
Definition: assimpLoader.cpp:346
Assimp::Importer importer
Definition: assimpLoader.hpp:33