-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModelLoader.h
More file actions
35 lines (30 loc) · 966 Bytes
/
ModelLoader.h
File metadata and controls
35 lines (30 loc) · 966 Bytes
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
#pragma once
#include <string>
#include <vector>
#include <DirectXMath.h>
#include "assimp/scene.h"
#include "Texture.h"
#include "Material.h"
using namespace DirectX;
class StaticMeshComponent;
class SkeletalMeshComponent;
class Mesh;
class ModelLoader
{
public:
static ModelLoader &GetInstance();
StaticMeshComponent *LoadStaticModel(const std::string &filePath);
SkeletalMeshComponent *LoadSkeletalModel(const std::string &filePath);
private:
ModelLoader() = default;
void ProcessNode(aiNode *node, const aiScene *scene);
void ProcessSkeletalNode(aiNode *node, const aiScene *scene);
void ProcessMesh(aiMesh *mesh, const aiScene *scene);
void ProcessSkeletalMesh(aiMesh *mesh, const aiScene *scene);
std::vector<Texture> LoadMaterials(aiMaterial *material, aiTextureType type);
std::string mDirectory;
std::vector<XMFLOAT3> mModelVertexPositions;
std::vector<Mesh> mModelMeshes;
std::vector<Material> mModelMaterials;
//Skeleton *mSkeleton;
};