In file include/csgeom/bsp.h:

## class csBspTree

> The BSP tree

### Public Methods

  void | AddDynamicPolygons (csPolygonInt** polygons, int num, int mode = BSP_MINIMIZE_SPLITS) Add a bunch of polygons to the BSP tree
  void* | Back2Front (const csVector3& pos, csBspVisitFunc* func, void* data) Traverse the tree from back to front starting at the root and 'pos'.
  | csBspTree (csPolygonParentInt* pset, int mode = BSP_MINIMIZE_SPLITS) Create the tree for the given parent
  | csBspTree (csPolygonParentInt* pset, csPolygonInt** polygons, int num, int mode = BSP_MINIMIZE_SPLITS) Create the tree with a given set of polygons.
  void* | Front2Back (const csVector3& pos, csBspVisitFunc* func, void* data) Traverse the tree from front to back starting at the root and 'pos'.
  csPolygonParentInt* | GetParent () Get the polygonset for this BSP tree.
  void | RemoveDynamicPolygons () Remove all dynamically added polygons from the node
  | ~csBspTree () Destroy the whole BSP tree (but not the actual polygons and parent objects)

### Private Fields

  csPolygonParentInt* | pset The parent that this tree is made for.
  csBspNode* | root The root of the tree.

### Private Methods

  void* | Back2Front (csBspNode* node, const csVector3& pos, csBspVisitFunc* func, void* data) Traverse the tree from back to front starting at 'node' and 'pos'.
  void | Build (csBspNode* node, csPolygonInt** polygons, int num, int mode) Build the tree from the given node and number of polygons.
  void | BuildDynamic (csBspNode* node, csPolygonInt** polygons, int num, int mode) Build the tree from the given node and number of polygons
  void | Clear (csBspNode* node) Clear the node.
  void* | Front2Back (csBspNode* node, const csVector3& pos, csBspVisitFunc* func, void* data) Traverse the tree from front to back starting at 'node' and 'pos'.
  void | RemoveDynamicPolygons (csBspNode* node) Remove all dynamically added polygons from the node
  int | SelectSplitter (csPolygonInt** polygons, int num, int mode) Select a splitter from a list of polygons and return the index

## Documentation

> The BSP tree

`csBspNode* root`
  The root of the tree.

`csPolygonParentInt* pset`
  The parent that this tree is made for.

`void Build(csBspNode* node, csPolygonInt** polygons, int num, int mode)`
  Build the tree from the given node and number of polygons.

`void BuildDynamic(csBspNode* node, csPolygonInt** polygons, int num, int mode)`
  Build the tree from the given node and number of polygons. This is a dynamic version. It will add the polygons to an already built BSP tree and add the polygons so that they can easily be removed later.

`void RemoveDynamicPolygons(csBspNode* node)`
  Remove all dynamically added polygons from the node

`int SelectSplitter(csPolygonInt** polygons, int num, int mode)`
  Select a splitter from a list of polygons and return the index

`void Clear(csBspNode* node)`
  Clear the node.

`void* Back2Front(csBspNode* node, const csVector3& pos, csBspVisitFunc* func, void* data)`
  Traverse the tree from back to front starting at 'node' and 'pos'.

`void* Front2Back(csBspNode* node, const csVector3& pos, csBspVisitFunc* func, void* data)`
  Traverse the tree from front to back starting at 'node' and 'pos'.

`csBspTree(csPolygonParentInt* pset, int mode = BSP_MINIMIZE_SPLITS)`
  Create the tree for the given parent. The polygons are fetched from the parent.

`csBspTree(csPolygonParentInt* pset, csPolygonInt** polygons, int num, int mode = BSP_MINIMIZE_SPLITS)`
  Create the tree with a given set of polygons.

`~csBspTree()`
  Destroy the whole BSP tree (but not the actual polygons and parent objects)

`void AddDynamicPolygons(csPolygonInt** polygons, int num, int mode = BSP_MINIMIZE_SPLITS)`
  Add a bunch of polygons to the BSP tree. They will be marked as dynamic polygons so that you can remove them from the tree again with RemoveDynamicPolygons(). Note that adding polygons dynamically will not modify the existing tree and splits but instead continue splitting in the leaves where the new polygons arrive.

`void RemoveDynamicPolygons()`
  Remove all dynamically added polygons from the node. Note that the polygons are not really destroyed. Only unlinked from the BSP tree.

`void* Back2Front(const csVector3& pos, csBspVisitFunc* func, void* data)`
  Traverse the tree from back to front starting at the root and 'pos'.

`void* Front2Back(const csVector3& pos, csBspVisitFunc* func, void* data)`
  Traverse the tree from front to back starting at the root and 'pos'.

`csPolygonParentInt* GetParent()`
  Get the polygonset for this BSP tree.

This class has no child classes.

alphabetic index hierarchy of classes

this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de