|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.graphics.opengl.renderobjects.SimpleLightState
public class SimpleLightState
A basic positional or directional light object. The assumption is that color attributes, and position or direction are set during initialization, and that the light is permanently bound to one of the fixed OpenGL lights. The position is passed to OpenGL for every render call, so that it will take the ModelView transform into account.
| Field Summary | |
|---|---|
private float[] |
ambient
|
private float[] |
diffuse
|
private boolean |
enabled
|
private int |
gl_light
|
private float[] |
originpos
|
private float[] |
position
|
private float[] |
specular
|
| Constructor Summary | |
|---|---|
SimpleLightState(int gl_light)
common initialization for new DirectionalLights. |
|
| Method Summary | |
|---|---|
float[] |
getPosition()
Returns a reference to the position float array of this light |
void |
glInit(GLRenderContext gl)
called during initialization phase of the renderer. |
void |
glRender(GLRenderContext gl)
Rendering a light means: set position, taking into account the current ModelView transformation. |
void |
setAmbientColor(float r,
float g,
float b)
sets the ambient color of the light. |
void |
setDiffuseColor(float r,
float g,
float b)
sets the diffuse color of the light. |
void |
setDirection(float x,
float y,
float z)
Turns the light into a direction light, and sets the direction from which the light is shining. |
void |
setEnabled(boolean e)
Easy way to disable this light object, for testing purposes. |
void |
setPosition(float[] pos)
Turns the light into a positional light, and sets the position from which the light is shining. |
void |
setPosition(float x,
float y,
float z)
Turns the light into a positional light, and sets the position from which the light is shining. |
void |
setSpecularColor(float r,
float g,
float b)
sets the specular color of the light. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private float[] ambient
private float[] diffuse
private float[] specular
private float[] position
private float[] originpos
private boolean enabled
private int gl_light
| Constructor Detail |
|---|
public SimpleLightState(int gl_light)
| Method Detail |
|---|
public void setAmbientColor(float r,
float g,
float b)
public void setDiffuseColor(float r,
float g,
float b)
public void setSpecularColor(float r,
float g,
float b)
public void setPosition(float x,
float y,
float z)
public void setPosition(float[] pos)
public float[] getPosition()
public void setDirection(float x,
float y,
float z)
public void setEnabled(boolean e)
public void glInit(GLRenderContext gl)
glInit in interface GLRenderObjectpublic void glRender(GLRenderContext gl)
glRender in interface GLRenderObject
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||