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

Go to the source code of this file.

Data Structures

struct  bspbrush_t

Macros

#define STANDARD_NUMBER_OF_BRUSHSIDES   6

Functions

bspbrush_tBrushFromBounds (const vec3_t mins, const vec3_t maxs)
 Creates a new axial brush.
bspbrush_tCopyBrush (const bspbrush_t *brush)
 Duplicates the brush, the sides, and the windings.
side_tSelectSplitSide (bspbrush_t *brushes, bspbrush_t *volume)
 Using a heuristic, choses one of the sides out of the brushlist to partition the brushes with.
void SplitBrushList (bspbrush_t *brushes, uint16_t planenum, bspbrush_t **front, bspbrush_t **back)
void SplitBrush (const bspbrush_t *brush, uint16_t planenum, bspbrush_t **front, bspbrush_t **back)
 Generates two new brushes, leaving the original unchanged.
bspbrush_tAllocBrush (int numsides)
int CountBrushList (bspbrush_t *brushes)
 Returns the amount of brushes in the given brushlist.
void FreeBrush (bspbrush_t *brushes)
void FreeBrushList (bspbrush_t *brushes)
uint32_t BrushListCalcContents (bspbrush_t *brushlist)
 Collects the contentsflags of the brushes in the given list.
void BrushlistCalcStats (bspbrush_t *brushlist, AABB &blBox)
 Counts the faces and calculate the aabb.

Macro Definition Documentation

◆ STANDARD_NUMBER_OF_BRUSHSIDES

#define STANDARD_NUMBER_OF_BRUSHSIDES   6

Definition at line 34 of file bspbrush.h.

Referenced by AllocBrush(), and CopyBrush().

Function Documentation

◆ AllocBrush()

bspbrush_t * AllocBrush ( int numsides)

◆ BrushFromBounds()

bspbrush_t * BrushFromBounds ( const vec3_t mins,
const vec3_t maxs )

Creates a new axial brush.

Definition at line 87 of file bspbrush.cpp.

References AllocBrush(), CreateBrushWindings(), FindOrCreateFloatPlane(), i, bspbrush_t::numsides, side_t::planenum, bspbrush_t::sides, and VectorClear.

Referenced by BuildTree().

◆ BrushListCalcContents()

uint32_t BrushListCalcContents ( bspbrush_t * brushlist)

Collects the contentsflags of the brushes in the given list.

Definition at line 300 of file bspbrush.cpp.

References CONTENTS_PASSABLE, CONTENTS_SOLID, i, bspbrush_t::next, bspbrush_t::numsides, bspbrush_t::original, bspbrush_t::sides, side_t::texinfo, and TEXINFO_NODE.

Referenced by LeafNode().

◆ BrushlistCalcStats()

void BrushlistCalcStats ( bspbrush_t * brushlist,
AABB & blBox )

◆ CopyBrush()

bspbrush_t * CopyBrush ( const bspbrush_t * brush)

Duplicates the brush, the sides, and the windings.

See also
AllocBrush

Definition at line 207 of file bspbrush.cpp.

References AllocBrush(), CopyWinding(), i, bspbrush_t::numsides, bspbrush_t::sides, STANDARD_NUMBER_OF_BRUSHSIDES, and side_t::winding.

Referenced by SplitBrush(), and SplitBrushList().

◆ CountBrushList()

int CountBrushList ( bspbrush_t * brushes)

Returns the amount of brushes in the given brushlist.

Definition at line 152 of file bspbrush.cpp.

References bspbrush_t::next.

Referenced by ChopBrushes().

◆ FreeBrush()

◆ FreeBrushList()

void FreeBrushList ( bspbrush_t * brushes)
See also
AllocBrush
CountBrushList

Definition at line 193 of file bspbrush.cpp.

References FreeBrush(), and bspbrush_t::next.

Referenced by BuildTree_r(), ChopBrushes(), FreeTree_r(), and SubtractBrush().

◆ SelectSplitSide()

side_t * SelectSplitSide ( bspbrush_t * brushes,
bspbrush_t * volume )

Using a heuristic, choses one of the sides out of the brushlist to partition the brushes with.

Returns
nullptr if there are no valid planes to split with..

the search order goes: visible-structural, visible-detail, nonvisible-structural, nonvisible-detail. If any valid plane is available in a pass, no further passes will be tried.

Definition at line 416 of file bspbrush.cpp.

References AXIAL, side_t::bevel, c_nonvis, CheckPlaneAgainstVolume(), CONTENTS_DETAIL, i, mapplanes, bspbrush_t::next, bspbrush_t::numsides, bspbrush_t::original, side_t::planenum, PSIDE_BACK, PSIDE_BOTH, PSIDE_FACING, PSIDE_FRONT, bspbrush_t::side, bspbrush_t::sides, SURF_HINT, SURF_SKIP, side_t::surfaceFlags, Sys_Error(), TestBrushToPlanenum(), side_t::tested, bspbrush_t::testside, side_t::texinfo, TEXINFO_NODE, threadstate, side_t::visible, and side_t::winding.

Referenced by BuildTree_r().

◆ SplitBrush()

void SplitBrush ( const bspbrush_t * brush,
uint16_t planenum,
bspbrush_t ** front,
bspbrush_t ** back )

Generates two new brushes, leaving the original unchanged.

Todo
Print brush and entnum either of the brush that was splitted or the plane that was used as splitplane
Todo
Print brush and entnum either of the brush that was split or the plane that was used as splitplane
Todo
Print brush and entnum either of the brush that was splitted or the plane that was used as splitplane
Todo
Print brush and entnum either of the brush that was splitted or the plane that was used as splitplane

Definition at line 544 of file bspbrush.cpp.

References AllocBrush(), BaseWindingForPlane(), BoundBrush(), bspbrush_t::brBox, BrushMostlyOnSide(), BrushVolume(), ChopWindingInPlace(), ClipWindingEpsilon(), Com_Printf(), CopyBrush(), CopyWinding(), plane_t::dist, DotProduct, FreeBrush(), i, mapplanes, MAX_WORLD_WIDTH, AABB::maxs, plane_t::normal, winding_t::numpoints, bspbrush_t::numsides, bspbrush_t::original, winding_t::p, side_t::planenum, PSIDE_BACK, PSIDE_FRONT, bspbrush_t::sides, side_t::tested, side_t::texinfo, TEXINFO_NODE, VERB_EXTRA, Verb_Printf(), side_t::visible, side_t::winding, WindingIsHuge(), and WindingIsTiny().

Referenced by BuildTree_r(), ClipBrushToBox(), SplitBrushList(), and SubtractBrush().

◆ SplitBrushList()