20typedef struct cBspPlane_s {
26typedef struct cBspModel_s {
37typedef struct cBspSurface_s {
42typedef struct cBspNode_s {
48typedef struct cBspBrushSide_s {
53typedef struct cBspLeaf_s {
59typedef struct cBspBrush_s {
69typedef struct tnode_s {
77typedef struct chead_s {
196typedef struct routing_s {
202 inline void setStepup (
const int x,
const int y,
const int z,
const int dir,
const int val) {
205 inline byte getStepup (
const int x,
const int y,
const int z,
const int dir)
const {
209 inline void setConn (
const int x,
const int y,
const int z,
const int dir,
const int val) {
210 _route[z][y][x][dir] = val;
212 inline byte getConn (
const int x,
const int y,
const int z,
const int dir)
const {
213 return _route[z][y][x][dir];
216 inline void setCeiling (
const int x,
const int y,
const int z,
const int val) {
217 _ceil[z][y][x] = val;
219 inline byte getCeiling (
const int x,
const int y,
const int z)
const {
220 return _ceil[z][y][x];
226 inline void setFloor (
const int x,
const int y,
const int z,
const int val) {
229 inline signed char getFloor (
const int x,
const int y,
const int z)
const {
233 return getFloor(pos[0], pos[1], pos[2]);
244#define PATHFINDING_BIG_STEPUP 0x80
246#define PATHFINDING_BIG_STEPDOWN 0x40
259 inline void setFloor (
const int actorSize,
const int x,
const int y,
const int z,
const int val) {
260 routes[actorSize - 1].setFloor(x, y, z, val);
263 return routes[actorSize - 1].getFloor(pos);
266 return routes[actorSize - 1].getFloor(x, y, z);
270 routes[actorSize - 1].setCeiling(x, y, z, val);
273 return routes[actorSize - 1].getCeiling(pos);
275 inline byte getCeiling (
const int actorSize,
const int x,
const int y,
const int z)
const {
276 return routes[actorSize - 1].getCeiling(x, y, z);
282 for (
i = lowZ;
i <= highZ;
i++) {
284 routes[actorSize - 1].setCeiling(x, y,
i, 0);
288 inline void setConn (
const int actorSize,
const int x,
const int y,
const int z,
const int dir,
const int val) {
289 routes[actorSize - 1].setConn(x, y, z, dir, val);
291 inline byte getConn (
const int actorSize,
const int x,
const int y,
const int z,
const int dir)
const {
292 return routes[actorSize - 1].getConn(x, y, z, dir);
295 return routes[actorSize - 1].getConn(pos[0], pos[1], pos[2], dir);
298 inline void setStepup (
const int actorSize,
const int x,
const int y,
const int z,
const int dir,
const int val) {
299 routes[actorSize - 1].setStepup(x, y, z, dir, val);
301 inline byte getStepup (
const int actorSize,
const int x,
const int y,
const int z,
const int dir)
const {
302 return routes[actorSize - 1].getStepup(x, y, z, dir);
305 inline byte getStepupHeight (
const int actorSize,
const int x,
const int y,
const int z,
const int dir)
const {
319 setFloor(actorSize, x, y, z, other.
getFloor(actorSize, x - sX, y - sY, z - sZ));
323 setConn(actorSize, x, y, z, dir, other.
getConn(actorSize, x - sX, y - sY, z - sZ, dir));
324 setStepup(actorSize, x, y, z, dir, other.
getStepup(actorSize, x - sX, y - sY, z - sZ, dir));
329typedef struct mapData_s {
388typedef struct texinfo_s {
Stores the data of a map tile, mostly the BSP stuff.
cBspHead_t cheads[MAX_MAP_NODES]
int theadlevel[LEVEL_MAX]
void getTileBox(AABB &box)
Calculate the bounding box for the tile (in mapunits).
intptr_t thead[LEVEL_MAX]
unsigned short * leafbrushes
cBspBrushSide_t * brushsides
void setStepup(const int actorSize, const int x, const int y, const int z, const int dir, const int val)
void setFilled(const actorSizeEnum_t actorSize, const int x, const int y, const int lowZ, const int highZ)
signed char getFloor(const actorSizeEnum_t actorSize, const int x, const int y, const int z) const
byte isStepUpLevel(const actorSizeEnum_t actorSize, const pos3_t pos, const int dir) const
void copyPosData(const Routing &other, actorSizeEnum_t actorSize, const int x, const int y, const int z, const int sX, const int sY, const int sZ)
byte getStepup(const int actorSize, const int x, const int y, const int z, const int dir) const
signed char getFloor(const actorSizeEnum_t actorSize, const pos3_t pos) const
byte getConn(const int actorSize, const int x, const int y, const int z, const int dir) const
byte isStepDownLevel(const actorSizeEnum_t actorSize, const pos3_t pos, const int dir) const
void setCeiling(const actorSizeEnum_t actorSize, const int x, const int y, const int z, const int val)
byte getCeiling(const int actorSize, const int x, const int y, const int z) const
byte getStepupHeight(const int actorSize, const int x, const int y, const int z, const int dir) const
return the value without the flags for z-level change
byte getConn(const actorSizeEnum_t actorSize, const pos3_t pos, const int dir) const
routing_t routes[ACTOR_MAX_SIZE]
byte getCeiling(const int actorSize, const pos3_t pos) const
void setConn(const int actorSize, const int x, const int y, const int z, const int dir, const int val)
void setFloor(const int actorSize, const int x, const int y, const int z, const int val)
Defined CONSTANTS (Macros are elsewhere).
#define MAX_MAP_SURFEDGES
#define MAX_MAP_BRUSHSIDES
#define PATHFINDING_WIDTH
absolute max
#define MAX_MAP_ENTSTRING
#define CELL_HEIGHT
A cell's height in QUANT sized units.
#define MAX_MAP_LEAFBRUSHES
#define PATHFINDING_HEIGHT
15 max, adjusting above 8 will require a rewrite to the DV code
#define PosToVec(p, v)
Pos boundary size is +/- 128 - to get into the positive area we add the possible max negative value a...
uint32_t brushContentFlags
unsigned short firstleafbrush
unsigned short numleafbrushes
uint32_t brushContentFlags
convex region of space in the BSP tree
int lightofs[LIGHTMAP_MAX]
byte routedata[MAX_MAP_ROUTING]
dBspLeaf_t leafs[MAX_MAP_LEAFS]
dBspEdge_t edges[MAX_MAP_EDGES]
cBspBrush_t brushes[MAX_MAP_BRUSHES]
dBspModel_t models[MAX_MAP_MODELS]
dBspPlane_t planes[MAX_MAP_PLANES]
int theadlevel[LEVEL_MAX]
dBspTexinfo_t texinfo[MAX_MAP_TEXINFO]
int surfedges[MAX_MAP_SURFEDGES]
dBspNode_t nodes[MAX_MAP_NODES]
unsigned short leafbrushes[MAX_MAP_LEAFBRUSHES]
dBspBrushSide_t brushsides[MAX_MAP_BRUSHSIDES]
byte lightdata[LIGHTMAP_MAX][MAX_MAP_LIGHTING]
cBspHead_t cheads[MAX_MAP_NODES]
dBspNormal_t normals[MAX_MAP_VERTS]
dBspBrush_t dbrushes[MAX_MAP_BRUSHES]
char entdata[MAX_MAP_ENTSTRING]
dBspVertex_t vertexes[MAX_MAP_VERTS]
int lightdatasize[LIGHTMAP_MAX]
dBspSurface_t faces[MAX_MAP_FACES]
char mapEntityString[MAX_MAP_ENTSTRING]
byte reroute[ACTOR_MAX_SIZE][PATHFINDING_WIDTH][PATHFINDING_WIDTH]
Used to track where rerouting needs to occur.
Pathfinding routing structure and tile layout.
signed char getFloor(const pos3_t pos) const
signed char getFloor(const int x, const int y, const int z) const
byte _route[PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH][CORE_DIRECTIONS]
signed char _floor[PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH]
byte _stepup[PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH][CORE_DIRECTIONS]
byte _ceil[PATHFINDING_HEIGHT][PATHFINDING_WIDTH][PATHFINDING_WIDTH]
void setCeiling(const int x, const int y, const int z, const int val)
void setStepup(const int x, const int y, const int z, const int dir, const int val)
void setFloor(const int x, const int y, const int z, const int val)
void setConn(const int x, const int y, const int z, const int dir, const int val)
byte getConn(const int x, const int y, const int z, const int dir) const
byte getStepup(const int x, const int y, const int z, const int dir) const
byte getCeiling(const pos3_t pos) const
byte getCeiling(const int x, const int y, const int z) const
Data for line tracing (?).
#define PATHFINDING_BIG_STEPUP
The home of the routing tables.
#define PATHFINDING_BIG_STEPDOWN
#define VectorSubtract(a, b, dest)
#define VectorAdd(a, b, dest)