de.jreality.scene
Class PointLight

java.lang.Object
  extended by de.jreality.scene.SceneGraphNode
      extended by de.jreality.scene.Light
          extended by de.jreality.scene.PointLight
Direct Known Subclasses:
SpotLight

public class PointLight
extends Light

A point light class. Situated at the origin (0,0,0,1); use scene graph transformations to position it where you want.

The attenuation of the point light is proportional to 1/(A0+A1*d+A2*d*d) where d is the distant of the illuminated point from the light. Set these attenuation factors using setFalloff(double, double, double).

TODO: Somebody needs to document what the shadow map settings are for.

Author:
Charles Gunn

Constructor Summary
PointLight()
           
PointLight(String name)
           
 
Method Summary
 void accept(SceneGraphVisitor v)
          The accept method for a SceneGraphVisitor.
 double getFalloffA0()
           
 double getFalloffA1()
           
 double getFalloffA2()
           
 String getShadowMap()
           
 int getShadowMapX()
           
 int getShadowMapY()
           
 boolean isUseShadowMap()
           
 void setFalloff(double[] atten)
          Deprecated. do we need that method?
 void setFalloff(double a0, double a1, double a2)
           
 void setFalloffA0(double falloffA0)
          Sets the falloffA0.
 void setFalloffA1(double falloffA1)
          Sets the falloffA1.
 void setFalloffA2(double falloffA2)
          Sets the falloffA2.
 void setShadowMap(String shadowMap)
          Sets the shadowMap.
 void setShadowMapX(int shadowMapX)
          Sets the shadowMapX.
 void setShadowMapY(int shadowMapY)
          Sets the shadowMapY.
 void setUseShadowMap(boolean useShadowMap)
          Sets the useShadowMap.
 
Methods inherited from class de.jreality.scene.Light
addLightListener, getColor, getIntensity, getScaledColorAsFloat, isAmbientFake, isGlobal, removeLightListener, setAmbientFake, setColor, setGlobal, setIntensity
 
Methods inherited from class de.jreality.scene.SceneGraphNode
getName, getOwner, getThreadSafe, isReadOnly, setName, setOwner, setReadOnly, setThreadSafe, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PointLight

public PointLight()

PointLight

public PointLight(String name)
Method Detail

getFalloffA0

public double getFalloffA0()

getFalloffA1

public double getFalloffA1()

getFalloffA2

public double getFalloffA2()

setFalloffA0

public void setFalloffA0(double falloffA0)
Sets the falloffA0.

Parameters:
falloffA0 - The falloffA0 to set

setFalloffA1

public void setFalloffA1(double falloffA1)
Sets the falloffA1.

Parameters:
falloffA1 - The falloffA1 to set

setFalloffA2

public void setFalloffA2(double falloffA2)
Sets the falloffA2.

Parameters:
falloffA2 - The falloffA2 to set

setFalloff

public void setFalloff(double a0,
                       double a1,
                       double a2)

setFalloff

public void setFalloff(double[] atten)
Deprecated. do we need that method?

Parameters:
atten -

getShadowMap

public String getShadowMap()

isUseShadowMap

public boolean isUseShadowMap()

setShadowMap

public void setShadowMap(String shadowMap)
Sets the shadowMap.

Parameters:
shadowMap - The shadowMap to set

setUseShadowMap

public void setUseShadowMap(boolean useShadowMap)
Sets the useShadowMap.

Parameters:
useShadowMap - The useShadowMap to set

getShadowMapX

public int getShadowMapX()

getShadowMapY

public int getShadowMapY()

setShadowMapX

public void setShadowMapX(int shadowMapX)
Sets the shadowMapX.

Parameters:
shadowMapX - The shadowMapX to set

setShadowMapY

public void setShadowMapY(int shadowMapY)
Sets the shadowMapY.

Parameters:
shadowMapY - The shadowMapY to set

accept

public void accept(SceneGraphVisitor v)
Description copied from class: SceneGraphNode
The accept method for a SceneGraphVisitor.

Overrides:
accept in class Light