UFO: Alien Invasion
Loading...
Searching...
No Matches
polylib.h File Reference
Include dependency graph for polylib.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  winding_t
 for storing the vertices of the side of a brush or other polygon More...

Macros

#define MAX_POINTS_ON_WINDING   64

Functions

winding_tAllocWinding (int points)
 Allocate a new winding (polygon).
vec_t WindingArea (const winding_t *w)
void WindingCenter (const winding_t *w, vec3_t center)
void ClipWindingEpsilon (const winding_t *in, const vec3_t normal, const vec_t dist, const vec_t epsilon, winding_t **front, winding_t **back)
winding_tChopWinding (winding_t *in, vec3_t normal, vec_t dist)
winding_tCopyWinding (const winding_t *w)
 Copy a winding with all its points allocated.
winding_tReverseWinding (const winding_t *w)
winding_tBaseWindingForPlane (const vec3_t normal, const vec_t dist)
void RemoveColinearPoints (winding_t *w)
void FreeWinding (winding_t *w)
void WindingBounds (const winding_t *w, vec3_t mins, vec3_t maxs)
void ChopWindingInPlace (winding_t **w, const vec3_t normal, const vec_t dist, const vec_t epsilon)
bool WindingIsTiny (winding_t *w)
 Returns true if the winding would be crunched out of existance by the vertex snapping.
bool WindingIsHuge (const winding_t *w)
 Returns true if the winding still has one of the points from basewinding for plane.
bool FixWinding (winding_t *w)
 removes degenerate edges from a winding

Macro Definition Documentation

◆ MAX_POINTS_ON_WINDING

#define MAX_POINTS_ON_WINDING   64

Definition at line 36 of file polylib.h.

Referenced by ChopWindingInPlace(), ClipWindingEpsilon(), and RemoveColinearPoints().

Function Documentation

◆ AllocWinding()

winding_t * AllocWinding ( int points)

Allocate a new winding (polygon).

Parameters
[in]pointsAmount of points for this winding
See also
FreeWinding

Definition at line 38 of file polylib.cpp.

References Mem_Alloc.

Referenced by BaseWindingForPlane(), Check_SidesOverlap(), ChopWindingInPlace(), ClipWindingEpsilon(), CopyWinding(), ReverseWinding(), TryMergeWinding(), and WindingFromFace().

◆ BaseWindingForPlane()

◆ ChopWinding()

winding_t * ChopWinding ( winding_t * in,
vec3_t normal,
vec_t dist )
Returns
the fragment of in that is on the front side of the cliping plane.
Note
The original is freed.

Definition at line 391 of file polylib.cpp.

References ClipWindingEpsilon(), f, FreeWinding(), and ON_EPSILON.

◆ ChopWindingInPlace()

◆ ClipWindingEpsilon()

void ClipWindingEpsilon ( const winding_t * in,
const vec3_t normal,
const vec_t dist,
const vec_t epsilon,
winding_t ** front,
winding_t ** back )

◆ CopyWinding()

winding_t * CopyWinding ( const winding_t * w)

Copy a winding with all its points allocated.

Parameters
[in]wThe winding to copy
Returns
the new winding

Definition at line 185 of file polylib.cpp.

References AllocWinding(), and winding_t::numpoints.

Referenced by ClipWindingEpsilon(), CopyBrush(), FaceFromPortal(), MakeBspBrushList(), and SplitBrush().

◆ FixWinding()

bool FixWinding ( winding_t * w)

removes degenerate edges from a winding

Returns
true if the winding is valid

Definition at line 478 of file polylib.cpp.

References i, winding_t::numpoints, ON_EPSILON, winding_t::p, SnapWeldVector(), VectorCopy, VectorLength(), and VectorSubtract.

Referenced by CreateBrushWindings().

◆ FreeWinding()

void FreeWinding ( winding_t * w)

◆ RemoveColinearPoints()

void RemoveColinearPoints ( winding_t * w)

◆ ReverseWinding()

winding_t * ReverseWinding ( const winding_t * w)

Definition at line 193 of file polylib.cpp.

References AllocWinding(), i, winding_t::numpoints, winding_t::p, and VectorCopy.

Referenced by FaceFromPortal().

◆ WindingArea()

◆ WindingBounds()

void WindingBounds ( const winding_t * w,
vec3_t mins,
vec3_t maxs )

Definition at line 97 of file polylib.cpp.

References AddPointToBounds(), ClearBounds(), i, winding_t::numpoints, and winding_t::p.

Referenced by SubdividePatch().

◆ WindingCenter()

void WindingCenter ( const winding_t * w,
vec3_t center )

◆ WindingIsHuge()

bool WindingIsHuge ( const winding_t * w)

Returns true if the winding still has one of the points from basewinding for plane.

Definition at line 427 of file polylib.cpp.

References i, MAX_WORLD_WIDTH, winding_t::numpoints, and winding_t::p.

Referenced by SplitBrush().

◆ WindingIsTiny()

bool WindingIsTiny ( winding_t * w)

Returns true if the winding would be crunched out of existance by the vertex snapping.

Definition at line 407 of file polylib.cpp.

References EDGE_LENGTH, i, len, winding_t::numpoints, winding_t::p, VectorLength(), and VectorSubtract.

Referenced by MakeNodePortal(), SplitBrush(), and SplitNodePortals().