Skylicht Engine
Loading...
Searching...
No Matches
Skylicht::CMeshManager Class Reference

This object class manages, load and converts model resources like .fbx, .dae, and .obj into a CEntityPrefab. More...

#include <MeshManager/CMeshManager.h>

Classes

struct  SPrefabInfo

Public Member Functions

bool isMeshLoaded (const char *resource)
CEntityPrefabloadModel (const char *resource, const char *texturePath, bool loadNormalMap=true, bool flipNormalMap=true, bool loadTexcoord2=false, bool createBatching=false)
CEntityPrefabloadModel (const char *resource, const char *texturePath, IMeshImporter *importer, bool loadNormalMap=true, bool flipNormalMap=true, bool loadTexcoord2=false, bool createBatching=false)
bool exportModel (CEntity **entities, u32 count, const char *output)
bool exportModel (CEntity **entities, u32 count, const char *output, IMeshExporter *exporter)
void releaseResource (const char *resource)
void releasePrefab (CEntityPrefab *prefab)
void releaseAllPrefabs ()
void releaseAllInstancingMesh ()
SMeshInstancingcreateGetInstancingMesh (CMesh *mesh)
SMeshInstancingcreateGetInstancingMesh (CMesh *mesh, IShaderInstancing *shaderInstancing)
void changeInstancingTransformBuffer (SMeshInstancing *mesh, IVertexBuffer *transform, IVertexBuffer *lighting)
void changeInstancingMaterialBuffer (SMeshInstancing *mesh, IVertexBuffer *materials)

Static Public Member Functions

static std::vector< std::string > getMeshExts ()
static bool isMeshExt (const char *ext)

Protected Member Functions

bool canCreateInstancingMesh (CMesh *mesh)
bool compareMeshBuffer (CMesh *mesh, SMeshInstancing *data)
SMeshInstancingcreateInstancingData (CMesh *mesh)
SMeshInstancingcreateInstancingData (CMesh *mesh, IShaderInstancing *shaderInstancing)

Protected Attributes

std::map< std::string, std::vector< SPrefabInfo * > > m_meshPrefabs
std::vector< SMeshInstancing * > m_instancingData

Detailed Description

This object class manages, load and converts model resources like .fbx, .dae, and .obj into a CEntityPrefab.

Singleton manager for loading, converting, and managing 3D models.

And, you can then use the CRenderMesh component to display this model on the scene.

std::string folder = "SampleModels/BlendShape/";
std::string modelPath = "SampleModels/BlendShape/Cat.fbx";
std::string materialPath = "SampleModels/BlendShape/Cat.mat";
CEntityPrefab* model = CMeshManager::getInstance()->loadModel(modelPath.c_str(), folder.c_str());
if (model)
{
CGameObject* renderObj = scene->createEmptyObject();
CRenderMesh* renderer = renderObj->addComponent<CRenderMesh>();
renderer->initFromPrefab(model);
std::vector<std::string> folders;
ArrayMaterial& materials = CMaterialManager::getInstance()->loadMaterial(
materialPath.c_str(),
true,
folders);
renderer->initMaterial(materials);
renderObj->addComponent<CIndirectLighting>();
}
This object class is created to store data in an array of multiple CEntities.
Definition CEntityPrefab.h:38
This object class stores information for a GameObject.
Definition CGameObject.h:52
This object holds the parameters for indirect lighting like SH or AmbientColor or Lightmap.
Definition CIndirectLighting.h:47
The object class helps to initialize a model from a path or prefab, and gets the model's material to ...
Definition CRenderMesh.h:81
All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees a...
Definition CIndexBuffer.h:13

The documentation for this class was generated from the following file: