![]() |
Stellarium
0.16.1
|
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... | |
Public Attributes | |
enum StelOBJ::Material::Illum | illum |
QString | name |
Name of the material as defined in the .mtl, default empty. More... | |
QVector3D | Ka |
Ambient coefficient. Contains all -1 if not set by .mtl. More... | |
QVector3D | Kd |
Diffuse coefficient. Contains all -1 if not set by .mtl. More... | |
QVector3D | Ks |
Specular coefficient. Contains all -1 if not set by .mtl. More... | |
QVector3D | Ke |
Emissive coefficient. Contains all -1 if not set by .mtl. More... | |
float | Ns |
Specular shininess (exponent), should be > 0. Default 8.0. More... | |
float | d |
Alpha value (1 means opaque). More... | |
QString | map_Ka |
The ambient texture map file path. More... | |
QString | map_Kd |
The diffuse texture map file path. More... | |
QString | map_Ks |
The specular texture map file path. More... | |
QString | map_Ke |
The emissive texture map file path. More... | |
QString | map_bump |
The bump/normal texture map file path. More... | |
QString | map_height |
The height map texture file path. More... | |
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... | |
Defines a material loaded from an .mtl file.
It uses QVector3D instead of Vec3f, etc, to be more compatible with Qt's OpenGL wrappers.
Definition at line 68 of file StelOBJ.hpp.
MTL Illumination models, see the developer doc for info.
Definition at line 72 of file StelOBJ.hpp.
|
static |
Loads all materials contained in an .mtl file.
Does not check if the texture map files exist.
|
staticprotected |
Parses a bool from a parameter list (like included in the ::additionalParams) using the same logic StelOBJ uses internally.
out
|
staticprotected |
Parses a float from a parameter list (like included in the ::additionalParams) using the same logic StelOBJ uses internally.
out
|
staticprotected |
Parses a Vec2d from a parameter list (like included in the ::additionalParams) using the same logic StelOBJ uses internally.
out
ParamsMap StelOBJ::Material::additionalParams |
Contains all other material parameters that are not recognized by this class, but can still be accessed by class users this way.
The key is the statement name (e.g. Ka
, map_bump
etc.), the value is the list of space-separated parameters to this statement
Definition at line 118 of file StelOBJ.hpp.
float StelOBJ::Material::d |
Alpha value (1 means opaque).
-1 if not set by .mtl Note that both the d
and Tr
statements can change this value
Definition at line 97 of file StelOBJ.hpp.
QVector3D StelOBJ::Material::Ka |
Ambient coefficient. Contains all -1 if not set by .mtl.
Definition at line 86 of file StelOBJ.hpp.
QVector3D StelOBJ::Material::Kd |
Diffuse coefficient. Contains all -1 if not set by .mtl.
Definition at line 88 of file StelOBJ.hpp.
QVector3D StelOBJ::Material::Ke |
Emissive coefficient. Contains all -1 if not set by .mtl.
Definition at line 92 of file StelOBJ.hpp.
QVector3D StelOBJ::Material::Ks |
Specular coefficient. Contains all -1 if not set by .mtl.
Definition at line 90 of file StelOBJ.hpp.
QString StelOBJ::Material::map_bump |
The bump/normal texture map file path.
Definition at line 108 of file StelOBJ.hpp.
QString StelOBJ::Material::map_height |
The height map texture file path.
Definition at line 110 of file StelOBJ.hpp.
QString StelOBJ::Material::map_Ka |
The ambient texture map file path.
Definition at line 100 of file StelOBJ.hpp.
QString StelOBJ::Material::map_Kd |
The diffuse texture map file path.
Definition at line 102 of file StelOBJ.hpp.
QString StelOBJ::Material::map_Ke |
The emissive texture map file path.
Definition at line 106 of file StelOBJ.hpp.
QString StelOBJ::Material::map_Ks |
The specular texture map file path.
Definition at line 104 of file StelOBJ.hpp.
QString StelOBJ::Material::name |
Name of the material as defined in the .mtl, default empty.
Definition at line 83 of file StelOBJ.hpp.
float StelOBJ::Material::Ns |
Specular shininess (exponent), should be > 0. Default 8.0.
Definition at line 94 of file StelOBJ.hpp.