|
|
|
|
@ -6,6 +6,7 @@
|
|
|
|
|
#include <assimp/scene.h> |
|
|
|
|
#include <assimp/postprocess.h> |
|
|
|
|
|
|
|
|
|
#include "util.h" |
|
|
|
|
#include "dumbLog.h" |
|
|
|
|
#include "mesh.h" |
|
|
|
|
|
|
|
|
|
@ -18,10 +19,34 @@ debugParseNode(aiNode* node, aiMatrix4x4 xform, uint depth=0)
|
|
|
|
|
snprintf(tabs, 256, "%*s", depth * 4, " "); |
|
|
|
|
std::cout << tabs << node->mName.C_Str() << ", has meshes: " << (node->mNumMeshes > 0) << "\n"; |
|
|
|
|
|
|
|
|
|
if (node->mNumMeshes > 0) { |
|
|
|
|
for (uint i = 0; i < node->mNumMeshes; i++) |
|
|
|
|
std::cout << tabs << " mesh index: " << node->mMeshes[i] << "\n"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (uint i = 0; i < node->mNumChildren; i++) |
|
|
|
|
debugParseNode(node->mChildren[i], xform, depth); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
debugParseAnimation(aiAnimation* anim) |
|
|
|
|
{ |
|
|
|
|
std::cout << "Animation, ticks/s: " << anim->mTicksPerSecond |
|
|
|
|
<< ", duration: " << anim->mDuration |
|
|
|
|
<< ", channels: " << anim->mNumChannels |
|
|
|
|
<< "\n"; |
|
|
|
|
|
|
|
|
|
for (uint i = 0; i < anim->mNumChannels; i++) { |
|
|
|
|
aiNodeAnim* chan = anim->mChannels[i]; |
|
|
|
|
std::cout << " channel " << i |
|
|
|
|
<< ", node name: " << chan->mNodeName.C_Str() |
|
|
|
|
<< ", mNumPositionKeys: " << chan->mNumPositionKeys |
|
|
|
|
<< ", mNumRotationKeys: " << chan->mNumRotationKeys |
|
|
|
|
<< ", mNumScalingKeys: " << chan->mNumScalingKeys |
|
|
|
|
<< "\n"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
logDebugAnimationInfo(const char* model_name) |
|
|
|
|
{ |
|
|
|
|
@ -33,26 +58,15 @@ logDebugAnimationInfo(const char* model_name)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::cout << "\n\n--------------------------------------\n"; |
|
|
|
|
std::cout << "Nodes:\n"; |
|
|
|
|
aiMatrix4x4 identity_mat; |
|
|
|
|
debugParseNode(scene->mRootNode, identity_mat); |
|
|
|
|
std::cout << "--------------------------------------\n"; |
|
|
|
|
|
|
|
|
|
if (scene->HasAnimations()) { |
|
|
|
|
aiAnimation* anim = scene->mAnimations[0]; |
|
|
|
|
std::cout << "Animation, ticks/s: " << anim->mTicksPerSecond |
|
|
|
|
<< ", duration: " << anim->mDuration |
|
|
|
|
<< ", channels: " << anim->mNumChannels |
|
|
|
|
<< "\n"; |
|
|
|
|
std::cout << "--------------------------------------\n"; |
|
|
|
|
std::cout << "Animations:\n"; |
|
|
|
|
|
|
|
|
|
for (uint i = 0; i < anim->mNumChannels; i++) { |
|
|
|
|
aiNodeAnim* chan = anim->mChannels[i]; |
|
|
|
|
std::cout << "channel, node name: " << chan->mNodeName.C_Str() |
|
|
|
|
<< ", mNumPositionKeys: " << chan->mNumPositionKeys |
|
|
|
|
<< ", mNumRotationKeys: " << chan->mNumRotationKeys |
|
|
|
|
<< ", mNumScalingKeys: " << chan->mNumScalingKeys |
|
|
|
|
<< "\n"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (scene->HasAnimations()) |
|
|
|
|
debugParseAnimation(scene->mAnimations[0]); |
|
|
|
|
|
|
|
|
|
std::cout << "--------------------------------------\n\n\n"; |
|
|
|
|
} |
|
|
|
|
|