VoltAir
|
Class managing a collection of TerrainMaterialDefs. More...
Public Member Functions | |
TerrainMaterials (const QString &jsonFilePath) | |
Construct a TerrainMaterials object and load TerrainMaterialDefs from the named file. More... | |
QSharedPointer < TerrainMaterialDef > | getMaterial (const QString &name) const |
Returns a shared pointer to the TerrainMaterialDefs with the given name, or a null shared pointer if none is found. More... | |
void | reload () |
Reloads TerrainMaterialDefs from the originally specified file, merging the results into currently stored materials. More... | |
Class managing a collection of TerrainMaterialDefs.
This class loads TerrainMaterialDefs from a JSON file, and allows them to be looked up by name.
TerrainMaterials::TerrainMaterials | ( | const QString & | jsonFilePath | ) |
Construct a TerrainMaterials object and load TerrainMaterialDefs from the named file.
jsonFilePath | Absolute path to file to load |
QSharedPointer<TerrainMaterialDef> TerrainMaterials::getMaterial | ( | const QString & | name | ) | const |
Returns a shared pointer to the TerrainMaterialDefs with the given name, or a null shared pointer if none is found.
name | Name of the material to look up |
void TerrainMaterials::reload | ( | ) |
Reloads TerrainMaterialDefs from the originally specified file, merging the results into currently stored materials.
Existing materials will be updated in place (pointers remain unchanged). New materials will be added, and materials that have been removed from the file will be removed from our map.