Slippers Engine
 
Loading...
Searching...
No Matches
ModelManager Class Reference

Singleton responisble for loading and retrieving models. More...

#include <ModelManager.h>

Collaboration diagram for ModelManager:
Collaboration graph

Public Types

enum class  DefaultModels { AXIS , UNITSQUAREXY }
 Collection of Preloaded Models. More...
 

Static Public Member Functions

static void LoadModel (const MapKey &key, const std::string &path)
 Load Model with KEY and FILE PATH.
 
static void LoadModel (const MapKey &key, int planeSize, int u, int v)
 Load Model with KEY, PLANESIZE, U, AND V.
 
static void LoadModel (const MapKey &key, const Model::PreMadeModels pmm)
 Load Shader with KEY and AZUL's PREMADEMODELS.
 
static Model * GetModel (const MapKey &key)
 Returns model pointer with given KEY.
 
static Model * GetModel (DefaultModels key)
 Returns model pointer from DEFAULTMODELS.
 

Private Types

using MapKey = std::string
 KEYS stored as STRINGS.
 

Detailed Description

Singleton responisble for loading and retrieving models.

Member Typedef Documentation

◆ MapKey

using ModelManager::MapKey = std::string
private

KEYS stored as STRINGS.

Member Enumeration Documentation

◆ DefaultModels

enum class ModelManager::DefaultModels
strong

Collection of Preloaded Models.

Enumerator
AXIS 
UNITSQUAREXY 

Member Function Documentation

◆ GetModel() [1/2]

static Model * ModelManager::GetModel ( const MapKey & key)
static

Returns model pointer with given KEY.

A function that returns a model pointer based on a user generated key. Checks if key already exists.

Parameters
key
Returns
Model*

◆ GetModel() [2/2]

static Model * ModelManager::GetModel ( DefaultModels key)
static

Returns model pointer from DEFAULTMODELS.

A function that returns a model pointer based on the enum class DefaultModels.

Parameters
key
Returns
Model*

◆ LoadModel() [1/3]

static void ModelManager::LoadModel ( const MapKey & key,
const Model::PreMadeModels pmm )
static

Load Shader with KEY and AZUL's PREMADEMODELS.

A function callable in SlippersResources/LoadResources that takes in a String as a key for retrieval, as well as an AZUL premade model. Checks for repeated key use.

Parameters
key
preMadeModel

◆ LoadModel() [2/3]

static void ModelManager::LoadModel ( const MapKey & key,
const std::string & path )
static

Load Model with KEY and FILE PATH.

A function callable in SlippersResources/LoadResources that takes in a String as a key for retrieval, as well as a file path for a shader existing in Assets/Models. Checks for repeated key use.

Parameters
key
path

◆ LoadModel() [3/3]

static void ModelManager::LoadModel ( const MapKey & key,
int planeSize,
int u,
int v )
static

Load Model with KEY, PLANESIZE, U, AND V.

A function callable in SlippersResources/LoadResources that takes in a String as a key for retrieval. Uses plane size to get total width and length of the plane, and u and v for how often to repeat tiles. Checks for repeated key use.

Parameters
key
planeSize
u
v