Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.renderer.ogl.browser
Class GlobalEffectsGroup

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.Node
          extended by org.j3d.aviatrix3d.Group
              extended by org.web3d.vrml.renderer.ogl.browser.GlobalEffectsGroup
All Implemented Interfaces:
org.j3d.aviatrix3d.NodeUpdateListener, org.j3d.aviatrix3d.picking.GroupPickTarget, org.j3d.aviatrix3d.picking.PickableObject, org.j3d.aviatrix3d.picking.PickTarget, org.j3d.aviatrix3d.rendering.Cullable, org.j3d.aviatrix3d.rendering.GroupCullable, org.j3d.aviatrix3d.TransformHierarchy, OGLGlobalEffectsHandler

public class GlobalEffectsGroup
extends org.j3d.aviatrix3d.Group
implements OGLGlobalEffectsHandler, org.j3d.aviatrix3d.NodeUpdateListener

Represents all of the global rendering effects in the world - viewpoint, background and fog.

TODO:
- Figure out the correct density calculations for exponential fog based on visibilityRange.

Version:
$Revision: 1.23 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.Group
childList, cullList, dirtyBoundsCount, lastChild, pickableList, pickFlags, wkVec1, wkVec2
 
Fields inherited from class org.j3d.aviatrix3d.Node
bounds, implicitBounds, INVALID_BOUNDS, parent
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_NOT_LIVE_MESSAGE, updateHandler, WRITE_TIMING_MSG
 
Fields inherited from interface org.web3d.vrml.renderer.ogl.input.OGLGlobalEffectsHandler
FOG_DISABLE, FOG_EXPONENTIAL, FOG_LINEAR
 
Fields inherited from interface org.j3d.aviatrix3d.picking.PickableObject
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECT
 
Fields inherited from interface org.j3d.aviatrix3d.picking.PickTarget
CUSTOM_PICK_TYPE, GROUP_PICK_TYPE, LEAF_PICK_TYPE, SINGLE_PICK_TYPE
 
Constructor Summary
GlobalEffectsGroup(org.j3d.aviatrix3d.SimpleScene scene)
          Create a new instance with the headlight off and controls over whether the code will be used in a static or dynamic environment.
 
Method Summary
 void addViewDependentChild(org.j3d.aviatrix3d.Group group)
          Add an arbitrary child that depends on being view-aligned to the view group.
 void enableFog(int state)
          Update the fog type in use.
 org.j3d.aviatrix3d.Viewpoint getViewpoint()
          Get the viewPlatform defined here so that views can be attached to it.
 void initialize()
          Instruct the effects group to start initialisation now
 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.
 void updateNodeBoundsChanges(java.lang.Object src)
          Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.
 void updateNodeDataChanges(java.lang.Object src)
          Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.
 void useHeadlight(boolean on)
          Set the embedded headlight to be on or off.
 
Methods inherited from class org.j3d.aviatrix3d.Group
addChild, checkForCyclicChild, checkPickMask, getAllChildren, getChild, getCullableChildren, getCullableParent, getPickableBounds, getPickableChild, getPickableChildren, getPickMask, getPickTargetType, hasMultipleParents, indexOfChild, markBoundsDirty, numChildren, numCullableChildren, numPickableChildren, pickBatch, pickSingle, recomputeBounds, removeAllChildren, removeChild, removeChild, requestBoundsUpdate, setBounds, setChild, setLive, setPickMask, setUpdateHandler, updateBounds
 
Methods inherited from class org.j3d.aviatrix3d.Node
boundsChanged, checkForCyclicParent, getBounds, getParent, removeParent, setParent, updateParentBounds
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
dataChanged, getUserData, isLive, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.GroupCullable
getBounds
 

Constructor Detail

GlobalEffectsGroup

public GlobalEffectsGroup(org.j3d.aviatrix3d.SimpleScene scene)
Create a new instance with the headlight off and controls over whether the code will be used in a static or dynamic environment.

Parameters:
scene - The scene to use for the global effects
Method Detail

setLayerId

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

Specified by:
setLayerId in interface OGLGlobalEffectsHandler
Parameters:
id - A non-negative ID for the layer

setViewMatrix

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

Specified by:
setViewMatrix in interface OGLGlobalEffectsHandler
Parameters:
transform - The new view matrix settings

setBackgroundMatrix

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

Specified by:
setBackgroundMatrix in interface OGLGlobalEffectsHandler
Parameters:
transform - The new background matrix settings

setFogMatrix

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

Specified by:
setFogMatrix in interface OGLGlobalEffectsHandler
Parameters:
transform - The new fog matrix settings

updateBackgroundTransparency

public 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.

Specified by:
updateBackgroundTransparency in interface OGLGlobalEffectsHandler
Parameters:
transparency - A value between 0 and 1

updateBackgroundTextures

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

Specified by:
updateBackgroundTextures in interface OGLGlobalEffectsHandler
Parameters:
textures - The list of textures to use
flags - The list of flags indicating a texture change

updateBackgroundGround

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

Specified by:
updateBackgroundGround in interface OGLGlobalEffectsHandler
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

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

Specified by:
updateBackgroundSky in interface OGLGlobalEffectsHandler
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

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

Specified by:
enableFog in interface OGLGlobalEffectsHandler
Parameters:
state - The fog to use right now

setFogDetails

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

Specified by:
setFogDetails in interface OGLGlobalEffectsHandler
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

updateNodeBoundsChanges

public void updateNodeBoundsChanges(java.lang.Object src)
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.

Specified by:
updateNodeBoundsChanges in interface org.j3d.aviatrix3d.NodeUpdateListener
Parameters:
src - The node or Node Component that is to be updated.

updateNodeDataChanges

public void updateNodeDataChanges(java.lang.Object src)
Notification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.

Specified by:
updateNodeDataChanges in interface org.j3d.aviatrix3d.NodeUpdateListener
Parameters:
src - The node or Node Component that is to be updated.

initialize

public void initialize()
Instruct the effects group to start initialisation now


getViewpoint

public org.j3d.aviatrix3d.Viewpoint getViewpoint()
Get the viewPlatform defined here so that views can be attached to it.

Returns:
The ViewPlatform instance in use

useHeadlight

public void useHeadlight(boolean on)
Set the embedded headlight to be on or off.

Parameters:
on - true if the headlight should be turned on

addViewDependentChild

public void addViewDependentChild(org.j3d.aviatrix3d.Group group)
Add an arbitrary child that depends on being view-aligned to the view group.

Parameters:
group - The child to add

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium