espresso3d.engine.world.sector.light
Class E3DLight
java.lang.Object
espresso3d.engine.base.E3DEngineItem
espresso3d.engine.renderer.base.E3DRenderable
espresso3d.engine.world.sector.base.E3DPortalEnabledRenderable
espresso3d.engine.world.sector.light.E3DLight
- All Implemented Interfaces:
- E3DPortalEnabledItem
- public class E3DLight
- extends E3DPortalEnabledRenderable
- Author:
- Curt
A light class for lighting the world/actors. A light belongs to a single sector,
but will light any sectors that its sector is connected to with a portal as well.
TODO: This is temporary and basic light support for E3D. This will very likely change and be
extended upon to provide support for all the light types and models planned. This is essentially
available now in a basic format to provide you with some sort of lighting facility.
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LIGHT_TYPE_OMNIDIRECTIONAL
public static final int LIGHT_TYPE_OMNIDIRECTIONAL
- See Also:
- Constant Field Values
LIGHT_TYPE_GLOBAL
public static final int LIGHT_TYPE_GLOBAL
- See Also:
- Constant Field Values
E3DLight
public E3DLight(E3DEngine engine,
java.lang.String lightID)
getLitVertex
public E3DVector3F getLitVertex(E3DVector3F vertex)
- Returns the RGB values in a E3DVector3F with the correct lighting information for this light
based on the distance the vertex passed in is away and the lights color, brightness, falloff, etc.
- Parameters:
vertex - The vertex that we want to get the lit values of from this light
- Returns:
- Returns the lit values for this vertex from this light or null if it has no effect. Other lights will have to be accumulated
render
public void render()
- Specified by:
render in class E3DRenderable
getBrightness
public double getBrightness()
- Returns:
- Returns the brightness of the light
setBrightness
public void setBrightness(double brightness)
- Brightness is how bright the light is.
- Parameters:
brightness - The brightness to set.
getColor
public E3DVector3F getColor()
- Returns:
- Returns the color in a vector with RGB = XYZ as a 0.0 to 1.0 value
setColor
public void setColor(E3DVector3F color)
- Parameters:
color - The color to set.
getFalloff
public double getFalloff()
- Returns:
- Returns the falloff distance
setFalloff
public void setFalloff(double falloff)
- Parameters:
falloff - The falloff distance is the distance the light stops working. 0 disables falloff and the light goes until it no longer has any strength left
getPosition
public E3DVector3F getPosition()
- Returns:
- Returns the position.
setPosition
public void setPosition(E3DVector3F position)
- Parameters:
position - The position to set.
getType
public int getType()
- Returns:
- Returns the type.
setType
public void setType(int type)
- Parameters:
type - The type to set.
getLightID
public java.lang.String getLightID()
setLightID
public void setLightID(java.lang.String lightID)
setSector
public void setSector(E3DSector sector)
- Override setSector to provide ability to tell the sector it needs
to be relit when this light is set to point to it.
- Specified by:
setSector in interface E3DPortalEnabledItem- Overrides:
setSector in class E3DPortalEnabledRenderable
translate
public void translate(E3DVector3F translationAmt)
- Translate the light
- Parameters:
translationAmt -