public class BasicLightingModel extends java.lang.Object implements LightingModel
Modifier and Type | Field and Description |
---|---|
protected long |
frameID |
protected Vec4 |
lightDirection |
protected OGLStackHandler |
lightingStackHandler |
protected Material |
lightMaterial |
Constructor and Description |
---|
BasicLightingModel() |
Modifier and Type | Method and Description |
---|---|
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.
|
protected long frameID
protected Vec4 lightDirection
protected OGLStackHandler lightingStackHandler
protected Material lightMaterial
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)
public void beginLighting(DrawContext dc)
LightingModel
beginLighting
in interface LightingModel
dc
- the current draw context.DrawContext.setStandardLightingModel(LightingModel)
,
DrawContext.endStandardLighting()
public void endLighting(DrawContext dc)
LightingModel
LightingModel.beginLighting(DrawContext)
to its original state.endLighting
in interface LightingModel
dc
- the current draw context.public Vec4 getLightDirection()
public Material getLightMaterial()
public void setLightDirection(Vec4 lightDirection)
lightDirection
- the model's light direction.java.lang.IllegalArgumentException
- if the light direction is null.public void setLightMaterial(Material lightMaterial)
lightMaterial
- the model's light material.java.lang.IllegalArgumentException
- if the light material is null.