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

Generated on Fri Dec 23 05:19:53 2005 for Particles by doxygen1.2.15