org.xith3d.scenegraph
Class PointLight

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
All Implemented Interfaces:
org.jagatoo.datatypes.Enableable, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.SpatialNode
Direct Known Subclasses:
SpotLight

public class PointLight
extends Light

PointLight defines a point light source located at some point in space and radiating in all directions.


Field Summary
static org.openmali.vecmath2.Tuple3f DEFAULT_ATTENUATION
           
static org.openmali.vecmath2.Point3f 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
PointLight()
          Constructs a new PointLight object with a default color of white and default location of (0,0,0).
PointLight(boolean enabled)
          Constructs a new PointLight object with a default color of white and default location of (0,0,0).
PointLight(boolean enabled, org.openmali.vecmath2.Colorf color, Node trackedNode, float attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(boolean enabled, org.openmali.vecmath2.Colorf color, Node trackedNode, org.openmali.vecmath2.Tuple3f attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(boolean enabled, org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f location, float attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(boolean enabled, org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f location, org.openmali.vecmath2.Tuple3f attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(boolean enabled, float colorR, float colorG, float colorB, float locX, float locY, float locZ, float attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(boolean enabled, float colorR, float colorG, float colorB, float locX, float locY, float locZ, float attenuationConstant, float attenuationLinear, float attenuationQuadratic)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(boolean enabled, float colorR, float colorG, float colorB, Node trackedNode, float attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(boolean enabled, float colorR, float colorG, float colorB, Node trackedNode, float attenuationConstant, float attenuationLinear, float attenuationQuadratic)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(boolean enabled, Node trackedNode)
          Constructs a new PointLight object with a default color of white and default location of (0,0,0).
PointLight(org.openmali.vecmath2.Colorf color, Node trackedNode, float attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(org.openmali.vecmath2.Colorf color, Node trackedNode, org.openmali.vecmath2.Tuple3f attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f location, float attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(org.openmali.vecmath2.Colorf color, org.openmali.vecmath2.Tuple3f location, org.openmali.vecmath2.Tuple3f attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(float colorR, float colorG, float colorB, float locX, float locY, float locZ, float attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(float colorR, float colorG, float colorB, float locX, float locY, float locZ, float attenuationConstant, float attenuationLinear, float attenuationQuadratic)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(float colorR, float colorG, float colorB, Node trackedNode, float attenuation)
          Constructs a new PointLight object with the specified color, location and attenuation.
PointLight(float colorR, float colorG, float colorB, Node trackedNode, float attenuationConstant, float attenuationLinear, float attenuationQuadratic)
          Constructs a new PointLight object with the specified color, location and attenuation.
 
Method Summary
protected static org.openmali.vecmath2.Tuple3f getAtt(org.openmali.vecmath2.Tuple3f att)
           
 org.openmali.vecmath2.Tuple3f getAttenuation()
          Gets the attenuation for this object.
 org.openmali.vecmath2.Tuple3f getAttenuation(org.openmali.vecmath2.Tuple3f attenuation)
          Gets the attenuation for this object.
 void getComputedLocation(org.openmali.vecmath2.Point3f location)
          If this light has a tracked-node, the light's location is transformed by the tracked-node's world-transform.
protected static org.openmali.vecmath2.Tuple3f getLoc(org.openmali.vecmath2.Tuple3f loc)
           
 org.openmali.vecmath2.Point3f getLocation()
          Gets the location for this object.
<T extends org.openmali.vecmath2.Tuple3f>
T
getLocation(T location)
          Gets the location for this object.
 Node getTrackedNode()
           
 org.openmali.vecmath2.Tuple3f setAttenuation(float attConstant, float attLinear, float attQuadratic)
          Sets the attenuation for this object.
 org.openmali.vecmath2.Tuple3f setAttenuation(org.openmali.vecmath2.Tuple3f attenuation)
          Sets the attenuation for this object.
 org.openmali.vecmath2.Point3f setLocation(float x, float y, float z)
          Sets the location for this object.
 org.openmali.vecmath2.Point3f setLocation(org.openmali.vecmath2.Tuple3f location)
          Sets the location 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_LOCATION

public static final org.openmali.vecmath2.Point3f DEFAULT_LOCATION

DEFAULT_ATTENUATION

public static final org.openmali.vecmath2.Tuple3f DEFAULT_ATTENUATION
Constructor Detail

PointLight

public PointLight(boolean enabled,
                  float colorR,
                  float colorG,
                  float colorB,
                  float locX,
                  float locY,
                  float locZ,
                  float attenuationConstant,
                  float attenuationLinear,
                  float attenuationQuadratic)
Constructs a new PointLight object with the specified color, location and attenuation.

Parameters:
enabled -
colorR -
colorG -
colorB -
locX -
locY -
locZ -
attenuationConstant -
attenuationLinear -
attenuationQuadratic -

PointLight

public PointLight(float colorR,
                  float colorG,
                  float colorB,
                  float locX,
                  float locY,
                  float locZ,
                  float attenuationConstant,
                  float attenuationLinear,
                  float attenuationQuadratic)
Constructs a new PointLight object with the specified color, location and attenuation.

Parameters:
colorR -
colorG -
colorB -
locX -
locY -
locZ -
attenuationConstant -
attenuationLinear -
attenuationQuadratic -

PointLight

public PointLight(boolean enabled,
                  float colorR,
                  float colorG,
                  float colorB,
                  float locX,
                  float locY,
                  float locZ,
                  float attenuation)
Constructs a new PointLight object with the specified color, location and attenuation.

Parameters:
enabled -
colorR -
colorG -
colorB -
locX -
locY -
locZ -
attenuation -

PointLight

public PointLight(float colorR,
                  float colorG,
                  float colorB,
                  float locX,
                  float locY,
                  float locZ,
                  float attenuation)
Constructs a new PointLight object with the specified color, location and attenuation.

Parameters:
colorR -
colorG -
colorB -
locX -
locY -
locZ -
attenuation -

PointLight

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

Parameters:
enabled -
color -
location -
attenuation -

PointLight

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

Parameters:
color -
location -
attenuation -

PointLight

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

Parameters:
enabled -
color -
location -
attenuation -

PointLight

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

Parameters:
color -
location -
attenuation -

PointLight

public PointLight(boolean enabled,
                  float colorR,
                  float colorG,
                  float colorB,
                  Node trackedNode,
                  float attenuationConstant,
                  float attenuationLinear,
                  float attenuationQuadratic)
Constructs a new PointLight object with the specified color, location and attenuation.

Parameters:
enabled -
colorR -
colorG -
colorB -
trackedNode -
attenuationConstant -
attenuationLinear -
attenuationQuadratic -

PointLight

public PointLight(float colorR,
                  float colorG,
                  float colorB,
                  Node trackedNode,
                  float attenuationConstant,
                  float attenuationLinear,
                  float attenuationQuadratic)
Constructs a new PointLight object with the specified color, location and attenuation.

Parameters:
colorR -
colorG -
colorB -
trackedNode -
attenuationConstant -
attenuationLinear -
attenuationQuadratic -

PointLight

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

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

PointLight

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

Parameters:
colorR -
colorG -
colorB -
trackedNode -
attenuation -

PointLight

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

Parameters:
enabled -
color -
trackedNode -
attenuation -

PointLight

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

Parameters:
color -
trackedNode -
attenuation -

PointLight

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

Parameters:
enabled -
color -
trackedNode -
attenuation -

PointLight

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

Parameters:
color -
trackedNode -
attenuation -

PointLight

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

Parameters:
enabled -

PointLight

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

Parameters:
enabled -
trackedNode -

PointLight

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

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.


setLocation

public org.openmali.vecmath2.Point3f setLocation(float x,
                                                 float y,
                                                 float z)
Sets the location for this object.

Parameters:
x -
y -
z -

setLocation

public final org.openmali.vecmath2.Point3f setLocation(org.openmali.vecmath2.Tuple3f location)
Sets the location for this object.

Parameters:
location -

getLocation

public final org.openmali.vecmath2.Point3f getLocation()
Gets the location for this object.


getLocation

public final <T extends org.openmali.vecmath2.Tuple3f> T getLocation(T location)
Gets the location for this object.

Parameters:
location -

getComputedLocation

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

Parameters:
location -

setAttenuation

public org.openmali.vecmath2.Tuple3f setAttenuation(float attConstant,
                                                    float attLinear,
                                                    float attQuadratic)
Sets the attenuation for this object.

Parameters:
attConstant -
attLinear -
attQuadratic -

setAttenuation

public final org.openmali.vecmath2.Tuple3f setAttenuation(org.openmali.vecmath2.Tuple3f attenuation)
Sets the attenuation for this object.


getAttenuation

public final org.openmali.vecmath2.Tuple3f getAttenuation()
Gets the attenuation for this object.


getAttenuation

public final org.openmali.vecmath2.Tuple3f getAttenuation(org.openmali.vecmath2.Tuple3f attenuation)
Gets the attenuation for this object.

Parameters:
attenuation -

getAtt

protected static final org.openmali.vecmath2.Tuple3f getAtt(org.openmali.vecmath2.Tuple3f att)

getLoc

protected static final org.openmali.vecmath2.Tuple3f getLoc(org.openmali.vecmath2.Tuple3f loc)