MarSTDv2004: COctree Class Reference

MarSTDv2004

COctree Class Reference

Collaboration diagram for COctree:

Collaboration graph
[legend]
List of all members.

Detailed Description

Octree class. Use octrees to reject polygons from your rendering pipeline as soon as possible. Unlike the BSP tree this class doesn't guarantee perfect back-to-front rendering. On the other hand, it doesn't require as much time to create an octree and filter the polygons into it as it takes with BSP creation, and polygons won't get split. Octrees are great in an z-buffered environment.

Definition at line 29 of file COctree.h.

Public Member Functions

void zero ()
void zeroChildren ()
void clear ()
void clearChildren ()
float calculateCubeSize ()
void create (float minCubeSize, int minPolyCount)
void create (int levels, int minPolyCount)
void filter (CPoly *poly)

Public Attributes

COctreechild [8]
 Child nodes.
bool leaf
 True if this node is a leaf.
CVector mid
 Center of cube.
float size
 Size of cube.
std::vector< CPoly * > polygon
 Polygons.

Member Function Documentation

float COctree::calculateCubeSize  ) 
 

Calculates the initial cube size.

Returns:
The maximal side length.

void COctree::create float  minCubeSize,
int  minPolyCount
 

Starts building an octree.

Parameters:
min_cube_size Minimal size a node must have to be split.
min_polycount Minimal number of polygons a node must have to be split.

void COctree::create int  levels,
int  minPolyCount
 

Creates child nodes from this node and splits child nodes.

void COctree::filter CPoly poly  ) 
 

Filters a polygon into the tree. The polygon will be added to every leaf it touches. It is up to the user not to redraw polygons as they are referenced a second time.


The documentation for this class was generated from the following file:
Generated on Tue Feb 8 21:59:42 2005 for MarSTDv2004 by  doxygen 1.4.1