#include <Material.h>
Inherits Shade.
Inheritance diagram for Material:


Public Methods | |
| Material () | |
| const Color4 & | getEmission () |
| const Color4 & | getAmbient () |
| const Color4 & | getDiffuse () |
| const Color4 & | getSpecular () |
| float | getShininess () |
| void | setEmission (const Color4 &color) |
| void | setAmbient (const Color4 &color) |
| void | setDiffuse (const Color4 &color) |
| void | setSpecular (const Color4 &color) |
| void | setShininess (float s) |
| void | render () |
| void | read (WDFFile &f) |
| void | write (WDFFile &f) const |
| Color4 | calculateColor (const SurfaceInfo &s, Scene &scene) |
| void | parseSymbol (Token &t, ObjectFile &file) |
| Reads a single parameter sections inside the body of the object description. More... | |
| void | writeParams (ostream &stream) |
| Writes all parameter sections inside the body of the object description. More... | |
Protected Methods | |
| void | createSymbols () |
| Creates all parameter symbols that are used within the body of the object description. | |
Protected Attributes | |
| Color4 | emission |
| Color4 | ambient |
| Color4 | diffuse |
| Color4 | specular |
| float | shininess |
Format: (see Shade)
PARAM ::= EMISSION | AMBIENT | DIFFUSE | SPECULAR | SHININESS
EMISSION ::= "emission" <Color4>
AMBIENT ::= "ambient" <Color4>
DIFFUSE ::= "diffuse" <Color4>
SPECULAR ::= "specular" <Color4>
SHININESS ::= "shininess" <float>
Example:
Material {
emission [ 1, 0, 0, ];
shininess 200;
}
|
||||||||||||
|
Reads a single parameter sections inside the body of the object description. Each object has a set of parameter names associated with it, called symbols. Symbols are declared inside the createSymbols method. The method parseSymbol expects the Token t to be such a symbol and reads the corresponding parameters. Unknown symbols are passed to its super class.
Reimplemented from Shade. |
|
|
Writes all parameter sections inside the body of the object description. This method writes all object parameters to ostream. Inhereting classes will always call super::writeParams().
Reimplemented from DynamicObject. |