QuakeForge  0.7.2.210-815cf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Winding Manipulation

Data Structures

struct  winding_s
 

Macros

#define ON_EPSILON   0.05
 

Typedefs

typedef struct winding_s winding_t
 

Functions

winding_tBaseWindingForPlane (const struct plane_s *p)
 Create a very large four-point winding with all point on the plane. More...
 
winding_tClipWinding (winding_t *in, struct plane_s *split, qboolean keepon)
 Clip the winding to the plain. More...
 
winding_tCopyWinding (const winding_t *w)
 Create a new winding with the same points as the given winding. More...
 
winding_tCopyWindingReverse (const winding_t *w)
 Create a new winding with the reverse points of the given winding. More...
 
void DivideWinding (winding_t *in, struct plane_s *split, winding_t **front, winding_t **back)
 Divide a winding by a plane, producing one or two windings. More...
 
void FreeWinding (winding_t *w)
 Free the winding. More...
 
winding_tNewWinding (int points)
 Create a new, empty winding with space for the specified number of points. More...
 
winding_tWindingVectors (const winding_t *w, int unit)
 Create a new "winding" that holds the unit vectors of the edges of the given winding. More...
 

Detailed Description

Macro Definition Documentation

#define ON_EPSILON   0.05

Typedef Documentation

typedef struct winding_s winding_t

Function Documentation

winding_t* BaseWindingForPlane ( const struct plane_s p)

Create a very large four-point winding with all point on the plane.

The winding will be a box with aligned with the axes of the plane. The order of yhe points is clockwise when viewed from the front side of the plane.

In terms of s and t, the axes of the plane will be such that t (up) is the projection of either the z-axis or the x-axis (whichever is "closer"), and s is to the right (n = s cross t).

Parameters
pThe plane on which to create the winding.
Returns
The new winding.
Note
It is the caller's responsibiltiy to free the new winding.
winding_t* ClipWinding ( winding_t in,
struct plane_s split,
qboolean  keepon 
)

Clip the winding to the plain.

The new winding will be the part of the input winding that is on the front side of the plane.

The direction of the winding is preserved.

Note
It is the caller's responsibiltiy to free the new winding.
The input winding will be freed.
Parameters
inThe winding to be clipped.
splitThe plane by which the winding will be clipped.
keeponIf true, an exactly on-plane winding will be saved, otherwise it will be clipped away.
Returns
The new winding representing the part of the input winding on the font side of the plane, or NULL if the winding has been clipped away.
winding_t* CopyWinding ( const winding_t w)

Create a new winding with the same points as the given winding.

Parameters
wThe winding to copy.
Returns
The new winding.
Note
It is the caller's responsibiltiy to free the new winding.
winding_t* CopyWindingReverse ( const winding_t w)

Create a new winding with the reverse points of the given winding.

This is useful when a winding for the back side of a plane is required.

Parameters
wThe winding to copy.
Returns
The new winding.
Note
It is the caller's responsibiltiy to free the new winding.
void DivideWinding ( winding_t in,
struct plane_s split,
winding_t **  front,
winding_t **  back 
)

Divide a winding by a plane, producing one or two windings.

Note
The original winding is not damaged or freed.
If one of front or back is NULL, the other will point to the input winding.
If neither front nor back are NULL, then both will be new windings and the caller will be responsible for freeing them.
Parameters
inThe winding to be divided.
splitThe plane by which the winding will be divided.
frontSet to the part of the input winding that is in front of the plane, or NULL if no part of the winding is in front of the plane.
backSet to the part of the input winding that is behind the plane, or NULL if no part of the winding is behind the plane.
void FreeWinding ( winding_t w)

Free the winding.

Parameters
wThe winding to be freed.
winding_t* NewWinding ( int  points)

Create a new, empty winding with space for the specified number of points.

Parameters
pointsThe number of points for which to leave space.
Returns
The new winding.
Note
It is the caller's responsibiltiy to free the new winding.
winding_t* WindingVectors ( const winding_t w,
int  unit 
)

Create a new "winding" that holds the unit vectors of the edges of the given winding.

Parameters
wThe winding to convert.
unitIf true, normalize the vectors.
Returns
The "winding" holding the (unit) vectors.
Note
It is the caller's responsibiltiy to free the new winding.