-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFbxFileReader.h
60 lines (49 loc) · 1.74 KB
/
FbxFileReader.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
// This file is part of FbxReader.
//
// FbxReader is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// FbxReader is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with FbxReader. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#ifndef FBXFiLEREADER_H
#define FBXFiLEREADER_H
#include <string>
#include <memory>
#include <fbxsdk.h>
#include "VertexAttributes.h"
//Custom deleter for FbxManager pointer
template<>
struct std::default_delete<FbxManager>{
void operator()(FbxManager* ptr) { ptr->Destroy(); }
};
class FbxFileReader
{
public:
// * Imports a .fbx file and creates a scene to hold its contents.
FbxFileReader(const std::string& filename);
virtual ~FbxFileReader(void);
// * Retrieves the first MeshNode found in the scene.
// * Throws exception if no meshes are found.
Mesh& GetMesh(void);
// * Retrieves the MeshNode with the given name.
// * Throws exception when mesh is not found.
Mesh& GetMesh(const std::string& filename);
private:
static std::unique_ptr<FbxManager> s_pSdkManager;
FbxScene* m_pScene;
std::vector<Mesh> m_Meshes;
//Store meshes for later use
void ReadMeshes(void);
//Disabling default copy constructor & assignment operator
FbxFileReader(const FbxFileReader& src);
FbxFileReader& operator=(const FbxFileReader& src);
};
#endif