org.xith3d.scenegraph
Class DirectionalLight

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.Node
          extended by org.xith3d.scenegraph.Leaf
              extended by org.xith3d.scenegraph.Light
                  extended by org.xith3d.scenegraph.DirectionalLight
All Implemented Interfaces:
org.jagatoo.datatypes.Enableable, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.SpatialNode

public class DirectionalLight
extends Light

DirectionalLight defines an oriented light source with an origin at infinity.


Field Summary
static org.openmali.vecmath2.Vector3f DEFAULT_DIRECTION
           
 
Fields inherited from class org.xith3d.scenegraph.Light
DEFAULT_COLOR
 
Fields inherited from class org.xith3d.scenegraph.Node
bounds, boundsAutoCompute, boundsDirty, globalIgnoreBounds, instanceBoundsTypeHint, transformGroup, untransformedBounds
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
DirectionalLight()
          Constructs a new DirectionalLight object with a default color of white and default direction of toward the screen along the negative z axis.
DirectionalLight(boolean enabled)
          Constructs a new DirectionalLight object with a default color of white and default direction of toward the screen along the negative z axis.
DirectionalLight(boolean enabled, org.openmali.vecmath2.Colorf color, Node trackedNode)
          Constructs a new DirectionalLight object with the specified color and specified direction.
DirectionalLight(boolean enabled, org.openmali.vecmath2.Colorf color, Node trackedNode, org.openmali.vecmath2.Vector3f direction)
          Constructs a new DirectionalLight object with the specified color and specified direction.
DirectionalLight(boolean enabled, org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Vector3f direction)
          Constructs a new DirectionalLight object with the specified color and specified direction.
DirectionalLight(boolean enabled, float colorR, float colorG, float colorB, float dirX, float dirY, float dirZ)
          Constructs a new DirectionalLight object with the specified color and specified direction.
DirectionalLight(boolean enabled, float colorR, float colorG, float colorB, Node trackedNode)
          Constructs a new DirectionalLight object with the specified color and specified direction.
DirectionalLight(boolean enabled, float colorR, float colorG, float colorB, Node trackedNode, float dirX, float dirY, float dirZ)
          Constructs a new DirectionalLight object with the specified color and specified direction.
DirectionalLight(boolean enabled, Node trackedNode)
          Constructs a new DirectionalLight object with a default color of white and default direction of toward the screen along the negative z axis.
DirectionalLight(org.openmali.vecmath2.Colorf color, Node trackedNode)
          Constructs a new DirectionalLight object with the specified color and specified direction.
DirectionalLight(org.openmali.vecmath2.Colorf color, Node trackedNode, org.openmali.vecmath2.Vector3f direction)
          Constructs a new DirectionalLight object with the specified color and specified direction.
DirectionalLight(org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Vector3f direction)
          Constructs a new DirectionalLight object with the specified color and specified direction.
DirectionalLight(float colorR, float colorG, float colorB, float dirX, float dirY, float dirZ)
          Constructs a new DirectionalLight object with the specified color and specified direction.
DirectionalLight(float colorR, float colorG, float colorB, Node trackedNode)
          Constructs a new DirectionalLight object with the specified color and specified direction.
DirectionalLight(Node trackedNode)
          Constructs a new DirectionalLight object with a default color of white and default direction of toward the screen along the negative z axis.
 
Method Summary
 void getComputedDirection(org.openmali.vecmath2.Vector3f direction)
          If this light has a tracked-node, the light's direction is transformed by the tracked-node's world-transform.
protected static org.openmali.vecmath2.Vector3f getDir(org.openmali.vecmath2.Vector3f dir)
           
 org.openmali.vecmath2.Vector3f getDirection()
          Gets the direction for this object.
 org.openmali.vecmath2.Vector3f getDirection(org.openmali.vecmath2.Vector3f direction)
          Gets the direction for this object.
 Node getTrackedNode()
           
 void setDirection(float dirX, float dirY, float dirZ)
          Sets the direction for this object.
 void setDirection(org.openmali.vecmath2.Vector3f direction)
          Sets the direction for this object.
 void setTrackedNode(Node node)
          Sets the Node to be tracked
If this is not null, the PointLight's location will not be an absolute one anymore, but relative to the tracked Node's world-transform.
 
Methods inherited from class org.xith3d.scenegraph.Light
freeOpenGLResources, getCol, getColor, getInfluencingBoundingLeaf, getInfluencingBounds, getLightID, isEnabled, setColor, setColor, setEnabled, setInfluencingBoundingLeaf, setInfluencingBounds, setPickable, traverse
 
Methods inherited from class org.xith3d.scenegraph.Leaf
dump, getPickHost, setPickHost
 
Methods inherited from class org.xith3d.scenegraph.Node
absorbDetails, cloneNode, detach, duplicateNode, freeOpenGLResources, getBounds, getBoundsAutoCompute, getBoundsType, getBoundsTypeHint, getDefaultPickable, getIndentString, getInheritedNodeAttributes, getModListener, getOrderedChild, getOrderedState, getParent, getRoot, getShadowAttachment, getShowBounds, getTransformGroup, getTreeCell, getWorldBounds, getWorldTransform, getWorldTransform, isBillboard, isIgnoreBounds, isOccluder, isPickable, isRenderable, isUpdatableNode, mergeInheritedClipper, mergeInheritedNodes, mergeInheritedScissorRect, popGlobalIgnoreBounds, printBounds, pushGlobalIgnoreBounds, setBounds, setBoundsAutoCompute, setBoundsDirty, setBoundsDirtyUpward, setBoundsTypeHint, setDefaultPickable, setGlobalIgnoreBounds, setIgnoreBounds, setIsOccluder, setModListener, setOrderedChild, setParent, setPickableRecursive, setPickableRecursive, setRenderable, setShadowAttachment, setShowBounds, setTransformGroup, setTreeCell, sharedCopy, sharedCopy, traverse, unmergeInheritedFog, unmergeInheritedLight, unmergeInheritedNodes, updateBounds, updateBoundsCheap, updateOrderedChild, updateTransformGroup, updateWorldTransform
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_DIRECTION

public static final org.openmali.vecmath2.Vector3f DEFAULT_DIRECTION
Constructor Detail

DirectionalLight

public DirectionalLight(boolean enabled,
                        float colorR,
                        float colorG,
                        float colorB,
                        float dirX,
                        float dirY,
                        float dirZ)
Constructs a new DirectionalLight object with the specified color and specified direction.

Parameters:
enabled -
colorR -
colorG -
colorB -
dirX -
dirY -
dirZ -

DirectionalLight

public DirectionalLight(float colorR,
                        float colorG,
                        float colorB,
                        float dirX,
                        float dirY,
                        float dirZ)
Constructs a new DirectionalLight object with the specified color and specified direction.

Parameters:
colorR -
colorG -
colorB -
dirX -
dirY -
dirZ -

DirectionalLight

public DirectionalLight(boolean enabled,
                        org.openmali.vecmath2.Colorf color,
                        org.openmali.vecmath2.Vector3f direction)
Constructs a new DirectionalLight object with the specified color and specified direction.

Parameters:
enabled -
color -
direction -

DirectionalLight

public DirectionalLight(org.openmali.vecmath2.Colorf color,
                        org.openmali.vecmath2.Vector3f direction)
Constructs a new DirectionalLight object with the specified color and specified direction.

Parameters:
color -
direction -

DirectionalLight

public DirectionalLight(boolean enabled)
Constructs a new DirectionalLight object with a default color of white and default direction of toward the screen along the negative z axis.

Parameters:
enabled -

DirectionalLight

public DirectionalLight()
Constructs a new DirectionalLight object with a default color of white and default direction of toward the screen along the negative z axis.


DirectionalLight

public DirectionalLight(boolean enabled,
                        float colorR,
                        float colorG,
                        float colorB,
                        Node trackedNode,
                        float dirX,
                        float dirY,
                        float dirZ)
Constructs a new DirectionalLight object with the specified color and specified direction.

Parameters:
enabled -
colorR -
colorG -
colorB -
trackedNode -

DirectionalLight

public DirectionalLight(boolean enabled,
                        float colorR,
                        float colorG,
                        float colorB,
                        Node trackedNode)
Constructs a new DirectionalLight object with the specified color and specified direction.

Parameters:
enabled -
colorR -
colorG -
colorB -
trackedNode -

DirectionalLight

public DirectionalLight(float colorR,
                        float colorG,
                        float colorB,
                        Node trackedNode)
Constructs a new DirectionalLight object with the specified color and specified direction.

Parameters:
colorR -
colorG -
colorB -
trackedNode -

DirectionalLight

public DirectionalLight(boolean enabled,
                        org.openmali.vecmath2.Colorf color,
                        Node trackedNode)
Constructs a new DirectionalLight object with the specified color and specified direction.

Parameters:
enabled -
color -
trackedNode -

DirectionalLight

public DirectionalLight(boolean enabled,
                        org.openmali.vecmath2.Colorf color,
                        Node trackedNode,
                        org.openmali.vecmath2.Vector3f direction)
Constructs a new DirectionalLight object with the specified color and specified direction.

Parameters:
enabled -
color -
trackedNode -
direction -

DirectionalLight

public DirectionalLight(org.openmali.vecmath2.Colorf color,
                        Node trackedNode)
Constructs a new DirectionalLight object with the specified color and specified direction.

Parameters:
color -
trackedNode -

DirectionalLight

public DirectionalLight(org.openmali.vecmath2.Colorf color,
                        Node trackedNode,
                        org.openmali.vecmath2.Vector3f direction)
Constructs a new DirectionalLight object with the specified color and specified direction.

Parameters:
color -
trackedNode -
direction -

DirectionalLight

public DirectionalLight(boolean enabled,
                        Node trackedNode)
Constructs a new DirectionalLight object with a default color of white and default direction of toward the screen along the negative z axis.

Parameters:
enabled -
trackedNode -

DirectionalLight

public DirectionalLight(Node trackedNode)
Constructs a new DirectionalLight object with a default color of white and default direction of toward the screen along the negative z axis.

Parameters:
trackedNode -
Method Detail

setTrackedNode

public void setTrackedNode(Node node)
Sets the Node to be tracked
If this is not null, the PointLight's location will not be an absolute one anymore, but relative to the tracked Node's world-transform.

Parameters:
node -

getTrackedNode

public final Node getTrackedNode()
Returns:
the Node to be tracked
If this is not null, the PointLight's location will not be an absolute one anymore, but relative to the tracked Node's world-transform.


setDirection

public void setDirection(float dirX,
                         float dirY,
                         float dirZ)
Sets the direction for this object.

Parameters:
dirX -
dirY -
dirZ -

setDirection

public final void setDirection(org.openmali.vecmath2.Vector3f direction)
Sets the direction for this object.

Parameters:
direction -

getDirection

public final org.openmali.vecmath2.Vector3f getDirection()
Gets the direction for this object.


getDirection

public final org.openmali.vecmath2.Vector3f getDirection(org.openmali.vecmath2.Vector3f direction)
Gets the direction for this object.

Parameters:
direction -

getComputedDirection

public final void getComputedDirection(org.openmali.vecmath2.Vector3f direction)
If this light has a tracked-node, the light's direction is transformed by the tracked-node's world-transform. If it doesn't have a tracked-node, the plain light's direction is returned.

Parameters:
direction -

getDir

protected static final org.openmali.vecmath2.Vector3f getDir(org.openmali.vecmath2.Vector3f dir)