org.xith3d.effects.shadows.occluder
Class Occluder

java.lang.Object
  extended by org.xith3d.effects.shadows.occluder.Occluder

public class Occluder
extends java.lang.Object

An occluder is a special construction of the geometry of a piece in the scene graph. It consists of a set of faces with connectivity information and a spatial container which partitions the faces such that they can be quickly used in collision checks. An occluder is a primary object for shadow volumes as we can easily calculate the proper edges needed for silhouettes.

An occluder is attached to a node in the scenegraph and from that point forward represents the geometry lying below that portion of the scene. It does duplicate some aspects of the GeometryArrays in the shapes below the occluder, but the occluder can be polygon reduced to have a less dense set of triangles.

it is important to note that occluders should be fully contiguous shapes such that there are no orphan edges.

One thing that can cause issues is the fact that the scenegraph which is represented by a single occluder could actually contain nested transforms which within the local coordinate space of the model. These nested transforms are flattened when building the occluder so that the proper vertices can align.

The next problem is that there could be a transform above the model which moves in real time. This would of course normally effect the faces within their local space, as well as their plane calculations. In order to bypass this we will be transforming the location of the lightsource into the local coordinate space so that we can determine the edges. Then when we render the shadow we will use the normal local to world transform for the shadow. (I thought of this in a dream btw... ran downstairs to write it down - Yazel).


Field Summary
 Geometry buffer
           
 int[] neighbourIndices
           
 int nFaces
           
 int nVertices
           
 float[] planeEquation
           
 int[] vertexIndices
           
 float[] vertices
           
 boolean[] visible
           
 Transform3D worldTransform
           
 
Constructor Summary
Occluder()
          Creates a new Occluder.
 
Method Summary
 void build(java.util.List<OccluderSubmission> submission)
          Takes a list of occluder submission nodes and builds the vertex and face lists
 void determineVisibleEdges(org.openmali.vecmath2.Point3f lightPosition)
           
 Geometry getBuffer()
           
 int[] getNeighbourIndices()
           
 int getNFaces()
           
 int getNVertices()
           
 float[] getPlaneEquation()
           
 int[] getVertexIndices()
           
 float[] getVertices()
           
 boolean[] getVisible()
           
 Transform3D getWorldTransform()
           
 void setWorldTransform(Transform3D worldTransform)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

worldTransform

public Transform3D worldTransform

nVertices

public int nVertices

nFaces

public int nFaces

vertexIndices

public int[] vertexIndices

planeEquation

public float[] planeEquation

neighbourIndices

public int[] neighbourIndices

visible

public boolean[] visible

vertices

public float[] vertices

buffer

public Geometry buffer
Constructor Detail

Occluder

public Occluder()
Creates a new Occluder.

Method Detail

getBuffer

public Geometry getBuffer()

determineVisibleEdges

public void determineVisibleEdges(org.openmali.vecmath2.Point3f lightPosition)

build

public void build(java.util.List<OccluderSubmission> submission)
Takes a list of occluder submission nodes and builds the vertex and face lists

Parameters:
submission - A list of OccluderSubmission nodes

setWorldTransform

public void setWorldTransform(Transform3D worldTransform)

getWorldTransform

public Transform3D getWorldTransform()

getNeighbourIndices

public int[] getNeighbourIndices()

getNFaces

public int getNFaces()

getNVertices

public int getNVertices()

getPlaneEquation

public float[] getPlaneEquation()

getVertexIndices

public int[] getVertexIndices()

getVertices

public float[] getVertices()

getVisible

public boolean[] getVisible()