|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object glmodel.GLMaterial
public class GLMaterial
Wraps properties for a material. To use: create a new material, set the material properties (setDiffuse(), setAmbient(), setSpecular(), setShininess()), call material.apply() in your render function to set the OpenGL current material properties.
Field Summary | |
---|---|
java.nio.FloatBuffer |
ambient
|
static float[] |
colorBeige
|
static float[] |
colorBlack
|
static float[] |
colorBlue
|
static float[] |
colorClear
|
static float[] |
colorCyan
|
static float[] |
colorDefaultAmbient
|
static float[] |
colorDefaultDiffuse
|
static float[] |
colorGrayDark
|
static float[] |
colorGrayLight
|
static float[] |
colorGrayMedium
|
static float[] |
colorGreen
|
static float[] |
colorMagenta
|
static float[] |
colorNone
|
static float[] |
colorRed
|
static float[] |
colorWhite
|
static float[] |
colorYellow
|
java.nio.FloatBuffer |
diffuse
|
java.nio.FloatBuffer |
emission
|
static float |
maxShine
|
static float |
minShine
|
java.lang.String |
mtlname
|
java.nio.FloatBuffer |
shininess
|
static int |
SIZE_FLOAT
|
java.nio.FloatBuffer |
specular
|
java.lang.String |
textureFile
|
int |
textureHandle
|
Constructor Summary | |
---|---|
GLMaterial()
|
|
GLMaterial(float[] color)
|
Method Summary | |
---|---|
static java.nio.FloatBuffer |
allocFloats(float[] floatarray)
|
static java.nio.FloatBuffer |
allocFloats(int howmany)
|
void |
apply()
Call glMaterial() to activate these material properties in the OpenGL environment. |
static void |
clear()
Reset all material settings to the default values. |
float |
getAlpha()
alpha value is stored in the diffuse material color alpha. |
java.lang.String |
getName()
|
int |
getTexture()
|
java.lang.String |
getTextureFile()
|
void |
setAlpha(float alphaVal)
alpha value is set in the diffuse material color. |
void |
setAmbient(float[] color)
Set the ambient material color. |
void |
setColor(float[] color)
Sets the material color to approximate a "real" surface color. |
void |
setDefaults()
Set the material to OpenGL's default values (gray, with no reflection and no glow) |
void |
setDiffuse(float[] color)
Set the diffuse material color. |
void |
setEmission(float[] color)
Set the emission material color. |
void |
setGlowColor(float[] color)
Make material appear to emit light |
void |
setName(java.lang.String s)
set the material name. |
void |
setReflection(float intensity,
float highlight)
Set the reflection properties. |
void |
setShininess(float howShiny)
Set size of the reflection highlight. |
void |
setSpecular(float[] color)
Set the specular material color. |
void |
setTexture(int txtrHandle)
Assign a texture handle to this material. |
void |
setTextureFile(java.lang.String s)
Store a texture filename with the material. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final float[] colorClear
public static final float[] colorNone
public static final float[] colorRed
public static final float[] colorGreen
public static final float[] colorBlue
public static final float[] colorYellow
public static final float[] colorCyan
public static final float[] colorMagenta
public static final float[] colorGrayLight
public static final float[] colorGrayMedium
public static final float[] colorGrayDark
public static final float[] colorWhite
public static final float[] colorBlack
public static final float[] colorBeige
public static final float[] colorDefaultDiffuse
public static final float[] colorDefaultAmbient
public static final float minShine
public static final float maxShine
public java.nio.FloatBuffer diffuse
public java.nio.FloatBuffer ambient
public java.nio.FloatBuffer specular
public java.nio.FloatBuffer emission
public java.nio.FloatBuffer shininess
public java.lang.String mtlname
public java.lang.String textureFile
public int textureHandle
public static final int SIZE_FLOAT
Constructor Detail |
---|
public GLMaterial()
public GLMaterial(float[] color)
Method Detail |
---|
public void setDefaults()
public void setDiffuse(float[] color)
public void setAmbient(float[] color)
public void setSpecular(float[] color)
public void setEmission(float[] color)
public void setShininess(float howShiny)
howShiny
- How sharp reflection is: 0 - 127 (127=very sharp pinpoint)public void apply()
public static void clear()
public void setColor(float[] color)
public void setReflection(float intensity, float highlight)
public void setGlowColor(float[] color)
public void setAlpha(float alphaVal)
alphaVal
- 0 - 1public float getAlpha()
public void setTextureFile(java.lang.String s)
public void setTexture(int txtrHandle)
txtrHandle
- public java.lang.String getTextureFile()
public int getTexture()
public void setName(java.lang.String s)
s
- public java.lang.String getName()
public static java.nio.FloatBuffer allocFloats(int howmany)
public static java.nio.FloatBuffer allocFloats(float[] floatarray)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |