|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xith3d.scenegraph.SceneGraphObject
org.xith3d.scenegraph.NodeComponent
org.xith3d.scenegraph.Material
public class Material
The Material object defines the appearance of an object under illumination. If the Material object in an Appearance object is null, lighting is disabled for all nodes that use that Appearance object. The properties that can be set for a Material object are:
| Field Summary | |
|---|---|
static org.jagatoo.opengl.enums.ColorTarget |
AMBIENT
|
static org.jagatoo.opengl.enums.ColorTarget |
AMBIENT_AND_DIFFUSE
|
static org.jagatoo.opengl.enums.ColorTarget |
DIFFUSE
|
static org.jagatoo.opengl.enums.ColorTarget |
EMISSIVE
|
static org.jagatoo.opengl.enums.ColorTarget |
NONE
|
static org.jagatoo.opengl.enums.ColorTarget |
SPECULAR
|
| Fields inherited from class org.xith3d.scenegraph.SceneGraphObject |
|---|
XITH3D_USERDATAKEY_OLDUSERDATA |
| Constructor Summary | |
|---|---|
Material()
Constructs a new Material object with default values. |
|
Material(boolean lightEnabled)
Constructs a new Material object with lighting enabled or not. |
|
Material(boolean lightEnabled,
float shininess)
Constructs a new Material object with light enabled or not and setting the shininess value. |
|
Material(org.openmali.vecmath2.Colorf ambientColor,
org.openmali.vecmath2.Colorf emissiveColor,
org.openmali.vecmath2.Colorf diffuseColor,
org.openmali.vecmath2.Colorf specularColor,
float shininess)
Constructs a new Material object setting the ambient, emissive, diffuse and specular colors at the same time. |
|
Material(org.openmali.vecmath2.Colorf ambientColor,
org.openmali.vecmath2.Colorf emissiveColor,
org.openmali.vecmath2.Colorf diffuseColor,
org.openmali.vecmath2.Colorf specularColor,
float shininess,
boolean lightingEnabled)
Constructs a new Material object setting the ambient, emissive, diffuse and specular colors at the same time. |
|
Material(org.openmali.vecmath2.Colorf ambientColor,
org.openmali.vecmath2.Colorf emissiveColor,
org.openmali.vecmath2.Colorf diffuseColor,
org.openmali.vecmath2.Colorf specularColor,
float shininess,
org.jagatoo.opengl.enums.ColorTarget colorTarget,
boolean lightingEnabled)
Constructs a new Material object setting the ambient, emissive, diffuse and specular colors at the same time. |
|
Material(org.openmali.vecmath2.Colorf ambientColor,
org.openmali.vecmath2.Colorf emissiveColor,
org.openmali.vecmath2.Colorf diffuseColor,
org.openmali.vecmath2.Colorf specularColor,
float shininess,
org.jagatoo.opengl.enums.ColorTarget colorTarget,
boolean normalizeNormals,
boolean lightingEnabled)
Constructs a new Material object setting the ambient, emissive, diffuse and specular colors at the same time. |
|
Material(float shininess)
Constructs a new Material object and also setting the shininess value. |
|
| Method Summary | |
|---|---|
Material |
cloneNodeComponent(boolean forceDuplicate)
|
int |
compareTo(Material o)
|
protected void |
duplicateNodeComponent(NodeComponent original,
boolean forceDuplicate)
|
boolean |
equals(java.lang.Object o)
|
void |
freeOpenGLResources(CanvasPeer canvasPeer)
This method frees OpenGL resources (names) for all this NodeComponent and all child-components. |
org.openmali.vecmath2.Colorf |
getAmbientColor()
Returns the current ambient color for this material. |
void |
getAmbientColor(org.openmali.vecmath2.Colorf color)
Gets the current ambient color for this material. |
org.jagatoo.opengl.enums.ColorTarget |
getColorTarget()
Returns the current ColorTarget for this material. |
Material |
getCopy()
|
org.openmali.vecmath2.Colorf |
getDiffuseColor()
Returns the current diffuse color for this material. |
void |
getDiffuseColor(org.openmali.vecmath2.Colorf color)
Gets the current diffuse color for this material. |
org.openmali.vecmath2.Colorf |
getEmissiveColor()
Returns the current emissive color for this material. |
void |
getEmissiveColor(org.openmali.vecmath2.Colorf color)
Gets the current emissive color for this material. |
boolean |
getNormalizeNormals()
Returns the current value of normals normalization flag. |
float |
getShininess()
Returns the current shininess value. |
org.openmali.vecmath2.Colorf |
getSpecularColor()
Returns the current specular color for this material. |
void |
getSpecularColor(org.openmali.vecmath2.Colorf color)
Gets the current specular color for this material. |
long |
getStateId()
Returns the current state id of the object. |
StateNode |
getStateNode()
Returns the current state node of the object. |
boolean |
isLightingEnabled()
Returns a flag whether the lighting is enabled or not. |
void |
setAmbientColor(org.openmali.vecmath2.Colorf color)
Sets the ambient color value. |
void |
setAmbientColor(float r,
float g,
float b)
Sets the ambient color value. |
void |
setColorTarget(org.jagatoo.opengl.enums.ColorTarget colorTarget)
Sets the color target for per-vertex colors. |
void |
setDiffuseColor(org.openmali.vecmath2.Colorf color)
Sets the diffuse color value. |
void |
setDiffuseColor(float r,
float g,
float b)
Sets the diffuse color value. |
void |
setEmissiveColor(org.openmali.vecmath2.Colorf color)
Sets the emissive color value. |
void |
setEmissiveColor(float r,
float g,
float b)
Sets the emissive color value. |
void |
setLightingEnabled(boolean enabled)
Turns lighting on or off. |
void |
setNormalizeNormals(boolean normalizeNormals)
Sets flag indicating the normal vectors should be normalized after transformations applied. |
void |
setShininess(float shininess)
Sets the shininess value. |
void |
setSpecularColor(org.openmali.vecmath2.Colorf color)
Sets the specular color value. |
void |
setSpecularColor(float r,
float g,
float b)
Sets the specular color value. |
void |
setStateNode(StateNode stateNode)
Used by the render engine to set the state id for the node. |
java.lang.String |
toString()
|
| Methods inherited from class org.xith3d.scenegraph.NodeComponent |
|---|
freeOpenGLResources, getDuplicateOnCloneTree, getModListener, isChanged, isChanged2, setChanged, setDuplicateOnCloneTree, setModListener |
| Methods inherited from class org.xith3d.scenegraph.SceneGraphObject |
|---|
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final org.jagatoo.opengl.enums.ColorTarget NONE
ColorTarget.NONEpublic static final org.jagatoo.opengl.enums.ColorTarget AMBIENT
ColorTarget.AMBIENTpublic static final org.jagatoo.opengl.enums.ColorTarget EMISSIVE
ColorTarget.EMISSIVEpublic static final org.jagatoo.opengl.enums.ColorTarget DIFFUSE
ColorTarget.DIFFUSEpublic static final org.jagatoo.opengl.enums.ColorTarget SPECULAR
ColorTarget.SPECULARpublic static final org.jagatoo.opengl.enums.ColorTarget AMBIENT_AND_DIFFUSE
ColorTarget.AMBIENT_AND_DIFFUSE| Constructor Detail |
|---|
public Material()
public Material(boolean lightEnabled)
lightEnabled - true to enable lighting, false to disable
public Material(boolean lightEnabled,
float shininess)
lightEnabled - true to enable light, false to disableshininess - The shininess value to usepublic Material(float shininess)
shininess - The shininess value to use
public Material(org.openmali.vecmath2.Colorf ambientColor,
org.openmali.vecmath2.Colorf emissiveColor,
org.openmali.vecmath2.Colorf diffuseColor,
org.openmali.vecmath2.Colorf specularColor,
float shininess)
ambientColor - The ambient color to useemissiveColor - The emissive color to usediffuseColor - The diffuse color to usespecularColor - The specular color to useshininess - the shininess value to set
public Material(org.openmali.vecmath2.Colorf ambientColor,
org.openmali.vecmath2.Colorf emissiveColor,
org.openmali.vecmath2.Colorf diffuseColor,
org.openmali.vecmath2.Colorf specularColor,
float shininess,
boolean lightingEnabled)
ambientColor - The ambient color to useemissiveColor - The emissive color to usediffuseColor - The diffuse color to usespecularColor - The specular color to useshininess - The shininess value to setlightingEnabled - true to turn on lighting, false to turn off
public Material(org.openmali.vecmath2.Colorf ambientColor,
org.openmali.vecmath2.Colorf emissiveColor,
org.openmali.vecmath2.Colorf diffuseColor,
org.openmali.vecmath2.Colorf specularColor,
float shininess,
org.jagatoo.opengl.enums.ColorTarget colorTarget,
boolean lightingEnabled)
ambientColor - The ambient color to useemissiveColor - The emissive color to usediffuseColor - The diffuse color to usespecularColor - The specular color to useshininess - The shininess value to setcolorTarget - The color target value to setlightingEnabled - true to turn on lighting, false to turn off
public Material(org.openmali.vecmath2.Colorf ambientColor,
org.openmali.vecmath2.Colorf emissiveColor,
org.openmali.vecmath2.Colorf diffuseColor,
org.openmali.vecmath2.Colorf specularColor,
float shininess,
org.jagatoo.opengl.enums.ColorTarget colorTarget,
boolean normalizeNormals,
boolean lightingEnabled)
ambientColor - The ambient color to useemissiveColor - The emissive color to usediffuseColor - The diffuse color to usespecularColor - The specular color to useshininess - The shininess value to setcolorTarget - The color target value to setnormalizeNormals - true to normalize, false otherwiselightingEnabled - true to turn on lighting, false to turn off| Method Detail |
|---|
public final void setAmbientColor(org.openmali.vecmath2.Colorf color)
color - the ambient color to use
public final void setAmbientColor(float r,
float g,
float b)
r - the red element of the color to useg - the green element of the color to useb - the blue element of the color to usepublic final void getAmbientColor(org.openmali.vecmath2.Colorf color)
color - the color to set to the current ambient colorpublic final org.openmali.vecmath2.Colorf getAmbientColor()
public final void setEmissiveColor(org.openmali.vecmath2.Colorf color)
color - the emissive color to use
public final void setEmissiveColor(float r,
float g,
float b)
r - the red element of the color to useg - the green element of the color to useb - the blue element of the color to usepublic final void getEmissiveColor(org.openmali.vecmath2.Colorf color)
color - the color to set to the current emissive colorpublic final org.openmali.vecmath2.Colorf getEmissiveColor()
public final void setDiffuseColor(org.openmali.vecmath2.Colorf color)
color - the diffuse color to use
public final void setDiffuseColor(float r,
float g,
float b)
r - the red element of the color to useg - the green element of the color to useb - the blue element of the color to usepublic final void getDiffuseColor(org.openmali.vecmath2.Colorf color)
color - the color to set to the current diffuse colorpublic final org.openmali.vecmath2.Colorf getDiffuseColor()
public final void setSpecularColor(org.openmali.vecmath2.Colorf color)
color - the specular color to use
public final void setSpecularColor(float r,
float g,
float b)
r - the red element of the color to useg - the green element of the color to useb - the blue element of the color to usepublic final void getSpecularColor(org.openmali.vecmath2.Colorf color)
color - the color to set to the current specular colorpublic final org.openmali.vecmath2.Colorf getSpecularColor()
public final void setShininess(float shininess)
shininess - the shininess value to setpublic final float getShininess()
public final void setColorTarget(org.jagatoo.opengl.enums.ColorTarget colorTarget)
colorTarget - the ColorTarget to setpublic final org.jagatoo.opengl.enums.ColorTarget getColorTarget()
ColorTarget.public final void setNormalizeNormals(boolean normalizeNormals)
normalizeNormals - new value for normals normalization flagpublic final boolean getNormalizeNormals()
public final void setLightingEnabled(boolean enabled)
enabled - true to turn on, false to turn offpublic final boolean isLightingEnabled()
true if on, false if offpublic final void setStateNode(StateNode stateNode)
setStateNode in interface StateTrackable<Material>stateNode - The StateNode to setpublic final StateNode getStateNode()
getStateNode in interface StateTrackable<Material>StateNode of the object.public final long getStateId()
public Material getCopy()
getCopy in interface StateTrackable<Material>public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int compareTo(Material o)
compareTo in interface java.lang.Comparable<Material>
protected void duplicateNodeComponent(NodeComponent original,
boolean forceDuplicate)
duplicateNodeComponent in class NodeComponentpublic Material cloneNodeComponent(boolean forceDuplicate)
cloneNodeComponent in class NodeComponentpublic void freeOpenGLResources(CanvasPeer canvasPeer)
freeOpenGLResources in class NodeComponentpublic java.lang.String toString()
toString in class SceneGraphObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||