This class is used to create models, load in meshes and textures. NOTE: Only the Engine is allowed to create this object.
More...
#include <ResourceManager.hpp>
|
| eastl::weak_ptr< Model > | GetModel (eastl::string modelName) |
| | This method allows you to get a model with a specific name. More...
|
| |
| eastl::weak_ptr< Model > | CreateModel (eastl::string modelName, eastl::string meshToLoad="", eastl::string skeleton="") |
| | This method will allow you to create a new model with the model name. More...
|
| |
| eastl::weak_ptr< Skeleton > | CreateSkeleton (eastl::string skeletonToLoad) |
| | This will load the skeleton data from the file specified. NOTe: This method will not load in the skeleton again, if it's already loaded in. More...
|
| |
| void | AddAnimationsToSkeleton (eastl::string skeletonName, eastl::string animationsToLoad="", eastl::vector< eastl::string > names={}) |
| | This method loads animations from a file, and adds them to the skeleton with the specified name. More...
|
| |
| eastl::weak_ptr< Mesh > | CreateMesh (aiMesh *mesh, eastl::shared_ptr< Skeleton > skeleton, eastl::vector< Vertex > vertices, eastl::vector< unsigned > indices) |
| | This method allows you to create a new mesh. NOTE: This method will not load in the mesh again, if it's already loaded in. More...
|
| |
| eastl::weak_ptr< Texture > | GetTexture (eastl::string textureName) |
| | This method allows you to get a texture with the defined name. More...
|
| |
| eastl::weak_ptr< Texture > | CreateTexture (eastl::string textureName) |
| | This method allows you to create a new texture with the given name. More...
|
| |
| eastl::weak_ptr< Texture > | CreateTexture (eastl::string textureName, stbi_uc *data, int width, int height) |
| | Creates a new texture with the given name, using the supplied data as source. More...
|
| |
| | ~ResourceManager ()=default |
| |
This class is used to create models, load in meshes and textures. NOTE: Only the Engine is allowed to create this object.
Definition at line 16 of file ResourceManager.hpp.
| Engine::ResourceManager::~ResourceManager |
( |
| ) |
|
|
default |
| void Engine::ResourceManager::AddAnimationsToSkeleton |
( |
eastl::string |
skeletonName, |
|
|
eastl::string |
animationsToLoad = "", |
|
|
eastl::vector< eastl::string > |
names = {} |
|
) |
| |
This method loads animations from a file, and adds them to the skeleton with the specified name.
- Parameters
-
| skeletonName | The model to add animations to. |
| animationsToLoad | The file containing the animations. NOTE: The animation file needs to be located under 'Resources/Animations/' You then give the animation file name + its extension. The file can be in a subfolder of 'Resources/Animations/' |
| names | A vector containing names for the animations being loaded. If animation n in the file has a name at position n in the vector that name will be used instead. Leave the name at position n blank to use the name supplied by the file instead. |
Definition at line 92 of file ResourceManager.cpp.
| eastl::weak_ptr< Mesh > Engine::ResourceManager::CreateMesh |
( |
aiMesh * |
mesh, |
|
|
eastl::shared_ptr< Skeleton > |
skeleton, |
|
|
eastl::vector< Vertex > |
vertices, |
|
|
eastl::vector< unsigned > |
indices |
|
) |
| |
This method allows you to create a new mesh. NOTE: This method will not load in the mesh again, if it's already loaded in.
- Parameters
-
| mesh | The mesh you want to load in. |
| skeleton | The skeleton the mesh is bound to. Passing a nullptr will create a non-animated mesh. |
| vertices | The vertices of the mesh. |
| indices | The indices of the mesh. |
- Returns
- Returns a shared_ptr of the mesh you want to create.
Definition at line 106 of file ResourceManager.cpp.
| eastl::weak_ptr< Model > Engine::ResourceManager::CreateModel |
( |
eastl::string |
modelName, |
|
|
eastl::string |
meshToLoad = "", |
|
|
eastl::string |
skeleton = "" |
|
) |
| |
This method will allow you to create a new model with the model name.
- Parameters
-
| modelName | The model you want to create. |
| meshToLoad | Optional parameter where you can add a mesh you want to load in. NOTE: The mesh needs to be located under 'Resources/Models/' You then give the mesh name + its extension. The mesh can be in a subfolder of 'Resources/Meshes/' |
| skeleton | Optional parameter to load a specific skeleton with the model. If not specified the function will load the skeleton from the same file as the model. NOTE: The skeleton needs to be located under 'Resources/Models/' You then give the mesh name + its extension. The skeleton can be in a subfolder of 'Resources/Models/' |
- Returns
- Will return a new model, optionally with an already loaded mesh and skeleton.
Definition at line 34 of file ResourceManager.cpp.
| eastl::weak_ptr< Skeleton > Engine::ResourceManager::CreateSkeleton |
( |
eastl::string |
skeletonToLoad | ) |
|
This will load the skeleton data from the file specified. NOTe: This method will not load in the skeleton again, if it's already loaded in.
- Parameters
-
| skeletonToLoad | The file to load the skeleton from. NOTE: The skeleton needs to be located under 'Resources/Models/' You then give the mesh name + its extension. The skeleton can be in a subfolder of 'Resources/Models/' |
- Returns
- Will return a new skeleton.
Definition at line 65 of file ResourceManager.cpp.
| eastl::weak_ptr< Texture > Engine::ResourceManager::CreateTexture |
( |
eastl::string |
textureName | ) |
|
This method allows you to create a new texture with the given name.
- Parameters
-
| textureName | The texture you want to create. NOTE: The texture needs to be located under 'Resources/Textures/'. You then give the texture name + extension. The texture can be in a subfolder of of 'Resources/Textures/'. |
- Returns
- Returns a reference to the just created texture. Or if the texture was already created before, it'll return a reference to that texture.
Definition at line 134 of file ResourceManager.cpp.
| eastl::weak_ptr< Texture > Engine::ResourceManager::CreateTexture |
( |
eastl::string |
textureName, |
|
|
stbi_uc * |
data, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Creates a new texture with the given name, using the supplied data as source.
- Parameters
-
| textureName | The name for the texture you want to create. |
| data | The raw data of the texture you want to create. NOTE: The data must be of RGBA8 format. |
| width | The width of the texture. |
| height | The height of the texture. |
- Returns
Definition at line 258 of file ResourceManager.cpp.
| eastl::weak_ptr< Model > Engine::ResourceManager::GetModel |
( |
eastl::string |
modelName | ) |
|
This method allows you to get a model with a specific name.
- Parameters
-
| modelName | The model name you are looking for. |
- Returns
- Returns a shared pointer to the model is it was found. Otherwise it will return a empty shared pointer.
Definition at line 21 of file ResourceManager.cpp.
| eastl::weak_ptr< Texture > Engine::ResourceManager::GetTexture |
( |
eastl::string |
textureName | ) |
|
This method allows you to get a texture with the defined name.
- Parameters
-
| textureName | The texture you want to find. NOTE: The texture needs to be located under 'Resources/Textures/'. You then give the texture name + extension. The texture can be in a subfolder of 'Resources/Textures/'. |
- Returns
- Returns a shared pointer of the texture you want to get. Will return an empty shared pointer if the texture hasn't been loaded yet.
Definition at line 124 of file ResourceManager.cpp.
The documentation for this class was generated from the following files: