j3d.org Code

org.j3d.loaders.ac3d
Class Ac3dMaterial

java.lang.Object
  extended by org.j3d.loaders.ac3d.Ac3dMaterial

public class Ac3dMaterial
extends java.lang.Object

Defines a model to represent the properties of a surface material in the AC3D file format.

Version:
$Revision: 1.4 $
Author:
Ryan Wilhm (ryan@entrophica.com)

Constructor Summary
Ac3dMaterial()
          Default constructor.
 
Method Summary
 void getAmbientColor(float[] rgb)
          Get the current ambient colour set.
 void getEmissiveColor(float[] rgb)
          Get the current emissive colour set.
 int getIndex()
          Get the index of this material in the file.
 java.lang.String getName()
          Get the currently set name.
 void getRGBColor(float[] rgb)
          Get the current base colour set.
 float getShininess()
          Get the shininess factor of the object.
 void getSpecularColor(float[] rgb)
          Get the current specular colour set.
 float getTransparency()
          Get the transparency amount.
 void setAmbientColor(float[] rgb)
          Set the ambient colour of this material.
 void setEmissiveColor(float[] rgb)
          Set the emissive colour of this material.
 void setIndex(int index)
          Set the index of this material in the file.
 void setName(java.lang.String name)
          Set the name of this material.
 void setRGBColor(float[] rgb)
          Set the base colour of this material.
 void setShininess(float factor)
          Set the shininess factor of the object.
 void setSpecularColor(float[] rgb)
          Set the specular colour of this material.
 void setTransparency(float trans)
          Set the transparency amount.
 java.lang.String toString()
          Provides a humantext string version of the current object state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Ac3dMaterial

public Ac3dMaterial()
Default constructor. Sets the internal state to initial values.

Method Detail

setName

public void setName(java.lang.String name)
Set the name of this material.

Parameters:
name - The new name to associate with this material

getName

public java.lang.String getName()
Get the currently set name. If the name is not set, will return an empty string.

Returns:
The current name of this material

setRGBColor

public void setRGBColor(float[] rgb)
Set the base colour of this material. Colour is a 3-component value.

Parameters:
rgb - The components of the colour to set in R, G, B order

getRGBColor

public void getRGBColor(float[] rgb)
Get the current base colour set.

Parameters:
rgb - An array of length 3 to cop the values in to.

setAmbientColor

public void setAmbientColor(float[] rgb)
Set the ambient colour of this material. Colour is a 3-component value.

Parameters:
rgb - The components of the colour to set in R, G, B order

getAmbientColor

public void getAmbientColor(float[] rgb)
Get the current ambient colour set.

Parameters:
rgb - An array of length 3 to cop the values in to.

setEmissiveColor

public void setEmissiveColor(float[] rgb)
Set the emissive colour of this material. Colour is a 3-component value.

Parameters:
rgb - The components of the colour to set in R, G, B order

getEmissiveColor

public void getEmissiveColor(float[] rgb)
Get the current emissive colour set.

Parameters:
rgb - An array of length 3 to cop the values in to.

setSpecularColor

public void setSpecularColor(float[] rgb)
Set the specular colour of this material. Colour is a 3-component value.

Parameters:
rgb - The components of the colour to set in R, G, B order

getSpecularColor

public void getSpecularColor(float[] rgb)
Get the current specular colour set.

Parameters:
rgb - An array of length 3 to cop the values in to.

setShininess

public void setShininess(float factor)
Set the shininess factor of the object. This should be a value that is greater than zero. The max value is unbounded.

Parameters:
factor - The shininess factor value

getShininess

public float getShininess()
Get the shininess factor of the object.

Returns:
The shininess factor value

setTransparency

public void setTransparency(float trans)
Set the transparency amount. 0 is completely opaque, 1 is completely see through.

Parameters:
trans - The value of transparency between 0 and 1

getTransparency

public float getTransparency()
Get the transparency amount. 0 is completely opaque, 1 is completely see through.

Returns:
The value of transparency between 0 and 1

setIndex

public void setIndex(int index)
Set the index of this material in the file.

Parameters:
index - A zero or positive number

getIndex

public int getIndex()
Get the index of this material in the file.

Returns:
The index of this material in the file

toString

public java.lang.String toString()
Provides a humantext string version of the current object state.

Overrides:
toString in class java.lang.Object
Returns:
The humantext stringification of the current object state.

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org