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
FieldsModifier and TypeFieldDescriptionstatic final int
Constant used to set the fog state to disabled.static final int
Constant used to set the fog state to exponential.static final int
Constant used to set the fog state to linear. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 Details
-
FOG_DISABLE
static final int FOG_DISABLEConstant used to set the fog state to disabled.- See Also:
-
FOG_LINEAR
static final int FOG_LINEARConstant used to set the fog state to linear.- See Also:
-
FOG_EXPONENTIAL
static final int FOG_EXPONENTIALConstant used to set the fog state to exponential.- See Also:
-
-
Method Details
-
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 useflags
- 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 arrayangles
- The angles to use at each colour boundarynum
- 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 arrayangles
- The angles to use at each colour boundarynum
- 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 itr
- The red component of the fog colorg
- The green component of the fog colorb
- The blue component of the fog color
-