model.cpp
// Loads a model with supported ASSIMP extensions from file and stores the resulting meshes in the meshes vector.
Loads a model with supported ASSIMP extensions from file and stores the resulting meshes in the meshes vector.
Loads a model with supported ASSIMP extensions from file and stores the resulting meshes in the meshes vector .
void Model::loadModel(string path)
{
    Assimp::Importer importer;
    const aiScene *scene = importer.ReadFile(path, aiProcess_Triangulate | aiProcess_FlipUVs | aiProcess_GenNormals | aiProcess_JoinIdenticalVertices);
    if (!scene || scene->mFlags == AI_SCENE_FLAGS_INCOMPLETE || !scene->mRootNode) 
    {
        cout << "ERROR::ASSIMP:: " << importer.GetErrorString() << endl;
        return;
    }
    this->directory = path.substr(0, path.find_last_of('/'));
    this->processNode(scene->mRootNode, scene);
    cout << path << " " << scene->mNumMeshes << endl;
}
void Model :: loadModel ( string path ) { Assimp :: Importer importer ; const aiScene * scene = importer . ReadFile ( path , aiProcess_Triangulate | aiProcess_FlipUVs | aiProcess_GenNormals | aiProcess_JoinIdenticalVertices ) ; if ( ! scene || scene -> mFlags == AI_SCENE_FLAGS_INCOMPLETE || ! scene -> mRootNode ) { cout << " " << importer . GetErrorString ( ) << endl ; return ; } this -> directory = path . substr ( 0 , path . find_last_of ( ' ' ) ) ; this -> processNode ( scene -> mRootNode , scene ) ; cout << path << " " << scene -> mNumMeshes << endl ; }
Loads a model with supported ASSIMP extensions from file and stores the resulting meshes in the meshes vector.
Loads a model with supported ASSIMP extensions from file and stores the resulting meshes in the meshes vector .
// Read file via ASSIMP // Check for errors // if is Not Zero // Retrieve the directory path of the filepath // Process ASSIMP's root node recursively