model.cpp
// Processes a node in a recursive fashion. Processes each individual mesh located at the node and repeats this process on its children nodes (if any).
Processes a node in a recursive fashion. Processes each individual mesh located at the node and repeats this process on its children nodes (if any).
Processes a node in a recursive fashion . Processes each individual mesh located at the node and repeats this process on its children nodes ( if any ) .
void Model::processNode(aiNode *node, const aiScene *scene)
{
    for (GLuint i = 0; i < node->mNumMeshes; i++)
    {
        aiMesh *mesh = scene->mMeshes[node->mMeshes[i]];
        this->meshes.push_back(this->processMesh(mesh, scene));
    }
    for (GLuint i = 0; i < node->mNumChildren; i++)
    {
        this->processNode(node->mChildren[i], scene);
    }
}
void Model :: processNode ( aiNode * node , const aiScene * scene ) { for ( GLuint i = 0 ; i < node -> mNumMeshes ; i ++ ) { aiMesh * mesh = scene -> mMeshes [ node -> mMeshes [ i ] ] ; this -> meshes . push_back ( this -> processMesh ( mesh , scene ) ) ; } for ( GLuint i = 0 ; i < node -> mNumChildren ; i ++ ) { this -> processNode ( node -> mChildren [ i ] , scene ) ; } }
Processes a node in a recursive fashion.
Processes a node in a recursive fashion .
// Process each mesh located at the current node // The node object only contains indices to index the actual objects in the scene. // The scene contains all the data, node is just to keep stuff organized. // After we've processed all of the meshes (if any) we then recursively process each of the children nodes // Child nodes are actually stored in the node, not in the scene (which makes sense since nodes only contain // links and indices, nothing more, so why store that in the scene)