- m.transpose();
- return m;
-}
-
-/* convert an assimp keyframe time (ticks) into milliseconds */
-static long assimp_time(const aiAnimation *anim, double aitime)
-{
- double sec;
- if(anim->mTicksPerSecond < 1e-6) {
- // assume time is in frames?
- sec = aitime / 30.0;
- } else {
- sec = aitime / anim->mTicksPerSecond;
- }
- return (long)(sec * 1000.0);
-}
-
-static void print_hierarchy(const aiNode *node)
-{
- static int lvl;
- static int lvlopen[256];
-
- for(int i=0; i<lvl; i++) {
- putchar(' ');
- if(lvlopen[i]) {
- putchar(i >= lvl - 1 ? '+' : '|');
- } else {
- putchar(i >= lvl - 1 ? '+' : ' ');
- }
- }
- printf("- \"%s\"\n", node->mName.data);
-
- lvlopen[lvl] = 1;
-
- lvl++;
- for(unsigned int i=0; i<node->mNumChildren; i++) {
- if(i == node->mNumChildren - 1) {
- lvlopen[lvl - 1] = 0;
- }
- print_hierarchy(node->mChildren[i]);
- }
- lvl--;