7#include "assimp/Importer.hpp"
8#include "assimp/postprocess.h"
9#include "assimp/scene.h"
13#include <unordered_map>
27 const std::string& modelFileName,
28 const std::vector<std::string>& texFileNames,
46 static const aiScene*
loadAsset(Assimp::Importer& importer,
const std::string& fileName,
const bool flipUVs);
61 const aiScene& sceneAi,
63 const uint32_t modelIndexNode);
GPU asset types and global registries for the new renderer.
uint32_t MeshIdInt
Definition Asset.hpp:19
uint32_t ModelIdInt
Definition Asset.hpp:20
Loads 3D models via Assimp and populates the global Asset registries.
Definition AssetLoader.hpp:17
static void pushAiNodeMeshesToModelElements(const std::string &meshNameSpace, const aiNode &nodeAi, const aiScene &sceneAi, const ModelIdInt k_modelId, const uint32_t modelIndexNode)
Recursively extract meshes from an Assimp node and add them as ModelElements.
Definition AssetLoader.cpp:279
static void updateModelTransformCache(const ModelIdInt id)
Definition AssetLoader.cpp:325
static glm::mat4 glmFromAiTransform(const aiMatrix4x4 &transformAi)
Convert an Assimp 4x4 matrix to a glm::mat4.
Definition AssetLoader.cpp:360
static bool loadMesh(MeshIdInt id, const aiMesh &asimpMeshResult)
Import a single Assimp mesh into the global Asset::meshes_ registry.
Definition AssetLoader.cpp:27
static bool loadModel(const ModelIdInt id, const std::string &modelFileName, const std::vector< std::string > &texFileNames, const bool k_flatten, const bool flipUVs)
Load a single model from file and register it in Asset::models_.
Definition AssetLoader.cpp:98
static const aiScene * loadAsset(Assimp::Importer &importer, const std::string &fileName, const bool flipUVs)
Read a file from disk through Assimp and return the parsed scene.
Definition AssetLoader.cpp:14