UFO: Alien Invasion
Loading...
Searching...
No Matches
bspbrush.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 1997-2001 Id Software, Inc.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
27#include "../../shared/mathlib.h" /* for vec3_t */
28
29#if 0
30/* the code is not yet ready for this */
31struct bspbrush_s;
32typedef struct bspbrush_s bspbrush_t;
33#else
34#define STANDARD_NUMBER_OF_BRUSHSIDES 6
35typedef struct bspbrush_s {
36 struct bspbrush_s* next;
38 int side;
40 struct mapbrush_s* original;
44#endif
45
46bspbrush_t* BrushFromBounds(const vec3_t mins, const vec3_t maxs);
47bspbrush_t* CopyBrush(const bspbrush_t* brush);
49void SplitBrushList(bspbrush_t* brushes, uint16_t planenum, bspbrush_t** front, bspbrush_t** back);
50void SplitBrush(const bspbrush_t* brush, uint16_t planenum, bspbrush_t** front, bspbrush_t** back);
51bspbrush_t* AllocBrush(int numsides);
52int CountBrushList(bspbrush_t* brushes);
53void FreeBrush(bspbrush_t* brushes);
54void FreeBrushList(bspbrush_t* brushes);
55uint32_t BrushListCalcContents(bspbrush_t* brushlist);
56void BrushlistCalcStats(bspbrush_t* brushlist, AABB& blBox);
#define STANDARD_NUMBER_OF_BRUSHSIDES
Definition bspbrush.h:34
bspbrush_t * CopyBrush(const bspbrush_t *brush)
Duplicates the brush, the sides, and the windings.
Definition bspbrush.cpp:207
bspbrush_t * BrushFromBounds(const vec3_t mins, const vec3_t maxs)
Creates a new axial brush.
Definition bspbrush.cpp:87
void FreeBrushList(bspbrush_t *brushes)
Definition bspbrush.cpp:193
void FreeBrush(bspbrush_t *brushes)
Definition bspbrush.cpp:179
bspbrush_t * AllocBrush(int numsides)
Definition bspbrush.cpp:166
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.
Definition bspbrush.cpp:416
void SplitBrush(const bspbrush_t *brush, uint16_t planenum, bspbrush_t **front, bspbrush_t **back)
Generates two new brushes, leaving the original unchanged.
Definition bspbrush.cpp:544
uint32_t BrushListCalcContents(bspbrush_t *brushlist)
Collects the contentsflags of the brushes in the given list.
Definition bspbrush.cpp:300
int CountBrushList(bspbrush_t *brushes)
Returns the amount of brushes in the given brushlist.
Definition bspbrush.cpp:152
void BrushlistCalcStats(bspbrush_t *brushlist, AABB &blBox)
Counts the faces and calculate the aabb.
Definition bspbrush.cpp:759
void SplitBrushList(bspbrush_t *brushes, uint16_t planenum, bspbrush_t **front, bspbrush_t **back)
Definition bspbrush.cpp:700
Definition aabb.h:42
struct mapbrush_s * original
Definition bspbrush.h:40
AABB brBox
Definition bspbrush.h:37
struct bspbrush_s * next
Definition bspbrush.h:36
int testside
Definition bspbrush.h:39
int numsides
Definition bspbrush.h:41
side_t sides[STANDARD_NUMBER_OF_BRUSHSIDES]
Definition bspbrush.h:42
Definition map.h:60
vec_t vec3_t[3]
Definition ufotypes.h:39