yaarq.sys
Class yrqEffectVisual

java.lang.Object
  |
  +--yaarq.sys.yrqVisual
        |
        +--yaarq.sys.yrqEffectVisual

public class yrqEffectVisual
extends yrqVisual

This class extends the yrqVisual class providing support for viewport-oriented effects based on a texture being displayed on a quadrangle geometry which is created automatically. Effect visuals only have a material and a lightmap texture assigned, and they have only brightness for a material color (they are never lighted using the lighting system).

Effect visuals always are added to yrqFrame instances. Effect visuals automatically align to the viewport, resulting in a billboard effect. Their position, however, is determined by the frame they have been attached to.

TODO: Nothing


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
yrqEffectVisual(float a_size, javax.media.j3d.Texture2D a_texMaterial, javax.media.j3d.Texture2D a_texLightMap, int a_mode, float a_transparency, float a_brightness)
          Constructs a effect basic visual using passed parameters.
 
Method Summary
 float getSize()
          This function retrieves the size of the internal geometry used for the effect
 javax.media.j3d.Texture2D getTexture(int a_type)
          This function returns one of the textures used in the visual.
 int getTransparencyMode()
          Returns the transparency mode of the visual.
 float getTransparencyValue()
          Returns the transparency value for this visual.
 void setBrightness(float a_brightness)
          This method sets the material of the visual to a greyscale level having defined emissivity.
 void setSize(float a_size)
          This method sets the size, in world coordinates, of the effects visual geometry.
 void setTexture(int a_type, javax.media.j3d.Texture2D a_texture)
          This function sets one of the textures used in the visual.
 void setTextureAnimation(double a_left, double a_top, double a_width, double a_height)
          This function sets a continuous texture animation to the base material texture.
 void setTextureAnimation(int a_clipIndex, int a_clipCountX, int a_clipCountY)
          This function set a clip-based texture animation to the base material texture.
 void setTransparency(float a_alpha, int a_mode)
          Sets the transparency factor for the visual.
 
Methods inherited from class yaarq.sys.yrqVisual
attach, detach, getBaseShape3D, getBumpShape3D, getGeometry, getParent, setColor, setGeometry, setShininess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

yrqEffectVisual

public yrqEffectVisual(float a_size,
                       javax.media.j3d.Texture2D a_texMaterial,
                       javax.media.j3d.Texture2D a_texLightMap,
                       int a_mode,
                       float a_transparency,
                       float a_brightness)
Constructs a effect basic visual using passed parameters. All parameters can be changed at runtime. Attach the visual to a component to make it visible in the scene.

Parameters:
a_size - The size of the geometry to use in construction of the visual
a_texMaterial - The basic material texture
a_texLightMap - The lightmap texture to add with the material texture
a_transparency - The alpha-transparency of the constructed visual, 0-1f
a_mode - The alpha-transparency mode of the constructed visual, one of the mode_xxx constants
a_brightness - The emissive component of the constructed visual, 0-1f
Method Detail

getSize

public float getSize()
This function retrieves the size of the internal geometry used for the effect

Returns:
the geometry size, in world coordinates

getTexture

public javax.media.j3d.Texture2D getTexture(int a_type)
This function returns one of the textures used in the visual. Which texture to return is defined by one of the TEXTURE_XXX constants to be passed for the type parameter.

Overrides:
getTexture in class yrqVisual
Parameters:
a_type - The type of the texture to return. One of the TEXTURE_xxx constants
Returns:
The texture

getTransparencyMode

public int getTransparencyMode()
Returns the transparency mode of the visual. One of the MODE_xxx constants.

Overrides:
getTransparencyMode in class yrqVisual
Returns:
Global transparency value of the visual

getTransparencyValue

public float getTransparencyValue()
Returns the transparency value for this visual. Usage of this value is dependend on the transparency mode set for the visual.

Overrides:
getTransparencyValue in class yrqVisual
Returns:
Global transparency value of the visual

setBrightness

public void setBrightness(float a_brightness)
This method sets the material of the visual to a greyscale level having defined emissivity. Lighting is disabled. The method is provided for convenience, to allow setting fully textured visuals not needing any material color to a given level of emissive light.

The values set by the convenience methods setBrightness and setShininess are only valid until the next call to setColor. Setting individual color components of the visual overrides previous settings.

Overrides:
setBrightness in class yrqVisual
Parameters:
a_brightness - The brightness of the visual, 0-1f

setSize

public void setSize(float a_size)
This method sets the size, in world coordinates, of the effects visual geometry.

Parameters:
a_size - The size of the geometry internally used for the visual

setTexture

public void setTexture(int a_type,
                       javax.media.j3d.Texture2D a_texture)
This function sets one of the textures used in the visual. Which texture to set is defined by one of the TEXTURE_XXX constants to be passed for the type parameter. All texturing states are adjusted automatically when this function is called.

Overrides:
setTexture in class yrqVisual
Parameters:
a_type - The type of the texture to set. One of the TEXTURE_xxx constants
a_texture - The texture to set

setTextureAnimation

public void setTextureAnimation(double a_left,
                                double a_top,
                                double a_width,
                                double a_height)
This function sets a continuous texture animation to the base material texture. Use it to set the base material texture to any position in a (0,1) normalized frame of reference.

Overrides:
setTextureAnimation in class yrqVisual
Parameters:
a_left - Left clip position, normalized (0-1)
a_top - Top clip position, normalized (0-1)
a_width - Width of clip to use, normalized (0-1)
a_height - Height of clip to use, normalized (0-1)

setTextureAnimation

public void setTextureAnimation(int a_clipIndex,
                                int a_clipCountX,
                                int a_clipCountY)
This function set a clip-based texture animation to the base material texture. Use it to set the base material texture to a clip indexed by the index parameter in a rectangular tiling clip starting top/left in the texture, having the provided number of clips in the x (left) and y(top) direction.

Overrides:
setTextureAnimation in class yrqVisual
Parameters:
a_clipIndex - Index of the clip within the texture
a_clipCountX - Number of clips in X direction
a_clipCountY - Number of clips in Y direction

setTransparency

public void setTransparency(float a_alpha,
                            int a_mode)
Sets the transparency factor for the visual. Transparency can be additive, blended or disabled, pass one of the MODE_xxx constants as the mode parameter to switch modes.

Overrides:
setTransparency in class yrqVisual
Parameters:
a_alpha - Global transparency factor for this visual
a_mode - Transparency mode for this visual