Package gov.nasa.worldwind.render
Class BasicLightingModel
- java.lang.Object
-
- gov.nasa.worldwind.render.BasicLightingModel
-
- All Implemented Interfaces:
LightingModel
public class BasicLightingModel extends java.lang.Object implements LightingModel
Provides a simple lighting model with one light. This model uses only OpenGL light 0.
-
-
Field Summary
Fields Modifier and Type Field Description protected longframeIDprotected Vec4lightDirectionprotected OGLStackHandlerlightingStackHandlerprotected MateriallightMaterial
-
Constructor Summary
Constructors Constructor Description BasicLightingModel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapply(DrawContext dc)protected voidapplyStandardLightDirection(com.jogamp.opengl.GL2 gl, int light, Vec4 direction)protected static voidapplyStandardLightMaterial(com.jogamp.opengl.GL2 gl, int light, Material material)protected voidapplyStandardLightModel(com.jogamp.opengl.GL2 gl)protected voidapplyStandardShadeModel(com.jogamp.opengl.GL2 gl)voidbeginLighting(DrawContext dc)Initializes the OpenGL state necessary to effect the lighting model.voidendLighting(DrawContext dc)Restores state set byLightingModel.beginLighting(DrawContext)to its original state.Vec4getLightDirection()Returns the model's light direction.MaterialgetLightMaterial()Returns the model's light material.voidsetLightDirection(Vec4 lightDirection)Specifies the model's light direction.voidsetLightMaterial(Material lightMaterial)Specifies the model's light direction.
-
-
-
Field Detail
-
lightingStackHandler
protected OGLStackHandler lightingStackHandler
-
lightDirection
protected Vec4 lightDirection
-
lightMaterial
protected Material lightMaterial
-
frameID
protected long frameID
-
-
Method Detail
-
beginLighting
public void beginLighting(DrawContext dc)
Description copied from interface:LightingModelInitializes the OpenGL state necessary to effect the lighting model.- Specified by:
beginLightingin interfaceLightingModel- Parameters:
dc- the current draw context.- See Also:
DrawContext.setStandardLightingModel(LightingModel),DrawContext.endStandardLighting()
-
endLighting
public void endLighting(DrawContext dc)
Description copied from interface:LightingModelRestores state set byLightingModel.beginLighting(DrawContext)to its original state.- Specified by:
endLightingin interfaceLightingModel- Parameters:
dc- the current draw context.
-
getLightDirection
public Vec4 getLightDirection()
Returns the model's light direction.- Returns:
- the model's light direction.
-
setLightDirection
public void setLightDirection(Vec4 lightDirection)
Specifies the model's light direction.- Parameters:
lightDirection- the model's light direction.- Throws:
java.lang.IllegalArgumentException- if the light direction is null.
-
getLightMaterial
public Material getLightMaterial()
Returns the model's light material.- Returns:
- the model's light material.
-
setLightMaterial
public void setLightMaterial(Material lightMaterial)
Specifies the model's light direction.- Parameters:
lightMaterial- the model's light material.- Throws:
java.lang.IllegalArgumentException- if the light material is null.
-
apply
protected void apply(DrawContext dc)
-
applyStandardLightModel
protected void applyStandardLightModel(com.jogamp.opengl.GL2 gl)
-
applyStandardShadeModel
protected void applyStandardShadeModel(com.jogamp.opengl.GL2 gl)
-
applyStandardLightMaterial
protected static void applyStandardLightMaterial(com.jogamp.opengl.GL2 gl, int light, Material material)
-
applyStandardLightDirection
protected void applyStandardLightDirection(com.jogamp.opengl.GL2 gl, int light, Vec4 direction)
-
-