com.vwp.j3d
Class VisiblePointLight

java.lang.Object
  extended by javax.media.j3d.SceneGraphObject
      extended by javax.media.j3d.Node
          extended by javax.media.j3d.Group
              extended by javax.media.j3d.Switch
                  extended by com.vwp.j3d.VisiblePointLight

public class VisiblePointLight
extends javax.media.j3d.Switch

The VisiblePointLight class is a small scene graph which contains a light source and some geometry below of a Switch where the visible parts of this light (a lens flare like effect) are mapped onto as texture. The texture and the geometry are created dynamically. The color of the light and the color of the visible parts can be defined separately, so that in case the light has to be completely white the visible part nevertheless can be colored.


Field Summary
static int FASTEST
          This constant insfluences the quality of the result.
static int NICEST
          Setting the quality to NICEST the results look better but they require more computing power
 
Fields inherited from class javax.media.j3d.Switch
ALLOW_SWITCH_READ, ALLOW_SWITCH_WRITE, CHILD_ALL, CHILD_MASK, CHILD_NONE
 
Fields inherited from class javax.media.j3d.Group
ALLOW_CHILDREN_EXTEND, ALLOW_CHILDREN_READ, ALLOW_CHILDREN_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE
 
Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
 
Constructor Summary
VisiblePointLight(boolean visible, int quality)
          The default constructor for a VisiblePointLight.
VisiblePointLight(javax.vecmath.Color3f lightColor, javax.vecmath.Point3f position, javax.vecmath.Point3f attenuation, javax.vecmath.Color3f visibleColor, int size, int quality)
          This constructor creates a new VisiblePointLight with the given values.
 
Method Summary
 javax.media.j3d.Bounds getBounds()
          This method returns the Bounds-object for the geometry part
 boolean getEnable()
          This method returns the information if the light is enabled (true) and therefore visible or not (false)
 javax.vecmath.Color3f getVisibleColor()
          This method returns the color of the light objects visible parts
 void setAppearanceCapability(int int0)
          This method allows it to set a capability for the Appearance-part of this objects geometry.
 void setAttenuation(float float0, float float1, float float2)
          This method allowes it to set new constant, linear and quadratic attenuation values for the light part of this object.
 void setEnable(boolean b)
          A VisiblePointLight can be turned on (enabled) or off (disbled) with this method.
 void setGeometryCapability(int int0)
          This method allows it to set a capability for the geometry-part of this object.
 void setGroupCapability(int int0)
          This method allowes it to set a capability for the Group-node-parts of this object.
 void setInfluencingBounds(javax.media.j3d.Bounds bounds)
          This method allows it to specify the working bounds for this object.
 void setLightColor(javax.vecmath.Color3f color3f)
          This method allows it to specify a new color for the indirectly visible part of the light (the real lights color)
 void setPointLightCapability(int int0)
          This method allows it to set a capability for the Light-parts of this object.
 void setPointLightCapabilityIsFrequent(int int0)
          This method allows it to set a is-frequent-capability for the Light-parts of this object.
 void setShapeCapability(int int0)
          This method allows it to set a capability for the Shape3D-part of this objects geometry.
 void setVisibleColor(javax.vecmath.Color3f color3f, int size)
          Comparing to setLightColor() this method doesn't affects the color of the light which is reflected on other objects but the visible part of it (the lens flare like effect).
 
Methods inherited from class javax.media.j3d.Switch
cloneNode, currentChild, getChildMask, getWhichChild, setChildMask, setWhichChild
 
Methods inherited from class javax.media.j3d.Group
addChild, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, indexOfChild, insertChild, moveTo, numChildren, removeAllChildren, removeChild, removeChild, setAlternateCollisionTarget, setChild, setCollisionBounds
 
Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
 
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData, updateNodeReferences
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FASTEST

public static final int FASTEST
This constant insfluences the quality of the result. Using this one the results are less nice but they also use less computing power

See Also:
Constant Field Values

NICEST

public static final int NICEST
Setting the quality to NICEST the results look better but they require more computing power

See Also:
Constant Field Values
Constructor Detail

VisiblePointLight

public VisiblePointLight(boolean visible,
                         int quality)
The default constructor for a VisiblePointLight. It creates a white light with a white-blue looking visible light source at position 0,0,0 and with no attenuation. In every case it is necessary to define working bounds for this object using setInfluencingBounds().

Parameters:
visible - specifies if the light source has to be visible immediately. If this parameter is set to false, the light source becomes visible and active after the next call of setVisibleColor() and after the requred working bound have been set
quality - specifies the quality of the result using FASTEST or NICEST

VisiblePointLight

public VisiblePointLight(javax.vecmath.Color3f lightColor,
                         javax.vecmath.Point3f position,
                         javax.vecmath.Point3f attenuation,
                         javax.vecmath.Color3f visibleColor,
                         int size,
                         int quality)
This constructor creates a new VisiblePointLight with the given values. Using this constructor the light becomes visible immediately after the working bounds have been set.

Parameters:
lightColor - specifies the color of the light which is reflected on other objects
position - specifies the position of the VisiblePointLights source
attenuation - specifies the constant, linear and quadratic attenuation; these values influence the light in the same way as described for the PointLight
visibleColor - specifies the visible color part of the light source. This color value normally should be similar to the lightColor, but in case a completely white lightcolor was set, it could be necessary to let the visibleColor differ for a proper effect
size - specifies the size of the used image and therefore it influences the quality of the result
quality - specifies the quality of the result using FASTEST or NICEST
Method Detail

setEnable

public void setEnable(boolean b)
A VisiblePointLight can be turned on (enabled) or off (disbled) with this method.

Parameters:
b - specifies if the light has to be turned on (true) or off (false)

getEnable

public boolean getEnable()
This method returns the information if the light is enabled (true) and therefore visible or not (false)


getBounds

public javax.media.j3d.Bounds getBounds()
This method returns the Bounds-object for the geometry part

Overrides:
getBounds in class javax.media.j3d.Node

setInfluencingBounds

public void setInfluencingBounds(javax.media.j3d.Bounds bounds)
This method allows it to specify the working bounds for this object. The same bounds-object is used for the influencing bounds of the light and for the scheduling bounds of the Billboard behavior which lets the visible part always direct to the users position.

Parameters:
bounds - the Bounds object which is required in every case to let the light become visible and to let the object work

setAttenuation

public void setAttenuation(float float0,
                           float float1,
                           float float2)
This method allowes it to set new constant, linear and quadratic attenuation values for the light part of this object. Please refer the Java 3D documentation about the class Light for more information how this attenuation works.

Parameters:
float0 - the constant part of the attenuation
float1 - the linear part of the attenuation which grows with the distance from the light source
float2 - this part of the attenuation grows quadratically with the distance

setLightColor

public void setLightColor(javax.vecmath.Color3f color3f)
This method allows it to specify a new color for the indirectly visible part of the light (the real lights color)

Parameters:
color3f - the new color for the light

setVisibleColor

public void setVisibleColor(javax.vecmath.Color3f color3f,
                            int size)
Comparing to setLightColor() this method doesn't affects the color of the light which is reflected on other objects but the visible part of it (the lens flare like effect). When a new visible light color is specified, the texture which represents the light sources corona is computed completely new which can take some time.

Parameters:
color3f - the new color for the directly visible part of this light
size - the scaling factor which specifies how big the corona of the light has to be

getVisibleColor

public javax.vecmath.Color3f getVisibleColor()
This method returns the color of the light objects visible parts


setPointLightCapability

public void setPointLightCapability(int int0)
This method allows it to set a capability for the Light-parts of this object. Please use the capability constants from class Pointlight as parameter

Parameters:
int0 - the capability constant which has to be set

setPointLightCapabilityIsFrequent

public void setPointLightCapabilityIsFrequent(int int0)
This method allows it to set a is-frequent-capability for the Light-parts of this object. Please use the capability constants from class Pointlight as parameter

Parameters:
int0 - the capability constant which has to be set

setAppearanceCapability

public void setAppearanceCapability(int int0)
This method allows it to set a capability for the Appearance-part of this objects geometry. Please use the capability constants from class Appearance as parameter

Parameters:
int0 - the capability constant which has to be set

setGeometryCapability

public void setGeometryCapability(int int0)
This method allows it to set a capability for the geometry-part of this object. Please use the capability constants from class IndexedTriangleFanArray as parameter

Parameters:
int0 - the capability constant which has to be set

setShapeCapability

public void setShapeCapability(int int0)
This method allows it to set a capability for the Shape3D-part of this objects geometry. Please use the capability constants from class Shape3D as parameter

Parameters:
int0 - the capability constant which has to be set

setGroupCapability

public void setGroupCapability(int int0)
This method allowes it to set a capability for the Group-node-parts of this object. Please use the capability constants from class Group as parameter

Parameters:
int0 - the capability constant which has to be set