#include <light.h>
Public Member Functions | |
CMaterial (void) | |
Constructs a CMaterial object. | |
vec4_t | getEmission (void) const |
Reads emission color. | |
void | setEmission (const vec4_t &v) |
Writes emission color. | |
vec4_t | getAmbient (void) const |
Reads ambient color. | |
void | setAmbient (const vec4_t &v) |
Writes ambient color. | |
vec4_t | getDiffuse (void) const |
Reads diffuse color. | |
void | setDiffuse (const vec4_t &v) |
Writes diffuse colors. | |
vec4_t | getSpecular (void) const |
Reads specular color. | |
void | setSpecular (const vec4_t &v) |
Writes specular color. | |
float | getSpecularExponent (void) const |
Reads the specular exponent. | |
void | setSpecularExponent (float f) |
Writes the specular exponent. | |
bool | getUseVertexColor (void) const |
Reads the use-vertex-color flag. | |
void | setUseVertexColor (bool enable) |
Writes the use-vertex-color flag. |
This class allows storing the most important OpenGL material parameters like colors and the specular exponent. It also supports a flag, wether the diffuse color should be taken form the current vertex color instead of the diffuse color stored. The initial state of the lighting parameters is the same like that defined in the OpenGL specification.
The methods of this class are only used for reading/writing material parameters and have no side effects. That's why they are less documented.
CMaterial::CMaterial | ( | void | ) | [inline] |
Constructs a CMaterial object.
It initializes all colors to back (0,0,0,0) and the specular exponent to zero. The use-vertex-color flag is set to False.