|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--javax.media.j3d.SceneGraphObject
|
+--javax.media.j3d.NodeComponent
|
+--javax.media.j3d.Material
The Material object defines the appearance of an object under illumination.
| Field Summary | |
static int |
ALLOW_COMPONENT_READ
For material object, specifies that Material allows reading individual component field information. |
static int |
ALLOW_COMPONENT_WRITE
For material object, specifies that Material allows reading individual component field information. |
| Constructor Summary | |
Material()
Constructs and initializes a Material object using default parameters. |
|
Material(Color3f ambientColor,
Color3f emissiveColor,
Color3f diffuseColor,
Color3f specularColor,
float shininess)
Constructs and initializes a new material object using the specified parameters. |
|
| Method Summary | |
NodeComponent |
cloneNodeComponent()
Creates a new Material object. |
void |
duplicateNodeComponent(NodeComponent originalNodeComponent)
Copies the information found in originalNodeComponent to
the current node. |
void |
getAmbientColor(Color3f color)
Retrieves this material's ambient color. |
void |
getDiffuseColor(Color3f color)
Retrieves this material's diffuse color. |
void |
getEmissiveColor(Color3f color)
Retrieves this material's emissive color and stores it in the argument provided. |
boolean |
getLightingEnable()
Retrieves the state of the lighting enable flag. |
float |
getShininess()
Retrieves this material's shininess. |
void |
getSpecularColor(Color3f color)
Retrieves this material's specular color. |
void |
setAmbientColor(Color3f color)
Sets this material's ambient color. |
void |
setAmbientColor(float r,
float g,
float b)
Sets this material's ambient color. |
void |
setDiffuseColor(Color3f color)
Sets this material's diffuse color. |
void |
setDiffuseColor(float r,
float g,
float b)
Sets this material's diffuse color. |
void |
setDiffuseColor(float r,
float g,
float b,
float a)
Sets this material's diffuse color plus alpha. |
void |
setEmissiveColor(Color3f color)
Sets this material's emissive color. |
void |
setEmissiveColor(float r,
float g,
float b)
Sets this material's emissive color. |
void |
setLightingEnable(boolean state)
Enables or disables lighting for this appearance component object. |
void |
setShininess(float shininess)
Sets this material's shininess. |
void |
setSpecularColor(Color3f color)
Sets this material's specular color. |
void |
setSpecularColor(float r,
float g,
float b)
Sets this material's specular color. |
java.lang.String |
toString()
Returns a String representation of this Materials values. |
| Methods inherited from class javax.media.j3d.NodeComponent |
getDuplicateOnCloneTree,
setDuplicateOnCloneTree |
| Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability,
duplicateSceneGraphObject,
getCapability,
getUserData,
isCompiled,
isLive,
setCapability,
setUserData |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int ALLOW_COMPONENT_READ
public static final int ALLOW_COMPONENT_WRITE
| Constructor Detail |
public Material()
public Material(Color3f ambientColor,
Color3f emissiveColor,
Color3f diffuseColor,
Color3f specularColor,
float shininess)
ambientColor - the material's ambient coloremissiveColor - the material's emissive colordiffuseColor - the material's diffuse color when illuminated by a
lightspecularColor - the material's specular color when illuminated
to generate a highlightshininess - the material's shininess in the
range [1.0, 128.0] with 1.0 being not shiny and 128.0 being very shiny.
Values outside this range are clamped.| Method Detail |
public final void setAmbientColor(Color3f color)
color - the material's ambient color
public final void setAmbientColor(float r,
float g,
float b)
r - the new ambient color's red componentg - the new ambient color's green componentb - the new ambient color's blue componentpublic final void getAmbientColor(Color3f color)
color - that will contain the material's ambient colorpublic final void setEmissiveColor(Color3f color)
color - the new emissive color
public final void setEmissiveColor(float r,
float g,
float b)
r - the new emissive color's red componentg - the new emissive color's green componentb - the new emissive color's blue componentpublic final void getEmissiveColor(Color3f color)
color - the vector that will receive this material's emissive colorpublic final void setDiffuseColor(Color3f color)
color - the new diffuse color
public final void setDiffuseColor(float r,
float g,
float b)
r - the new diffuse color's red componentg - the new diffuse color's green componentb - the new diffuse color's blue component
public final void setDiffuseColor(float r,
float g,
float b,
float a)
r - the new diffuse color's red componentg - the new diffuse color's green componentb - the new diffuse color's blue componenta - the alpha component used to set transparencypublic final void getDiffuseColor(Color3f color)
color - the vector that will receive this material's diffuse colorpublic final void setSpecularColor(Color3f color)
color - the new specular color
public final void setSpecularColor(float r,
float g,
float b)
r - the new specular color's red componentg - the new specular color's green componentb - the new specular color's blue componentpublic final void getSpecularColor(Color3f color)
color - the vector that will receive this material's specular colorpublic final void setShininess(float shininess)
shininess - the material's shininesspublic final float getShininess()
public final void setLightingEnable(boolean state)
state - true or false to enable or disable lightingpublic final boolean getLightingEnable()
public java.lang.String toString()
public NodeComponent cloneNodeComponent()
duplicateNode method.Node.cloneTree(),
NodeComponent.duplicateNodeComponent(javax.media.j3d.NodeComponent),
NodeComponent.setDuplicateOnCloneTree(boolean)public void duplicateNodeComponent(NodeComponent originalNodeComponent)
originalNodeComponent to
the current node. This routine is called as part of the
cloneTree operation.originalNodeComponent - the node to duplicate.Node.cloneTree(),
Node.duplicateNode(javax.media.j3d.Node, boolean),
NodeComponent.setDuplicateOnCloneTree(boolean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||