Class GlobalEffectsGroup
java.lang.Object
org.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.Node
org.j3d.aviatrix3d.Group
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_TIMING_ERR_PROP, updateHandler
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
ConstructorsConstructorDescriptionGlobalEffectsGroup
(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
Modifier and TypeMethodDescriptionvoid
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
Get the viewPlatform defined here so that views can be attached to it.void
Instruct the effects group to start initialization nowvoid
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
shutdown()
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
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.void
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, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, 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 Details
-
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 Details
-
setLayerId
public void setLayerId(int id) Set or reset the layer ID to the new ID value.- Specified by:
setLayerId
in interfaceOGLGlobalEffectsHandler
- 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 interfaceOGLGlobalEffectsHandler
- 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 interfaceOGLGlobalEffectsHandler
- 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 interfaceOGLGlobalEffectsHandler
- 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 interfaceOGLGlobalEffectsHandler
- 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 interfaceOGLGlobalEffectsHandler
- Parameters:
textures
- The list of textures to useflags
- 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 interfaceOGLGlobalEffectsHandler
- 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
public void updateBackgroundSky(float[] color, float[] angles, int num) Update the background sky color sphere to the new values.- Specified by:
updateBackgroundSky
in interfaceOGLGlobalEffectsHandler
- 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
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 interfaceOGLGlobalEffectsHandler
- 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 interfaceOGLGlobalEffectsHandler
- 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
-
updateNodeBoundsChanges
Notification that its safe to update the node now with any operations that could potentially effect the node's bounds.- Specified by:
updateNodeBoundsChanges
in interfaceorg.j3d.aviatrix3d.NodeUpdateListener
- Parameters:
src
- The node or Node Component that is to be updated.
-
updateNodeDataChanges
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 interfaceorg.j3d.aviatrix3d.NodeUpdateListener
- Parameters:
src
- The node or Node Component that is to be updated.
-
shutdown
public void shutdown() -
initialize
public void initialize()Instruct the effects group to start initialization 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
-