Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Class Members

Material Class Reference
[Scene Graph]

#include <lvt/Material.h>

Inheritance diagram for Material:

Inheritance graph
[legend]
List of all members.

Detailed Description

Sets material properties.

Use the Material class to specify material properties for use with the OpenGL lighting model. Some common material properties are provided with the MaterialType enum, which can be passed into the Material constructor, or set with a call to SetType.


Public Types

enum  MaterialType {
  CUSTOM = 0, BRASS, BRONZE, POLISHED_BRONZE,
  CHROME, COPPER, POLISHED_COPPER, GOLD,
  POLISHED_GOLD, PEWTER, SILVER, POLISHED_SILVER,
  EMERALD, JADE, OBSIDIAN, PEARL,
  RUBY, TURQUOISE, BLACK_PLASTIC, BLACK_RUBBER
}
 Pre-defined material types. More...

Public Member Functions

 Material (MaterialType type=CUSTOM)
 Constructs the new material using the specified material type.
virtual void Render ()
 Renders the object.
void SetFace (GLenum face)
 Sets which type of face (front-facing or back-facing) the Material applies to.
void SetShininess (float s)
 Sets the shininess of the material.
void SetType (MaterialType type)
 Sets the Material properties to that of the specified type.
void SetAmbient (float r, float g, float b, float a=1.0f)
 Sets the ambient component.
void SetAmbient (const Vec &v)
 Sets the ambient component.
void SetColor (float r, float g, float b, float a=1.0f)
 Sets the ambient, diffuse, and specular components.
void SetColor (const Vec &v)
 Sets the ambient, diffuse, and specular components.
void SetDiffuse (float r, float g, float b, float a=1.0f)
 Sets the diffuse component.
void SetDiffuse (const Vec &v)
 Sets the diffuse component.
void SetEmission (float r, float g, float b, float a=1.0f)
 Sets the emissive component.
void SetEmission (const Vec &v)
 Sets the emissive component.
void SetSpecular (float r, float g, float b, float a=1.0f)
 Sets the specular component.
void SetSpecular (const Vec &v)
 Sets the specular component.


Member Enumeration Documentation

enum MaterialType
 

Pre-defined material types.

Enumeration values:
CUSTOM  A custom material.
BRASS  Brass.
BRONZE  Bronze.
POLISHED_BRONZE  Polished Bronze.
CHROME  Chrome.
COPPER  Copper.
POLISHED_COPPER  Polished Copper.
GOLD  Gold.
POLISHED_GOLD  Polished Gold.
PEWTER  Pewter.
SILVER  Silver.
POLISHED_SILVER  Polished Silver.
EMERALD  Emerald.
JADE  Jade.
OBSIDIAN  Obsidian.
PEARL  Pearl.
RUBY  Ruby.
TURQUOISE  Turquoise.
BLACK_PLASTIC  Black Plastic.
BLACK_RUBBER  Black Rubber.


Constructor & Destructor Documentation

Material MaterialType  type = CUSTOM  ) 
 

Constructs the new material using the specified material type.

The custom material type (the default) corresponds to an ambient component of (0.2, 0.2, 0.2, 1.0), a diffuse component of (0.8, 0.8, 0.8, 1.0) and no specular component.


Member Function Documentation

virtual void Render  )  [virtual]
 

Renders the object.

Draws the object and/or modifies the OpenGL state appropriately.

Implements Node.

void SetAmbient float  r,
float  g,
float  b,
float  a = 1.0f
[inline]
 

Sets the ambient component.

void SetAmbient const Vec v  )  [inline]
 

Sets the ambient component.

void SetColor float  r,
float  g,
float  b,
float  a = 1.0f
[inline]
 

Sets the ambient, diffuse, and specular components.

void SetColor const Vec v  )  [inline]
 

Sets the ambient, diffuse, and specular components.

void SetDiffuse float  r,
float  g,
float  b,
float  a = 1.0f
[inline]
 

Sets the diffuse component.

void SetDiffuse const Vec v  )  [inline]
 

Sets the diffuse component.

void SetEmission float  r,
float  g,
float  b,
float  a = 1.0f
[inline]
 

Sets the emissive component.

void SetEmission const Vec v  )  [inline]
 

Sets the emissive component.

void SetFace GLenum  face  )  [inline]
 

Sets which type of face (front-facing or back-facing) the Material applies to.

Parameters:
face Either GL_FRONT (the default), GL_BACK, or GL_FRONT_AND_BACK

void SetShininess float  s  )  [inline]
 

Sets the shininess of the material.

void SetSpecular float  r,
float  g,
float  b,
float  a = 1.0f
[inline]
 

Sets the specular component.

void SetSpecular const Vec v  )  [inline]
 

Sets the specular component.

void SetType MaterialType  type  ) 
 

Sets the Material properties to that of the specified type.


Generated on Thu Feb 17 09:45:47 2005 for liblvt by  doxygen 1.4.1