polylib.c File Reference

#include "shared.h"
#include "polylib.h"
Include dependency graph for polylib.c:

Go to the source code of this file.

Defines

#define BOGUS_RANGE   8192

Functions

winding_tAllocWinding (int points)
 Allocate a new winding (polygon).
void FreeWinding (winding_t *w)
void RemoveColinearPoints (winding_t *w)
vec_t WindingArea (const winding_t *w)
void WindingBounds (const winding_t *w, vec3_t mins, vec3_t maxs)
void WindingCenter (const winding_t *w, vec3_t center)
winding_tBaseWindingForPlane (const vec3_t normal, const vec_t dist)
winding_tCopyWinding (const winding_t *w)
 Copy a winding with all its points allocated.
winding_tReverseWinding (const winding_t *w)
void ClipWindingEpsilon (const winding_t *in, const vec3_t normal, const vec_t dist, const vec_t epsilon, winding_t **front, winding_t **back)
void ChopWindingInPlace (winding_t **inout, const vec3_t normal, const vec_t dist, const vec_t epsilon)
winding_tChopWinding (winding_t *in, vec3_t normal, vec_t dist)

Variables

static int c_active_windings
static int c_peak_windings

Detailed Description

Note:
Winding = Polyon representation of brushes

Definition in file polylib.c.


Define Documentation

#define BOGUS_RANGE   8192

Definition at line 33 of file polylib.c.

Referenced by BaseWindingForPlane().


Function Documentation

winding_t* AllocWinding ( int  points  ) 

Allocate a new winding (polygon).

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

Definition at line 40 of file polylib.c.

References c_active_windings, c_peak_windings, Mem_Alloc, and threadstate.

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

winding_t* BaseWindingForPlane ( const vec3_t  normal,
const vec_t  dist 
)
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 421 of file polylib.c.

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

void ChopWindingInPlace ( winding_t **  inout,
const vec3_t  normal,
const vec_t  dist,
const vec_t  epsilon 
)
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_t* CopyWinding ( const winding_t w  ) 

Copy a winding with all its points allocated.

Parameters:
[in] w The winding to copy
Returns:
the new winding

Definition at line 207 of file polylib.c.

References AllocWinding(), and winding_s::numpoints.

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

void FreeWinding ( winding_t w  ) 
void RemoveColinearPoints ( winding_t w  ) 
winding_t* ReverseWinding ( const winding_t w  ) 

Definition at line 215 of file polylib.c.

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

Referenced by FaceFromPortal().

vec_t WindingArea ( const winding_t w  ) 
void WindingBounds ( const winding_t w,
vec3_t  mins,
vec3_t  maxs 
)

Definition at line 106 of file polylib.c.

References i, winding_s::numpoints, and winding_s::p.

Referenced by SubdividePatch().

void WindingCenter ( const winding_t w,
vec3_t  center 
)

Definition at line 124 of file polylib.c.

References i, winding_s::numpoints, winding_s::p, scale, vec3_origin, VectorAdd, VectorCopy, and VectorScale.

Referenced by BuildPatch(), and FinishSubdividePatch().


Variable Documentation

int c_active_windings [static]

Definition at line 30 of file polylib.c.

Referenced by AllocWinding(), and FreeWinding().

int c_peak_windings [static]

Definition at line 31 of file polylib.c.

Referenced by AllocWinding().


Generated by  doxygen 1.6.2