org.sunflow.core.primitive

Class CornellBox

Implemented Interfaces:
LightSource, PrimitiveList, RenderObject, Shader

public class CornellBox
extends java.lang.Object
implements PrimitiveList, Shader, LightSource

Constructor Summary

CornellBox()

Method Summary

PrimitiveList
getBakingPrimitives()
float
getBound(int i)
BoundingBox
getBounds()
int
getNumPrimitives()
int
getNumSamples()
void
getPhoton(double randX1, double randY1, double randX2, double randY2, Point3 p, Vector3 dir, Color power)
float
getPower()
float
getPrimitiveBound(int primID, int i)
Color
getRadiance(ShadingState state)
void
getSamples(ShadingState state)
BoundingBox
getWorldBounds(Matrix4 o2w)
void
init(String name, SunflowAPI api)
void
intersectPrimitive(Ray r, int primID, IntersectionState state)
boolean
intersects(BoundingBox box)
void
prepareShadingState(ShadingState state)
void
scatterPhoton(ShadingState state, Color power)
boolean
update(ParameterList pl, SunflowAPI api)

Constructor Details

CornellBox

public CornellBox()

Method Details

getBakingPrimitives

public PrimitiveList getBakingPrimitives()
Specified by:
getBakingPrimitives in interface PrimitiveList

getBound

public float getBound(int i)

getBounds

public BoundingBox getBounds()

getNumPrimitives

public int getNumPrimitives()
Specified by:
getNumPrimitives in interface PrimitiveList

getNumSamples

public int getNumSamples()
Specified by:
getNumSamples in interface LightSource

getPhoton

public void getPhoton(double randX1,
                      double randY1,
                      double randX2,
                      double randY2,
                      Point3 p,
                      Vector3 dir,
                      Color power)
Specified by:
getPhoton in interface LightSource

getPower

public float getPower()
Specified by:
getPower in interface LightSource

getPrimitiveBound

public float getPrimitiveBound(int primID,
                               int i)
Specified by:
getPrimitiveBound in interface PrimitiveList

getRadiance

public Color getRadiance(ShadingState state)
Specified by:
getRadiance in interface Shader

getSamples

public void getSamples(ShadingState state)
Specified by:
getSamples in interface LightSource

getWorldBounds

public BoundingBox getWorldBounds(Matrix4 o2w)
Specified by:
getWorldBounds in interface PrimitiveList

init

public void init(String name,
                 SunflowAPI api)

intersectPrimitive

public void intersectPrimitive(Ray r,
                               int primID,
                               IntersectionState state)
Specified by:
intersectPrimitive in interface PrimitiveList

intersects

public boolean intersects(BoundingBox box)

prepareShadingState

public void prepareShadingState(ShadingState state)
Specified by:
prepareShadingState in interface PrimitiveList

scatterPhoton

public void scatterPhoton(ShadingState state,
                          Color power)
Specified by:
scatterPhoton in interface Shader

update

public boolean update(ParameterList pl,
                      SunflowAPI api)
Specified by:
update in interface RenderObject