net.dzzd.access
Interface IMaterial

All Superinterfaces:
IMonitoredSceneObject, ISceneObject

public interface IMaterial
extends ISceneObject

Used for accessing to a Material.

Material specify the appareance of a Face3D.


Available implemented features are :
- ambiant color - diffuse color - specular color - specular power - specular level - diffuse color and/or alpha texture. - diffuse light detail texture. - global alpha.

Since:
1.0
Version:
1.0, 01/01/04
Author:
Bruno Augier
See Also:
IMaterial, ITexture

Method Summary
 boolean getAlphaEnabled()
          Gets alpha flag.
 int getAlphaLevel()
          Gets alpha level value. 0=opaque Higher value make the object more transparent. 255=invisible Higher value increment the glosiness.
 int getAmbientColor()
          Gets ambient color as an 24bit int using the following bitmask RRGGBB.
 ITexture getBumpNormalTexture()
          Gets Texture to use for bump
 int getDiffuseColor()
          Gets diffuse color as an 24bit int using the following bitmask RRGGBB.
 ITexture getDiffuseTexture()
          Gets Texture to use for diffuse color texture.
 ITexture getDiffuseTextureDetail()
          Gets Texture to use for diffuse light detail texture.
 int getDiffuseTextureDetailFactor()
          Gets detail texture factor.
 int getEmissiveColor()
          Gets emissive color as an 24bit int using the following bitmask RRGGBB.
 ITexture getEnvTexture()
          Gets Texture to use for environment
 IMappingUV getMappingUV()
          Gets MappingUV to use for diffuse texture color and diffuse light detail texture.
 int getSelfIlluminationLevel()
          Gets self illumination level in unit .
 int getSpecularColor()
          Gets specular color as an 24bit int using the following bitmask RRGGBB.
 int getSpecularLevel()
          Gets specular level in unit : 255 <=> 100% .
 int getSpecularPower()
          Gets specular power.
 boolean isUsingAlpha()
          Gets a flag that indicate if this Material use alpha channel.
 void setAlphaEnabled(boolean alphaEnabled)
          Sets alpha flag.
 void setAlphaLevel(int alpha)
          Sets alpha level value. 0=opaque Higher value make the object more transparent. 255=invisible Higher value increment the glosiness.
 void setAmbientColor(int color)
          Sets ambient color as an 24bit int using the following bitmask RRGGBB.
 void setBumpNormalTexture(ITexture texture)
          Sets Texture to use for bump
 void setDiffuseColor(int color)
          Sets diffuse color as an 24bit int using the following bitmask RRGGBB.
 void setDiffuseTexture(ITexture texture)
          Sets Texture to use for diffuse color texture.
 void setDiffuseTextureDetail(ITexture texture)
          Sets Texture to use for diffuse light detail texture.
 void setDiffuseTextureDetailFactor(int diffuseTextureDetailFactor)
          Sets detail texture factor.
 void setEmissiveColor(int color)
          Sets emissive color as an 24bit int using the following bitmask RRGGBB.
 void setEnvTexture(ITexture texture)
          Sets Texture to use for environment
 void setMappingUV(IMappingUV mapping)
          Sets MappingUV to use for diffuse texture color and diffuse light detail texture.
 void setSelfIlluminationLevel(int level)
          Sets self illumination level in unit .
 void setSpecularColor(int color)
          Sets specualar color as an 24bit int using the following bitmask RRGGBB.
 void setSpecularLevel(int level)
          Sets specular level in unit : 255 <=> 100% .
 void setSpecularPower(int power)
          Sets specular power.
 
Methods inherited from interface net.dzzd.access.ISceneObject
build, clearProperties, copy, getBuild, getId, getName, getProperty, getScene, setBuild, setId, setName, setProperty
 
Methods inherited from interface net.dzzd.access.IMonitoredSceneObject
copy
 

Method Detail

getMappingUV

public IMappingUV getMappingUV()
Gets MappingUV to use for diffuse texture color and diffuse light detail texture.

Returns:
current MappingUV or null if none

setMappingUV

public void setMappingUV(IMappingUV mapping)
Sets MappingUV to use for diffuse texture color and diffuse light detail texture.

Parameters:
mapping - new MappingUV or null to remove

getAmbientColor

public int getAmbientColor()
Gets ambient color as an 24bit int using the following bitmask RRGGBB.

Returns:
color.

getDiffuseColor

public int getDiffuseColor()
Gets diffuse color as an 24bit int using the following bitmask RRGGBB.

Returns:
color.

getEmissiveColor

public int getEmissiveColor()
Gets emissive color as an 24bit int using the following bitmask RRGGBB.

Returns:
color.

getSelfIlluminationLevel

public int getSelfIlluminationLevel()
Gets self illumination level in unit .

Returns:
self illumination level.

getSpecularColor

public int getSpecularColor()
Gets specular color as an 24bit int using the following bitmask RRGGBB.

Returns:
color.

getSpecularLevel

public int getSpecularLevel()
Gets specular level in unit : 255 <=> 100% . You can use value greater than 255 to make an object looking very bright.

Returns:
color.

getSpecularPower

public int getSpecularPower()
Gets specular power. Higher value increment the glosiness.

Returns:
color.

getAlphaLevel

public int getAlphaLevel()
Gets alpha level value. 0=opaque Higher value make the object more transparent. 255=invisible Higher value increment the glosiness.

Returns:
color.

setAmbientColor

public void setAmbientColor(int color)
Sets ambient color as an 24bit int using the following bitmask RRGGBB.

Parameters:
color - new color.

setDiffuseColor

public void setDiffuseColor(int color)
Sets diffuse color as an 24bit int using the following bitmask RRGGBB.

Parameters:
color - new color.

setEmissiveColor

public void setEmissiveColor(int color)
Sets emissive color as an 24bit int using the following bitmask RRGGBB.

Parameters:
color - new color.

setSelfIlluminationLevel

public void setSelfIlluminationLevel(int level)
Sets self illumination level in unit .

Parameters:
level - new level.

setSpecularColor

public void setSpecularColor(int color)
Sets specualar color as an 24bit int using the following bitmask RRGGBB.

Parameters:
color - new color.

setSpecularLevel

public void setSpecularLevel(int level)
Sets specular level in unit : 255 <=> 100% . You can use value greater than 255 to make an object looking very bright.

Parameters:
level - new level.

setSpecularPower

public void setSpecularPower(int power)
Sets specular power. Higher value increment the glosiness.

Parameters:
power - new power.

setAlphaLevel

public void setAlphaLevel(int alpha)
Sets alpha level value. 0=opaque Higher value make the object more transparent. 255=invisible Higher value increment the glosiness.

Parameters:
alpha - new alpha value.

getAlphaEnabled

public boolean getAlphaEnabled()
Gets alpha flag.

Returns:
true if this object must use alpha.

setAlphaEnabled

public void setAlphaEnabled(boolean alphaEnabled)
Sets alpha flag.


isUsingAlpha

public boolean isUsingAlpha()
Gets a flag that indicate if this Material use alpha channel.
If this Material has no alpha map or an alpha level==0 than this will return false even if setAlphaEnable has been called with true

Returns:
flag true if this material should be rendered with alpha.

getDiffuseTexture

public ITexture getDiffuseTexture()
Gets Texture to use for diffuse color texture.

Returns:
interface to access the Texture or null if none

getBumpNormalTexture

public ITexture getBumpNormalTexture()
Gets Texture to use for bump

Returns:
interface to access the Texture or null if none

getEnvTexture

public ITexture getEnvTexture()
Gets Texture to use for environment

Returns:
interface to access the Texture or null if none

getDiffuseTextureDetail

public ITexture getDiffuseTextureDetail()
Gets Texture to use for diffuse light detail texture.

Returns:
interface to access the Texture or null if none

setDiffuseTexture

public void setDiffuseTexture(ITexture texture)
Sets Texture to use for diffuse color texture.

Parameters:
texture - interface to access the Texture or null if none

setBumpNormalTexture

public void setBumpNormalTexture(ITexture texture)
Sets Texture to use for bump

Parameters:
texture - interface to access the Texture or null if none

setEnvTexture

public void setEnvTexture(ITexture texture)
Sets Texture to use for environment

Parameters:
texture - interface to access the Texture or null if none

setDiffuseTextureDetail

public void setDiffuseTextureDetail(ITexture texture)
Sets Texture to use for diffuse light detail texture.

Parameters:
texture - interface to access the Texture or null if none

setDiffuseTextureDetailFactor

public void setDiffuseTextureDetailFactor(int diffuseTextureDetailFactor)
Sets detail texture factor. When using a detail texture this factor will be used to scale mapping coordinate of the main texture.
negative value mean size decrease.
positive value mean size increase.
value must be given as ln2 factor:
- 2 mean detail texture is 4 times smaller than main texture.
- 1 mean detail texture is 2 times smaller than main texture.
0 mean same size
+ 1 mean detail texture is 2 times bigger than main texture.
+ 2 mean detail texture is 4 times bigger than main texture.

Values can range from -8(scale by 1/256) to +8(scale by 256)

Parameters:
diffuseTextureDetailFactor - new detail factor

getDiffuseTextureDetailFactor

public int getDiffuseTextureDetailFactor()
Gets detail texture factor. When using a detail texture this factor will be used to scale mapping coordinate of the main texture.
negative value mean size decrease.
positive value mean size increase.
value must be given as ln2 factor:
- 2 mean detail texture is 4 times smaller than main texture.
- 1 mean detail texture is 2 times smaller than main texture.
0 mean same size
+ 1 mean detail texture is 2 times bigger than main texture.
+ 2 mean detail texture is 4 times bigger than main texture.

Values can range from -8(scale by 1/256) to +8(scale by 256)

Returns:
detail factor