#ifndef _CSCENEFBX_H_ #define _CSCENEFBX_H_ #include #include #include #include struct MATERIAL { D3DXCOLOR Diffuse; D3DXCOLOR Ambient; D3DXCOLOR Specular; D3DXCOLOR Emission; float Shininess; }; struct BornRefarence { BornRefarence( unsigned char index, float weight ): index( index ), weight( weight ) { } unsigned char index; float weight; }; struct Point { Point( const D3DXVECTOR3 positions ): positions( positions ) { } D3DXVECTOR3 positions; std::vector bornRefarences; }; struct Mesh { Mesh(): materialIndex( -1 ) { } std::vector points; std::vector normals; std::vector texcoords; std::vector positionIndices; std::vector normalIndices; std::vector texcoordIndices; int materialIndex; // DDMTRI initInvMatrix; std::vector> matrixes; }; struct FaceIndex { unsigned short vIndex; unsigned short vtIndex; unsigned short vnIndex; }; struct myNode { std::string name; std::list children; std::vector attributeNames; D3DXVECTOR3 translation; D3DXVECTOR3 rotation; D3DXVECTOR3 scaling; std::vector textures; // とマテリアル std::vector meshes; static myNode* recursiveNode( FbxManager* pManager, FbxNode* pNode, bool bTexcoordVReverse, FbxTime startTime, FbxTime endTime ); void recursiveDraw( int currentFrame ); void analyzePosition( FbxMesh* pMesh ); void analyzeNormal( FbxMesh* pMesh ); void analyzeTexcoord( FbxMesh* pMesh, bool bRevers = false ); void analyzeMaterial( FbxNode* pNode ); void analyzeMaterial( FbxMesh* pMesh ); void analyzeCluster( FbxMesh* pMesh, FbxTime startTime, FbxTime endTime ); FbxMatrix GetGeometry( FbxNode* pNode ); // - New!! static std::string GetttributeTypeName( FbxNodeAttribute::EType type ); }; class CSceneFBX { public: void Init( void ); void Uninit( void ); void Update( void ); void Draw( int currentFrame ); private: int m_faceCount; int m_indexCount; int m_vCount; int m_vtCount; int m_vnCount; Vector3* m_pV; FaceIndex* m_pFace; int* m_pFbxI; myNode* m_pTopMyNode; }; #endif // !_CSCENEFBX_H_