Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

bsp.h

Go to the documentation of this file.
00001 #ifndef BSP_H
00002 #define BSP_H
00003 
00004 #include "polygon.h"
00005 #include "lightmap.h"
00006 #include "portal.h"
00007 #include "tll.h"
00008 
00009 // Enumerated constants for the bsp and portal functions
00010 enum {Front, Back, TwoFrontOneBack, OneFrontTwoBack, OneFrontOneBack, PortalWasSplit, OnPartition};
00011 
00012 typedef struct BSP_node
00013 {
00014     int nodeid;             //unique identification number given to the node
00015     bool visible;           //flag used as part of the pvs
00016     POLYGON partition;      //we'll use this to store the partitioning plane that divides our nodes up
00017     BSP_node* backnode;     //pointer to the node that is on the back side of our partitioning plane
00018     BSP_node* frontnode;    //pointer to the node that is on the front side of our partitioning plane
00019     bool leaf;              //true or false value for a node saying that this node has no children and only contains polygons
00020     int numpolys;           //number of polygons in the node, this will be 0 if the node is not a leaf
00021     POLYGON* nodepolylist;  //pointer to the list of polygons in the leaf node, again this list will be empty if the node is not a leaf
00022     Lightmap* nodelightmaplist; //pointer to a list of lightmaps or NULL if this node isn't a leaf
00023     int numportals;             //the number of portals in the leaf node
00024     LinkedList<PORTAL> portallist; //list of portals in the leaf node
00025 } BSP_node;
00026 
00027 int FindCurrentLeaf(VECTOR Position, BSP_node* node);
00028 int SplitPolygon(POLYGON, POLYGON, POLYGON*);
00029 int SelectPartitionfromList(POLYGON* nodepolylist, int numpolys, int* bestfront, int* bestback);
00030 void BuildBSP(BSP_node *node);
00031 int RenderBSP(BSP_node *node);
00032 void DeleteBSP(BSP_node *node);
00033 void DrawIntersectionSphere(VECTOR coordinates);
00034 
00035 #endif

Generated on Fri Dec 23 05:20:17 2005 for Portals by doxygen1.2.15