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, wkVec2Fields inherited from class org.j3d.aviatrix3d.Node
bounds, implicitBounds, INVALID_BOUNDS, parentFields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandlerFields inherited from interface org.web3d.vrml.renderer.ogl.input.OGLGlobalEffectsHandler
FOG_DISABLE, FOG_EXPONENTIAL, FOG_LINEARFields inherited from interface org.j3d.aviatrix3d.picking.PickableObject
COLLIDABLE_OBJECT, GENERAL_OBJECT, PROXIMITY_OBJECT, VISIBLE_OBJECTFields 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 TypeMethodDescriptionvoidaddViewDependentChild(org.j3d.aviatrix3d.Group group) Add an arbitrary child that depends on being view-aligned to the view group.voidenableFog(int state) Update the fog type in use.org.j3d.aviatrix3d.ViewpointGet the viewPlatform defined here so that views can be attached to it.voidInstruct the effects group to start initialization nowvoidsetBackgroundMatrix(javax.vecmath.Matrix4f transform) Set the background rotation matrix this new matrix.voidsetFogDetails(float visLimit, float r, float g, float b) Update the fog with different setups.voidsetFogMatrix(javax.vecmath.Matrix4f transform) Set the fog coordinate matrix this new matrix.voidsetLayerId(int id) Set or reset the layer ID to the new ID value.voidsetViewMatrix(javax.vecmath.Matrix4f transform) Update the view matrix to be this new matrix.voidshutdown()voidupdateBackgroundGround(float[] color, float[] angles, int num) Update the background ground color sphere to the new values.voidupdateBackgroundSky(float[] color, float[] angles, int num) Update the background sky color sphere to the new values.voidupdateBackgroundTextures(org.j3d.aviatrix3d.Texture2D[] textures, boolean[] flags) Update the background textures to this new set.voidupdateBackgroundTransparency(float transparency) Update the background transparency to this new value.voidNotification that its safe to update the node now with any operations that could potentially effect the node's bounds.voidNotification that its safe to update the node now with any operations that only change the node's properties, but do not change the bounds.voiduseHeadlight(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, updateBoundsMethods inherited from class org.j3d.aviatrix3d.Node
boundsChanged, checkForCyclicParent, getBounds, getParent, removeParent, setParent, updateParentBoundsMethods inherited from class org.j3d.aviatrix3d.SceneGraphObject
dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
setLayerIdin 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:
setViewMatrixin 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:
setBackgroundMatrixin 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:
setFogMatrixin 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:
updateBackgroundTransparencyin 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:
updateBackgroundTexturesin 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:
updateBackgroundGroundin 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:
updateBackgroundSkyin 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:
enableFogin 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:
setFogDetailsin 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:
updateNodeBoundsChangesin 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:
updateNodeDataChangesin 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
-