OSDN Git Service

動作確認用機能追加
authorqw_fuku <fkhideaki@gmail.com>
Tue, 3 Feb 2015 15:26:09 +0000 (00:26 +0900)
committerqw_fuku <fkhideaki@gmail.com>
Tue, 3 Feb 2015 15:26:09 +0000 (00:26 +0900)
Src/LibQtGeoViewerCore/Format/AssimpReader.cpp
Src/LibQtGeoViewerCore/Format/AssimpReader.h

index 162b995..a543042 100644 (file)
@@ -27,6 +27,8 @@ bool AssimpReader::Load(SceneMain& scene, const std::string& filename)
        if (!ai_scene)
                return false;
 
+       PlotASNode(ai_scene->mRootNode);
+
        std::string dirpath = lib_geo::Path::GetParentDirPath(filename);
 
        BoneMap bone_map;
@@ -246,6 +248,27 @@ void AssimpReader::LoadAnimation(const aiScene* ai_scene, BoneMap& bone_map)
        }
 }
 
+void AssimpReader::PlotASNode(aiNode* n)
+{
+       static int layer = 0;
+
+       for (int i = 0; i < layer; ++i)
+       {
+               OutputDebugStringA("|");
+       }
+
+       OutputDebugStringA("+");
+       OutputDebugStringA(n->mName.C_Str());
+       OutputDebugStringA("\n");
+
+       for (unsigned int i = 0; i < n->mNumChildren; ++i)
+       {
+               layer++;
+               PlotASNode(n->mChildren[i]);
+               layer--;
+       }
+}
+
 // 0\95b\96¢\96\9e\82Ì\83L\81[\83t\83\8c\81[\83\80\90\94\82ð\90\94\82¦\82é
 int AssimpReader::GetNumMinusKeyFrames(const aiNodeAnim* ch) const
 {
index d792a16..bf70b00 100644 (file)
@@ -33,4 +33,5 @@ private:
 
        void SetKeyToBone(aiNodeAnim* ch, geom::Bone* bone);
        void ApplyASTransform(aiNode* n, aiMatrix4x4& t, std::map<int, geom::MeshBuf*>& AiToLGMesh);
+       void PlotASNode(aiNode* n);
 };