Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csOctreeNode Class Reference

An octree node. More...

#include <octree.h>

Inheritance diagram for csOctreeNode:

csPolygonTreeNode List of all members.

Public Methods

bool IsEmpty ()
 Return true if node is empty.

bool IsLeaf ()
 Return true if node is leaf.

const csVector3GetCenter () const
 Get center.

const csVector3GetMinCorner () const
 Get minimum coordinate of box.

const csVector3GetMaxCorner () const
 Get maximum coordinate of box.

const csBox3GetBox ()
 Get box.

csOctreeNode* GetChild (int i)
 Get a child.

uint16 GetSolidMask (int idx)
 Get one of the masks representing solid space on the boundaries of this node. More...

csPolygonIntArrayGetUnsplitPolygons ()
 Get the list of all unsplit polygons in this node. More...

csBspTreeGetMiniBsp () const
 Get mini-bsp tree.

int* GetMiniBspVerts () const
 Get indices of vertices used in the mini-bsp of this leaf.

int GetMiniBspVertexCount () const
 Get number of vertices.

int Type ()
 Return type (NODE_???).

int CountChildren ()
 Count the number of children (octree nodes) for this node.

int CountPolygons ()
 Count all the polygons in this node and children. More...

void* InitSolidPolygonIterator (int side)
 Create an iterator to iterate over all solid polygons that are on the specified side of this octree node ('side' is one of CS_BOX_SIDE_xxx flags).

bool NextSolidPolygon (void *vspit, csPoly3D &poly)
 Get the next solid polygon from the iterator. More...

void CleanupSolidPolygonIterator (void *vspit)
 If done with the iterator clean it up.


Friends

class  csOctree

Detailed Description

An octree node.

@@ We should have seperate leaf/non-leaf structures as they are considerably different.


Member Function Documentation

int csOctreeNode::CountPolygons ( )
 

Count all the polygons in this node and children.

This function only calls leaf polygons (i.e. polygons that will actually be returned by Front2Back/Back2Front).

uint16 csOctreeNode::GetSolidMask ( int idx ) [inline]
 

Get one of the masks representing solid space on the boundaries of this node.

Use the CS_BOX_SIDE_xxx flags to fetch them.

csPolygonIntArray & csOctreeNode::GetUnsplitPolygons ( ) [inline]
 

Get the list of all unsplit polygons in this node.

These are the original unsplit polygons. Further subdivision of this node will have caused these polygons to be split into the children but the list here reflects the unsplit polygons.

bool csOctreeNode::NextSolidPolygon ( void * vspit,
csPoly3D & poly )
 

Get the next solid polygon from the iterator.

Returns false if there are no more polygons.


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