ScEng::MixTexture Class Reference

The MixTexture. Mixes two input textures using a float value, or a third mixing texture. More...

#include <mixtexture.h>

Inheritance diagram for ScEng::MixTexture:

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

Public Types

enum  DATAID
 Enum DATAID. More...
enum  DEPENDENCIES { DATA_TABLE_DEPENDENCY, COLOR1TEX_DEPENDENCY, COLOR2TEX_DEPENDENCY, MIXTEX_DEPENDENCY }
 Enum DEPENDENCIES. More...
enum  CHUNKS { NAME_CHUNKID = 0x00000005 }
 Enum CHUNKS. More...

Public Member Functions

 MixTexture (bool create_dependencies)
 Constructor.
std::string GetClassName ()
 Returns the name for this class.
void SetNumSubTextures (int num)
 Virtual function.
int GetNumSubTextures ()
 Virtual function.
TextureGetSubTexture (int i)
 Virtual function.
void SetSubTexture (int i, Texture *texture)
 Virtual function.
BlockType GetBlockType ()
 Virtual function.
int NumDependencies ()
 Returns the number of Dependencies for this class.
void SetDependency (int id, Block *dependency)
 Sets a Dependency.
BlockGetDependency (int i)
 Returns the specific dependency.
std::string GetDependencyName (int i)
 Gets the name for the specified dependency.
unsigned int GetDependencyType (int i)
BlockClone ()
 Creates a copy of this object and return it.
std::string GetName ()
 Return the name for this texture.
void SetName (std::string new_name)
 Sets the name for this texture.
int GetNumDataTables ()
 Return the number of DataTables.
DataTableGetDataTable (int id=0)
 Returns the DataTable.
void SetDataTable (DataTable *d, int i=0)
 Sets the i_th data table.
void UpdateDataTable (int id=0)
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)
GMT::AColor EvaluateColor (DifferentialGeometry &dg)
 Returns the color of the texture in the position specified by the differential geometry instance.
GMT::Point3F EvaluateBump (DifferentialGeometry &dg)
 Returns the normal perturbation produced by the texture in the position specified by the differential geometry instance.

Public Attributes

std::string name
 The name for this texture.
Texturecolor_1_tex
 The first color texture.
Texturecolor_2_tex
 The second color texture.
Texturemix_tex
 The mixing texture. Only its mono output is used to mix the color textures.
DataTabledt
 The DataTable to hold the info for this class.

Static Public Attributes

static BlockType block_type

Detailed Description

The MixTexture. Mixes two input textures using a float value, or a third mixing texture.


Member Enumeration Documentation

enum ScEng::MixTexture::DATAID

Enum DATAID.

Enums the Ids for the differents Data used for the MixTexture

enum ScEng::MixTexture::DEPENDENCIES

Enum DEPENDENCIES.

Enums the chunks used for this class

Enumerator:
DATA_TABLE_DEPENDENCY  The dependency to the data table
COLOR1TEX_DEPENDENCY  Color1 Texture dependency
COLOR2TEX_DEPENDENCY  Color2 Texture dependency
MIXTEX_DEPENDENCY  MIX Texture dependency

enum ScEng::MixTexture::CHUNKS

Enum CHUNKS.

Enums the differents types of dependency for this class

Enumerator:
NAME_CHUNKID  Name chunk


Member Function Documentation

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

Returns the name for this class.

Returns:
Returns "MixTexture"

Implements ScEng::Block.

void ScEng::MixTexture::SetDependency ( int  id,
Block dependency 
) [virtual]

Sets a Dependency.

Parameters:
id the id for the dependency
dependency the dependency

Implements ScEng::Block.

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

Returns the type of the specified dependency. Although our dependency is a BlockVector, we return BlockType::TEXTURE so the scripts can know what type of blocks this BlockVector uses.

Reimplemented from ScEng::Block.

Block * ScEng::MixTexture::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::MixTexture::UpdateDataTable ( int  id = 0  )  [virtual]

Updates the data table. This fills the name variables in the data table so it can be used properly. This function is called after a scene is loaded and each block must call it after its data_table has been built or set.

Reimplemented from ScEng::Block.

void ScEng::MixTexture::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::MixTexture::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::MixTexture::Update ( int  time  )  [inline, 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::MixTexture::block_type [static]

The type of this block BlockType MaskTexture::block_type( BlockType::TEXTURE, 0x00500000,0x00000010 );

Texture* ScEng::MixTexture::color_1_tex

The first color texture.

Texture* ScEng::MixTexture::color_2_tex

The second color texture.

Texture* ScEng::MixTexture::mix_tex

The mixing texture. Only its mono output is used to mix the color textures.


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