UFO: Alien Invasion
|
#include "../../shared/mathlib.h"
Go to the source code of this file.
Data Structures | |
struct | bspbrush_s |
Macros | |
#define | STANDARD_NUMBER_OF_BRUSHSIDES 6 |
Typedefs | |
typedef struct bspbrush_s | bspbrush_t |
Functions | |
bspbrush_t * | BrushFromBounds (const vec3_t mins, const vec3_t maxs) |
Creates a new axial brush. More... | |
bspbrush_t * | CopyBrush (const bspbrush_t *brush) |
Duplicates the brush, the sides, and the windings. More... | |
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. More... | |
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. More... | |
bspbrush_t * | AllocBrush (int numsides) |
int | CountBrushList (bspbrush_t *brushes) |
Returns the amount of brushes in the given brushlist. More... | |
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. More... | |
void | BrushlistCalcStats (bspbrush_t *brushlist, AABB &blBox) |
Counts the faces and calculate the aabb. More... | |
#define STANDARD_NUMBER_OF_BRUSHSIDES 6 |
Definition at line 34 of file bspbrush.h.
Referenced by AllocBrush(), and CopyBrush().
typedef struct bspbrush_s bspbrush_t |
bspbrush_t* AllocBrush | ( | int | numsides | ) |
Definition at line 166 of file bspbrush.cpp.
References c_active_brushes, Mem_Alloc, STANDARD_NUMBER_OF_BRUSHSIDES, and threadstate.
Referenced by BrushFromBounds(), CopyBrush(), MakeBspBrushList(), and SplitBrush().
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_s::numsides, side_s::planenum, bspbrush_s::sides, and VectorClear.
Referenced by BuildTree().
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 node_s::contentFlags, mapbrush_s::contentFlags, CONTENTS_PASSABLE, CONTENTS_SOLID, i, bspbrush_s::next, bspbrush_s::numsides, bspbrush_s::original, bspbrush_s::sides, side_s::texinfo, and TEXINFO_NODE.
Referenced by LeafNode().
void BrushlistCalcStats | ( | bspbrush_t * | brushlist, |
AABB & | blBox | ||
) |
Counts the faces and calculate the aabb.
Definition at line 759 of file bspbrush.cpp.
References AABB::add(), side_s::bevel, bspbrush_s::brBox, mapbrush_s::brushnum, BrushVolume(), c_faces, Com_Printf(), config, mapbrush_s::entitynum, i, bspbrush_s::next, bspbrush_s::numsides, bspbrush_s::original, node_s::side, bspbrush_s::sides, side_s::texinfo, TEXINFO_NODE, VERB_EXTRA, Verb_Printf(), side_s::visible, and side_s::winding.
Referenced by BuildTree().
bspbrush_t* CopyBrush | ( | const bspbrush_t * | brush | ) |
Duplicates the brush, the sides, and the windings.
Definition at line 207 of file bspbrush.cpp.
References AllocBrush(), CopyWinding(), i, bspbrush_s::numsides, node_s::side, bspbrush_s::sides, STANDARD_NUMBER_OF_BRUSHSIDES, and side_s::winding.
Referenced by SplitBrush(), and SplitBrushList().
int CountBrushList | ( | bspbrush_t * | brushes | ) |
Returns the amount of brushes in the given brushlist.
Definition at line 152 of file bspbrush.cpp.
References bspbrush_s::next.
Referenced by ChopBrushes().
void FreeBrush | ( | bspbrush_t * | brushes | ) |
Definition at line 179 of file bspbrush.cpp.
References c_active_brushes, FreeWinding(), i, Mem_Free, bspbrush_s::numsides, bspbrush_s::sides, threadstate, and side_s::winding.
Referenced by ClipBrushToBox(), CullList(), FreeBrushList(), FreeTree_r(), SplitBrush(), and SubtractBrush().
void FreeBrushList | ( | bspbrush_t * | brushes | ) |
Definition at line 193 of file bspbrush.cpp.
References FreeBrush(), and bspbrush_s::next.
Referenced by BuildTree_r(), ChopBrushes(), FreeTree_r(), and SubtractBrush().
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.
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_s::bevel, c_nonvis, CheckPlaneAgainstVolume(), mapbrush_s::contentFlags, CONTENTS_DETAIL, i, mapplanes, bspbrush_s::next, bspbrush_s::numsides, bspbrush_s::original, side_s::planenum, PSIDE_BACK, PSIDE_BOTH, PSIDE_FACING, PSIDE_FRONT, bspbrush_s::side, node_s::side, bspbrush_s::sides, SURF_HINT, SURF_SKIP, side_s::surfaceFlags, Sys_Error(), TestBrushToPlanenum(), side_s::tested, bspbrush_s::testside, side_s::texinfo, TEXINFO_NODE, threadstate, side_s::visible, and side_s::winding.
Referenced by BuildTree_r().
void SplitBrush | ( | const bspbrush_t * | brush, |
uint16_t | planenum, | ||
bspbrush_t ** | front, | ||
bspbrush_t ** | back | ||
) |
Generates two new brushes, leaving the original unchanged.
Definition at line 544 of file bspbrush.cpp.
References AllocBrush(), BaseWindingForPlane(), BoundBrush(), bspbrush_s::brBox, BrushMostlyOnSide(), BrushVolume(), ChopWindingInPlace(), ClipWindingEpsilon(), Com_Printf(), CopyBrush(), CopyWinding(), plane_s::dist, DotProduct, FreeBrush(), i, mapplanes, MAX_WORLD_WIDTH, AABB::maxs, plane_s::normal, winding_s::numpoints, bspbrush_s::numsides, bspbrush_s::original, winding_s::p, node_s::planenum, side_s::planenum, PSIDE_BACK, PSIDE_FRONT, node_s::side, bspbrush_s::sides, side_s::tested, side_s::texinfo, TEXINFO_NODE, VERB_EXTRA, Verb_Printf(), side_s::visible, side_s::winding, WindingIsHuge(), and WindingIsTiny().
Referenced by BuildTree_r(), ClipBrushToBox(), SplitBrushList(), and SubtractBrush().
void SplitBrushList | ( | bspbrush_t * | brushes, |
uint16_t | planenum, | ||
bspbrush_t ** | front, | ||
bspbrush_t ** | back | ||
) |
Definition at line 700 of file bspbrush.cpp.
References mapbrush_s::brushnum, CopyBrush(), i, bspbrush_s::next, bspbrush_s::numsides, bspbrush_s::original, side_s::planenum, PSIDE_BACK, PSIDE_BOTH, PSIDE_FACING, PSIDE_FRONT, bspbrush_s::side, node_s::side, bspbrush_s::sides, SplitBrush(), side_s::texinfo, TEXINFO_NODE, VERB_DUMP, and Verb_Printf().
Referenced by BuildTree_r().