de.grogra.gpuflux.scene.BVH
Class BVHTree

java.lang.Object
  extended by de.grogra.gpuflux.scene.BVH.BVHTree

public class BVHTree
extends java.lang.Object


Field Summary
static int MAX_DEPTH
           
static float TAABB
           
static double TPRIM
           
 
Constructor Summary
BVHTree(BVHNode root, BoundingBox3d bbox, java.lang.Integer[] primOrder)
           
 
Method Summary
 double computeSAH()
           
 BoundingBox3d getBounds()
           
 BVHNode getRoot()
           
 int getRootIdx()
           
static double getSAH(double area, double leftArea, double rightArea, int leftPrims, int rightPrims)
           
 java.lang.Integer[] getVolumeOrdering()
           
 void prune()
           
 void serializeBIH(ComputeByteBuffer computeByteBuffer, int primitiveIdxOffset)
           
 void serializeBVH(ComputeByteBuffer computeByteBuffer, int primitiveIdxOffset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DEPTH

public static final int MAX_DEPTH
See Also:
Constant Field Values

TAABB

public static final float TAABB
See Also:
Constant Field Values

TPRIM

public static final double TPRIM
See Also:
Constant Field Values
Constructor Detail

BVHTree

public BVHTree(BVHNode root,
               BoundingBox3d bbox,
               java.lang.Integer[] primOrder)
Method Detail

computeSAH

public double computeSAH()

getBounds

public BoundingBox3d getBounds()

getRoot

public BVHNode getRoot()

getRootIdx

public int getRootIdx()

getSAH

public static double getSAH(double area,
                            double leftArea,
                            double rightArea,
                            int leftPrims,
                            int rightPrims)

getVolumeOrdering

public java.lang.Integer[] getVolumeOrdering()

prune

public void prune()

serializeBIH

public void serializeBIH(ComputeByteBuffer computeByteBuffer,
                         int primitiveIdxOffset)
                  throws java.io.IOException
Throws:
java.io.IOException

serializeBVH

public void serializeBVH(ComputeByteBuffer computeByteBuffer,
                         int primitiveIdxOffset)
                  throws java.io.IOException
Throws:
java.io.IOException