ScEng::StandardMaterial Class Reference

#include <standardmaterial.h>

Inheritance diagram for ScEng::StandardMaterial:

ScEng::Material ScEng::Block List of all members.

Public Types

enum  DATAID { ,
  id_opacity, id_specular_level, id_glossiness, id_soften,
  id_use_color_selfillum, id_mono_selfillum, id_diffuse_color, id_ambient_color,
  id_specular_color, id_selfillu_color
}
enum  SUBTEXTURES {
  ID_AMBIENT = 0, ID_DIFFUSE = 1, ID_SPECULAR = 2, ID_GLOSSINESS = 3,
  ID_SPECULARLEVEL = 4, ID_SELFILLU = 5, ID_OPACITY = 6, ID_FILTERCOLOR = 7,
  ID_BUMP = 8, ID_REFLECTION = 9, ID_REFRACTION = 10, ID_DISPLACEMENT = 11,
  ID_NUM_MAPS = 12
}
enum  DEPENDENCIES { DATA_TABLE_DEPENDENCY = 12, NUM_DEPENDENCIES = 13 }

Public Member Functions

 StandardMaterial (bool create_dependencies)
std::string GetClassName ()
BlockType GetBlockType ()
 Virtual function.
int NumDependencies ()
void SetDependency (int i, Block *dependency)
BlockGetDependency (int i)
std::string GetDependencyName (int i)
 Gets the name for the specified dependency.
unsigned int GetDependencyType (int i)
std::string GetName ()
 Returns the name of the material.
void SetName (std::string new_name)
 Sets the name for this material.
void SetNumSubMaterials (int num)
 This Material has no sub-materials.
int GetNumSubMaterials ()
MaterialGetSubMaterial (int i)
void SetSubMaterial (int i, Material *material)
 This Material has no sub-materials.
void SetNumSubTextures (int num)
 Please add comments here.
int GetNumSubTextures ()
TextureGetSubTexture (int i)
void SetSubTexture (int id, Texture *texture)
void SetShaderType (unsigned int type)
unsigned int GetShaderType ()
 Returns the current shader type.
float GetSubTextureIntensity (int id)
 Returns the intensity for the specified sub-texture.
void SetSubTextureIntensity (int id, float value)
 Sets the intensity for the specified sub-texture.
GMT::Color GetAmbientColor (int t)
 Returns the ambient color.
GMT::Color GetDiffuseColor (int t)
 Returns the diffuse color.
GMT::Color GetSpecularColor (int t)
 Returns the specular color.
GMT::Color GetSelfIlluminationColor (int t)
 Returns the self illumination color.
bool GetDoubleSided (int t)
 Returns if the material is or not double sided.
float GetOpacity (int t)
 Returns the opacity value for this material.
float GetSpecularLevel (int t)
 Returns the specular level for this material.
float GetSoften (int t)
 Returns the soften value for this material.
int GetUseColorSelfIllum (int t)
 Returns if the material uses or not the self color illumination.
float GetMonoSelfIllum (int t)
 Returns the mono self illumination color.
float GetGlossiness (int t)
 Returns the glossiness value for this material.
void SetSelfIlluminationColor (GMT::Color color_selfillum_val, int t)
 Sets the self illumination color.
void SetDoubleSided (bool double_sided_val, int t)
 Sets if this material is or not doble sided.
void SetSpecularLevel (float specular_level_val, int t)
 Sets the specular color for this material.
void SetGlossiness (float glossiness_val, int t)
 Sets the glossiness value for this material.
void SetSoften (float soften_val, int t)
 Sets the soften value for this material.
void SetAmbientColor (GMT::Color color_ambient_val, int t)
 Sets the ambient color.
void SetDiffuseColor (GMT::Color color_diffuse_val, int t)
 Sets the diffuse color.
void SetSpecularColor (GMT::Color color_specular_val, int t)
 Sets the specular color.
void SetOpacity (float opacity_val, int t)
 Sets the opacity value for this material.
void SetUseColorSelfIllum (int use_color_selfillum_val, int t)
 Sets if the material uses or not the self illumination color.
void SetMonoSelfIllum (float mono_selfillum_val, int t)
 Sets the mono self illumination value.
int GetNumDataTables ()
DataTableGetDataTable (int id=0)
 Returns the DataTable for this class.
void SetDataTable (DataTable *d, int i=0)
 Sets the i_th data table.
void UpdateDataTable (int id=0)
 Updates the indexes for the DataTable.
BlockClone ()
int Save (SceneSave *scene_save)
 Saves the info for this class.
int Load (SceneLoad *scene_load)
 Loads the info for this class.
void DeleteThis ()
 Deletes this class.
void ActionBegin (int time, int action)
void ActionEnd (int time, int action)
void Update (int time)
void Shade (DifferentialGeometry &dg)
 Virtual function.

Public Attributes

DataTabledt
 The DataTable to hold the info for this class.
Texturesub_textures [ID_NUM_MAPS]
 The array to hold the sub-textures.
float sub_textures_intensity [ID_NUM_MAPS]
 The array to hold the sub-textures intensity.

Static Public Attributes

static BlockType block_type

Detailed Description

Describes the standard Material Please add comments here


Member Enumeration Documentation

enum ScEng::StandardMaterial::DATAID

Enum DATAID Enums the Ids for the differents Data used for the material

Enumerator:
id_opacity  <The id for the double sided value in the DataTable
id_specular_level  <The id for the opacity in the DataTable
id_glossiness  <The id for the specular level in the DataTable
id_soften  <The id for the glossiness in the DataTable
id_use_color_selfillum  <The id for the soften in the DataTable
id_mono_selfillum  <The id for the use color self illumination in the DataTable
id_diffuse_color  <The id for the mono self illumination in the DataTable
id_ambient_color  <The id for the diffuse color in the DataTable
id_specular_color  <The id for the ambient color in the DataTable
id_selfillu_color  <The id for the self illumination color in the DataTable

enum ScEng::StandardMaterial::SUBTEXTURES

Enum SubTextures Enums the possible sub-textures for this material

Enumerator:
ID_AMBIENT  The ambient sub-texture
ID_DIFFUSE  The diffuse sub-texture
ID_SPECULAR  The specular sub-texture
ID_GLOSSINESS  The glossiness sub-texture
ID_SPECULARLEVEL  The specular level sub-texture
ID_SELFILLU  The self illumination sub-texture
ID_OPACITY  The opacity sub-texture
ID_FILTERCOLOR  The filter color sub-texture
ID_BUMP  The bump sub-texture
ID_REFLECTION  The reflection sub-texture
ID_REFRACTION  The refraction sub-texture
ID_DISPLACEMENT  The displacement sub-texture
ID_NUM_MAPS  The total number of possible maps

enum ScEng::StandardMaterial::DEPENDENCIES

Enum DEPENDENCIES Enums the chunks used for this class

Enumerator:
DATA_TABLE_DEPENDENCY  The dependency to the DataTable
NUM_DEPENDENCIES  The total number of dependencies. 12 textures + 1 DataTable


Constructor & Destructor Documentation

ScEng::StandardMaterial::StandardMaterial ( bool  create_dependencies  ) 

Constructor Sets all the sub-textures to NULL


Member Function Documentation

std::string ScEng::StandardMaterial::GetClassName (  )  [virtual]

Returns the name for this class

Returns:
Returns "StandardMaterial"

Implements ScEng::Block.

int ScEng::StandardMaterial::NumDependencies (  )  [virtual]

Returns the number of Dependencies for this class

Returns:
Returns ID_NUM_MAPS
See also:
enum SUBTEXTURES

Implements ScEng::Block.

void ScEng::StandardMaterial::SetDependency ( int  i,
Block dependency 
) [virtual]

Sets a Dependency Sets the specified sub-texture.

Parameters:
id the ID for the sub-texture. Must be one of the values defined in the SUBTEXTURES enum.
dependency the dependency
See also:
enum SUBTEXTURES

Implements ScEng::Block.

Block * ScEng::StandardMaterial::GetDependency ( int  i  )  [virtual]

Returns the specified dependency

Parameters:
id the ID for the sub-texture. Must be one of the values defined in the SUBTEXTURES enum.
Returns:
If the ID is correct returns the correspondent sub-texture. If not returns NULL

Implements ScEng::Block.

unsigned int ScEng::StandardMaterial::GetDependencyType ( int  i  )  [virtual]

Returns the type of the i-th dependency of this block.

Returns:
The type of the dependency. This is the type defined in BlockType::type.
See also:
BlockType

Reimplemented from ScEng::Block.

int ScEng::StandardMaterial::GetNumSubMaterials (  )  [virtual]

This Material has no sub-materials

Returns:
Returns 0

Implements ScEng::Material.

Material * ScEng::StandardMaterial::GetSubMaterial ( int  i  )  [virtual]

This Material has no sub-materials

Returns:
Returns NULL

Implements ScEng::Material.

int ScEng::StandardMaterial::GetNumSubTextures (  )  [virtual]

Returns the number of sub-textures for this material

Returns:
Returns ID_NUM_MAPS
See also:
enum SUBTEXTURES

Implements ScEng::Material.

Texture * ScEng::StandardMaterial::GetSubTexture ( int  i  )  [virtual]

Returns the specified sub-texture param i the ID for the sub-texture. Must be one of the values defined in the SUBTEXTURES enum. return If the ID is correct returns the correspondent sub-texture. If not returns NULL

Implements ScEng::Material.

void ScEng::StandardMaterial::SetSubTexture ( int  id,
Texture texture 
) [virtual]

Sets the specified sub-texture Sets the sub-texture using MakeDependencyByID

Parameters:
id the ID for the sub-texture. Must be one of the values defined in the SUBTEXTURES enum.
texture the Texture to be dependency
See also:
enum SUBTEXTURES

ScEng::Block::MakeDependencyByID

Implements ScEng::Material.

void ScEng::StandardMaterial::SetShaderType ( unsigned int  type  ) 

Sets the shader type to the specified type

See also:

int ScEng::StandardMaterial::GetNumDataTables (  )  [virtual]

Returns the number of DataTables used for this class

Returns:
Returns 1

Reimplemented from ScEng::Block.

Block * ScEng::StandardMaterial::Clone (  )  [virtual]

Creates a copy of this object and return it. The caller of this function is responsible to add this block to the DAG or to delete it.

Implements ScEng::Block.

void ScEng::StandardMaterial::ActionBegin ( int  time,
int  action 
) [inline, virtual]

Informs the block that an action will begin

Parameters:
time the time at which the action begins. more details about the action, for example, it can be a RENDER_ACTION, or a SAVE_ACTION.

Reimplemented from ScEng::Block.

void ScEng::StandardMaterial::ActionEnd ( int  time,
int  action 
) [inline, virtual]

Informs the block that an action will end.

Parameters:
time the time at which the action ends. more details about the action, for example, it can be a RENDER_ACTION, or a SAVE_ACTION.

Reimplemented from ScEng::Block.

void ScEng::StandardMaterial::Update ( int  time  )  [virtual]

Informs the block that it needs to update its data. For example, texture and material blocks usually move all their animated parameters from the data_table to int or float variables. This is specially useful when rendering, so there is no need to interpolate a data_value every time.

Parameters:
time the time at which the block needs to update its data.

Reimplemented from ScEng::Block.


Member Data Documentation

BlockType ScEng::StandardMaterial::block_type [static]

The type of this block BlockType StandardMaterial::block_type( BlockType::MATERIAL, 0x00300000, 0x00000010 );


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 10:49:23 2007 for SceneEngine by  doxygen 1.5.1-p1