Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

ThingMaterial Class Reference

Material Thing for the scenegraph. More...

#include <ThingMaterial.h>

Inherits Thing.

Inherited by ThingMaterialText.

Inheritance diagram for ThingMaterial:

Inheritance graph
[legend]
Collaboration diagram for ThingMaterial:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ThingMaterial (void)
 constructor
virtual ~ThingMaterial (void)
 destructor
void setAmbient (float red, float green, float blue, float intensity)
 set the ambient term of the material
void setDiffuse (float red, float green, float blue, float intensity)
 set the diffuse term of the material
void setSpecular (float red, float green, float blue, float intensity)
 set the specular term of the material
void setColor (float red, float green, float blue, float alpha)
 set the color of the material, used if lighting is disabled
void setShininess (float intensity)
 set the shininess of the material, default 50.0
MaterialSettings getAmbient ()
MaterialSettings getDiffuse ()
MaterialSettings getSpecular ()
float getShininess ()
 get the shininess of the material
int addTexture (char *path, int mode=0)
 load the texture at path
void switchTextureOnOff ()
 switch the texture on or off
chargetTexturePath ()
 get the texture path
void setBlendMode (int textureIndex, int blendMode)
 set the blend mode for a specific texture
void enableLighting (bool)
 switch lighting on/off
void init ()
 write the initialization openGL code for init()
void render ()
 write the render openGL code for display()
void finish ()
 finish up the rendering, e.g. drop all set Attributes

Protected Attributes

float color [4]
float ambient [4]
float diffuse [4]
float specular [4]
float shininess
bool lighting
unsigned int textureCount
unsigned int g_Texture [MATERIAL_MAX_TEXTURES]
unsigned int g_TextureBlendings [MATERIAL_MAX_TEXTURES]
bool texture
chartexturePath [MATERIAL_MAX_TEXTURES]

Detailed Description

Material Thing for the scenegraph.

Material Thing for the Scenegraph. Ambient, diffuse, specular term and shiniess can be set. Also Textures can be loaded, multitexturing is supported


Constructor & Destructor Documentation

ThingMaterial::ThingMaterial void   ) 
 

constructor

ThingMaterial::~ThingMaterial void   )  [virtual]
 

destructor


Member Function Documentation

int ThingMaterial::addTexture char path,
int  modus = 0
 

load the texture at path

Parameters:
path to to the texture
mode for blending

void ThingMaterial::enableLighting bool  enable  ) 
 

switch lighting on/off

Parameters:
true - lighting enabled, false - no lighting

void ThingMaterial::finish  )  [virtual]
 

finish up the rendering, e.g. drop all set Attributes

Reimplemented from Thing.

Reimplemented in ThingMaterialText.

MaterialSettings ThingMaterial::getAmbient  ) 
 

MaterialSettings ThingMaterial::getDiffuse  ) 
 

float ThingMaterial::getShininess  ) 
 

get the shininess of the material

Returns:
shininess of the material

MaterialSettings ThingMaterial::getSpecular  ) 
 

char * ThingMaterial::getTexturePath  ) 
 

get the texture path

Returns:
texture path

void ThingMaterial::init  )  [virtual]
 

write the initialization openGL code for init()

Reimplemented from Thing.

Reimplemented in ThingMaterialText.

void ThingMaterial::render  )  [virtual]
 

write the render openGL code for display()

Reimplemented from Thing.

Reimplemented in ThingMaterialText.

void ThingMaterial::setAmbient float  red,
float  green,
float  blue,
float  intensity
 

set the ambient term of the material

Parameters:
red part (0.0-1.0)
green part (0.0-1.0)
blue part (0.0-1.0)
intensity of the ambient term (0.0-1.0)

void ThingMaterial::setBlendMode int  textureIndex,
int  blendMode
 

set the blend mode for a specific texture

Parameters:
number of the texture
blending mode

void ThingMaterial::setColor float  red,
float  green,
float  blue,
float  alpha
 

set the color of the material, used if lighting is disabled

Parameters:
red part (0.0-1.0)
green part (0.0-1.0)
blue part (0.0-1.0)
alpha part (0.0-1.0)

void ThingMaterial::setDiffuse float  red,
float  green,
float  blue,
float  intensity
 

set the diffuse term of the material

Parameters:
red part (0.0-1.0)
green part (0.0-1.0)
blue part (0.0-1.0)
intensity of the diffuse term (0.0-1.0)

void ThingMaterial::setShininess float  intensity  ) 
 

set the shininess of the material, default 50.0

void ThingMaterial::setSpecular float  red,
float  green,
float  blue,
float  intensity
 

set the specular term of the material

Parameters:
red part (0.0-1.0)
green part (0.0-1.0)
blue part (0.0-1.0)
intensity of the specular term (0.0-1.0)

void ThingMaterial::switchTextureOnOff  ) 
 

switch the texture on or off


Member Data Documentation

float ThingMaterial::ambient[4] [protected]
 

float ThingMaterial::color[4] [protected]
 

float ThingMaterial::diffuse[4] [protected]
 

unsigned int ThingMaterial::g_Texture[MATERIAL_MAX_TEXTURES] [protected]
 

unsigned int ThingMaterial::g_TextureBlendings[MATERIAL_MAX_TEXTURES] [protected]
 

bool ThingMaterial::lighting [protected]
 

float ThingMaterial::shininess [protected]
 

float ThingMaterial::specular[4] [protected]
 

bool ThingMaterial::texture [protected]
 

unsigned int ThingMaterial::textureCount [protected]
 

char* ThingMaterial::texturePath[MATERIAL_MAX_TEXTURES] [protected]
 


The documentation for this class was generated from the following files:
Generated on Mon Jan 24 17:42:33 2005 for Loud and Proud by doxygen 1.3.8