|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ryanm.glvisualiser.GLMaterial
public class GLMaterial
Encapsulates OpenGL material attributes, diffuse, emission etc
| Field Summary | |
|---|---|
static int |
FLAT
Selects flat shading for this material |
static int |
SMOOTH
Selects gouraud shading for this material |
| Constructor Summary | |
|---|---|
GLMaterial()
Standard constructor. |
|
GLMaterial(GLMaterial other)
Copies the supplied GLMaterial's values |
|
| Method Summary | |
|---|---|
void |
apply(javax.media.opengl.GL gl)
Applies this material to the supplied GL context. |
void |
applyInBeginEnd(javax.media.opengl.GL gl)
Applies as much of the material as is possible when in a glBegin/glEnd block. |
float[] |
getAmbient()
|
java.awt.Color |
getAmbientColour()
|
float[] |
getDiffuse()
|
java.awt.Color |
getDiffuseColour()
|
float[] |
getEmission()
|
java.awt.Color |
getEmissionColour()
|
int |
getShadingModel()
|
float |
getShininess()
|
float[] |
getSpecular()
|
java.awt.Color |
getSpecularColour()
|
void |
setAmbientReflectivity(float[] colour)
Sets the ambient reflectivity colour of this object. |
void |
setAmbientReflectivity(float r,
float g,
float b,
float a)
Sets the ambient reflectivity colour of this object. |
void |
setAmbientReflectivity(GLColour colour)
Sets the ambient reflectivity colour of this object. |
void |
setDiffuseReflectivity(float[] colour)
Sets the diffuse reflectivity colour of this object. |
void |
setDiffuseReflectivity(float r,
float g,
float b,
float a)
Sets the diffuse reflectivity colour of this object. |
void |
setDiffuseReflectivity(GLColour colour)
Sets the diffuse reflectivity colour of this object. |
void |
setEmission(float[] colour)
Sets the emission colour of this object. |
void |
setEmission(float r,
float g,
float b,
float a)
Sets the emission colour of this object. |
void |
setEmission(GLColour colour)
Sets the emission colour of this object. |
void |
setShadingMode(int mode)
Sets the shading mode for this material |
void |
setShininess(float shiny)
Sets the shininess of this material, mmmm shiny. |
void |
setSpecularReflectivity(float[] colour)
Sets the specular reflectivity colour of this object. |
void |
setSpecularReflectivity(float r,
float g,
float b,
float a)
Sets the specular reflectivity colour of this object. |
void |
setSpecularReflectivity(GLColour colour)
Sets the specular reflectivity colour of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SMOOTH
public static final int FLAT
| Constructor Detail |
|---|
public GLMaterial()
public GLMaterial(GLMaterial other)
other - The material to duplicate| Method Detail |
|---|
public void apply(javax.media.opengl.GL gl)
gl - The GL context to apply to.public void applyInBeginEnd(javax.media.opengl.GL gl)
gl - The GL context to apply to.public void setAmbientReflectivity(float[] colour)
colour - the rgba values
public void setAmbientReflectivity(float r,
float g,
float b,
float a)
r - The red componentg - The green componentb - The blue componenta - The alpha componentpublic void setAmbientReflectivity(GLColour colour)
colour - The desired colour for ambient reflectivity
public void setDiffuseReflectivity(float r,
float g,
float b,
float a)
r - The red componentg - The green componentb - The blue componenta - The alpha componentpublic void setDiffuseReflectivity(GLColour colour)
colour - The desired colour for diffuse reflectivitypublic void setDiffuseReflectivity(float[] colour)
colour - The desired colour for diffuse reflectivity
public void setSpecularReflectivity(float r,
float g,
float b,
float a)
r - The red componentg - The green componentb - The blue componenta - The alpha componentpublic void setSpecularReflectivity(GLColour colour)
colour - The desired colour for specular reflectivitypublic void setSpecularReflectivity(float[] colour)
colour - The desired colour for specular reflectivity
public void setEmission(float r,
float g,
float b,
float a)
r - The red componentg - The green componentb - The blue componenta - The alpha componentpublic void setEmission(GLColour colour)
colour - The desried emision colourpublic void setEmission(float[] colour)
colour - The desried emision colourpublic void setShininess(float shiny)
shiny - the shininess factor A value from 0 (big fat
highlight) to 128 (little skinny highlight). Values
outside this will be truncatedpublic void setShadingMode(int mode)
mode - can be either GLMaterial.SMOOTH or GLMaterial.FLATpublic float[] getAmbient()
public float[] getDiffuse()
public float[] getEmission()
public float[] getSpecular()
public java.awt.Color getAmbientColour()
public java.awt.Color getDiffuseColour()
public java.awt.Color getEmissionColour()
public java.awt.Color getSpecularColour()
public int getShadingModel()
public float getShininess()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||