1 /****************************************************************************************/
\r
4 /* Author: John Pollard */
\r
5 /* Description: Various Poly routines (clipping, splitting, etc) */
\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
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
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
21 /****************************************************************************************/
\r
25 #include <Windows.h>
\r
28 #include "MathLib.h"
\r
30 extern geBoolean gCountVerts;
\r
31 extern int32 gTotalVerts;
\r
32 extern int32 gPeekVerts;
\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
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
69 extern int32 NumSubdivides;
\r
70 extern geFloat SubdivideSize;
\r