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

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

public class PointLightGrid
extends AbstractSurface
implements Light

A PointLightGrid object stores a grid of PointLight objects.


Field Summary
 
Fields inherited from interface net.sf.j3d.threeD.raytracer.lighting.Light
castShadows
 
Constructor Summary
PointLightGrid(int width, int height, double xSpace, double ySpace)
          Constructs a new PointLightGrid object with the specified width, height, and x and y spacing between lights and uses a default PointLight object for each light in the grid.
PointLightGrid(int width, int height, double xSpace, double ySpace, PointLight prototype)
          Constructs a new PointLightGrid object with the specified width, height, and x and y spacing between lights using the data from the specified PointLight object for each light in the grid.
 
Method Summary
 double getIntensity()
          Returns the total intensity of this PointLightGrid (the sum of the intensities of all lights in the grid).
 PointLight[] getLights()
          Returns the array of PointLight objects stored by this PointLightGrid object.
 Vector getNormalAt(Vector point)
          Returns a zero vector.
 boolean intersect(Ray ray)
          Returns false.
 Intersection intersectAt(Ray ray)
          Returns null.
 void setColor(RGB color)
          Sets the color of the PointLight objects stored by this PointLightGrid object to the color represented by the specified RGB object.
 void setIntensity(double intensity)
          Sets the total intensity of this PointLightGrid object (the sum of intensities of all lights in the grid) to the specified double value.
 void updateGrid(int width, int height, double xSpace, double ySpace, PointLight prototype)
          Updates the light grid stored by this PointLightGrid object to have the specified width, height, and x and y spaceing between lights using the data from the specified Point Light object for each light in the grid.
 
Methods inherited from class net.sf.j3d.threeD.raytracer.engine.AbstractSurface
addShader, addTexture, addTransform, calculateTransform, getColor, getColorAt, getColorAt, getIndexOfRefraction, getIndexOfRefraction, getLocation, getParent, getReflectedPercentage, getReflectedPercentage, getRefractedPercentage, getRefractedPercentage, getRotationCoefficients, getScaleCoefficients, getShadeBack, getShadeFront, getShaderSet, getSize, getTexture, getTextures, getTextureSet, getTransform, getTransform, getTransforms, removeTexture, removeTransform, setIndexOfRefraction, setLocation, setParent, setReflectedPercentage, setRefractedPercentage, setRotationCoefficients, setScaleCoefficients, setShadeBack, setShadeFront, setShaders, setShaders, setSize, setTexture, setTextures, setTransform, setTransforms, shade, triangulate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.j3d.threeD.raytracer.lighting.Light
getColor, getColorAt
 

Constructor Detail

PointLightGrid

public PointLightGrid(int width,
                      int height,
                      double xSpace,
                      double ySpace)
Constructs a new PointLightGrid object with the specified width, height, and x and y spacing between lights and uses a default PointLight object for each light in the grid. After the grid is created the total intensity will be set to 1.0.


PointLightGrid

public PointLightGrid(int width,
                      int height,
                      double xSpace,
                      double ySpace,
                      PointLight prototype)
Constructs a new PointLightGrid object with the specified width, height, and x and y spacing between lights using the data from the specified PointLight object for each light in the grid.

Method Detail

updateGrid

public void updateGrid(int width,
                       int height,
                       double xSpace,
                       double ySpace,
                       PointLight prototype)
Updates the light grid stored by this PointLightGrid object to have the specified width, height, and x and y spaceing between lights using the data from the specified Point Light object for each light in the grid.


setIntensity

public void setIntensity(double intensity)
Sets the total intensity of this PointLightGrid object (the sum of intensities of all lights in the grid) to the specified double value.

Specified by:
setIntensity in interface Light

setColor

public void setColor(RGB color)
Sets the color of the PointLight objects stored by this PointLightGrid object to the color represented by the specified RGB object.

Specified by:
setColor in interface Light
Overrides:
setColor in class AbstractSurface

getIntensity

public double getIntensity()
Returns the total intensity of this PointLightGrid (the sum of the intensities of all lights in the grid).

Specified by:
getIntensity in interface Light

getLights

public PointLight[] getLights()
Returns the array of PointLight objects stored by this PointLightGrid object.


getNormalAt

public Vector getNormalAt(Vector point)
Returns a zero vector.

Specified by:
getNormalAt in interface Surface

intersect

public boolean intersect(Ray ray)
Returns false.

Specified by:
intersect in interface Surface

intersectAt

public Intersection intersectAt(Ray ray)
Returns null.

Specified by:
intersectAt in interface Surface