UFO: Alien Invasion
Loading...
Searching...
No Matches
polylib.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 1997-2001 Id Software, Inc.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
28
30typedef struct winding_s {
32 vec3_t p[4];
34} winding_t;
35
36#define MAX_POINTS_ON_WINDING 64
37
38winding_t* AllocWinding(int points);
40void WindingCenter(const winding_t* w, vec3_t center);
41void ClipWindingEpsilon(const winding_t* in, const vec3_t normal, const vec_t dist,
42 const vec_t epsilon, winding_t** front, winding_t** back);
43winding_t* ChopWinding(winding_t* in, vec3_t normal, vec_t dist);
46winding_t* BaseWindingForPlane(const vec3_t normal, const vec_t dist);
48void FreeWinding(winding_t* w);
49void WindingBounds(const winding_t* w, vec3_t mins, vec3_t maxs);
50
51/* frees the original if clipped */
52void ChopWindingInPlace(winding_t** w, const vec3_t normal, const vec_t dist, const vec_t epsilon);
54bool WindingIsHuge(const winding_t* w);
55bool FixWinding(winding_t* w);
winding_t * ChopWinding(winding_t *in, vec3_t normal, vec_t dist)
Definition polylib.cpp:391
void FreeWinding(winding_t *w)
Definition polylib.cpp:46
bool WindingIsTiny(winding_t *w)
Returns true if the winding would be crunched out of existance by the vertex snapping.
Definition polylib.cpp:407
winding_t * ReverseWinding(const winding_t *w)
Definition polylib.cpp:193
void ChopWindingInPlace(winding_t **w, const vec3_t normal, const vec_t dist, const vec_t epsilon)
Definition polylib.cpp:299
winding_t * AllocWinding(int points)
Allocate a new winding (polygon).
Definition polylib.cpp:38
void RemoveColinearPoints(winding_t *w)
Definition polylib.cpp:55
bool WindingIsHuge(const winding_t *w)
Returns true if the winding still has one of the points from basewinding for plane.
Definition polylib.cpp:427
winding_t * BaseWindingForPlane(const vec3_t normal, const vec_t dist)
Definition polylib.cpp:116
void WindingCenter(const winding_t *w, vec3_t center)
Definition polylib.cpp:106
void WindingBounds(const winding_t *w, vec3_t mins, vec3_t maxs)
Definition polylib.cpp:97
bool FixWinding(winding_t *w)
removes degenerate edges from a winding
Definition polylib.cpp:478
vec_t WindingArea(const winding_t *w)
Definition polylib.cpp:81
winding_t * CopyWinding(const winding_t *w)
Copy a winding with all its points allocated.
Definition polylib.cpp:185
void ClipWindingEpsilon(const winding_t *in, const vec3_t normal, const vec_t dist, const vec_t epsilon, winding_t **front, winding_t **back)
Definition polylib.cpp:204
for storing the vertices of the side of a brush or other polygon
Definition polylib.h:30
int numpoints
Definition polylib.h:31
vec3_t p[4]
Definition polylib.h:32
float vec_t
Definition ufotypes.h:37
vec_t vec3_t[3]
Definition ufotypes.h:39