Loading...
Searching...
No Matches
Gfx::COldModelManager Class Reference

Manager for static models. More...

`#include <src/graphics/engine/oldmodelmanager.h>`

## Public Member Functions

| COldModelManager (CEngine *engine)
bool | LoadModel (const std::string &fileName, bool mirrored, int variant=0)
| Loads a model from given file.
bool | AddModelReference (const std::string &fileName, bool mirrored, int objRank, int variant=0)
| Adds an instance of model to the given object rank as a reference to base object.
bool | AddModelCopy (const std::string &fileName, bool mirrored, int objRank, int variant=0)
| Adds an instance of model to the given object rank as a copy (copied base object).
bool | IsModelLoaded (const std::string &fileName, bool mirrored, int variant=0)
| Returns true if given model is loaded.
int | GetModelBaseObjRank (const std::string &fileName, bool mirrored, int variant=0)
| Returns the rank of base engine object of given loaded model.
void | DeleteAllModelCopies ()
| Deletes all copied objects.
void | UnloadModel (const std::string &fileName, bool mirrored, int variant=0)
| Unloads the given model.
void | UnloadAllModels ()
| Unloads all models.

## Protected Member Functions

void | Mirror (std::vector< ModelTriangle > &triangles)
| Mirrors the model along the Z axis.
void | ChangeVariant (std::vector< ModelTriangle > &triangles, int variant)
| Changes variant.

## Detailed Description

Manager for static models.

The manager allows for loading models as static objects and adding new instances of models to the engine.

The models are loaded from stanard application model directory and they are identified by unique file names.

The models are loaded by creating (if it doesn't exist yet) a base engine object from the model geometry. This base object is then shared among all instances of this model with the instances being engine objects linked to the shared base object.

There is also a possibility of creating a copy of model so it has its own and unique base engine object. This is especially useful for models where the geometry must be altered.

## Member Function Documentation

## LoadModel()

bool Gfx::COldModelManager::LoadModel | ( | const std::string & | fileName,
|  | bool | mirrored,
|  | int | variant = 0 )

Loads a model from given file.

## AddModelReference()

bool Gfx::COldModelManager::AddModelReference | ( | const std::string & | fileName,
|  | bool | mirrored,
|  | int | objRank,
|  | int | variant = 0 )

Adds an instance of model to the given object rank as a reference to base object.

## AddModelCopy()

bool Gfx::COldModelManager::AddModelCopy | ( | const std::string & | fileName,
|  | bool | mirrored,
|  | int | objRank,
|  | int | variant = 0 )

Adds an instance of model to the given object rank as a copy (copied base object).

## IsModelLoaded()

bool Gfx::COldModelManager::IsModelLoaded | ( | const std::string & | fileName,
|  | bool | mirrored,
|  | int | variant = 0 )

Returns true if given model is loaded.

## GetModelBaseObjRank()

int Gfx::COldModelManager::GetModelBaseObjRank | ( | const std::string & | fileName,
|  | bool | mirrored,
|  | int | variant = 0 )

Returns the rank of base engine object of given loaded model.

## DeleteAllModelCopies()

void Gfx::COldModelManager::DeleteAllModelCopies | ( |  | ) |

Deletes all copied objects.

## UnloadModel()

void Gfx::COldModelManager::UnloadModel | ( | const std::string & | fileName,
|  | bool | mirrored,
|  | int | variant = 0 )

Unloads the given model.

## UnloadAllModels()

void Gfx::COldModelManager::UnloadAllModels | ( |  | ) |

Unloads all models.

## Mirror()

void Gfx::COldModelManager::Mirror | ( | std::vector< ModelTriangle > & | triangles | ) |

protected

Mirrors the model along the Z axis.

## ChangeVariant()

void Gfx::COldModelManager::ChangeVariant | ( | std::vector< ModelTriangle > & | triangles,
|  | int | variant )

protected

Changes variant.

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

- src/graphics/engine/oldmodelmanager.h
- src/graphics/engine/oldmodelmanager.cpp