19#include <assimp/postprocess.h>
20#include <assimp/scene.h>
26#include <assimp/IOStream.hpp>
27#include <assimp/IOSystem.hpp>
28#include <assimp/Importer.hpp>
47 size_t Read(
void* pvBuffer,
size_t pSize,
size_t pCount);
48 size_t Write(
const void* pvBuffer,
size_t pSize,
size_t pCount) {
51 aiReturn
Seek(
size_t pOffset, aiOrigin pOrigin);
69 Assimp::IOStream*
Open(
const char* pFile,
const char* pMode)
override;
70 void Close(Assimp::IOStream* pFile)
override;
124 bool LoadMaterialTexture(aiMaterial* material,
const aiTextureType type, std::string& str);
Definition: assetprototype.h:37
Definition: modelloader.h:38
size_t Tell() const
Definition: modelloader.cpp:93
void Flush()
Definition: modelloader.cpp:95
size_t FileSize() const
Definition: modelloader.cpp:94
void Close()
Definition: modelloader.cpp:64
size_t Write(const void *pvBuffer, size_t pSize, size_t pCount)
Definition: modelloader.h:48
aiReturn Seek(size_t pOffset, aiOrigin pOrigin)
Definition: modelloader.cpp:75
IVirtualFilePtr ivfp
Definition: modelloader.h:44
IOStream(IVirtualFilePtr _ivfp)
Definition: modelloader.h:42
size_t Read(void *pvBuffer, size_t pSize, size_t pCount)
Definition: modelloader.cpp:66
Definition: modelloader.h:59
Assimp::IOStream * Open(const char *pFile, const char *pMode) override
Definition: modelloader.cpp:46
IOSystem(VirtualMounter *mount)
Definition: modelloader.cpp:39
void Close(Assimp::IOStream *pFile) override
Definition: modelloader.cpp:42
bool Exists(const char *file) const override
Definition: modelloader.cpp:40
char getOsSeparator() const override
Definition: modelloader.h:67
VirtualMounter * mount
Definition: modelloader.h:60
lib tracy file(GLOB_RECURSE CPP_FILES *.cpp) list(FILTER CPP_FILES EXCLUDE REGEX ".*main.cpp$") file(GLOB_RECURSE H_FILES *.h) set(SOURCE_FILES $
Definition: CMakeLists.txt:22
void LoadModelPrototype(ModelPrototype *prototype, Model *asset)
Definition: modelloader.cpp:155
void LoadModelData(engine::Mesh *mesh, std::vector< Vertex > &vertices, std::vector< unsigned int > &indices)
Definition: modelloader.cpp:196
@ MODEL
Model prototype.
Definition: assetprototype.h:30
std::shared_ptr< IVirtualFile > IVirtualFilePtr
Definition: vfs.h:34
Definition: modelloader.h:88
std::map< std::string, std::string > texture_map
Definition: modelloader.h:89
std::map< std::string, glm::vec3 > base_map
Definition: modelloader.h:90
Definition: modelloader.h:73
std::vector< unsigned int > indices
Definition: modelloader.h:75
std::vector< Vertex > vertices
Definition: modelloader.h:74
std::vector< std::string > textures
Definition: modelloader.h:76
int material_id
Definition: modelloader.h:77
Definition: modelloader.h:105
int m_count
Definition: modelloader.h:106
void LoadMaterial(int idx, aiMaterial *material)
Definition: modelloader.cpp:304
bool LoadMaterialTexture(aiMaterial *material, const aiTextureType type, std::string &str)
Definition: modelloader.cpp:200
ModelLoader(const aiScene *_scene, std::string asset_path)
Definition: modelloader.h:110
ModelPrototype * model_prototype
Definition: modelloader.h:107
const aiScene * scene
Definition: modelloader.h:108
std::string asset_path
Definition: modelloader.h:109
void LoadMesh(aiMesh *mesh)
Definition: modelloader.cpp:248
void LoadMaterials()
Definition: modelloader.cpp:293
void LoadModel()
Definition: modelloader.cpp:229
void LoadNode(aiNode *node)
Definition: modelloader.cpp:234
Definition: modelloader.h:93
std::map< std::string, int > texture_idx_map
Definition: modelloader.h:98
std::string shader
Definition: modelloader.h:100
int GetPrototypeType()
Definition: modelloader.h:102
std::vector< MeshPrototype > prototypes
Definition: modelloader.h:95
std::map< std::string, ModelTexturePrototype > texture_map
Definition: modelloader.h:96
std::map< int, MaterialPrototype > material_map
Definition: modelloader.h:97
Definition: modelloader.h:80
int height
Definition: modelloader.h:82
int width
Definition: modelloader.h:81
unsigned char * texture_data
Definition: modelloader.h:85
int channels
Definition: modelloader.h:83