Skylicht Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
MeshManager
CMeshManager.h
1
#pragma once
2
3
#include "RenderMesh/CMesh.h"
4
#include "Entity/CEntityPrefab.h"
5
#include "Utils/CSingleton.h"
6
#include "Instancing/SMeshInstancing.h"
7
8
#include "Importer/IMeshImporter.h"
9
#include "Exporter/IMeshExporter.h"
10
11
namespace
Skylicht
12
{
15
46
class
SKYLICHT_API CMeshManager
47
{
48
public
:
49
DECLARE_SINGLETON
(CMeshManager)
50
51
protected
:
52
struct
SPrefabInfo
53
{
54
bool
NormalMap;
55
bool
FlipNormalMap;
56
bool
Texcoord2;
57
bool
Batching;
58
59
CEntityPrefab
* Prefab;
60
61
SPrefabInfo()
62
{
63
NormalMap =
true
;
64
FlipNormalMap =
true
;
65
Texcoord2 =
false
;
66
Batching =
false
;
67
Prefab = NULL;
68
}
69
};
70
71
std::map<std::string, std::vector<SPrefabInfo*>> m_meshPrefabs;
72
73
std::vector<SMeshInstancing*> m_instancingData;
74
75
public
:
76
CMeshManager();
77
78
virtual
~CMeshManager();
79
80
static
std::vector<std::string> getMeshExts();
81
82
static
bool
isMeshExt(
const
char
* ext);
83
84
bool
isMeshLoaded(
const
char
* resource);
85
86
CEntityPrefab
* loadModel(
const
char
* resource,
const
char
* texturePath,
bool
loadNormalMap =
true
,
bool
flipNormalMap =
true
,
bool
loadTexcoord2 =
false
,
bool
createBatching =
false
);
87
88
CEntityPrefab
* loadModel(
const
char
* resource,
const
char
* texturePath,
IMeshImporter
* importer,
bool
loadNormalMap =
true
,
bool
flipNormalMap =
true
,
bool
loadTexcoord2 =
false
,
bool
createBatching =
false
);
89
90
bool
exportModel(
CEntity
** entities,
u32
count,
const
char
* output);
91
92
bool
exportModel(
CEntity
** entities,
u32
count,
const
char
* output,
IMeshExporter
* exporter);
93
94
void
releaseResource(
const
char
* resource);
95
96
void
releasePrefab(
CEntityPrefab
* prefab);
97
98
void
releaseAllPrefabs();
99
100
void
releaseAllInstancingMesh();
101
102
SMeshInstancing
* createGetInstancingMesh(
CMesh
* mesh);
103
104
SMeshInstancing
* createGetInstancingMesh(
CMesh
* mesh,
IShaderInstancing
* shaderInstancing);
105
106
void
changeInstancingTransformBuffer(
SMeshInstancing
* mesh,
IVertexBuffer
* transform,
IVertexBuffer
* lighting);
107
108
void
changeInstancingMaterialBuffer(
SMeshInstancing
* mesh,
IVertexBuffer
* materials);
109
110
protected
:
111
112
bool
canCreateInstancingMesh(
CMesh
* mesh);
113
114
bool
compareMeshBuffer(
CMesh
* mesh,
SMeshInstancing
* data);
115
116
SMeshInstancing
* createInstancingData(
CMesh
* mesh);
117
118
SMeshInstancing
* createInstancingData(
CMesh
* mesh,
IShaderInstancing
* shaderInstancing);
119
};
120
}
Skylicht::CEntity
This is the object class that describes an entity.
Definition
CEntity.h:58
Skylicht::CEntityPrefab
This object class is created to store data in an array of multiple CEntities.
Definition
CEntityPrefab.h:38
Skylicht::CMesh
Definition
CMesh.h:75
Skylicht::IMeshExporter
Definition
IMeshExporter.h:32
Skylicht::IMeshImporter
Definition
IMeshImporter.h:32
Skylicht::IShaderInstancing
Abstract base class for GPU instancing logic in Skylicht-Engine.
Definition
IShaderInstancing.h:45
irr::scene::IVertexBuffer
Definition
IVertexBuffer.h:17
DECLARE_SINGLETON
#define DECLARE_SINGLETON(className)
Declare the standard singleton accessors for a class.
Definition
CSingleton.h:36
Skylicht
Everything in the Skylicht Engine. You can start by looking at the topics.
Definition
AudioDebugLog.h:29
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition
irrTypes.h:58
Skylicht::SMeshInstancing
Definition
SMeshInstancing.h:39
Generated by
1.17.0