version 3.3

VRS::Material Class Reference

OpenGL-like Surface Material . More...

#include <vrs/material.h>

Inheritance diagram for VRS::Material:

VRS::MonoAttribute VRS::Attribute VRS::RenderObj VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 Material (double Ka=0.2, double Kd=0.5, double Ks=0.0, double roughness=0.1, const Color &specularColor=Color::white, const Color &emissionColor=Color::black, bool distinguishFrontAndBackFaces=0)
bool operator== (const Material &other) const
void setAmbient (double Ka, int side=0)
double getAmbient (int side=0) const
 Ka: ambient coefficient.
void setDiffuse (double Kd, int side=0)
double getDiffuse (int side=0) const
 Kd: diffuse coefficient.
void setSpecular (double Ks, int side=0)
double getSpecular (int side=0) const
 Ks: specular coefficient.
void setRoughness (double r, int side=0)
double getRoughness (int side=0) const
 r: the specular exponent.
void setSpecularColor (const Color &s, int side=0)
Color getSpecularColor (int side=0) const
 s: specular color.
void setEmissionColor (const Color &, int side=0)
Color getEmissionColor (int side=0) const
 Light emission of the surface.
void setDistinguishSides (bool onOff)
bool getDistinguishSides () const
 VRS_TYPEINFO (Material, MonoAttribute)
 VRS_SERIALIZABLE (Material)


Detailed Description

OpenGL-like Surface Material .

Constructor & Destructor Documentation

VRS::Material::Material ( double  Ka = 0.2,
double  Kd = 0.5,
double  Ks = 0.0,
double  roughness = 0.1,
const Color specularColor = Color::white,
const Color emissionColor = Color::black,
bool  distinguishFrontAndBackFaces = 0 
)

For OpenGL, these coefficients are evaluated as follows (where color denotes the current ColorAttribute): ambient color = Ka * color diffuse color = Kd * color specular color = Ks * speccolor emission color = emiscolor shininess = roughness opacity = color[3] By default, front and back attributes are set to the same value.


Member Function Documentation

bool VRS::Material::operator== ( const Material other  )  const

void VRS::Material::setAmbient ( double  Ka,
int  side = 0 
)

double VRS::Material::getAmbient ( int  side = 0  )  const [inline]

Ka: ambient coefficient.

void VRS::Material::setDiffuse ( double  Kd,
int  side = 0 
)

double VRS::Material::getDiffuse ( int  side = 0  )  const [inline]

Kd: diffuse coefficient.

void VRS::Material::setSpecular ( double  Ks,
int  side = 0 
)

double VRS::Material::getSpecular ( int  side = 0  )  const [inline]

Ks: specular coefficient.

void VRS::Material::setRoughness ( double  r,
int  side = 0 
)

double VRS::Material::getRoughness ( int  side = 0  )  const [inline]

r: the specular exponent.

void VRS::Material::setSpecularColor ( const Color s,
int  side = 0 
)

Color VRS::Material::getSpecularColor ( int  side = 0  )  const [inline]

s: specular color.

void VRS::Material::setEmissionColor ( const Color ,
int  side = 0 
)

Color VRS::Material::getEmissionColor ( int  side = 0  )  const [inline]

Light emission of the surface.

void VRS::Material::setDistinguishSides ( bool  onOff  ) 

bool VRS::Material::getDistinguishSides (  )  const [inline]

If the flag is not set, all of the above set-methods set the attributes for both sides.

VRS::Material::VRS_TYPEINFO ( Material  ,
MonoAttribute   
)

VRS::Material::VRS_SERIALIZABLE ( Material   ) 


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

Generated on Tue May 22 06:00:22 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact