cz.cuni.jagrlib.iface
Interface LightSource

All Superinterfaces:
Property
All Known Implementing Classes:
AmbientLightSource, DefaultLightSource, RectangleLightSource, StaticPointLightSource

public interface LightSource
extends Property

Abstract light source in 3D scene.

Since:
0.11
Version:
0.26 $Rev: 434 $ $Date: 2007-05-02 03:57:09 +0200 (st, 02 V 2007) $ $Author: pepca $
See Also:
LightSource.java, LightModel, RTScene

Field Summary
static String COLOR
          Property - [primary] surface [diffuse] color.
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Method Summary
 boolean getDirection(MicroFacet mf, double[] dir)
          Returns light direction between the source and the given MicroFacet.
 boolean getDirection(MicroFacet mf, int order, int total, double[] dir)
          Returns light direction between the source and the given MicroFacet.
 boolean getIntensity(MicroFacet mf, double[] color)
          Returns light intensity coming from the source to the given MicroFacet.
 boolean getIntensity(MicroFacet mf, int order, int total, double[] color)
          Returns light intensity coming from the source to the given MicroFacet.
 boolean lights(MicroFacet mf)
          Lighting test from the source to the given MicroFacet.
 boolean lights(MicroFacet mf, int order, int total)
          Lighting test from the source to the given MicroFacet.
 Intersectable setIntersectable(Intersectable inter)
          Sets intersectable object (for light-source of visibility: lights(MicroFacet), ..).
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit, get, set
 

Field Detail

COLOR

static final String COLOR
Property - [primary] surface [diffuse] color.

See Also:
Constant Field Values
Method Detail

setIntersectable

Intersectable setIntersectable(Intersectable inter)
Sets intersectable object (for light-source of visibility: lights(MicroFacet), ..).


lights

boolean lights(MicroFacet mf)
Lighting test from the source to the given MicroFacet.

Parameters:
mf - The checked MicroFacet (point on surface of some solid).
Returns:
true if the light source lights on the given point.
See Also:
getIntensity(cz.cuni.jagrlib.MicroFacet, double[]), getDirection(cz.cuni.jagrlib.MicroFacet, double[])

lights

boolean lights(MicroFacet mf,
               int order,
               int total)
Lighting test from the source to the given MicroFacet. Super-sampling variant.

Parameters:
mf - The checked MicroFacet (point on surface of some solid).
order - Order of this sample inside the actual pixel.
total - Total number of samples in the actual pixel.
Returns:
true if the light source lights on the given point.
See Also:
getIntensity(cz.cuni.jagrlib.MicroFacet, double[]), getDirection(cz.cuni.jagrlib.MicroFacet, double[])

getIntensity

boolean getIntensity(MicroFacet mf,
                     double[] color)
Returns light intensity coming from the source to the given MicroFacet.

Parameters:
mf - The MicroFacet (point on surface of some solid).
color - Pre-allocated double[C] array to hold result - light intensity coming from the source to the given point (C can be either 1 /for monochrome computing/, 3 /for RGB color system/ or greater /for more complex spectral color sampling/).
Returns:
true if the light source can light on the given point (cannot replace the lights() call!).
See Also:
lights(cz.cuni.jagrlib.MicroFacet), getDirection(cz.cuni.jagrlib.MicroFacet, double[])

getIntensity

boolean getIntensity(MicroFacet mf,
                     int order,
                     int total,
                     double[] color)
Returns light intensity coming from the source to the given MicroFacet. Super-sampling variant.

Parameters:
mf - The MicroFacet (point on surface of some solid).
order - Order of this sample inside the actual pixel.
total - Total number of samples in the actual pixel.
color - Pre-allocated double[C] array to hold result - light intensity coming from the source to the given point (C can be either 1 /for monochrome computing/, 3 /for RGB color system/ or greater /for more complex spectral color sampling/).
Returns:
true if the light source can light on the given point (cannot replace the lights() call!).
See Also:
lights(cz.cuni.jagrlib.MicroFacet), getDirection(cz.cuni.jagrlib.MicroFacet, double[])

getDirection

boolean getDirection(MicroFacet mf,
                     double[] dir)
Returns light direction between the source and the given MicroFacet.

Parameters:
mf - The MicroFacet (point on surface of some solid).
dir - Pre-allocated array to hold the result - normalised direction vector from the MicroFacet to the light source.
Returns:
false if the light source is not directional (thus dir is irrelevant).
See Also:
lights(cz.cuni.jagrlib.MicroFacet), getIntensity(cz.cuni.jagrlib.MicroFacet, double[])

getDirection

boolean getDirection(MicroFacet mf,
                     int order,
                     int total,
                     double[] dir)
Returns light direction between the source and the given MicroFacet. Super-sampling variant.

Parameters:
mf - The MicroFacet (point on surface of some solid).
order - Order of this sample inside the actual pixel.
total - Total number of samples in the actual pixel.
dir - Pre-allocated array to hold the result - normalised direction vector from the MicroFacet to the light source.
Returns:
false if the light source is not directional (thus dir is irrelevant).
See Also:
lights(cz.cuni.jagrlib.MicroFacet), getIntensity(cz.cuni.jagrlib.MicroFacet, double[])