OSDN Git Service

ボーン描画処理の微調整
authorqw_fuku <fkhideaki@gmail.com>
Sun, 8 Feb 2015 13:51:23 +0000 (22:51 +0900)
committerqw_fuku <fkhideaki@gmail.com>
Sun, 8 Feb 2015 13:51:23 +0000 (22:51 +0900)
Src/QtGeoViewer/View3D.cpp
Src/QtGeoViewer/View3D.h

index 85af9b3..5d28b4c 100644 (file)
@@ -968,20 +968,19 @@ void View3D::DrawAllGeomBone(void)
        {
                for (BoneNode& b : g.m_Nodes.m_RootNodes)
                {
-                       DrawBone(NULL, &b, af, lm::matrix4f::get_identity());
+                       DrawBone(&b, af, lm::matrix4f::get_identity());
                }
        }
 
        glPopAttrib();
 }
 
-void View3D::DrawBone(Bone* parent, BoneNode* bn, int frame, const lm::matrix4f& m)
+void View3D::DrawBone(BoneNode* bn, int frame, const lm::matrix4f& m)
 {
-       Bone* b = bn->m_Bone;
        lm::matrix4f fm = bn->GetFrameTransform(frame);
        lm::matrix4f nf = fm * m;
 
-       if (b != NULL && parent != NULL)
+       if (bn->m_Bone != NULL)
        {
                lm::vec3f v0 = lm::vec3f(0, 0, 0) * m;
                lm::vec3f v1 = lm::vec3f(0, 0, 0) * nf;
@@ -1010,7 +1009,7 @@ void View3D::DrawBone(Bone* parent, BoneNode* bn, int frame, const lm::matrix4f&
 
        for (size_t i = 0; i < bn->m_Children.size(); ++i)
        {
-               DrawBone(b, &bn->m_Children[i], frame, nf);
+               DrawBone(&bn->m_Children[i], frame, nf);
        }
 }
 
index 4311300..6f17bbc 100644 (file)
@@ -137,7 +137,7 @@ protected:
        void DrawAllGeomMeshStd(bool UseShader, std::vector<MeshBuf*>& meshes);
        void DrawAllGeomVLinks(std::vector<MeshBuf*>& meshes);
        void DrawAllGeomBone(void);
-       void DrawBone(Bone* parent, BoneNode* b, int frame, const lm::matrix4f& m);
+       void DrawBone(BoneNode* b, int frame, const lm::matrix4f& m);
 
        void DrawAllGeomPolyline(std::vector<MeshBuf*>& meshes);
        void DrawPolyline(MeshBuf& mbuf);