UFO: Alien Invasion
|
Constructive Solids Geometry. More...
#include "bsp.h"
Go to the source code of this file.
Functions | |
static bspbrush_t * | SubtractBrush (bspbrush_t *a, const bspbrush_t *b) |
static bool | BrushesDisjoint (bspbrush_t *a, bspbrush_t *b) |
static bspbrush_t * | ClipBrushToBox (bspbrush_t *brush, const AABB &clipBox) |
Any planes shared with the box edge will be set to no texinfo. More... | |
static bool | IsInLevel (const int contents, const int level) |
checks if the level# matches the contentsmask. The level# is mapped to the appropriate levelflags. More... | |
static bspbrush_t * | AddBrushListToTail (bspbrush_t *list, bspbrush_t *tail) |
static bspbrush_t * | CullList (bspbrush_t *list, bspbrush_t *skip) |
Builds a new list that doesn't hold the given brush. More... | |
static bool | BrushGE (bspbrush_t *b1, bspbrush_t *b2) |
Returns true if b1 is allowed to bite b2. More... | |
int | MapBrushesBounds (const int startbrush, const int endbrush, const int level, const AABB &clipBox, AABB &bBox) |
sets mins and maxs to the smallest sizes that can contain all brushes from startbrush to endbrush that are in a given level. More... | |
bspbrush_t * | MakeBspBrushList (int startbrush, int endbrush, int level, const AABB &clip) |
bspbrush_t * | ChopBrushes (bspbrush_t *head) |
Carves any intersecting solid brushes into the minimum number of non-intersecting brushes. More... | |
Variables | |
static uint16_t | minplanenums [2] |
static uint16_t | maxplanenums [2] |
Constructive Solids Geometry.
each side has a count of the other sides it splits
the best split will be the one that minimizes the total split counts of all remaining sides
precalc side on plane table
evaluate split side
Definition in file csg.cpp.
|
static |
|
static |
Definition at line 86 of file csg.cpp.
References bspbrush_s::brBox, i, AABB::maxs, AABB::mins, bspbrush_s::numsides, side_s::planenum, and bspbrush_s::sides.
Referenced by ChopBrushes().
|
inlinestatic |
Returns true if b1 is allowed to bite b2.
Definition at line 242 of file csg.cpp.
References mapbrush_s::contentFlags, CONTENTS_DETAIL, CONTENTS_SOLID, and bspbrush_s::original.
Referenced by ChopBrushes().
bspbrush_t* ChopBrushes | ( | bspbrush_t * | head | ) |
Carves any intersecting solid brushes into the minimum number of non-intersecting brushes.
Definition at line 376 of file csg.cpp.
References AddBrushListToTail(), BrushesDisjoint(), BrushGE(), CountBrushList(), CullList(), FreeBrushList(), bspbrush_s::next, SubtractBrush(), VERB_EXTRA, and Verb_Printf().
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
|
static |
Any planes shared with the box edge will be set to no texinfo.
Definition at line 113 of file csg.cpp.
References bspbrush_s::brBox, FreeBrush(), i, maxplanenums, AABB::maxs, minplanenums, AABB::mins, bspbrush_s::numsides, side_s::planenum, bspbrush_s::sides, SplitBrush(), side_s::texinfo, TEXINFO_NODE, and side_s::visible.
Referenced by MakeBspBrushList().
|
static |
Builds a new list that doesn't hold the given brush.
[in] | list | The brush list to copy |
[in] | skip | The brush to skip |
bspbrush_t
that is the old list without the skip entry Definition at line 220 of file csg.cpp.
References FreeBrush(), and bspbrush_s::next.
Referenced by ChopBrushes().
checks if the level# matches the contentsmask. The level# is mapped to the appropriate levelflags.
[in] | contents | The contentsmask (of the brush, surface, etc.) to check |
[in] | level | -1 for skipping the levelflag check |
Definition at line 158 of file csg.cpp.
References CONTENTS_ACTORCLIP, CONTENTS_LIGHTCLIP, CONTENTS_WEAPONCLIP, LEVEL_ACTORCLIP, LEVEL_LIGHTCLIP, LEVEL_WEAPONCLIP, and MASK_CLIP.
Referenced by MakeBspBrushList(), and MapBrushesBounds().
bspbrush_t* MakeBspBrushList | ( | int | startbrush, |
int | endbrush, | ||
int | level, | ||
const AABB & | clip | ||
) |
Definition at line 292 of file csg.cpp.
References AllocBrush(), bspbrush_s::brBox, ClipBrushToBox(), AABB::contains(), mapbrush_s::contentFlags, CopyWinding(), FindOrCreateFloatPlane(), mapbrush_s::finished, i, IsInLevel(), mapbrushes, maxplanenums, AABB::maxs, mapbrush_s::mbBox, minplanenums, AABB::mins, bspbrush_s::next, bspbrush_s::numsides, mapbrush_s::numsides, bspbrush_s::original, mapbrush_s::original_sides, AABB::set(), bspbrush_s::sides, SURF_HINT, side_s::surfaceFlags, VERB_DUMP, Verb_Printf(), side_s::visible, and side_s::winding.
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
int MapBrushesBounds | ( | const int | startbrush, |
const int | endbrush, | ||
const int | level, | ||
const AABB & | clipBox, | ||
AABB & | bBox | ||
) |
sets mins and maxs to the smallest sizes that can contain all brushes from startbrush to endbrush that are in a given level.
[in] | startbrush | the index of the first brush to check. |
[in] | endbrush | the index after the last brush to check. |
[in] | level | the level that we are searching for brushes in. -1 for skipping the levelflag check. |
[in] | clipBox | the absolute lowest and highest boundaries to allow for brushes. |
[out] | bBox | the max boundaries for all accepted brushes within the clipped bounds. |
Definition at line 264 of file csg.cpp.
References AABB::add(), AABB::contains(), mapbrush_s::contentFlags, mapbrush_s::finished, i, IsInLevel(), mapbrushes, mapbrush_s::mbBox, and AABB::setNegativeVolume().
Referenced by ConstructLevelNodes_r().
|
static |
Definition at line 55 of file csg.cpp.
References FreeBrush(), FreeBrushList(), i, bspbrush_s::next, bspbrush_s::numsides, side_s::planenum, bspbrush_s::sides, and SplitBrush().
Referenced by ChopBrushes().
|
static |
Definition at line 107 of file csg.cpp.
Referenced by ClipBrushToBox(), and MakeBspBrushList().
|
static |
Definition at line 106 of file csg.cpp.
Referenced by ClipBrushToBox(), and MakeBspBrushList().