|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.scene.state.RenderState
com.jme.scene.state.LightState
public abstract class LightState
LightState
maintains a collection of lights up to the set
number of maximum lights allowed. Any subclass of Light
can be
added to the light state. Each light is processed and used to modify the
color of the scene.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.jme.scene.state.RenderState |
---|
RenderState.StateType |
Field Summary | |
---|---|
protected int |
backLightMask
|
protected float[] |
globalAmbient
|
protected int |
lightMask
|
static boolean |
LIGHTS_ENABLED
Debug flag for turning off all lighting. |
protected boolean |
localViewerOn
When true, the eye position (as opposed to just the view direction) will be taken into account when computing specular reflections. |
static int |
MASK_AMBIENT
When applied to lightMask, implies ambient light should be set to 0 for this lightstate |
static int |
MASK_DIFFUSE
When applied to lightMask, implies diffuse light should be set to 0 for this lightstate |
static int |
MASK_GLOBALAMBIENT
When applied to lightMask, implies global ambient light should be set to 0 for this lightstate |
static int |
MASK_SPECULAR
When applied to lightMask, implies specular light should be set to 0 for this lightstate |
static int |
MAX_LIGHTS_ALLOWED
defines the maximum number of lights that are allowed to be maintained at one time. |
protected boolean |
separateSpecularOn
When true, specular highlights will be computed separately and added to fragments after texturing. |
protected boolean |
twoSidedOn
When true, both sides of the model will be lighted. |
protected static java.nio.FloatBuffer |
zeroBuffer
|
Fields inherited from class com.jme.scene.state.RenderState |
---|
QUICK_COMPARE, RS_BLEND, RS_CLIP, RS_COLORMASK_STATE, RS_CULL, RS_FOG, RS_FRAGMENT_PROGRAM, RS_GLSL_SHADER_OBJECTS, RS_LIGHT, RS_MATERIAL, RS_MAX_STATE, RS_SHADE, RS_STENCIL, RS_TEXTURE, RS_VERTEX_PROGRAM, RS_WIREFRAME, RS_ZBUFFER |
Constructor Summary | |
---|---|
LightState()
Constructor instantiates a new LightState object. |
Method Summary | |
---|---|
boolean |
attach(Light light)
attach places a light in the queue to be processed. |
void |
detach(Light light)
detach removes a light from the queue for processing. |
void |
detachAll()
detachAll clears the queue of all lights to be processed. |
Light |
get(int i)
get retrieves a particular light defined by an index. |
java.lang.Class<?> |
getClassTag()
|
ColorRGBA |
getGlobalAmbient()
|
java.util.ArrayList<Light> |
getLightList()
Retrieves all lights handled by this LightState |
int |
getLightMask()
|
boolean |
getLocalViewer()
Returns the current state of local viewer mode for this LightState. |
int |
getQuantity()
getQuantity returns the number of lights currently in the
queue. |
boolean |
getSeparateSpecular()
Returns the current state of separate specular mode for this LightState. |
RenderState.StateType |
getStateType()
getStateType returns the type RenderState.StateType.Light |
boolean |
getTwoSidedLighting()
Returns the current state of two sided lighting for this LightState. |
int |
getType()
Deprecated. As of 2.0, use RenderState.getStateType() instead. |
void |
popLightMask()
Recalls the light mask from a back store or 0 if none was pushed. |
void |
pushLightMask()
Saves the light mask to a back store. |
void |
read(JMEImporter e)
|
void |
setGlobalAmbient(ColorRGBA color)
|
void |
setLightMask(int lightMask)
setLightMask sets what attributes of this lightstate to
apply as an int comprised of bitwise or'ed values. |
void |
setLocalViewer(boolean localViewerOn)
Sets if local viewer mode should be enabled for this LightState. |
void |
setSeparateSpecular(boolean separateSpecularOn)
Sets if separate specular mode should be enabled for this LightState. |
void |
setTwoSidedLighting(boolean twoSidedOn)
Sets if two sided lighting should be enabled for this LightState. |
void |
write(JMEExporter e)
|
Methods inherited from class com.jme.scene.state.RenderState |
---|
apply, createStateRecord, extract, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean LIGHTS_ENABLED
public static final int MAX_LIGHTS_ALLOWED
public static final int MASK_AMBIENT
public static final int MASK_DIFFUSE
public static final int MASK_SPECULAR
public static final int MASK_GLOBALAMBIENT
protected int lightMask
protected int backLightMask
protected boolean twoSidedOn
protected float[] globalAmbient
protected static java.nio.FloatBuffer zeroBuffer
protected boolean localViewerOn
protected boolean separateSpecularOn
Constructor Detail |
---|
public LightState()
LightState
object.
Initially there are no lights set.
Method Detail |
---|
public int getType()
RenderState.getStateType()
instead.
getType
returns the type of render state this is.
(RS_LIGHT).
getType
in class RenderState
RenderState.getType()
public RenderState.StateType getStateType()
getStateType
returns the type RenderState.StateType.Light
getStateType
in class RenderState
RenderState.StateType.Light
RenderState.getStateType()
public boolean attach(Light light)
attach
places a light in the queue to be processed. If
there are already eight lights placed in the queue, the light is ignored
and false is returned. Otherwise, true is returned to indicate success.
light
- the light to add to the queue.
public void detach(Light light)
detach
removes a light from the queue for processing.
light
- the light to be removed.public void detachAll()
detachAll
clears the queue of all lights to be processed.
public java.util.ArrayList<Light> getLightList()
public Light get(int i)
get
retrieves a particular light defined by an index. If
there exists no light at a particular index, null is returned.
i
- the index to retrieve the light from the queue.
public int getQuantity()
getQuantity
returns the number of lights currently in the
queue.
public void setTwoSidedLighting(boolean twoSidedOn)
twoSidedOn
- If true, two sided lighting is enabled.public boolean getTwoSidedLighting()
public void setLocalViewer(boolean localViewerOn)
localViewerOn
- If true, local viewer mode is enabled.public boolean getLocalViewer()
public void setSeparateSpecular(boolean separateSpecularOn)
separateSpecularOn
- If true, separate specular mode is enabled.public boolean getSeparateSpecular()
public void setGlobalAmbient(ColorRGBA color)
public ColorRGBA getGlobalAmbient()
public int getLightMask()
public void setLightMask(int lightMask)
setLightMask
sets what attributes of this lightstate to
apply as an int comprised of bitwise or'ed values.
lightMask
- The lightMask to set.public void pushLightMask()
public void popLightMask()
pushLightMask()
public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class RenderState
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class RenderState
java.io.IOException
public java.lang.Class<?> getClassTag()
getClassTag
in interface Savable
getClassTag
in class RenderState
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |