OSDN Git Service

ボーン表示機能を修正
authorqw_fuku <fkhideaki@gmail.com>
Sun, 8 Feb 2015 11:12:13 +0000 (20:12 +0900)
committerqw_fuku <fkhideaki@gmail.com>
Sun, 8 Feb 2015 11:12:13 +0000 (20:12 +0900)
Src/QtGeoViewer/View3D.cpp
Src/QtGeoViewer/View3D.h

index 13f1dbe..85af9b3 100644 (file)
@@ -968,24 +968,20 @@ void View3D::DrawAllGeomBone(void)
        {
                for (BoneNode& b : g.m_Nodes.m_RootNodes)
                {
-                       lm::matrix4f m = b.m_Transform;
-                       DrawBone(NULL, &b, af, m);
+                       DrawBone(NULL, &b, af, lm::matrix4f::get_identity());
                }
        }
 
        glPopAttrib();
 }
 
-void View3D::DrawBone(Bone* parent, BoneNode* bn, int frame, lm::matrix4f m)
+void View3D::DrawBone(Bone* parent, BoneNode* bn, int frame, const lm::matrix4f& m)
 {
        Bone* b = bn->m_Bone;
-       if (b == NULL)
-               return;
-
        lm::matrix4f fm = bn->GetFrameTransform(frame);
        lm::matrix4f nf = fm * m;
 
-       if (parent != NULL)
+       if (b != NULL && parent != NULL)
        {
                lm::vec3f v0 = lm::vec3f(0, 0, 0) * m;
                lm::vec3f v1 = lm::vec3f(0, 0, 0) * nf;
index fb33c65..4311300 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, lm::matrix4f m);
+       void DrawBone(Bone* parent, BoneNode* b, int frame, const lm::matrix4f& m);
 
        void DrawAllGeomPolyline(std::vector<MeshBuf*>& meshes);
        void DrawPolyline(MeshBuf& mbuf);