de.grogra.imp3d.objects
Class LightBase

java.lang.Object
  extended by de.grogra.persistence.ShareableBase
      extended by de.grogra.imp3d.objects.LightBase
All Implemented Interfaces:
Manageable, Shareable, Emitter, Light, Scattering
Direct Known Subclasses:
AmbientLight, DirectionalLight, PointLight

public abstract class LightBase
extends ShareableBase
implements Light


Nested Class Summary
static class LightBase.Type
           
 
Field Summary
static LightBase.Type $TYPE
           
static SCOType.Field color$FIELD
           
static SCOType.Field shadowless$FIELD
           
 
Fields inherited from interface de.grogra.ray.physics.Light
AMBIENT, AREA, DIRECTIONAL, NO_LIGHT, POINT, SKY
 
Fields inherited from interface de.grogra.ray.physics.Scattering
DELTA_FACTOR, IS_NON_OPAQUE, MIN_UNUSED_FLAG, NEEDS_NORMAL, NEEDS_POINT, NEEDS_TANGENTS, NEEDS_TRANSFORMATION, NEEDS_UV, RANDOM_RAYS_GENERATE_ORIGINS
 
Constructor Summary
LightBase()
           
 
Method Summary
 double completeRay(Environment env, Point3d vertex, Ray out)
           
protected  void draw(Tuple3f color, RenderState rs)
           
 int getAverageColor()
          Returns an average color for the scattering entity.
 RGBColor getColor()
           
 int getFlags()
           
 boolean isIgnoredWhenHit()
          Determines whether the light source shall be ignored when a shot ray happens to hit the geometry of the light source.
 boolean isShadowless()
          Determines whether the light source casts shadows or not.
 void setShadowless(boolean value)
           
 
Methods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.grogra.imp3d.shading.Light
accept
 
Methods inherited from interface de.grogra.ray.physics.Light
getLightType, getTotalPower
 
Methods inherited from interface de.grogra.ray.physics.Emitter
computeExitance, generateRandomOrigins
 
Methods inherited from interface de.grogra.ray.physics.Scattering
computeBSDF, generateRandomRays
 
Methods inherited from interface de.grogra.persistence.Manageable
getManageableType
 

Field Detail

$TYPE

public static final LightBase.Type $TYPE

color$FIELD

public static final SCOType.Field color$FIELD

shadowless$FIELD

public static final SCOType.Field shadowless$FIELD
Constructor Detail

LightBase

public LightBase()
Method Detail

completeRay

public double completeRay(Environment env,
                          Point3d vertex,
                          Ray out)
Specified by:
completeRay in interface Emitter

draw

protected void draw(Tuple3f color,
                    RenderState rs)

getAverageColor

public int getAverageColor()
Description copied from interface: Scattering
Returns an average color for the scattering entity. This color is used for simplified graphical representations of the corresponding objects.

Specified by:
getAverageColor in interface Scattering
Returns:
an average color in Java's default sRGB color space, encoded as an int (0xAARRGGBB).

getColor

public RGBColor getColor()

getFlags

public int getFlags()
Specified by:
getFlags in interface Scattering

isIgnoredWhenHit

public boolean isIgnoredWhenHit()
Description copied from interface: Light
Determines whether the light source shall be ignored when a shot ray happens to hit the geometry of the light source.

Specified by:
isIgnoredWhenHit in interface Light
Returns:
true iff the light source shall be ignored

isShadowless

public boolean isShadowless()
Description copied from interface: Light
Determines whether the light source casts shadows or not.

Specified by:
isShadowless in interface Light
Returns:
true iff the light source does not cast shadows

setShadowless

public void setShadowless(boolean value)