zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Material Class Reference

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 Stringget_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...
 

Detailed Description

An Abstraction of a Material.

The Light class simply provides Material data to both Direct3D9 and OpenGL.

Note
Materials are relevant only when dynamic lighting is used.
Author
bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 56 of file Material.h.

Constructor & Destructor Documentation

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().

Member Function Documentation

void Zeni::Material::clear_optimization ( )

Simply undo any previous optimizations.

Definition at line 235 of file Material.cpp.

float Zeni::Material::get_power ( ) const
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.

const String & Zeni::Material::get_Texture ( ) const
inline

Get the texture identifier.

Definition at line 29 of file Material.hxx.

bool Zeni::Material::operator< ( const Material rhs) const

To provide an arbitrary total ordering. Do not depend on it remaining the same in the future.

Definition at line 183 of file Material.cpp.

References ambient, diffuse, emissive, and specular.

bool Zeni::Material::operator== ( const Material rhs) const

A simple equality test. Close hits are misses.

Definition at line 192 of file Material.cpp.

References ambient, diffuse, emissive, and specular.

void Zeni::Material::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.

Definition at line 201 of file Material.cpp.

References ambient, diffuse, emissive, and specular.

void Zeni::Material::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.

Definition at line 218 of file Material.cpp.

References ambient, diffuse, emissive, and specular.

void Zeni::Material::set_power ( const float &  power)
inline

Set the power of the Material (indicates the focus of the specular highlights)

Definition at line 33 of file Material.hxx.

void Zeni::Material::set_shininess ( const float &  shininess)

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.

void Zeni::Material::set_Texture ( const String texture)

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_Shader screen) const
void Zeni::Material::unset ( Video_DX9 screen) const

Definition at line 176 of file Material.cpp.

References Zeni::String::empty(), and Zeni::Video_DX9::unapply_Texture().

Member Data Documentation

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().


The documentation for this class was generated from the following files: