zenilib
0.5.3.0
|
An Abstraction of a Material. More...
#include <Material.h>
Public Member Functions | |
Material (const Color &ambient=ZENI_DEFAULT_MATERIAL_DIFFUSE, const Color &diffuse=ZENI_DEFAULT_MATERIAL_DIFFUSE, const Color &specular=ZENI_DEFAULT_MATERIAL_SPECULAR, const Color &emissive=ZENI_DEFAULT_MATERIAL_EMISSIVE, const float &power=ZENI_DEFAULT_MATERIAL_POWER, const String &texture="") | |
An Alternative to the numerous setter functions. More... | |
Material (const String &texture, const Color &ambient_and_diffuse=ZENI_DEFAULT_MATERIAL_DIFFUSE) | |
void | clear_optimization () |
Simply undo any previous optimizations. More... | |
float | get_power () const |
Get the power of the Material (indicates the focus of the specular highlights) More... | |
float | get_shininess () const |
Get the shininess of the Material (indicates the focus of the specular highlights - logarithmically tied to power) More... | |
const String & | get_Texture () const |
Get the texture identifier. More... | |
bool | operator< (const Material &rhs) const |
To provide an arbitrary total ordering. Do not depend on it remaining the same in the future. More... | |
bool | operator== (const Material &rhs) const |
A simple equality test. Close hits are misses. More... | |
void | optimize_to_follow (const Material &rhs) |
If this Material will be set regularly after another Material, and only after that other Material, the set function can be optimized. More... | |
void | optimize_to_precede (const Material &rhs) |
If this Material will be set regularly before another Material, and only before that other Material, the unset function can be optimized. More... | |
void | set (Video_GL_Fixed &screen) const |
void | set (Video_GL_Shader &screen) const |
void | set (Video_DX9 &screen) const |
void | set_power (const float &power) |
Set the power of the Material (indicates the focus of the specular highlights) More... | |
void | set_shininess (const float &shininess) |
Set the shininess of the Material (indicates the focus of the specular highlights - logarithmically tied to power) More... | |
void | set_Texture (const String &texture) |
Set the texture identifier. More... | |
void | unset (Video_GL_Fixed &screen) const |
void | unset (Video_GL_Shader &screen) const |
void | unset (Video_DX9 &screen) const |
Public Attributes | |
Color | ambient |
The ambient Color. More... | |
Color | diffuse |
The diffuse Color. More... | |
Color | emissive |
The emissive Color. More... | |
Color | specular |
The specular Color. More... | |
An Abstraction of a Material.
The Light class simply provides Material data to both Direct3D9 and OpenGL.
Contact: bazal d@ze nipex .com
Definition at line 56 of file Material.h.
Zeni::Material::Material | ( | const Color & | ambient = ZENI_DEFAULT_MATERIAL_DIFFUSE , |
const Color & | diffuse = ZENI_DEFAULT_MATERIAL_DIFFUSE , |
||
const Color & | specular = ZENI_DEFAULT_MATERIAL_SPECULAR , |
||
const Color & | emissive = ZENI_DEFAULT_MATERIAL_EMISSIVE , |
||
const float & | power = ZENI_DEFAULT_MATERIAL_POWER , |
||
const String & | texture = "" |
||
) |
An Alternative to the numerous setter functions.
Definition at line 38 of file Material.cpp.
References set_Texture().
Zeni::Material::Material | ( | const String & | texture, |
const Color & | ambient_and_diffuse = ZENI_DEFAULT_MATERIAL_DIFFUSE |
||
) |
Definition at line 51 of file Material.cpp.
References set_Texture().
void Zeni::Material::clear_optimization | ( | ) |
Simply undo any previous optimizations.
Definition at line 235 of file Material.cpp.
|
inline |
Get the power of the Material (indicates the focus of the specular highlights)
Definition at line 25 of file Material.hxx.
float Zeni::Material::get_shininess | ( | ) | const |
Get the shininess of the Material (indicates the focus of the specular highlights - logarithmically tied to power)
Definition at line 64 of file Material.cpp.
Get the texture identifier.
Definition at line 29 of file Material.hxx.
void Zeni::Material::set | ( | Video_GL_Fixed & | screen | ) | const |
Definition at line 83 of file Material.cpp.
References ambient, Zeni::Video_GL_Fixed::apply_Texture(), diffuse, emissive, Zeni::String::empty(), Zeni::Database< TYPE >::get_id(), Zeni::Video::get_lighting(), Zeni::get_Textures(), GL_AMBIENT, GL_DIFFUSE, GL_EMISSION, GL_FRONT_AND_BACK, GL_SHININESS, GL_SPECULAR, glMaterialfv, Zeni::Video_GL_Fixed::set_Color(), and specular.
Referenced by Zeni::Video_GL_Fixed::set_Material(), Zeni::Video_GL_Shader::set_Material(), and Zeni::Video_DX9::set_Material().
void Zeni::Material::set | ( | Video_GL_Shader & | screen | ) | const |
Definition at line 123 of file Material.cpp.
References ambient, Zeni::Video_GL_Shader::apply_Texture(), diffuse, emissive, Zeni::String::empty(), Zeni::Database< TYPE >::get_id(), Zeni::Video::get_lighting(), Zeni::get_Textures(), GL_AMBIENT, GL_DIFFUSE, GL_EMISSION, GL_FRONT_AND_BACK, GL_SHININESS, GL_SPECULAR, glMaterialfv, Zeni::Video_GL_Shader::set_Color(), and specular.
Definition at line 163 of file Material.cpp.
References Zeni::Video_DX9::apply_Texture(), diffuse, Zeni::String::empty(), Zeni::Video_DX9::get_d3d_device(), Zeni::Video::get_lighting(), and Zeni::Video_DX9::set_Color().
Set the power of the Material (indicates the focus of the specular highlights)
Definition at line 33 of file Material.hxx.
Set the shininess of the Material (indicates the focus of the specular highlights - logarithmically tied to power)
Definition at line 68 of file Material.cpp.
Set the texture identifier.
Definition at line 74 of file Material.cpp.
References Zeni::String::empty(), Zeni::Database< TYPE >::get_id(), and Zeni::get_Textures().
Referenced by Material().
void Zeni::Material::unset | ( | Video_GL_Fixed & | screen | ) | const |
Definition at line 115 of file Material.cpp.
References Zeni::String::empty(), and Zeni::Video_GL_Fixed::unapply_Texture().
Referenced by Zeni::Video_GL_Fixed::unset_Material(), Zeni::Video_GL_Shader::unset_Material(), and Zeni::Video_DX9::unset_Material().
void Zeni::Material::unset | ( | Video_GL_Shader & | screen | ) | const |
Definition at line 155 of file Material.cpp.
References Zeni::String::empty(), and Zeni::Video_GL_Shader::unapply_Texture().
Definition at line 176 of file Material.cpp.
References Zeni::String::empty(), and Zeni::Video_DX9::unapply_Texture().
Color Zeni::Material::ambient |
The ambient Color.
Definition at line 103 of file Material.h.
Referenced by operator<(), operator==(), optimize_to_follow(), optimize_to_precede(), and set().
Color Zeni::Material::diffuse |
The diffuse Color.
Definition at line 102 of file Material.h.
Referenced by operator<(), operator==(), optimize_to_follow(), optimize_to_precede(), and set().
Color Zeni::Material::emissive |
The emissive Color.
Definition at line 105 of file Material.h.
Referenced by operator<(), operator==(), optimize_to_follow(), optimize_to_precede(), and set().
Color Zeni::Material::specular |
The specular Color.
Definition at line 104 of file Material.h.
Referenced by operator<(), operator==(), optimize_to_follow(), optimize_to_precede(), and set().