![]() |
Stellarium
0.20.4
|
Defines a material loaded from an .mtl file. More...
#include <StelOBJ.hpp>
Public Types | |
| enum | Illum { I_NONE =-1, I_DIFFUSE =0, I_DIFFUSE_AND_AMBIENT =1, I_SPECULAR =2, I_TRANSLUCENT =9 } |
| MTL Illumination models, see the developer doc for info. More... | |
| typedef QMap< QString, QStringList > | ParamsMap |
Static Public Member Functions | |
| static QVector< Material > | loadFromFile (const QString &filename) |
| Loads all materials contained in an .mtl file. More... | |
Data Fields | |
| enum StelOBJ::Material::Illum | illum |
| QString | name |
| Name of the material as defined in the .mtl, default empty. | |
| QVector3D | Ka |
| Ambient coefficient. Contains all -1 if not set by .mtl. | |
| QVector3D | Kd |
| Diffuse coefficient. Contains all -1 if not set by .mtl. | |
| QVector3D | Ks |
| Specular coefficient. Contains all -1 if not set by .mtl. | |
| QVector3D | Ke |
| Emissive coefficient. Contains all -1 if not set by .mtl. | |
| float | Ns |
| Specular shininess (exponent), should be > 0. Default 8.0. | |
| float | d |
| Alpha value (1 means opaque). More... | |
| QString | map_Ka |
| The ambient texture map file path. | |
| QString | map_Kd |
| The diffuse texture map file path. | |
| QString | map_Ks |
| The specular texture map file path. | |
| QString | map_Ke |
| The emissive texture map file path. | |
| QString | map_bump |
| The bump/normal texture map file path. | |
| QString | map_height |
| The height map texture file path. | |
| ParamsMap | additionalParams |
| Contains all other material parameters that are not recognized by this class, but can still be accessed by class users this way. More... | |
Static Protected Member Functions | |
| static bool | parseBool (const QStringList ¶ms, bool &out) |
| Parses a bool from a parameter list (like included in the ::additionalParams) using the same logic StelOBJ uses internally. More... | |
| static bool | parseFloat (const QStringList ¶ms, float &out) |
| Parses a float from a parameter list (like included in the ::additionalParams) using the same logic StelOBJ uses internally. More... | |
| static bool | parseVec2d (const QStringList ¶ms, Vec2d &out) |
| Parses a Vec2d from a parameter list (like included in the ::additionalParams) using the same logic StelOBJ uses internally. More... | |
It uses QVector3D instead of Vec3f, etc, to be more compatible with Qt's OpenGL wrappers.
|
static |
Does not check if the texture map files exist.
|
staticprotected |
out
|
staticprotected |
out
|
staticprotected |
out | ParamsMap StelOBJ::Material::additionalParams |
The key is the statement name (e.g. Ka, map_bump etc.), the value is the list of space-separated parameters to this statement
| float StelOBJ::Material::d |
-1 if not set by .mtl Note that both the d and Tr statements can change this value
1.8.13