Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

Material Class Reference

#include <material.h>

Inheritance diagram for Material:

Inheritance graph
[legend]
Collaboration diagram for Material:

Collaboration graph
[legend]
List of all members.

Detailed Description

Material abstraction.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Types

enum  TEXTURELAYERFLAG { NOFLAGS = 0x0000, MULTIPASS = 0x0001 }
 Texture layer flags. More...

enum  TEXTUREADDRESSMODE {
  WRAP = 0x00000000, WRAP_U = 0x00000000, WRAP_V = 0x00000000, WRAP_W = 0x00000000,
  CLAMP = 0x00001111, CLAMP_U = 0x00000001, CLAMP_V = 0x00000010, CLAMP_W = 0x00000100
}
 Texture addressing modes To set texture addressing modes, set the wrap to either WRAP or CLAMP for all coordinates, or use WRAP_x or CLAMP_x combinations for detailed control. Default is WRAP for all dimensions. More...

enum  TEXCOORDGENERATION { NOGEN = 0, REFLECTION = 1, NORMAL = 2 }
 Automatic texture coordinate generation. More...


Public Member Functions

 Material (const HashString &rstrName, MaterialTable *pkTable=0)
 Material (const Material &rkMaterial, MaterialTable *pkTable=0)
virtual ~Material ()
void SetName (const std::string &rstrName)
const HashStringGetName () const
void SetTable (MaterialTable *pkTable)
const Materialoperator= (const Material &rkMaterial)
void IncRef ()
void DecRef ()
int GetRefCount () const

Static Public Member Functions

unsigned int GetFlagFromString (const std::string &rstrIdentifier)

Public Attributes

Color m_kAmbient
Color m_kDiffuse
Color m_kSpecular
Color m_kEmission
float m_fShininess
ZBufferMode m_kZBufferMode
bool m_bDynamicShadows
ProgramPtr m_pkVertexProgram
ProgramPtr m_pkFragmentProgram
std::vector< TextureLayer * > m_vpkTextureLayers
unsigned int m_uiMaxLights
BlendMode m_kBlendMode
TexturePtr m_pkTexture
unsigned int m_uiUVLayer
unsigned int m_uiUVAddress
std::vector< TextureMatrixGen * > m_vpkTexMatrixGen
unsigned int m_uiLayerFlags
TEXCOORDGENERATION m_eTexCoordGen

Protected Attributes

HashString m_strName
MaterialTablem_pkTable


Member Enumeration Documentation

enum TEXTURELAYERFLAG [inherited]
 

Texture layer flags.

Enumeration values:
NOFLAGS  Default rendering mode
MULTIPASS  Force multipass rendering

enum TEXTUREADDRESSMODE [inherited]
 

Texture addressing modes To set texture addressing modes, set the wrap to either WRAP or CLAMP for all coordinates, or use WRAP_x or CLAMP_x combinations for detailed control. Default is WRAP for all dimensions.

Enumeration values:
WRAP  Wrap all coordinates
WRAP_U  Wrap U coordinates
WRAP_V  Wrap V coordinates
WRAP_W  Wrap V coordinates
CLAMP  Clamp all coordinates
CLAMP_U  Clamp U coordinates
CLAMP_V  Clamp V coordinates
CLAMP_W  Clamp W coordinates

enum TEXCOORDGENERATION [inherited]
 

Automatic texture coordinate generation.

Enumeration values:
NOGEN  No special texcoord generator
REFLECTION  Reflection vector
NORMAL  Normal vector


Constructor & Destructor Documentation

Material const HashString rstrName,
MaterialTable pkTable = 0
 

Parameters:
rstrName Name
pkTable Material table

Material const Material rkMaterial,
MaterialTable pkTable = 0
 

Copy data

Parameters:
rkMaterial Reference material to copy
pkTable Material table

virtual ~Material  )  [virtual]
 

Delete data


Member Function Documentation

void SetName const std::string &  rstrName  ) 
 

Parameters:
rstrName New name

const HashString& GetName  )  const [inline]
 

Returns:
Name

void SetTable MaterialTable pkTable  ) 
 

Add material to table

Parameters:
pkTable New material table

const Material& operator= const Material rkMaterial  ) 
 

Assignment

Parameters:
rkMaterial Material to copy values from
Returns:
const Material ref (*this)

void IncRef  )  [inline, inherited]
 

Increase reference count

void DecRef  )  [inline, inherited]
 

Decrease reference count and garbage collect if 0

int GetRefCount  )  const [inline, inherited]
 

Returns:
Current reference count

unsigned int GetFlagFromString const std::string &  rstrIdentifier  )  [static, inherited]
 

Returns:
Layer flag string identifier as integer matching define


Member Data Documentation

HashString m_strName [protected]
 

Name

MaterialTable* m_pkTable [protected]
 

Table

Color m_kAmbient
 

Ambient color, only used in vertex-lighting path

Color m_kDiffuse
 

Diffuse color, only used in vertex-lighting path

Color m_kSpecular
 

Specular color, only used in vertex-lighting path

Color m_kEmission
 

Emission color, only used in vertex-lighting path

float m_fShininess
 

Shininess, only used in vertex-lighting path (range [0..1])

ZBufferMode m_kZBufferMode
 

Z buffer mode

bool m_bDynamicShadows
 

Object should cast dynamic shadows

ProgramPtr m_pkVertexProgram
 

Vertex program

ProgramPtr m_pkFragmentProgram
 

Fragment program

std::vector< TextureLayer* > m_vpkTextureLayers
 

Texture layers

unsigned int m_uiMaxLights
 

Number of lights this material can handle in one pass, 0 for infinite

BlendMode m_kBlendMode [inherited]
 

Blend mode

TexturePtr m_pkTexture [inherited]
 

Texture object

unsigned int m_uiUVLayer [inherited]
 

UV layer to use, 0 to indicate base layer

unsigned int m_uiUVAddress [inherited]
 

Texture addressing mode

std::vector< TextureMatrixGen* > m_vpkTexMatrixGen [inherited]
 

Texture matrix generators

unsigned int m_uiLayerFlags [inherited]
 

Flags

TEXCOORDGENERATION m_eTexCoordGen [inherited]
 

Texture coord generation


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:12 2004 for NeoEngine by doxygen 1.3.5