2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
\r
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
\r
5 This file is part of GtkRadiant.
\r
7 GtkRadiant is free software; you can redistribute it and/or modify
\r
8 it under the terms of the GNU General Public License as published by
\r
9 the Free Software Foundation; either version 2 of the License, or
\r
10 (at your option) any later version.
\r
12 GtkRadiant is distributed in the hope that it will be useful,
\r
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 GNU General Public License for more details.
\r
17 You should have received a copy of the GNU General Public License
\r
18 along with GtkRadiant; if not, write to the Free Software
\r
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\r
25 //returns true if the planes are equal
\r
26 int Plane_Equal(plane_t *a, plane_t *b, int flip);
\r
27 //returns false if the points are colinear
\r
28 int Plane_FromPoints(vec3_t p1, vec3_t p2, vec3_t p3, plane_t *plane);
\r
29 //returns true if the points are equal
\r
30 int Point_Equal(vec3_t p1, vec3_t p2, float epsilon);
\r
32 //allocate a winding
\r
33 winding_t* Winding_Alloc(int points);
\r
35 void Winding_Free(winding_t *w);
\r
36 //create a base winding for the plane
\r
37 winding_t* Winding_BaseForPlane (plane_t *p);
\r
38 //make a winding clone
\r
39 winding_t* Winding_Clone(winding_t *w );
\r
40 //creates the reversed winding
\r
41 winding_t* Winding_Reverse(winding_t *w);
\r
42 //remove a point from the winding
\r
43 void Winding_RemovePoint(winding_t *w, int point);
\r
44 //inserts a point to a winding, creating a new winding
\r
45 winding_t* Winding_InsertPoint(winding_t *w, vec3_t point, int spot);
\r
46 //returns true if the planes are concave
\r
47 int Winding_PlanesConcave(winding_t *w1, winding_t *w2,
\r
48 vec3_t normal1, vec3_t normal2,
\r
49 float dist1, float dist2);
\r
50 //returns true if the winding is tiny
\r
51 int Winding_IsTiny(winding_t *w);
\r
52 //returns true if the winding is huge
\r
53 int Winding_IsHuge(winding_t *w);
\r
54 //clip the winding with the plane
\r
55 winding_t* Winding_Clip(winding_t *in, plane_t *split, qboolean keepon);
\r
56 //split the winding with the plane
\r
57 void Winding_SplitEpsilon(winding_t *in, vec3_t normal, double dist,
\r
58 vec_t epsilon, winding_t **front, winding_t **back);
\r
59 //try to merge the windings, returns the new merged winding or NULL
\r
60 winding_t *Winding_TryMerge(winding_t *f1, winding_t *f2, vec3_t planenormal, int keep);
\r
61 //create a plane for the winding
\r
62 void Winding_Plane(winding_t *w, vec3_t normal, double *dist);
\r
63 //returns the winding area
\r
64 float Winding_Area(winding_t *w);
\r
65 //returns the bounds of the winding
\r
66 void Winding_Bounds(winding_t *w, vec3_t mins, vec3_t maxs);
\r
67 //returns true if the point is inside the winding
\r
68 int Winding_PointInside(winding_t *w, plane_t *plane, vec3_t point, float epsilon);
\r
69 //returns true if the vector intersects with the winding
\r
70 int Winding_VectorIntersect(winding_t *w, plane_t *plane, vec3_t p1, vec3_t p2, float epsilon);
\r