V-ART
|
Material properties for graphical objects. More...
#include <material.h>
Public Member Functions | |
Material () | |
Material (const Material &m) | |
Creates a new material, creating a copy of another one. More... | |
Material (const Color &c) | |
Creates plastic-looking material of given color. More... | |
Material (const Texture &t) | |
Creates a Material, aplying a texture to it. More... | |
Material (const Color &c, float spc, float amb, float ems, float shi) | |
Sets all colors to be shades of one single color. More... | |
Material & | operator= (const Material &m) |
Copies all texture data from one to another. More... | |
void | SetPlasticColor (const VART::Color &c) |
Makes the material to have a plastic-looking of given color. More... | |
void | SetDiffuseColor (const Color &c) |
Sets the diffuse color (main color) of the material. More... | |
const Color & | GetDiffuseColor () const |
Returns the diffuse color. More... | |
void | SetSpecularColor (const Color &c) |
Sets the specular color (highlight color) of the material. More... | |
const Color & | GetSpecularColor () const |
Returns the specular color of the material. More... | |
void | SetAmbientColor (const Color &c) |
Sets the ambient color of the material. More... | |
const Color & | GetAmbientColor () const |
Returns the ambient color of the material. More... | |
void | SetEmissiveColor (const Color &c) |
Sets the emissive color of the material. More... | |
const Color & | GetEmissiveColor () const |
Returns the emissive color of the material. More... | |
void | SetTexture (const Texture &t) |
Sets the texture of material. More... | |
bool | HasTexture () const |
Indicates if a material contains texture. More... | |
const VART::Texture & | GetTexture () const |
Returns the current texture of material. More... | |
void | SetShininess (float newValue) |
Set the shininess of the material. More... | |
float | GetShininess () const |
Return the shininess of the material. More... | |
bool | DrawOGL () const |
Draws the material using OpenGL engine. More... | |
Static Public Member Functions | |
static const Material & | LIGHT_PLASTIC_GRAY () |
static const Material & | DARK_PLASTIC_GRAY () |
static const Material & | PLASTIC_WHITE () |
static const Material & | PLASTIC_RED () |
static const Material & | PLASTIC_GREEN () |
static const Material & | PLASTIC_BLUE () |
static const Material & | PLASTIC_BLACK () |
Material properties for graphical objects.
FixMe: Put detailed description here.
Definition at line 16 of file material.h.
VART::Material::Material | ( | ) |
Definition at line 14 of file material.cpp.
VART::Material::Material | ( | const Material & | m | ) |
Creates a new material, creating a copy of another one.
Definition at line 19 of file material.cpp.
VART::Material::Material | ( | const Color & | c | ) |
Creates plastic-looking material of given color.
Definition at line 24 of file material.cpp.
VART::Material::Material | ( | const Texture & | t | ) |
Creates a Material, aplying a texture to it.
Definition at line 29 of file material.cpp.
VART::Material::Material | ( | const Color & | c, |
float | spc, | ||
float | amb, | ||
float | ems, | ||
float | shi | ||
) |
Sets all colors to be shades of one single color.
Definition at line 35 of file material.cpp.
References VART::Color::GetScaled().
|
static |
Definition at line 70 of file material.cpp.
Referenced by VART::Box::MakeBox(), and VART::MeshObject::MakeBox().
bool VART::Material::DrawOGL | ( | ) | const |
Draws the material using OpenGL engine.
Definition at line 111 of file material.cpp.
|
inline |
Returns the ambient color of the material.
Definition at line 58 of file material.h.
|
inline |
Returns the diffuse color.
Definition at line 46 of file material.h.
|
inline |
Returns the emissive color of the material.
Definition at line 64 of file material.h.
|
inline |
Return the shininess of the material.
Definition at line 82 of file material.h.
|
inline |
Returns the specular color of the material.
Definition at line 52 of file material.h.
|
inline |
Returns the current texture of material.
Definition at line 73 of file material.h.
|
inline |
Indicates if a material contains texture.
Definition at line 70 of file material.h.
References VART::Texture::HasData().
|
static |
Definition at line 64 of file material.cpp.
VART::Material & VART::Material::operator= | ( | const Material & | m | ) |
Copies all texture data from one to another.
Definition at line 44 of file material.cpp.
|
static |
Definition at line 100 of file material.cpp.
References VART::Color::BLACK().
|
static |
Definition at line 94 of file material.cpp.
References VART::Color::BLUE().
Referenced by VART::RefSystem::RefSystem().
|
static |
Definition at line 88 of file material.cpp.
References VART::Color::GREEN().
Referenced by VART::RefSystem::RefSystem().
|
static |
Definition at line 82 of file material.cpp.
References VART::Color::RED().
Referenced by VART::RefSystem::RefSystem().
|
static |
Definition at line 76 of file material.cpp.
References VART::Color::WHITE().
|
inline |
Sets the ambient color of the material.
Definition at line 55 of file material.h.
Referenced by VART::MeshObject::ReadMaterialTable().
|
inline |
Sets the diffuse color (main color) of the material.
Definition at line 43 of file material.h.
Referenced by VART::MeshObject::ReadMaterialTable().
|
inline |
Sets the emissive color of the material.
Definition at line 61 of file material.h.
Referenced by VART::MeshObject::ReadMaterialTable().
void VART::Material::SetPlasticColor | ( | const VART::Color & | c | ) |
Makes the material to have a plastic-looking of given color.
Sets the diffuse, specular, ambient and emissive colors of the material, to make it to have a plastic-looking of a given color.
Definition at line 55 of file material.cpp.
References VART::Color::GetScaled().
|
inline |
Set the shininess of the material.
According to the "OpenGL programming guide" (red book), shininess should be in the range of 0.0 (no shininess) to 128.0 (very shiny).
Definition at line 79 of file material.h.
Referenced by VART::MeshObject::ReadMaterialTable().
|
inline |
Sets the specular color (highlight color) of the material.
Definition at line 49 of file material.h.
Referenced by VART::MeshObject::ReadMaterialTable().
void VART::Material::SetTexture | ( | const Texture & | t | ) |
Sets the texture of material.
Definition at line 106 of file material.cpp.
Referenced by VART::MeshObject::ReadFromOBJ(), and VART::MeshObject::ReadMaterialTable().