astex
Class ShadowCache

java.lang.Object
  extended by astex.ShadowCache

public class ShadowCache
extends java.lang.Object


Field Summary
static FloatArray ccacher
           
static FloatArray ccachex0
          Cylinder cache for shadows.
static FloatArray ccachex1
           
static FloatArray ccachey0
           
static FloatArray ccachey1
           
static FloatArray ccachez0
           
static FloatArray ccachez1
           
static IntArray cylinderShadowCacheList
           
static IntArray initialList
           
static double overallScale
          Overall scale factor in the renderer.
static FloatArray scacher
           
static FloatArray scachex
          Sphere cache for shadows.
static FloatArray scachey
           
static FloatArray scachez
           
static float[] scr
           
static float[] scx
          References for sphere centers.
static float[] scy
           
static float[] scz
           
static IntArray sphereOcclusionCacheList
           
static IntArray sphereShadowCacheList
          Cache and occlusion lists.
static float[] tc2x
          References to the triangle bounding sphere info.
static float[] tc2y
           
static FloatArray tcachex0
          Triangle cache for shadows.
static FloatArray tcachex1
           
static FloatArray tcachex2
           
static FloatArray tcachey0
           
static FloatArray tcachey1
           
static FloatArray tcachey2
           
static FloatArray tcachez0
           
static FloatArray tcachez1
           
static FloatArray tcachez2
           
static FloatArray tcen2dx
           
static FloatArray tcen2dy
           
static FloatArray tcenr
           
static FloatArray tcenx
           
static FloatArray tceny
           
static FloatArray tcenz
           
static float[] tcr
           
static float[] tcx
           
static float[] tcy
           
static float[] tcz
           
static IntArray triangleShadowCacheList
           
static float[] tx0
          References to the triangle array contents.
static float[] tx1
           
static float[] tx2
           
static float[] ty0
           
static float[] ty1
           
static float[] ty2
           
static float[] tz0
           
static float[] tz1
           
static float[] tz2
           
 
Constructor Summary
ShadowCache()
           
 
Method Summary
static void addCylinderToCacheList(double x0, double y0, double z0, double x1, double y1, double z1, double r)
          Add a cylinder to the cache list.
static void addSphereToCacheList(double x, double y, double z, double r)
          Add a sphere to the cache list.
static void addTriangleToCacheList(double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2, int transparency)
          Add a cylinder to the cache list.
static void boundingSphereCylinder(double c0x, double c0y, double c0z, double c1x, double c1y, double c1z, double r, double[] bs)
          Prepare bounding sphere that encloses cylinder.
static void boundingSphereTriangle(double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2, double[] bs)
          Prepare bounding sphere that encloses cylinder.
static void clearShadowCaches()
          Clear out the shadow data structures.
static int intersect_triangle(double[] orig, double[] dir, double[] vert0, double[] vert1, double[] vert2, double[] tuv)
           
static void main(java.lang.String[] args)
           
static boolean obscuredBySphere(int i, double x, double y, double z)
           
static boolean pointInSphere(double x, double y, double z)
          Is this point in another sphere.
static boolean pointShadowed(double x, double y, double z)
          Is this point shadowed by stuff in the shadow cache.
static void prepareCylinderCacheList(double c0x, double c0y, double c0z, double c1x, double c1y, double c1z, double r)
          Prepare shadow cache list for cylinder, by making bounding volume a sphere that encloses the whole cylinder.
static void prepareSphereCacheList(double sx, double sy, double sz, double sr, boolean transparent)
          Prepare a list of objects that may obscure points on _this_ sphere.
static void prepareTriangleCacheList(double x0, double y0, double z0, double x1, double y1, double z1, double x2, double y2, double z2, boolean targetIsTransparent)
          Prepare shadow cache list for triangle, by making bounding volume a sphere that encloses the whole triangle.
static boolean selfShadowed(double nx, double ny, double nz, double tol)
          Is the surface at this point self shadowing.
static void setupShadowCaches(Light l0, double ovs)
          Set up the shadow cache data structures for renderering.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scachex

public static FloatArray scachex
Sphere cache for shadows.


scachey

public static FloatArray scachey

scachez

public static FloatArray scachez

scacher

public static FloatArray scacher

ccachex0

public static FloatArray ccachex0
Cylinder cache for shadows.


ccachey0

public static FloatArray ccachey0

ccachez0

public static FloatArray ccachez0

ccachex1

public static FloatArray ccachex1

ccachey1

public static FloatArray ccachey1

ccachez1

public static FloatArray ccachez1

ccacher

public static FloatArray ccacher

tcachex0

public static FloatArray tcachex0
Triangle cache for shadows.


tcachey0

public static FloatArray tcachey0

tcachez0

public static FloatArray tcachez0

tcachex1

public static FloatArray tcachex1

tcachey1

public static FloatArray tcachey1

tcachez1

public static FloatArray tcachez1

tcachex2

public static FloatArray tcachex2

tcachey2

public static FloatArray tcachey2

tcachez2

public static FloatArray tcachez2

tcen2dx

public static FloatArray tcen2dx

tcen2dy

public static FloatArray tcen2dy

tcenx

public static FloatArray tcenx

tceny

public static FloatArray tceny

tcenz

public static FloatArray tcenz

tcenr

public static FloatArray tcenr

tx0

public static float[] tx0
References to the triangle array contents.


ty0

public static float[] ty0

tz0

public static float[] tz0

tx1

public static float[] tx1

ty1

public static float[] ty1

tz1

public static float[] tz1

tx2

public static float[] tx2

ty2

public static float[] ty2

tz2

public static float[] tz2

tc2x

public static float[] tc2x
References to the triangle bounding sphere info.


tc2y

public static float[] tc2y

tcx

public static float[] tcx

tcy

public static float[] tcy

tcz

public static float[] tcz

tcr

public static float[] tcr

scx

public static float[] scx
References for sphere centers.


scy

public static float[] scy

scz

public static float[] scz

scr

public static float[] scr

sphereShadowCacheList

public static IntArray sphereShadowCacheList
Cache and occlusion lists.


sphereOcclusionCacheList

public static IntArray sphereOcclusionCacheList

cylinderShadowCacheList

public static IntArray cylinderShadowCacheList

triangleShadowCacheList

public static IntArray triangleShadowCacheList

initialList

public static IntArray initialList

overallScale

public static double overallScale
Overall scale factor in the renderer.

Constructor Detail

ShadowCache

public ShadowCache()
Method Detail

prepareTriangleCacheList

public static void prepareTriangleCacheList(double x0,
                                            double y0,
                                            double z0,
                                            double x1,
                                            double y1,
                                            double z1,
                                            double x2,
                                            double y2,
                                            double z2,
                                            boolean targetIsTransparent)
Prepare shadow cache list for triangle, by making bounding volume a sphere that encloses the whole triangle.


prepareCylinderCacheList

public static void prepareCylinderCacheList(double c0x,
                                            double c0y,
                                            double c0z,
                                            double c1x,
                                            double c1y,
                                            double c1z,
                                            double r)
Prepare shadow cache list for cylinder, by making bounding volume a sphere that encloses the whole cylinder.


boundingSphereCylinder

public static void boundingSphereCylinder(double c0x,
                                          double c0y,
                                          double c0z,
                                          double c1x,
                                          double c1y,
                                          double c1z,
                                          double r,
                                          double[] bs)
Prepare bounding sphere that encloses cylinder.


boundingSphereTriangle

public static void boundingSphereTriangle(double x0,
                                          double y0,
                                          double z0,
                                          double x1,
                                          double y1,
                                          double z1,
                                          double x2,
                                          double y2,
                                          double z2,
                                          double[] bs)
Prepare bounding sphere that encloses cylinder.


prepareSphereCacheList

public static void prepareSphereCacheList(double sx,
                                          double sy,
                                          double sz,
                                          double sr,
                                          boolean transparent)
Prepare a list of objects that may obscure points on _this_ sphere. As we have scan line coherence, the cache list can be reused many times for a given sphere.


addSphereToCacheList

public static void addSphereToCacheList(double x,
                                        double y,
                                        double z,
                                        double r)
Add a sphere to the cache list.


addCylinderToCacheList

public static void addCylinderToCacheList(double x0,
                                          double y0,
                                          double z0,
                                          double x1,
                                          double y1,
                                          double z1,
                                          double r)
Add a cylinder to the cache list.


addTriangleToCacheList

public static void addTriangleToCacheList(double x0,
                                          double y0,
                                          double z0,
                                          double x1,
                                          double y1,
                                          double z1,
                                          double x2,
                                          double y2,
                                          double z2,
                                          int transparency)
Add a cylinder to the cache list.


selfShadowed

public static boolean selfShadowed(double nx,
                                   double ny,
                                   double nz,
                                   double tol)
Is the surface at this point self shadowing. i.e. does the normal point away from the light.


pointShadowed

public static boolean pointShadowed(double x,
                                    double y,
                                    double z)
Is this point shadowed by stuff in the shadow cache.


obscuredBySphere

public static boolean obscuredBySphere(int i,
                                       double x,
                                       double y,
                                       double z)

pointInSphere

public static boolean pointInSphere(double x,
                                    double y,
                                    double z)
Is this point in another sphere.


clearShadowCaches

public static void clearShadowCaches()
Clear out the shadow data structures.


setupShadowCaches

public static void setupShadowCaches(Light l0,
                                     double ovs)
Set up the shadow cache data structures for renderering.


intersect_triangle

public static int intersect_triangle(double[] orig,
                                     double[] dir,
                                     double[] vert0,
                                     double[] vert1,
                                     double[] vert2,
                                     double[] tuv)

main

public static void main(java.lang.String[] args)