Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.renderer.ogl.input
Interface OGLGlobalEffectsHandler

All Known Implementing Classes:
GlobalEffectsGroup

public interface OGLGlobalEffectsHandler

A generic interface for the control of global effects like background fog and view management for the OpenGL renderer.

The input system takes care of the basic per-frame management, but needs to tell the collection of objects that represent the global structure about the new position or control settings. The architecture assumes that the actual matrices responsible for the view handling and backgrounds are managed separately from the VRML scene graph. This is to avoid issues with nodes appearing under SharedGroups etc.

Version:
$Revision: 1.2 $
Author:
Justin Couch

Field Summary
static int FOG_DISABLE
          Constant used to set the fog state to disabled.
static int FOG_EXPONENTIAL
          Constant used to set the fog state to exponential.
static int FOG_LINEAR
          Constant used to set the fog state to linear.
 
Method Summary
 void enableFog(int state)
          Update the fog type in use.
 void setBackgroundMatrix(javax.vecmath.Matrix4f transform)
          Set the background rotation matrix this new matrix.
 void setFogDetails(float visLimit, float r, float g, float b)
          Update the fog with different setups.
 void setFogMatrix(javax.vecmath.Matrix4f transform)
          Set the fog coordinate matrix this new matrix.
 void setLayerId(int id)
          Set or reset the layer ID to the new ID value.
 void setViewMatrix(javax.vecmath.Matrix4f transform)
          Update the view matrix to be this new matrix.
 void updateBackgroundGround(float[] color, float[] angles, int num)
          Update the background ground color sphere to the new values.
 void updateBackgroundSky(float[] color, float[] angles, int num)
          Update the background sky color sphere to the new values.
 void updateBackgroundTextures(org.j3d.aviatrix3d.Texture2D[] textures, boolean[] flags)
          Update the background textures to this new set.
 void updateBackgroundTransparency(float transparency)
          Update the background transparency to this new value.
 

Field Detail

FOG_DISABLE

static final int FOG_DISABLE
Constant used to set the fog state to disabled.

See Also:
Constant Field Values

FOG_LINEAR

static final int FOG_LINEAR
Constant used to set the fog state to linear.

See Also:
Constant Field Values

FOG_EXPONENTIAL

static final int FOG_EXPONENTIAL
Constant used to set the fog state to exponential.

See Also:
Constant Field Values
Method Detail

setLayerId

void setLayerId(int id)
Set or reset the layer ID to the new ID value.

Parameters:
id - A non-negative ID for the layer

setViewMatrix

void setViewMatrix(javax.vecmath.Matrix4f transform)
Update the view matrix to be this new matrix.

Parameters:
transform - The new view matrix settings

setBackgroundMatrix

void setBackgroundMatrix(javax.vecmath.Matrix4f transform)
Set the background rotation matrix this new matrix.

Parameters:
transform - The new background matrix settings

setFogMatrix

void setFogMatrix(javax.vecmath.Matrix4f transform)
Set the fog coordinate matrix this new matrix.

Parameters:
transform - The new fog matrix settings

updateBackgroundTransparency

void updateBackgroundTransparency(float transparency)
Update the background transparency to this new value. If the value is 1.0, then disable all the background rendering. A value of 0 is completely opaque and a value of 1 is clear.

Parameters:
transparency - A value between 0 and 1

updateBackgroundTextures

void updateBackgroundTextures(org.j3d.aviatrix3d.Texture2D[] textures,
                              boolean[] flags)
Update the background textures to this new set.

Parameters:
textures - The list of textures to use
flags - The list of flags indicating a texture change

updateBackgroundGround

void updateBackgroundGround(float[] color,
                            float[] angles,
                            int num)
Update the background ground color sphere to the new values.

Parameters:
color - The color values to use as a flat array
angles - The angles to use at each colour boundary
num - The number of color values to read from the arrays

updateBackgroundSky

void updateBackgroundSky(float[] color,
                         float[] angles,
                         int num)
Update the background sky color sphere to the new values.

Parameters:
color - The color values to use as a flat array
angles - The angles to use at each colour boundary
num - The number of color values to read from the arrays

enableFog

void enableFog(int state)
Update the fog type in use. Can be used to turn the current fog off too.

Parameters:
state - The fog to use right now

setFogDetails

void setFogDetails(float visLimit,
                   float r,
                   float g,
                   float b)
Update the fog with different setups. New colour and visibility range.

Parameters:
visLimit - The visibility limit. Zero to disable it
r - The red component of the fog color
g - The green component of the fog color
b - The blue component of the fog color

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium