Browse Source

add more animation debug info

testing
cinnaboot 6 years ago
parent
commit
b6535ba5c9
  1. 20
      examples/assimp_loading/animation_testing.cpp
  2. 2
      include/dumbLog.h

20
examples/assimp_loading/animation_testing.cpp

@ -7,6 +7,7 @@
#include <assimp/postprocess.h>
#include "dumbLog.h"
#include "mesh.h"
void
@ -34,5 +35,24 @@ logDebugAnimationInfo(const char* model_name)
std::cout << "\n\n--------------------------------------\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";
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";
}
}
std::cout << "--------------------------------------\n\n\n";
}

2
include/dumbLog.h

@ -1,4 +1,6 @@
#pragma once
#include <iomanip>
#include <iostream>

Loading…
Cancel
Save