org.jagatoo.loaders.models.cal3d.core
Class CalCoreMaterial

java.lang.Object
  extended by org.jagatoo.loaders.models.cal3d.core.CalCoreMaterial

public class CalCoreMaterial
extends java.lang.Object

The core material class.


Nested Class Summary
static class CalCoreMaterial.Map
           
 
Field Summary
protected  org.openmali.vecmath2.Colorf ambientColor
           
protected  org.openmali.vecmath2.Colorf diffuseColor
           
protected  CalCoreMaterial.Map[] maps
           
protected  java.lang.String name
           
protected  float shininess
           
protected  org.openmali.vecmath2.Colorf specularColor
           
protected  java.lang.Object userData
           
 
Constructor Summary
CalCoreMaterial()
          Constructs the core material instance.
 
Method Summary
 org.openmali.vecmath2.Colorf getAmbientColor()
          Returns the ambient color.
 java.net.URL getBaseURL()
           
 org.openmali.vecmath2.Colorf getDiffuseColor()
          Returns the diffuse color.
 int getMapCount()
          Returns the number of maps.
 java.lang.String getMapFilename(int mapId)
          Returns a specified map texture filename.
 CalCoreMaterial.Map[] getMaps()
          Returns the map vector.
 java.lang.Object getMapUserData(int mapId)
          Provides access to a specified map user data.
 java.lang.String getName()
          Gets the material resource name.
 float getShininess()
          Returns the shininess factor.
 org.openmali.vecmath2.Colorf getSpecularColor()
          Returns the specular color.
 java.lang.Object getUserData()
          Provides access to the user data.
 void reserve(int mapCount)
          Reserves memory for the maps.
 void setAmbientColor(org.openmali.vecmath2.Colorf ambientColor)
          Sets the ambient color.
 void setBaseURL(java.net.URL baseURL)
           
 void setDiffuseColor(org.openmali.vecmath2.Colorf diffuseColor)
          Sets the diffuse color.
 void setMap(int mapId, CalCoreMaterial.Map map)
          Sets a specified map.
 void setMaps(CalCoreMaterial.Map[] maps)
           
 void setMapUserData(int mapId, java.lang.Object userData)
          Stores specified map user data.
 void setName(java.lang.String name)
          Sets the material resource name.
 void setShininess(float shininess)
          Sets the shininess factor.
 void setSpecularColor(org.openmali.vecmath2.Colorf specularColor)
          Sets the specular color.
 void setUserData(java.lang.Object userData)
          Stores user data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

ambientColor

protected org.openmali.vecmath2.Colorf ambientColor

diffuseColor

protected org.openmali.vecmath2.Colorf diffuseColor

specularColor

protected org.openmali.vecmath2.Colorf specularColor

shininess

protected float shininess

maps

protected CalCoreMaterial.Map[] maps

userData

protected java.lang.Object userData
Constructor Detail

CalCoreMaterial

public CalCoreMaterial()
Constructs the core material instance. This function is the default constructor of the core material instance.

Method Detail

getAmbientColor

public org.openmali.vecmath2.Colorf getAmbientColor()
Returns the ambient color. This function returns the ambient color of the core material instance.

Returns:
A reference to the ambient color.

getDiffuseColor

public org.openmali.vecmath2.Colorf getDiffuseColor()
Returns the diffuse color. This function returns the diffuse color of the core material instance.

Returns:
A reference to the diffuse color.

getMapCount

public int getMapCount()
Returns the number of maps. This function returns the number of mapss in the core material instance.

Returns:
The number of maps.

getMapFilename

public java.lang.String 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: \li the filename of the map texture \li an empty string if an error happend

getMapUserData

public java.lang.Object 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: \li the user data stored in the specified map \li \b 0 if an error happend

getShininess

public float getShininess()
Returns the shininess factor. This function returns the shininess factor of the core material instance.

Returns:
The shininess factor.

getSpecularColor

public org.openmali.vecmath2.Colorf getSpecularColor()
Returns the specular color. This function returns the specular color of the core material instance.

Returns:
A reference to the specular color.

getUserData

public java.lang.Object 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.

setMaps

public void setMaps(CalCoreMaterial.Map[] maps)

getMaps

public CalCoreMaterial.Map[] getMaps()
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.

reserve

public void 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.

setAmbientColor

public void setAmbientColor(org.openmali.vecmath2.Colorf 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.

setDiffuseColor

public void setDiffuseColor(org.openmali.vecmath2.Colorf diffuseColor)
Sets the diffuse color. This function sets the diffuse color of the core material instance.

Parameters:
diffuseColor - The diffuse color that should be set.

setMap

public void setMap(int mapId,
                   CalCoreMaterial.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.

setMapUserData

public void setMapUserData(int mapId,
                           java.lang.Object 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.

setShininess

public void 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.

setSpecularColor

public void setSpecularColor(org.openmali.vecmath2.Colorf specularColor)
Sets the specular color. This function sets the specular color of the core material instance.

Parameters:
specularColor - The specular color that should be set.

setUserData

public void setUserData(java.lang.Object userData)
Stores user data. This function stores user data in the core material instance.

Parameters:
userData - The user data that should be stored.

getName

public java.lang.String getName()
Gets the material resource name.


setName

public void setName(java.lang.String name)
Sets the material resource name.


setBaseURL

public void setBaseURL(java.net.URL baseURL)

getBaseURL

public java.net.URL getBaseURL()