-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModuleModelLoader.h
More file actions
61 lines (45 loc) · 1.64 KB
/
ModuleModelLoader.h
File metadata and controls
61 lines (45 loc) · 1.64 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
#ifndef __ModuleModelLoader_h__
#define __ModuleModelLoader_h__
#include "Globals.h"
#include "Module.h"
#include <vector>
#include <map>
#include <string>
#include "GL/glew.h"
#include "Mesh.h"
struct Texture;
struct MeshData;
struct Model
{
std::multimap<Mesh*, Texture*> Meshes;
std::string Name = "";
//TODO: add count of similar models to track delete and remove data?
};
class ModuleModelLoader : public Module
{
public:
ModuleModelLoader() = default;
~ModuleModelLoader() = default;
bool Init();
update_status PreUpdate();
update_status Update();
update_status PostUpdate();
bool CleanUp();
void LoadModel(const std::string &path, Model& model);
const int GetNumberOfMeshes() const;
/*bool LoadSphere(const char* name, const math::float3& pos, const math::Quat& rot, float size,
unsigned slices, unsigned stacks, const math::float4& color);
bool LoadCylinder(const char* name, const math::float3& pos, const math::Quat& rot, float height,
float radius, unsigned slices, unsigned stacks, const math::float4& color);
bool LoadTorus(const char* name, const math::float3& pos, const math::Quat& rot, float inner_r, float outer_r,
unsigned slices, unsigned stacks, const math::float4& color);
bool LoadCube(const char* name, const math::float3& pos, const math::Quat& rot, float size, const math::float4& color);*/
float3 correctCameraPositionForModel = float3(0.0f, 0.0f, 0.0f);
float3 modelCenter = float3(0.0f, 0.0f, 0.0f);
std::vector<Model> models;
std::string ComputeName(const std::string &path) const;
private:
/* Functions */
void ProcessMeshData(const MeshData & data, Mesh & mesh);
};
#endif __ModuleModelLoader_h__