de.rico.engine.effect.lensflare
Class LensFlare

java.lang.Object
  extended by de.rico.engine.effect.lensflare.LensFlare

public class LensFlare
extends java.lang.Object

This class represents a lens flare effect

Author:
Frank Bruns

Constructor Summary
LensFlare(Point3D position, java.lang.String texHalo, java.lang.String texGlow, java.lang.String texBigGlow, java.lang.String texStreaks)
          Creates a new lens flare effect with the specified parameters.
 
Method Summary
 void draw(javax.media.opengl.GL gl)
          Draws the lens flare effect.
 float getScaleFactor()
          Returns the current scale factor for the flares
 void setScaleFactor(float factor)
          Sets the scale factor for the lens flare effect.
 void update(long elapsedTime)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LensFlare

public LensFlare(Point3D position,
                 java.lang.String texHalo,
                 java.lang.String texGlow,
                 java.lang.String texBigGlow,
                 java.lang.String texStreaks)
Creates a new lens flare effect with the specified parameters. The lens flare works correctly if the camera stays in front of the lens flare position. Therefore it it recommended to position the flare many units down the negative z-axis.

Parameters:
position - reference point for the lens flare
texHalo - path to halo like texture
texGlow - path to strong glow like texture
texBigGlow - path to big glow like texture
texStreaks - path to streaks like texture
Method Detail

setScaleFactor

public void setScaleFactor(float factor)
Sets the scale factor for the lens flare effect. A higher value means bigger flares. You can set the default scale factor by using this classes DEFAULT_SCALE_FACTOR constant. The default value for the scale factor is 4f.

Parameters:
factor - scale factor

getScaleFactor

public float getScaleFactor()
Returns the current scale factor for the flares

Returns:
scale factor for the flares

update

public void update(long elapsedTime)

draw

public void draw(javax.media.opengl.GL gl)
Draws the lens flare effect. Lens flares are not affected by the the engines lighting system

Parameters:
gl -