lux::BVHAccel Class Reference

#include <bvhaccel.h>

Inheritance diagram for lux::BVHAccel:
[legend]
Collaboration diagram for lux::BVHAccel:
[legend]

List of all members.

Public Member Functions

 BVHAccel (const vector< boost::shared_ptr< Primitive > > &p, int treetype, int csamples, int icost, int tcost, float ebonus)
virtual ~BVHAccel ()
virtual BBox WorldBound () const
virtual bool CanIntersect () const
virtual bool Intersect (const Ray &ray, Intersection *isect) const
virtual bool IntersectP (const Ray &ray) const
virtual void GetPrimitives (vector< boost::shared_ptr< Primitive > > &prims)

Static Public Member Functions

static AggregateCreateAccelerator (const vector< boost::shared_ptr< Primitive > > &prims, const ParamSet &ps)

Private Member Functions

boost::shared_ptr
< BVHAccelTreeNode
BuildHierarchy (vector< boost::shared_ptr< BVHAccelTreeNode > > &list, u_int begin, u_int end, u_int axis)
void FindBestSplit (vector< boost::shared_ptr< BVHAccelTreeNode > > &list, u_int begin, u_int end, float *splitValue, u_int *bestAxis)
u_int BuildArray (boost::shared_ptr< BVHAccelTreeNode > node, u_int offset)

Private Attributes

u_char treeType
int costSamples
int isectCost
int traversalCost
float emptyBonus
u_int nPrims
boost::shared_ptr< Primitive > * prims
u_int nNodes
BVHAccelArrayNodebvhTree

Detailed Description

Definition at line 45 of file bvhaccel.h.


Constructor & Destructor Documentation

BVHAccel::BVHAccel ( const vector< boost::shared_ptr< Primitive > > &  p,
int  treetype,
int  csamples,
int  icost,
int  tcost,
float  ebonus 
)
BVHAccel::~BVHAccel (  )  [virtual]

Definition at line 95 of file bvhaccel.cpp.

References bvhTree, lux::FreeAligned(), nPrims, and prims.


Member Function Documentation

u_int BVHAccel::BuildArray ( boost::shared_ptr< BVHAccelTreeNode node,
u_int  offset 
) [private]
boost::shared_ptr< BVHAccelTreeNode > BVHAccel::BuildHierarchy ( vector< boost::shared_ptr< BVHAccelTreeNode > > &  list,
u_int  begin,
u_int  end,
u_int  axis 
) [private]
virtual bool lux::BVHAccel::CanIntersect (  )  const [inline, virtual]

Returns whether this primitive can be intersected.

Reimplemented from lux::Aggregate.

Definition at line 51 of file bvhaccel.h.

Referenced by BVHAccel().

Aggregate * BVHAccel::CreateAccelerator ( const vector< boost::shared_ptr< Primitive > > &  prims,
const ParamSet ps 
) [static]
void BVHAccel::FindBestSplit ( vector< boost::shared_ptr< BVHAccelTreeNode > > &  list,
u_int  begin,
u_int  end,
float *  splitValue,
u_int bestAxis 
) [private]
void BVHAccel::GetPrimitives ( vector< boost::shared_ptr< Primitive > > &  prims  )  [virtual]

Gives all primitives in this aggregate.

Parameters:
prims The destination list for the primitives.

Implements lux::Aggregate.

Definition at line 305 of file bvhaccel.cpp.

References nPrims, and prims.

bool BVHAccel::Intersect ( const Ray r,
Intersection in 
) const [virtual]

Intersects this primitive with the given ray. If an intersection is found, the ray will (i.e. r.tmax) and all fields in the intersection info will be updated.

Parameters:
r The ray to intersect with this primitive.
in The destination of the intersection information.
Returns:
Whether an intersection was found.

Reimplemented from lux::Primitive.

Definition at line 267 of file bvhaccel.cpp.

References bvhTree, and lux::BVHAccelArrayNode::skipIndex.

bool BVHAccel::IntersectP ( const Ray r  )  const [virtual]

Tests for intersection of this primitive with the given ray.

Parameters:
r The ray to intersect with this primitive.
Returns:
Whether an intersection was found.

Reimplemented from lux::Primitive.

Definition at line 287 of file bvhaccel.cpp.

References bvhTree, and lux::BVHAccelArrayNode::skipIndex.

BBox BVHAccel::WorldBound (  )  const [virtual]

Returns the world bounds of this primitive.

Implements lux::Primitive.

Definition at line 263 of file bvhaccel.cpp.

References lux::BVHAccelArrayNode::bbox, and bvhTree.


Member Data Documentation

Definition at line 72 of file bvhaccel.h.

Referenced by BuildArray(), BVHAccel(), Intersect(), IntersectP(), WorldBound(), and ~BVHAccel().

Definition at line 67 of file bvhaccel.h.

Referenced by CreateAccelerator(), and FindBestSplit().

float lux::BVHAccel::emptyBonus [private]

Definition at line 68 of file bvhaccel.h.

Referenced by CreateAccelerator(), and FindBestSplit().

Definition at line 67 of file bvhaccel.h.

Referenced by CreateAccelerator(), and FindBestSplit().

Definition at line 71 of file bvhaccel.h.

Referenced by BuildHierarchy(), and BVHAccel().

Definition at line 69 of file bvhaccel.h.

Referenced by BVHAccel(), GetPrimitives(), and ~BVHAccel().

boost::shared_ptr<Primitive>* lux::BVHAccel::prims [private]

Definition at line 70 of file bvhaccel.h.

Referenced by BVHAccel(), CreateAccelerator(), GetPrimitives(), and ~BVHAccel().

Definition at line 67 of file bvhaccel.h.

Referenced by FindBestSplit().

Definition at line 66 of file bvhaccel.h.

Referenced by BuildHierarchy(), BVHAccel(), and CreateAccelerator().


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208