-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathKF_UtilityFBX.h
More file actions
65 lines (59 loc) · 2.36 KB
/
KF_UtilityFBX.h
File metadata and controls
65 lines (59 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//--------------------------------------------------------------------------------
//
// KF_UtilityFBX.h
// Author : Xu Wenjie
// Date : 2017-09-15
//--------------------------------------------------------------------------------
#pragma once
//--------------------------------------------------------------------------------
// インクルードファイル
//--------------------------------------------------------------------------------
#include "main.h"
#include "KF_CollisionSystem.h"
#include "drawComponent.h"
#include "node.h"
#include "animator.h"
#include "material.h"
//--------------------------------------------------------------------------------
// 列挙型
//--------------------------------------------------------------------------------
enum OutType
{
Json,
Binary
};
//--------------------------------------------------------------------------------
// 構造体定義
//--------------------------------------------------------------------------------
struct MyModel
{
MyModel() : pNode(nullptr), pAnimator(nullptr) {}
CMyNode* pNode;
CAnimator* pAnimator;
unordered_map<string, Material> mapMaterial;
};
//--------------------------------------------------------------------------------
// クラス定義
//--------------------------------------------------------------------------------
class CKFUtilityFBX
{
public:
static MyModel Load(const string& strFilePath);
static MyModel LoadFromTxt(const string& strFilePath);
static bool Save(const MyModel& model, const string& fileName, const OutType& type);
static void LoadAnimation(const string& strFilePath, CAnimator* animator);
#ifdef USING_DIRECTX
static int FindRepetition(const list<VertexDX>& listVtx, const VertexDX& vtx);
#endif
private:
CKFUtilityFBX() {}
~CKFUtilityFBX() {}
static CMyNode* recursiveNode(FbxManager* pManager, FbxNode* pNode, CMyNode* parent);
static void analyzeMaterial(FbxScene* lScene, unordered_map<string, Material>& mapMaterial);
static CAnimator* analyzeAnimator(FbxImporter* lImporter, FbxScene* lScene);
static void analyzeAnimation(FbxImporter* lImporter, FbxScene* lScene, CAnimator* animator);
static void findSkeletons(FbxNode* pNode, list<FbxNode*>& listSkeleton);
static void matchClusterWithSkeleton(vector<Cluster>& clusters, CMyNode* node);
static FbxAMatrix getGeometry(FbxNode* pNode);
static string getAttributeTypeName(FbxNodeAttribute::EType type);
};