- proper names for the global includes
[genesis3d.git] / GBSPLib / POLY.H
1 /****************************************************************************************/\r
2 /*  Poly.h                                                                              */\r
3 /*                                                                                      */\r
4 /*  Author: John Pollard                                                                */\r
5 /*  Description: Various Poly routines (clipping, splitting, etc)                       */\r
6 /*                                                                                      */\r
7 /*  The contents of this file are subject to the Genesis3D Public License               */\r
8 /*  Version 1.01 (the "License"); you may not use this file except in                   */\r
9 /*  compliance with the License. You may obtain a copy of the License at                */\r
10 /*  http://www.genesis3d.com                                                            */\r
11 /*                                                                                      */\r
12 /*  Software distributed under the License is distributed on an "AS IS"                 */\r
13 /*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See                */\r
14 /*  the License for the specific language governing rights and limitations              */\r
15 /*  under the License.                                                                  */\r
16 /*                                                                                      */\r
17 /*  The Original Code is Genesis3D, released March 25, 1999.                            */\r
18 /*  Genesis3D Version 1.1 released November 15, 1999                                 */\r
19 /*  Copyright (C) 1999 WildTangent, Inc. All Rights Reserved           */\r
20 /*                                                                                      */\r
21 /****************************************************************************************/\r
22 #ifndef POLY_H\r
23 #define POLY_H\r
24 \r
25 #include <Windows.h>\r
26 \r
27 #include "BSP.h"\r
28 #include "MathLib.h"\r
29 \r
30 extern geBoolean        gCountVerts;\r
31 extern int32            gTotalVerts;\r
32 extern int32            gPeekVerts;     \r
33 \r
34 //\r
35 //      Polys\r
36 //\r
37 GBSP_Poly       *AllocPoly(int32 NumVerts);\r
38 void            FreePoly(GBSP_Poly *Poly);\r
39 GBSP_Poly       *CreatePolyFromPlane(GBSP_Plane *Plane);\r
40 geBoolean       ClipPoly(GBSP_Poly *InPoly, GBSP_Plane *Plane, geBoolean FlipTest, GBSP_Poly **OutPoly);\r
41 geBoolean       ClipPolyEpsilon(GBSP_Poly *InPoly, geFloat Epsilon, GBSP_Plane *Plane, geBoolean FlipTest, GBSP_Poly **OutPoly);\r
42 geBoolean       SplitPoly(GBSP_Poly *InPoly, GBSP_Plane *Plane, GBSP_Poly **Front, GBSP_Poly **Back, \r
43                            geBoolean FlipTest);\r
44 geBoolean       SplitPolyEpsilon(GBSP_Poly *InPoly, geFloat Epsilon, GBSP_Plane *Plane, GBSP_Poly **Front, GBSP_Poly **Back, \r
45                            geBoolean FlipTest);\r
46 geFloat         PolyArea(GBSP_Poly *Poly);\r
47 geBoolean       CopyPoly(GBSP_Poly *In, GBSP_Poly **Out);\r
48 GBSP_Poly       *CopyPoly2(GBSP_Poly *In);\r
49 geBoolean       ReversePoly(GBSP_Poly *In, GBSP_Poly **Out);\r
50 void            RemoveDegenerateEdges(GBSP_Poly *Poly);\r
51 geBoolean       RemoveDegenerateEdges2(GBSP_Poly *Poly);\r
52 void            PolyCenter(GBSP_Poly *Poly, geVec3d *Center);\r
53 geBoolean       PolyIsTiny (GBSP_Poly *Poly);\r
54 \r
55 //\r
56 //      Faces\r
57 //\r
58 \r
59 GBSP_Face       *AllocFace(int32 NumVerts);\r
60 void            FreeFace(GBSP_Face *Face);\r
61 geBoolean       SplitFace(GBSP_Face *In, GBSP_Plane *Split, GBSP_Face **Front, GBSP_Face **Back, geBoolean FlipTest);\r
62 void            FreeFaceList(GBSP_Face *List);\r
63 int32           MergeFaceList(GBSP_Face *In, GBSP_Face **Out, geBoolean Mirror);\r
64 int32           EdgeExist(geVec3d *Edge1, GBSP_Poly *Poly, int32 *EdgeIndexOut);\r
65 GBSP_Face       *MergeFace(GBSP_Face *Face1, GBSP_Face *Face2);\r
66 geBoolean       CheckFace(GBSP_Face *Face, geBoolean Verb);\r
67 void            GetFaceListBOX(GBSP_Face *Faces, geVec3d *Mins, geVec3d *Maxs);\r
68 \r
69 extern int32    NumSubdivides;\r
70 extern geFloat  SubdivideSize;\r
71 \r
72 #endif\r