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