Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

BVH Class Reference

A Bounding Volume Hierarchy for ray tracing acceleration. More...

#include <accels/BVH.h>

Inheritance diagram for BVH:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 BVH (Surface **surfaces, int num_surfaces, int axis=0)
 BVH (Surface *prim1, Surface *prim2, const BBox &_bbox, int axis=0)
 BVH (Surface *prim1, Surface *prim2, int axis=0)
bool hit (Ray &r, HitRecord &rec, Context &context) const
bool shadowHit (Ray &r, Context &context) const
BBox boundingBox (double time0, double time1) const
bool overlapsBox (const BBox &box) const

Static Public Member Functions

static SurfacebuildBranch (Surface **surfaces, int num_surfaces, int axis=0)

Detailed Description

A Bounding Volume Hierarchy for ray tracing acceleration.

The BVH is built using slightly modified code from Realistic Ray Tracing, 2nd Edition. A variety of traversals are available by changing the defines at the top of BVH.cc. The ordered traversal seems to perform the best on all inputs.


Member Function Documentation

bool BVH::hit Ray r,
HitRecord rec,
Context context
const [virtual]
 

Intersect given ray with the surface.

Parameters:
[in,out] r Ray to be intersected.
[in,out] rec Struct for passed back shading geometry.
[in,out] context Rendering context.
Returns:
Returns true if a new closest intersection has been found.

Implements Surface.

bool BVH::shadowHit Ray r,
Context context
const [virtual]
 

Intersect without visibility ordering or shading geometry.

Parameters:
[in,out] r Ray to be intersected.
[in,out] context Rendering context.
Returns:
Returns true if a valid intersection is found.

Reimplemented from Surface.

BBox BVH::boundingBox double  time0,
double  time1
const [virtual]
 

Calculate the bounding box of the surface.

Parameters:
[in] time0 Minimum of time interval being sampled.
[in] time1 Maximum of time interval being sampled.
Returns:
The bounding box of the object in the interval [time0, time1).

Implements Surface.

bool BVH::overlapsBox const BBox box  )  const [virtual]
 

Determine if this surface overlaps the input axis aligned box.

Parameters:
[in] box Bounding box to test against.
Returns:
False if the surface definitely does not overlap the box.

Implements Surface.


The documentation for this class was generated from the following files:
Generated on Wed Jul 20 16:15:20 2005 for galileo by  doxygen 1.4.3