com.jme.effects
Class LensFlare

java.lang.Object
  extended bycom.jme.scene.Spatial
      extended bycom.jme.scene.Node
          extended bycom.jme.effects.LensFlare
All Implemented Interfaces:
java.io.Serializable

public class LensFlare
extends Node

LensFlare Lens flare effect for jME. Notice that currently, it doesn't do occlusion culling. The easiest way to use this class is to use the LensFlareFactory to create your LensFlare and then attach it as a child to a lightnode. Optionally you can make it a child or a sibling of an object you wish to have a 'glint' on. In the case of sibling, use setLocalTranslation(sibling.getLocalTranslation()) or something similar to ensure position. Only FlareQuad objects are acceptable as children.

Version:
$Id: LensFlare.java,v 1.16 2004/11/15 22:04:04 renanse Exp $
Author:
Joshua Slack
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.jme.scene.Node
children
 
Fields inherited from class com.jme.scene.Spatial
currentStates, defaultStateList, forceCull, forceView, frustrumIntersects, geometricalControllers, lightCombineMode, localRotation, localScale, localTranslation, name, parent, queueDistance, renderQueueMode, renderStateList, textureCombineMode, worldBound, worldRotation, worldScale, worldTranslation, zOrder
 
Constructor Summary
LensFlare(java.lang.String name)
          Creates a new LensFlare node without FlareQuad children.
 
Method Summary
 int attachChild(Spatial spat)
          Calls Node's attachChild after ensuring child is a FlareQuad.
 Vector2f getMidPoint()
          Get the flare's reference midpoint, usually the center of the screen.
 void setMidPoint(Vector2f midPoint)
          Set the flare's reference midpoint, the center of the screen by default.
 void updateWorldData(float time)
          updateWorldData updates all the children maintained by this node.
 
Methods inherited from class com.jme.scene.Node
applyRenderState, detachAllChildren, detachChild, detachChildAt, detachChildNamed, draw, drawBounds, findCollisions, findPick, getChild, getChild, getChildren, getQuantity, hasChild, hasCollision, putClone, setChild, setForceView, updateCollisionTree, updateWorldBound
 
Methods inherited from class com.jme.scene.Spatial
addController, applyDefaultStates, calculateCollisions, calculatePick, clearCurrentState, clearCurrentStates, clearRenderState, getController, getControllers, getCurrentState, getLastFrustumIntersection, getLightCombineMode, getLocalRotation, getLocalScale, getLocalTranslation, getName, getParent, getRenderQueueMode, getRenderStateList, getTextureCombineMode, getWorldBound, getWorldRotation, getWorldScale, getWorldTranslation, getZOrder, isForceCulled, isForceView, onDraw, onDrawBounds, propagateBoundToRoot, propagateStatesFromRoot, removeController, removeFromParent, setForceCull, setLightCombineMode, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalTranslation, setName, setParent, setRenderQueueMode, setRenderState, setTextureCombineMode, setWorldBound, setZOrder, toString, updateGeometricState, updateRenderState, updateRenderState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LensFlare

public LensFlare(java.lang.String name)
Creates a new LensFlare node without FlareQuad children. Use attachChild to attach FlareQuads.

Parameters:
name - The name of the node.
Method Detail

getMidPoint

public Vector2f getMidPoint()
Get the flare's reference midpoint, usually the center of the screen.

Returns:
Vector2f

setMidPoint

public void setMidPoint(Vector2f midPoint)
Set the flare's reference midpoint, the center of the screen by default. It may be useful to change this if the whole screen is not used for a scene (for example, if part of the screen is taken up by a status bar.)

Parameters:
midPoint - Vector2f

updateWorldData

public void updateWorldData(float time)
updateWorldData updates all the children maintained by this node. It decides where on the screen the flare reference point should be (by the LensFlares worldTranslation) and updates the children accordingly.

Overrides:
updateWorldData in class Node
Parameters:
time - the frame time.

attachChild

public int attachChild(Spatial spat)
Calls Node's attachChild after ensuring child is a FlareQuad.

Overrides:
attachChild in class Node
Parameters:
spat - Spatial
Returns:
int
See Also:
com.jme.scene.Node.attachChild(Spatial)