Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csOctree Class Reference

The octree. More...

#include <octree.h>

Inheritance diagram for csOctree:

csPolygonTree List of all members.

Public Methods

 csOctree (csThing *thing, const csVector3 &min_bbox, const csVector3 &max_bbox, int bsp_num, int mode=BSP_MINIMIZE_SPLITS)
 Create an empty tree for the given parent, a bounding box defining the outer limits of the octree, and the number of polygons at which we revert to a BSP tree.

virtual ~csOctree ()
 Destroy the whole octree (but not the actual polygons and parent objects).

csOctreeNodeGetRoot ()
 Get the root.

void Build (csPolygonInt **polygons, int num)
 Create the tree with a given set of polygons.

void Build (const csPolygonArray &polygons)
 Create the tree with a given set of polygons.

void* Back2Front (const csVector3 &pos, csTreeVisitFunc *func, void *data, csTreeCullFunc *cullfunc=NULL, void *culldata=NULL)
 Traverse the tree from back to front starting at the root and 'pos'.

void* Front2Back (const csVector3 &pos, csTreeVisitFunc *func, void *data, csTreeCullFunc *cullfunc=NULL, void *culldata=NULL)
 Traverse the tree from front to back starting at the root and 'pos'.

void GetConvexOutline (csOctreeNode *node, const csVector3 &pos, csVector3 *array, int &num_array, bool bVisible=false)
 Get a convex outline (not a polygon unless projected to 2D) for for this octree node as seen from the given position. More...

csOctreeNodeGetLeaf (const csVector3 &pos)
 Given a position return the leaf that this position is in.

void BuildVertexTables ()
 Build vertex tables for minibsp leaves. More...

void Statistics ()
 Print statistics about this octree.

void Cache (iCacheManager *cache_mgr)
 Cache this entire octree to the cache manager.

bool ReadFromCache (iCacheManager *cache_mgr, csPolygonInt **polygons, int num)
 Read this entire octree from cache manager. More...


Detailed Description

The octree.


Member Function Documentation

void csOctree::BuildVertexTables ( ) [inline]
 

Build vertex tables for minibsp leaves.

These tables are used to optimize the world to camera transformation so that only the needed vertices are transformed.

void csOctree::GetConvexOutline ( csOctreeNode * node,
const csVector3 & pos,
csVector3 * array,
int & num_array,
bool bVisible = false ) [inline]
 

Get a convex outline (not a polygon unless projected to 2D) for for this octree node as seen from the given position.

The coordinates returned are world space coordinates. Note that you need place for at least six vectors in the array. If bVisible is set true, the method returns all visible corners. This could be up to 7 vertices.

bool csOctree::ReadFromCache ( iCacheManager * cache_mgr,
csPolygonInt ** polygons,
int num )
 

Read this entire octree from cache manager.

Returns false if not cached, or cache not valid.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000