public class LensFlare
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
LensFlare(SimpleVector lightPos,
java.lang.String burst,
java.lang.String halo1,
java.lang.String halo2,
java.lang.String halo3)
Create a new lens flare for a light source.
|
Modifier and Type | Method and Description |
---|---|
void |
render(FrameBuffer buffer)
Renders the effect.
|
void |
setDirection(boolean lightToCam)
If hiding is enabled, the visibility calculations can be done camera->light (default) or light->camera.
|
void |
setGlobalScale(float scale)
Sets the global scale of the effect.
|
void |
setHiding(boolean hides)
If true (default), all geometry that is a potential collider hides the effect if it's located in
a direct line between the camera and the light source.
|
void |
setLightPosition(SimpleVector lightPos)
Sets a new light position.
|
void |
setMaximumDistance(float distance)
If hiding is enabled, this value specifies how far away from the camera a polygon can maximally be
to be considered as a blocker.
|
void |
setTransparency(int trans)
Sets the transparency of the effect.
|
void |
update(FrameBuffer buffer,
World world)
Updates the lens flare.
|
public LensFlare(SimpleVector lightPos, java.lang.String burst, java.lang.String halo1, java.lang.String halo2, java.lang.String halo3)
lightPos
- the position of the light sourceburst
- the name of the burst texture as added to the TextureManagerhalo1
- the name of the first halo texture as added to the TextureManagerhalo2
- the name of the second halo as added to the TextureManagerhalo3
- the name of the third halo texture added to the TextureManagerpublic void setTransparency(int trans)
trans
- the transparency. 0 is lowest,public void setLightPosition(SimpleVector lightPos)
lightPos
- the new positionpublic void setGlobalScale(float scale)
scale
- the scalepublic void setHiding(boolean hides)
hides
- should geometry hide it or not?public void setMaximumDistance(float distance)
distance
- the distancepublic void setDirection(boolean lightToCam)
lightToCam
- do it light->camera or vice versapublic void update(FrameBuffer buffer, World world)
buffer
- the frame bufferworld
- the worldpublic void render(FrameBuffer buffer)
buffer
- the frame buffer