org.xith3d.scenegraph
Class SpotLight

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.PointLight
                      extended by org.xith3d.scenegraph.SpotLight
All Implemented Interfaces:
org.jagatoo.datatypes.Enableable, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.SpatialNode

public class SpotLight
extends PointLight

SpotLight defines a point light source located at some point in space and radiating in a specific direction.


Field Summary
static float DEFAULT_CONCENTRAION
           
static org.openmali.vecmath2.Vector3f DEFAULT_DIRECTION
           
static float DEFAULT_SPREAD_ANGLE
           
 
Fields inherited from class org.xith3d.scenegraph.PointLight
DEFAULT_ATTENUATION, DEFAULT_LOCATION
 
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
SpotLight()
          Constructs a new SpotLight object with a default color of white and default location of (0, 0, 0).
SpotLight(boolean enabled)
          Constructs a new SpotLight object with a default color of white and default location of (0, 0, 0).
SpotLight(boolean enabled, org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f direction, Node trackedNode, float spreadAngle)
          Constructs a new SpotLight object with the specified color, location and attenuation.
SpotLight(boolean enabled, org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f direction, Node trackedNode, org.openmali.vecmath2.Tuple3f attenuation, float spreadAngle, float concentration)
          Constructs a new SpotLight object with the specified color, location and attenuation.
SpotLight(boolean enabled, org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f location, org.openmali.vecmath2.Tuple3f direction, float spreadAngle)
          Constructs a new SpotLight object with the specified color, location and attenuation.
SpotLight(boolean enabled, org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f location, org.openmali.vecmath2.Tuple3f direction, org.openmali.vecmath2.Tuple3f attenuation, float spreadAngle, float concentration)
          Constructs a new SpotLight object with the specified color, location and attenuation.
SpotLight(boolean enabled, Node trackedNode)
          Constructs a new SpotLight object with a default color of white and default location of (0, 0, 0).
SpotLight(org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f direction, Node trackedNode, float spreadAngle)
          Constructs a new SpotLight object with the specified color, location and attenuation.
SpotLight(org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f direction, Node trackedNode, org.openmali.vecmath2.Tuple3f attenuation, float spreadAngle, float concentration)
          Constructs a new SpotLight object with the specified color, location and attenuation.
SpotLight(org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f location, org.openmali.vecmath2.Tuple3f direction, float spreadAngle)
          Constructs a new SpotLight object with the specified color, location and attenuation.
SpotLight(org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f location, org.openmali.vecmath2.Tuple3f direction, org.openmali.vecmath2.Tuple3f attenuation, float spreadAngle, float concentration)
          Constructs a new SpotLight object with the specified color, location and attenuation.
SpotLight(Node trackedNode)
          Constructs a new SpotLight object with a default color of white and default location of (0, 0, 0).
 
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.
 float getConcentration()
          Gets the concentration for this object.
 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.
 float getSpreadAngle()
          Gets the spread angle for this object.
 float getSpreadAngleDeg()
          Gets the spread angle for this object.
 void setConcentration(float concentration)
          Sets the concentration for this object.
 void setDirection(float dirX, float dirY, float dirZ)
          Sets the direction for this object.
 void setDirection(org.openmali.vecmath2.Tuple3f direction)
          Sets the direction for this object.
 void setSpreadAngle(float spread)
          Sets the spread angle for this object.
 void setSpreadAngleDeg(float spread)
          Sets the spread angle for this object.
 
Methods inherited from class org.xith3d.scenegraph.PointLight
getAtt, getAttenuation, getAttenuation, getComputedLocation, getLoc, getLocation, getLocation, getTrackedNode, setAttenuation, setAttenuation, setLocation, setLocation, setTrackedNode
 
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

DEFAULT_SPREAD_ANGLE

public static final float DEFAULT_SPREAD_ANGLE
See Also:
Constant Field Values

DEFAULT_CONCENTRAION

public static final float DEFAULT_CONCENTRAION
See Also:
Constant Field Values
Constructor Detail

SpotLight

public SpotLight(boolean enabled,
                 org.openmali.vecmath2.Colorf color,
                 org.openmali.vecmath2.Tuple3f location,
                 org.openmali.vecmath2.Tuple3f direction,
                 org.openmali.vecmath2.Tuple3f attenuation,
                 float spreadAngle,
                 float concentration)
Constructs a new SpotLight object with the specified color, location and attenuation.

Parameters:
enabled -
color -
location -
direction -
attenuation -
spreadAngle -
concentration -

SpotLight

public SpotLight(org.openmali.vecmath2.Colorf color,
                 org.openmali.vecmath2.Tuple3f location,
                 org.openmali.vecmath2.Tuple3f direction,
                 org.openmali.vecmath2.Tuple3f attenuation,
                 float spreadAngle,
                 float concentration)
Constructs a new SpotLight object with the specified color, location and attenuation.

Parameters:
color -
location -
direction -
attenuation -
spreadAngle -
concentration -

SpotLight

public SpotLight(boolean enabled,
                 org.openmali.vecmath2.Colorf color,
                 org.openmali.vecmath2.Tuple3f location,
                 org.openmali.vecmath2.Tuple3f direction,
                 float spreadAngle)
Constructs a new SpotLight object with the specified color, location and attenuation.

Parameters:
enabled -
color -
location -
direction -
spreadAngle -

SpotLight

public SpotLight(org.openmali.vecmath2.Colorf color,
                 org.openmali.vecmath2.Tuple3f location,
                 org.openmali.vecmath2.Tuple3f direction,
                 float spreadAngle)
Constructs a new SpotLight object with the specified color, location and attenuation.

Parameters:
color -
location -
direction -
spreadAngle -

SpotLight

public SpotLight(boolean enabled)
Constructs a new SpotLight object with a default color of white and default location of (0, 0, 0).

Parameters:
enabled -

SpotLight

public SpotLight()
Constructs a new SpotLight object with a default color of white and default location of (0, 0, 0).


SpotLight

public SpotLight(boolean enabled,
                 org.openmali.vecmath2.Colorf color,
                 org.openmali.vecmath2.Tuple3f direction,
                 Node trackedNode,
                 org.openmali.vecmath2.Tuple3f attenuation,
                 float spreadAngle,
                 float concentration)
Constructs a new SpotLight object with the specified color, location and attenuation.

Parameters:
enabled -
color -
direction -
trackedNode -
attenuation -
spreadAngle -
concentration -

SpotLight

public SpotLight(org.openmali.vecmath2.Colorf color,
                 org.openmali.vecmath2.Tuple3f direction,
                 Node trackedNode,
                 org.openmali.vecmath2.Tuple3f attenuation,
                 float spreadAngle,
                 float concentration)
Constructs a new SpotLight object with the specified color, location and attenuation.

Parameters:
color -
direction -
trackedNode -
attenuation -
spreadAngle -
concentration -

SpotLight

public SpotLight(boolean enabled,
                 org.openmali.vecmath2.Colorf color,
                 org.openmali.vecmath2.Tuple3f direction,
                 Node trackedNode,
                 float spreadAngle)
Constructs a new SpotLight object with the specified color, location and attenuation.

Parameters:
enabled -
color -
direction -
trackedNode -
spreadAngle -

SpotLight

public SpotLight(org.openmali.vecmath2.Colorf color,
                 org.openmali.vecmath2.Tuple3f direction,
                 Node trackedNode,
                 float spreadAngle)
Constructs a new SpotLight object with the specified color, location and attenuation.

Parameters:
color -
direction -
trackedNode -
spreadAngle -

SpotLight

public SpotLight(boolean enabled,
                 Node trackedNode)
Constructs a new SpotLight object with a default color of white and default location of (0, 0, 0).

Parameters:
enabled -
trackedNode -

SpotLight

public SpotLight(Node trackedNode)
Constructs a new SpotLight object with a default color of white and default location of (0, 0, 0).

Parameters:
trackedNode -
Method Detail

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.Tuple3f 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.


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 -

setSpreadAngle

public void setSpreadAngle(float spread)
Sets the spread angle for this object.

Parameters:
spread - Spread angle in radians

setSpreadAngleDeg

public void setSpreadAngleDeg(float spread)
Sets the spread angle for this object.

Parameters:
spread - Spread angle in degrees

getSpreadAngle

public final float getSpreadAngle()
Gets the spread angle for this object.

Returns:
Spread angle in radians

getSpreadAngleDeg

public final float getSpreadAngleDeg()
Gets the spread angle for this object.

Returns:
Spread angle in degrees

setConcentration

public void setConcentration(float concentration)
Sets the concentration for this object.

Parameters:
concentration -

getConcentration

public final float getConcentration()
Gets the concentration for this object.