Xj3D VRML/X3D Code API

org.web3d.vrml.nodes
Interface VRMLFogNodeType

All Superinterfaces:
FrameStateListener, VRMLChildNodeType, VRMLNode, VRMLNodeType
All Known Subinterfaces:
J3DFogNodeType

public interface VRMLFogNodeType
extends VRMLChildNodeType

Representation of any type of fog in the system

Version:
$Revision: 1.7 $
Author:
Justin Couch

Field Summary
static int FOG_TYPE_DISABLE
          Constant used to set the fog type to disabled.
static int FOG_TYPE_EXPONENTIAL
          Constant used to set the fog type to exponential.
static int FOG_TYPE_LINEAR
          Constant used to set the fog type to linear.
 
Method Summary
 void getColor(float[] color)
          Get the color of the current fog.
 int getFogType()
          Get the currently set fog type.
 float getVisibilityRange()
          Get the current visibility limit on the fog to be viewed.
 void setColor(float[] color)
          Set the color of the current fog.
 void setFogType(int type)
          Set the fog type to one of the new values.
 void setVisibilityRange(float range)
          Set the visibility limit on the fog to be viewed to a new value.
 
Methods inherited from interface org.web3d.vrml.nodes.VRMLNodeType
addNodeListener, getFieldValue, getMetadataObject, getRefCount, hasFieldChanged, isSetupFinished, notifyExternProtoLoaded, removeNodeListener, sendRoute, setDEF, setFrameStateManager, setMetadataObject, setupFinished, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, updateRefCount
 
Methods inherited from interface org.web3d.vrml.lang.VRMLNode
getFieldDeclaration, getFieldIndex, getNodeFieldIndices, getNumFields, getPrimaryType, getSecondaryType, getUserData, getVRMLNodeName, isDEF, setErrorReporter, setUserData, setVersion
 
Methods inherited from interface org.web3d.vrml.nodes.FrameStateListener
allEventsComplete
 

Field Detail

FOG_TYPE_DISABLE

public static final int FOG_TYPE_DISABLE
Constant used to set the fog type to disabled.

See Also:
Constant Field Values

FOG_TYPE_LINEAR

public static final int FOG_TYPE_LINEAR
Constant used to set the fog type to linear.

See Also:
Constant Field Values

FOG_TYPE_EXPONENTIAL

public static final int FOG_TYPE_EXPONENTIAL
Constant used to set the fog type to exponential.

See Also:
Constant Field Values
Method Detail

getColor

public void getColor(float[] color)
Get the color of the current fog.

Parameters:
color - An array to copy the current color to

setColor

public void setColor(float[] color)
              throws InvalidFieldValueException
Set the color of the current fog. If the color values are out of range or the array is invalid, an exception will be generated.

Parameters:
color - The new colors to set
Throws:
InvalidFieldValueException - The colour values were out of range.

getVisibilityRange

public float getVisibilityRange()
Get the current visibility limit on the fog to be viewed. A value of zero would disable the fog. It will always be a positive number.

Returns:
A non-negative number indicating the distance

setVisibilityRange

public void setVisibilityRange(float range)
                        throws InvalidFieldValueException
Set the visibility limit on the fog to be viewed to a new value. The value of zero will disable the fog. A negative number will generate an exception.

Parameters:
range - A non-negative number indicating the distance
Throws:
InvalidFieldValueException - The number was negative

getFogType

public int getFogType()
Get the currently set fog type. Will be one of the above constant values.

Returns:
One of FOG_TYPE_LINEAR or FOG_TYPE_EXPONENTIAL

setFogType

public void setFogType(int type)
                throws InvalidFieldValueException
Set the fog type to one of the new values. If the value is not known, issue an exception and leave the value at the current.

Parameters:
type - Constant indicating the type. Should be one of FOG_TYPE_LINEAR or FOG_TYPE_EXPONENTIAL
Throws:
InvalidFieldValueException - The value type is unknown

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium