-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathfbxSdkUtil.h
executable file
·83 lines (61 loc) · 1.79 KB
/
fbxSdkUtil.h
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright(c) 2005-2006. All Rights Reserved
// By Jean-René Bédard (https://github.com/jrbedard/3d-converter)
#ifndef __FBXSDKUTIL_H__
#define __FBXSDKUTIL_H__
#include "fbxSdk.h" // FBX SDK
using namespace FBXSDK_NAMESPACE;
namespace ZBPlugin
{
// CFbxSdkUtil: FBX SDK general utilities
class CFbxSdkUtil
{
public:
// scene
static bool GetSceneInfo(KFbxScene* pScene);
// transform
static KFbxMatrix GetGeometricTransform(KFbxNode* pNode);
// vector
static inline Vector3D ConvertKFbxVector(KFbxVector2& vec);
static inline Vector3D ConvertKFbxVector(KFbxVector4& vec);
static Vector3D TransformAndConvertKFbxVector(KFbxVector4& vec, KFbxMatrix& transMat);
static inline KFbxVector4 ConvertVector3D(Vector3D& vec);
// color
static inline Vector3D ConvertKFbxColor(KFbxColor& color);
static inline KFbxColor ConvertColor3(Vector3D& color);
};
inline Vector3D CFbxSdkUtil::ConvertKFbxVector(KFbxVector2& vec)
{
Vector3D newVector(3);
newVector[0] = vec[0];
newVector[1] = vec[1];
newVector[2] = 0.0f;
return newVector;
}
Vector3D CFbxSdkUtil::ConvertKFbxVector(KFbxVector4& vec)
{
Vector3D newVector(3);
newVector[0] = vec[0];
newVector[1] = vec[1];
newVector[2] = vec[2];
return newVector;
}
inline Vector3D CFbxSdkUtil::ConvertKFbxColor(KFbxColor& color)
{
Vector3D newColor(3);
newColor[0] = color.mRed;
newColor[1] = color.mGreen;
newColor[2] = color.mBlue;
return newColor;
}
inline KFbxColor CFbxSdkUtil::ConvertColor3(Vector3D& color)
{
KFbxColor newColor(color[0], color[1], color[2]);
return newColor;
}
inline KFbxVector4 CFbxSdkUtil::ConvertVector3D(Vector3D& vec)
{
KFbxVector4 newVector(vec[0], vec[1], vec[2]);
return newVector;
}
} // End ZBPlugin namespace
#endif // __FBXSDKUTIL_H__