A small OpenGL 3+ renderer and game engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
956 B

#include <cstdio> // snprintf
#include <iostream> // std::cout
#include <assimp/cimport.h>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#include "dumbLog.h"
void
debugParseNode(aiNode* node, aiMatrix4x4 xform, uint depth=0)
{
depth++;
char tabs[256];
snprintf(tabs, 256, "%*s", depth * 4, " ");
std::cout << tabs << node->mName.C_Str() << ", has meshes: " << (node->mNumMeshes > 0) << "\n";
for (uint i = 0; i < node->mNumChildren; i++)
debugParseNode(node->mChildren[i], xform, depth);
}
void
logDebugAnimationInfo(const char* model_name)
{
const aiScene* scene = aiImportFile(model_name, aiProcessPreset_TargetRealtime_MaxQuality);
if (!scene) {
LOG(Error) << "Error loading file: " << model_name << "\n";
return;
}
std::cout << "\n\n--------------------------------------\n";
aiMatrix4x4 identity_mat;
debugParseNode(scene->mRootNode, identity_mat);
std::cout << "--------------------------------------\n\n\n";
}