|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--yaarq.sys.yrqVisual
|
+--yaarq.sys.yrqFlareVisual
This class extends the yrqVisual class providing support for optical effects like lensflares, glares and receptor overloading. A flare is attached to a frame producing it. It traces the frame automatically .
A flare features a displacement factor. Flares are artifical effects created by the virtual lens system tracking the scene. A flares position is always on a line connecting its source (e.g. the sun) with the screen center. The displacement factor states where on this line the flare is positioned. A displacement factor of 0 means that the flare appears exactly at the location its parenting frame, a factor of one positions the flare statically in the 2D center of the screen while a factor of 2 positions the flare at the 2D location of the parenting frame mirrored by the 2D center of the screen.
A flare normally fades, to some degree, with its distance from the optical center (the 2D screen center) The amount of this fading can be influcenced using the fade factor. A fade factor of 0 means no fading at all, like for the true source of a light (e.g. sun), a fade factor of 1 denotes full fading, resulting in an invisible flare regardless of screen distance.
The flare class uses 2D sprites seemingly positioned exactly on the 2D screen plane. Normally, such operations would be done in the postRender method of the Java3D canvas, but the update routines used by Java3D have very low performance, so this class creates 3D objects and manipulates them to appear as if they were twodimensional and screen- aligned.
FlareVisuals are internally attached to the viewport transform group to allow for automatic viewport alignment.
To match the location of their source object in the world, flares have to be updated constantly. This is done automatically by the engine, which calls the update method of the flares during its time-based updates.
TODO: When allowing fov changes to viewport, change transform code!
| Field Summary |
| Fields inherited from class yaarq.sys.yrqVisual |
COLOR_AMBIENT, COLOR_DIFFUSE, COLOR_EMISSIVE, COLOR_SPECULAR, m_parent, MODE_ADD, MODE_BLEND, MODE_NONE, TEXTURE_DOT3BUMP, TEXTURE_LIGHTMAP, TEXTURE_MATERIAL, TEXTURE_REFLECT |
| Constructor Summary | |
yrqFlareVisual(javax.media.j3d.Texture2D a_texture,
yrqFrame a_frame,
float a_scale,
float a_displacement,
float a_fadefactor)
Constructs a new flarevisual using the passed parameters. |
|
| Method Summary | |
void |
attach(javax.media.j3d.Group a_group)
This method attaches the flare to a parent. |
void |
detach()
This method detaches the flare to a parent. |
float |
getDisplacement()
This method retrieves the displacement of the flare. |
float |
getFadeFactor()
This method retrieves the fade factor of a flare in relation to its source. |
float |
getLuminance()
This function retrieves the overall luminance for the flare. |
javax.vecmath.Point2d |
getPosition()
This function retrieves the current location of the flare in screen coordinates. |
yrqFrame |
getSourceFrame()
This function returns the source frame for the flare. |
void |
setDisplacement(float a_displacement)
This method sets the displacement of a flare in relation to its source. |
void |
setFadeFactor(float a_fadefactor)
This method sets the fade factor of a flare in relation to its source. |
void |
setLuminance(float a_luminance)
This method sets the overall luminance for the flare. |
void |
setSourceFrame(yrqFrame a_frame)
This method sets the source frame for the flare. |
void |
setTexture(javax.media.j3d.Texture2D a_texture,
float a_scale)
This method sets the texture to use for the overlay. |
void |
update(yrqEngine a_engine)
This method updates the flare position in relation to the world position of its source frame. |
| Methods inherited from class yaarq.sys.yrqVisual |
getBaseShape3D, getBumpShape3D, getGeometry, getParent, getTexture, getTransparencyMode, getTransparencyValue, setBrightness, setColor, setGeometry, setShininess, setTexture, setTextureAnimation, setTextureAnimation, setTransparency |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public yrqFlareVisual(javax.media.j3d.Texture2D a_texture,
yrqFrame a_frame,
float a_scale,
float a_displacement,
float a_fadefactor)
a_texture - The texture to use for the overlaya_frame - The frame which prduces the flarea_displacement - The displacement of the flare from the sourcea_fadefactor - The fading alpha factor of the flare| Method Detail |
public void attach(javax.media.j3d.Group a_group)
attach in class yrqVisuala_group - The group to which to attachpublic void detach()
detach in class yrqVisualpublic float getDisplacement()
public float getFadeFactor()
public float getLuminance()
public javax.vecmath.Point2d getPosition()
public yrqFrame getSourceFrame()
public void setDisplacement(float a_displacement)
a_displacement - The displacement for the flare, 0=none, 1=screen center, 2=opposite to sourcepublic void setFadeFactor(float a_fadefactor)
a_fadefactor - The fade factor of the flare, 0-1public void setLuminance(float a_luminance)
a_luminance - the luminance to set, 0-1fpublic void setSourceFrame(yrqFrame a_frame)
a_frame - The frame which is the source for the flare
public void setTexture(javax.media.j3d.Texture2D a_texture,
float a_scale)
a_texture - The texture to use for the overlaya_scale - The scale (screen coords) to apply to the texturepublic void update(yrqEngine a_engine)
a_engine - The engine updating the flare
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||