- Cal3D 0.9 API Reference -

Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

CalCoreMaterial Class Reference

The core material class. More...

#include <corematerial.h>

List of all members.

Public Methods

 CalCoreMaterial ()
 Constructs the core material instance. More...

virtual ~CalCoreMaterial ()
 Destructs the core model instance. More...

bool create ()
 Creates the core material instance. More...

void destroy ()
 Destroys the core material instance. More...

Color & getAmbientColor ()
 Returns the ambient color. More...

Color & getDiffuseColor ()
 Returns the diffuse color. More...

int getMapCount ()
 Returns the number of maps. More...

const std::string & getMapFilename (int mapId)
 Returns a specified map texture filename. More...

Cal::UserData getMapUserData (int mapId)
 Provides access to a specified map user data. More...

float getShininess ()
 Returns the shininess factor. More...

Color & getSpecularColor ()
 Returns the specular color. More...

Cal::UserData getUserData ()
 Provides access to the user data. More...

std::vector< Map > & getVectorMap ()
 Returns the map vector. More...

bool reserve (int mapCount)
 Reserves memory for the maps. More...

void setAmbientColor (const Color &ambientColor)
 Sets the ambient color. More...

void setDiffuseColor (const Color &diffuseColor)
 Sets the diffuse color. More...

bool setMap (int mapId, const Map &map)
 Sets a specified map. More...

bool setMapUserData (int mapId, Cal::UserData userData)
 Stores specified map user data. More...

void setShininess (float shininess)
 Sets the shininess factor. More...

void setSpecularColor (const Color &specularColor)
 Sets the specular color. More...

void setUserData (Cal::UserData userData)
 Stores user data. More...


Protected Attributes

Color m_ambientColor
Color m_diffuseColor
Color m_specularColor
float m_shininess
std::vector< Map > m_vectorMap
Cal::UserData m_userData


Detailed Description

The core material class.


Constructor & Destructor Documentation

CalCoreMaterial::CalCoreMaterial (    ) 
 

Constructs the core material instance.

This function is the default constructor of the core material instance.

CalCoreMaterial::~CalCoreMaterial (    )  [virtual]
 

Destructs the core model instance.

This function is the destructor of the core model instance.


Member Function Documentation

bool CalCoreMaterial::create (    ) 
 

Creates the core material instance.

This function creates the core material instance.

Returns:
One of the following values:
  • true if successful
  • false if an error happend

void CalCoreMaterial::destroy (    ) 
 

Destroys the core material instance.

This function destroys all data stored in the core material instance and frees all allocated memory.

CalCoreMaterial::Color & CalCoreMaterial::getAmbientColor (    ) 
 

Returns the ambient color.

This function returns the ambient color of the core material instance.

Returns:
A reference to the ambient color.

CalCoreMaterial::Color & CalCoreMaterial::getDiffuseColor (    ) 
 

Returns the diffuse color.

This function returns the diffuse color of the core material instance.

Returns:
A reference to the diffuse color.

int CalCoreMaterial::getMapCount (    ) 
 

Returns the number of maps.

This function returns the number of mapss in the core material instance.

Returns:
The number of maps.

const std::string & CalCoreMaterial::getMapFilename (  int    mapId ) 
 

Returns a specified map texture filename.

This function returns the texture filename for a specified map ID of the core material instance.

Parameters:
mapId  The ID of the map.
Returns:
One of the following values:
  • the filename of the map texture
  • an empty string if an error happend

Cal::UserData CalCoreMaterial::getMapUserData (  int    mapId ) 
 

Provides access to a specified map user data.

This function returns the user data stored in the specified map of the core material instance.

Parameters:
mapId  The ID of the map.
Returns:
One of the following values:
  • the user data stored in the specified map
  • 0 if an error happend

float CalCoreMaterial::getShininess (    ) 
 

Returns the shininess factor.

This function returns the shininess factor of the core material instance.

Returns:
The shininess factor.

CalCoreMaterial::Color & CalCoreMaterial::getSpecularColor (    ) 
 

Returns the specular color.

This function returns the specular color of the core material instance.

Returns:
A reference to the specular color.

Cal::UserData CalCoreMaterial::getUserData (    ) 
 

Provides access to the user data.

This function returns the user data stored in the core material instance.

Returns:
The user data stored in the core material instance.

std::vector< CalCoreMaterial::Map > & CalCoreMaterial::getVectorMap (    ) 
 

Returns the map vector.

This function returns the vector that contains all maps of the core material instance.

Returns:
A reference to the map vector.

bool CalCoreMaterial::reserve (  int    mapCount ) 
 

Reserves memory for the maps.

This function reserves memory for the maps of the core material instance.

Parameters:
mapCount  The number of maps that this core material instance should be able to hold.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

void CalCoreMaterial::setAmbientColor (  const Color &    ambientColor ) 
 

Sets the ambient color.

This function sets the ambient color of the core material instance.

Parameters:
ambientColor  The ambient color that should be set.

void CalCoreMaterial::setDiffuseColor (  const Color &    diffuseColor ) 
 

Sets the diffuse color.

This function sets the diffuse color of the core material instance.

Parameters:
ambientColor  The diffuse color that should be set.

bool CalCoreMaterial::setMap (  int    mapId,
const Map &    map
) 
 

Sets a specified map.

This function sets a specified map in the core material instance.

Parameters:
mapId  The ID of the map.
map  The map that should be set.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

bool CalCoreMaterial::setMapUserData (  int    mapId,
Cal::UserData    userData
) 
 

Stores specified map user data.

This function stores user data in a specified map of the core material instance.

Parameters:
mapId  The ID of the map.
userData  The user data that should be stored.
Returns:
One of the following values:
  • true if successful
  • false if an error happend

void CalCoreMaterial::setShininess (  float    shininess ) 
 

Sets the shininess factor.

This function sets the shininess factor of the core material instance.

Parameters:
shininess  The shininess factor that should be set.

void CalCoreMaterial::setSpecularColor (  const Color &    specularColor ) 
 

Sets the specular color.

This function sets the specular color of the core material instance.

Parameters:
ambientColor  The specular color that should be set.

void CalCoreMaterial::setUserData (  Cal::UserData    userData ) 
 

Stores user data.

This function stores user data in the core material instance.

Parameters:
userData  The user data that should be stored.


The documentation for this class was generated from the following files:
Generated at Sun Oct 12 18:38:49 2003 by The Cal3D Team with doxygen 1.2.14 © 1997-2001 Dimitri van Heesch