net.sf.j3d.threeD.raytracer.lighting
Class SphericalLight

java.lang.Object
  extended by net.sf.j3d.threeD.raytracer.engine.AbstractSurface
      extended by net.sf.j3d.threeD.raytracer.primitives.Sphere
          extended by net.sf.j3d.threeD.raytracer.lighting.SphericalLight
All Implemented Interfaces:
Surface, Light, SurfaceLight

public class SphericalLight
extends Sphere
implements SurfaceLight

A SphericalLight object provides PointLight samples that are randomly distributed across the surface of a sphere.

Author:
Mike Murray

Field Summary
 
Fields inherited from interface net.sf.j3d.threeD.raytracer.lighting.Light
castShadows
 
Constructor Summary
SphericalLight()
          Constructs a new SphericalLight object.
SphericalLight(Vector location, double radius)
          Constructs a new SphericalLight object.
 
Method Summary
 double[] getAttenuationCoefficients()
           
 double getIntensity()
          Returns the intensity of this Light object as a double value.
 double[][] getParticleVertices()
           
 int getSampleCount()
           
 Light[] getSamples()
           
 Light[] getSamples(int total)
           
 void setAttenuationCoefficients(double a, double b, double c)
          Sets the attenuation coefficients to be used when light samples are created.
 void setIntensity(double intensity)
          Sets the intensity of this Light object.
 void setSampleCount(int samples)
          Sets the number of samples to use for this SphericalLight object.
 String toString()
           
 
Methods inherited from class net.sf.j3d.threeD.raytracer.primitives.Sphere
getIndexOfRefraction, getNormalAt, intersect, intersectAt, triangulate
 
Methods inherited from class net.sf.j3d.threeD.raytracer.engine.AbstractSurface
addShader, addTexture, addTransform, calculateTransform, getColor, getColorAt, getColorAt, getIndexOfRefraction, getLocation, getParent, getReflectedPercentage, getReflectedPercentage, getRefractedPercentage, getRefractedPercentage, getRotationCoefficients, getScaleCoefficients, getShadeBack, getShadeFront, getShaderSet, getSize, getTexture, getTextures, getTextureSet, getTransform, getTransform, getTransforms, removeTexture, removeTransform, setColor, setIndexOfRefraction, setLocation, setParent, setReflectedPercentage, setRefractedPercentage, setRotationCoefficients, setScaleCoefficients, setShadeBack, setShadeFront, setShaders, setShaders, setSize, setTexture, setTextures, setTransform, setTransforms, shade
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sf.j3d.threeD.raytracer.lighting.Light
getColor, getColorAt, setColor
 

Constructor Detail

SphericalLight

public SphericalLight()
Constructs a new SphericalLight object.


SphericalLight

public SphericalLight(Vector location,
                      double radius)
Constructs a new SphericalLight object.

Parameters:
location - Location for sphere.
radius - Radius of sphere.
Method Detail

setSampleCount

public void setSampleCount(int samples)
Sets the number of samples to use for this SphericalLight object.

Parameters:
samples -

getSampleCount

public int getSampleCount()
Returns:
The number of samples to use for this SphericalLight object.

getSamples

public Light[] getSamples(int total)
Specified by:
getSamples in interface SurfaceLight
Parameters:
total - Total number of samples to return.
Returns:
An array containing samples for this SurfaceLight instance.
See Also:
SurfaceLight.getSamples(int)

getSamples

public Light[] getSamples()
Specified by:
getSamples in interface SurfaceLight
Returns:
An array containing samples for this SurfaceLight instance.
See Also:
SurfaceLight.getSamples()

setIntensity

public void setIntensity(double intensity)
Description copied from interface: Light
Sets the intensity of this Light object.

Specified by:
setIntensity in interface Light
See Also:
Light.setIntensity(double)

getIntensity

public double getIntensity()
Description copied from interface: Light
Returns the intensity of this Light object as a double value.

Specified by:
getIntensity in interface Light
See Also:
Light.getIntensity()

setAttenuationCoefficients

public void setAttenuationCoefficients(double a,
                                       double b,
                                       double c)
Sets the attenuation coefficients to be used when light samples are created.


getAttenuationCoefficients

public double[] getAttenuationCoefficients()
Returns:
An array containing the attenuation coefficients used when light samples are created.

getParticleVertices

public double[][] getParticleVertices()
See Also:
ParticleGroup.getParticleVertices()

toString

public String toString()
Overrides:
toString in class Object
Returns:
"Spherical Light".