NASA World Wind

gov.nasa.worldwind.render
Class BasicLightingModel

java.lang.Object
  extended by gov.nasa.worldwind.render.BasicLightingModel
All Implemented Interfaces:
LightingModel

public class BasicLightingModel
extends Object
implements LightingModel

Provides a simple lighting model with one light. This model uses only OpenGL light 0.


Field Summary
protected  long frameID
           
protected  Vec4 lightDirection
           
protected  OGLStackHandler lightingStackHandler
           
protected  Material lightMaterial
           
 
Constructor Summary
BasicLightingModel()
           
 
Method Summary
protected  void apply(DrawContext dc)
           
protected  void applyStandardLightDirection(GL2 gl, int light, Vec4 direction)
           
protected static void applyStandardLightMaterial(GL2 gl, int light, Material material)
           
protected  void applyStandardLightModel(GL2 gl)
           
protected  void applyStandardShadeModel(GL2 gl)
           
 void beginLighting(DrawContext dc)
          Initializes the OpenGL state necessary to effect the lighting model.
 void endLighting(DrawContext dc)
          Restores state set by LightingModel.beginLighting(DrawContext) to its original state.
 Vec4 getLightDirection()
          Returns the model's light direction.
 Material getLightMaterial()
          Returns the model's light material.
 void setLightDirection(Vec4 lightDirection)
          Specifies the model's light direction.
 void setLightMaterial(Material lightMaterial)
          Specifies the model's light direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frameID

protected long frameID

lightDirection

protected Vec4 lightDirection

lightingStackHandler

protected OGLStackHandler lightingStackHandler

lightMaterial

protected Material lightMaterial
Constructor Detail

BasicLightingModel

public BasicLightingModel()
Method Detail

apply

protected void apply(DrawContext dc)

applyStandardLightDirection

protected void applyStandardLightDirection(GL2 gl,
                                           int light,
                                           Vec4 direction)

applyStandardLightMaterial

protected static void applyStandardLightMaterial(GL2 gl,
                                                 int light,
                                                 Material material)

applyStandardLightModel

protected void applyStandardLightModel(GL2 gl)

applyStandardShadeModel

protected void applyStandardShadeModel(GL2 gl)

beginLighting

public void beginLighting(DrawContext dc)
Description copied from interface: LightingModel
Initializes the OpenGL state necessary to effect the lighting model.

Specified by:
beginLighting in interface LightingModel
Parameters:
dc - the current draw context.
See Also:
DrawContext.setStandardLightingModel(LightingModel), DrawContext.endStandardLighting()

endLighting

public void endLighting(DrawContext dc)
Description copied from interface: LightingModel
Restores state set by LightingModel.beginLighting(DrawContext) to its original state.

Specified by:
endLighting in interface LightingModel
Parameters:
dc - the current draw context.

getLightDirection

public Vec4 getLightDirection()
Returns the model's light direction.

Returns:
the model's light direction.

getLightMaterial

public Material getLightMaterial()
Returns the model's light material.

Returns:
the model's light material.

setLightDirection

public void setLightDirection(Vec4 lightDirection)
Specifies the model's light direction.

Parameters:
lightDirection - the model's light direction.
Throws:
IllegalArgumentException - if the light direction is null.

setLightMaterial

public void setLightMaterial(Material lightMaterial)
Specifies the model's light direction.

Parameters:
lightMaterial - the model's light material.
Throws:
IllegalArgumentException - if the light material is null.

NASA World Wind