UFO: Alien Invasion
|
#include "bsp.h"
Go to the source code of this file.
Macros | |
#define | INTEGRAL_EPSILON 0.01 |
#define | POINT_EPSILON 0.0625 |
#define | OFF_EPSILON 0.5 |
#define | MAX_SUPERVERTS 512 |
#define | HASH_SIZE 64 |
#define | CONTINUOUS_EPSILON 0.001 |
Functions | |
static unsigned | HashVec (const vec3_t vec) |
static int | GetVertexnum (const vec3_t in) |
Returns the number of an existing vertex or allocates a new one. More... | |
static face_t * | AllocFace (void) |
static face_t * | NewFaceFromFace (const face_t *f) |
void | FreeFace (face_t *f) |
static void | FaceFromSuperverts (node_t *node, face_t *f, int base) |
The faces vertexes have been added to the superverts[] array, and there may be more there than can be held in a face (MAXEDGES). More... | |
static void | EmitFaceVertexes (node_t *node, face_t *f) |
static void | EmitVertexes_r (node_t *node) |
static void | FindEdgeVerts (const vec3_t v1, const vec3_t v2) |
Uses the hash tables to cut down to a small number. More... | |
static void | TestEdge (vec_t start, vec_t end, int p1, int p2, int startvert) |
static void | FixFaceEdges (node_t *node, face_t *f) |
static void | FixEdges_r (node_t *node) |
void | FixTjuncs (node_t *headnode) |
int | GetEdge (int v1, int v2, const face_t *f) |
static winding_t * | TryMergeWinding (winding_t *f1, winding_t *f2, const vec3_t planenormal) |
If two polygons share a common edge and the edges that meet at the common points are both inside the other polygons, merge them. More... | |
static face_t * | TryMerge (face_t *f1, face_t *f2, const vec3_t planenormal) |
If two polygons share a common edge and the edges that meet at the common points are both inside the other polygons, merge them. More... | |
static void | MergeNodeFaces (node_t *node) |
static void | SubdivideFace (node_t *node, face_t *f) |
Chop up faces that are larger than we want in the surface cache. More... | |
static void | SubdivideNodeFaces (node_t *node) |
static face_t * | FaceFromPortal (portal_t *p, bool pside) |
static void | MakeFaces_r (node_t *node) |
If a portal will make a visible face, mark the side that originally created it. More... | |
void | MakeFaces (node_t *node) |
Variables | |
static int | c_merge |
static int | c_subdivide |
static int | c_totalverts |
static int | c_uniqueverts |
static int | c_degenerate |
static int | c_tjunctions |
static int | c_faceoverflows |
static int | c_facecollapse |
static int | c_badstartverts |
static int | c_faces |
static int | superverts [MAX_SUPERVERTS] |
static int | numsuperverts |
static const face_t * | edgefaces [MAX_MAP_EDGES][2] |
int | firstmodeledge = 1 |
static vec3_t | edge_dir |
static vec3_t | edge_start |
static int | num_edge_verts |
static int | edge_verts [MAX_MAP_VERTS] |
static int | vertexchain [MAX_MAP_VERTS] |
static int | hashverts [HASH_SIZE *HASH_SIZE] |
static int | c_nodefaces |
Definition in file faces.cpp.
#define CONTINUOUS_EPSILON 0.001 |
Definition at line 435 of file faces.cpp.
Referenced by TryMergeWinding().
#define HASH_SIZE 64 |
Definition at line 49 of file faces.cpp.
Referenced by FindEdgeVerts(), and HashVec().
#define INTEGRAL_EPSILON 0.01 |
Definition at line 30 of file faces.cpp.
Referenced by GetVertexnum().
#define MAX_SUPERVERTS 512 |
Definition at line 36 of file faces.cpp.
Referenced by FixFaceEdges(), and TestEdge().
#define OFF_EPSILON 0.5 |
Definition at line 32 of file faces.cpp.
Referenced by TestEdge().
#define POINT_EPSILON 0.0625 |
Definition at line 31 of file faces.cpp.
Referenced by GetVertexnum().
Definition at line 114 of file faces.cpp.
References c_faces, and Mem_AllocType.
Referenced by FaceFromPortal(), and NewFaceFromFace().
Definition at line 184 of file faces.cpp.
References c_totalverts, c_uniqueverts, config, curTile, FaceFromSuperverts(), GetVertexnum(), i, MAX_MAP_VERTS, face_s::merged, dMapTile_t::numnormals, winding_s::numpoints, numsuperverts, dMapTile_t::numvertexes, winding_s::p, dBspVertex_t::point, face_s::split, superverts, Sys_Error(), VectorCopy, dMapTile_t::vertexes, and face_s::w.
Referenced by EmitVertexes_r().
Definition at line 210 of file faces.cpp.
References node_s::children, EmitFaceVertexes(), f, node_s::faces, i, node_s::planenum, and PLANENUM_LEAF.
Referenced by FixTjuncs().
Definition at line 672 of file faces.cpp.
References AllocFace(), side_s::brush, config, face_s::contentFlags, node_s::contentFlags, CONTENTS_WINDOW, CopyWinding(), curTile, entities, mapbrush_s::entitynum, f, mapplanes, portal_s::nodes, plane_s::normal, face_s::planenum, side_s::planenum, face_s::portal, Q_streq, ReverseWinding(), portal_s::side, SURF_LIGHT, SURF_NODRAW, side_s::surfaceFlags, texinfo_s::surfaceFlags, face_s::texinfo, side_s::texinfo, dMapTile_t::texinfo, ValueForKey(), VisibleContents(), face_s::w, and portal_s::winding.
Referenced by MakeFaces_r().
The faces vertexes have been added to the superverts[] array, and there may be more there than can be held in a face (MAXEDGES).
If less, the faces vertexnums[] will be filled in, otherwise face will reference a tree of split[] faces until all of the vertexnums can be added.
Definition at line 152 of file faces.cpp.
References c_faceoverflows, f, node_s::faces, i, MAXEDGES, NewFaceFromFace(), face_s::next, face_s::numpoints, numsuperverts, face_s::split, superverts, and face_s::vertexnums.
Referenced by EmitFaceVertexes(), and FixFaceEdges().
Uses the hash tables to cut down to a small number.
Definition at line 226 of file faces.cpp.
References edge_verts, HASH_SIZE, hashverts, int(), MAX_WORLD_WIDTH, num_edge_verts, and vertexchain.
Referenced by FixFaceEdges().
Definition at line 354 of file faces.cpp.
References node_s::children, f, node_s::faces, FixFaceEdges(), i, node_s::planenum, and PLANENUM_LEAF.
Referenced by FixTjuncs().
Definition at line 299 of file faces.cpp.
References c_badstartverts, c_facecollapse, count, curTile, edge_dir, edge_start, FaceFromSuperverts(), FindEdgeVerts(), i, len, MAX_SUPERVERTS, face_s::merged, face_s::numpoints, numsuperverts, dBspVertex_t::point, face_s::split, TestEdge(), VectorCopy, VectorNormalize(), VectorSubtract, dMapTile_t::vertexes, and face_s::vertexnums.
Referenced by FixEdges_r().
Definition at line 370 of file faces.cpp.
References c_badstartverts, c_degenerate, c_facecollapse, c_faceoverflows, c_tjunctions, c_totalverts, c_uniqueverts, config, EmitVertexes_r(), FixEdges_r(), hashverts, OBJZERO, VERB_EXTRA, and Verb_Printf().
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
Definition at line 133 of file faces.cpp.
References c_faces, FreeWinding(), Mem_Free, and face_s::w.
Referenced by FreeTree_r().
Definition at line 399 of file faces.cpp.
References config, face_s::contentFlags, curTile, dMapTile_t::edges, f, firstmodeledge, i, MAX_MAP_EDGES, dMapTile_t::numedges, Sys_Error(), and dBspEdge_t::v.
Referenced by EmitFace().
Returns the number of an existing vertex or allocates a new one.
Definition at line 72 of file faces.cpp.
References c_totalverts, c_uniqueverts, curTile, HashVec(), hashverts, i, INTEGRAL_EPSILON, MAX_MAP_VERTS, dMapTile_t::numnormals, dMapTile_t::numvertexes, dBspVertex_t::point, POINT_EPSILON, Q_rint(), Sys_Error(), vertexchain, and dMapTile_t::vertexes.
Referenced by EmitFaceVertexes().
|
static |
Definition at line 57 of file faces.cpp.
References HASH_SIZE, int(), and Sys_Error().
Referenced by GetVertexnum().
Definition at line 764 of file faces.cpp.
References c_merge, c_nodefaces, c_subdivide, MakeFaces_r(), VERB_EXTRA, and Verb_Printf().
Referenced by ConstructLevelNodes_r(), and ProcessSubModel().
If a portal will make a visible face, mark the side that originally created it.
Definition at line 728 of file faces.cpp.
References c_nodefaces, node_s::children, config, node_s::contentFlags, CONTENTS_SOLID, portal_s::face, FaceFromPortal(), node_s::faces, MergeNodeFaces(), face_s::next, portal_s::next, portal_s::nodes, portal_s::onnode, node_s::planenum, PLANENUM_LEAF, node_s::portals, and SubdivideNodeFaces().
Referenced by MakeFaces().
Definition at line 565 of file faces.cpp.
References node_s::faces, mapplanes, face_s::merged, face_s::next, plane_s::normal, node_s::planenum, face_s::split, and TryMerge().
Referenced by MakeFaces_r().
Definition at line 121 of file faces.cpp.
References AllocFace(), f, face_s::merged, face_s::split, and face_s::w.
Referenced by FaceFromSuperverts(), SubdivideFace(), and TryMerge().
Chop up faces that are larger than we want in the surface cache.
Definition at line 601 of file faces.cpp.
References c_subdivide, ClipWindingEpsilon(), config, curTile, DotProduct, node_s::faces, i, face_s::merged, NewFaceFromFace(), face_s::next, winding_s::numpoints, ON_EPSILON, winding_s::p, face_s::split, SURF_WARP, texinfo_s::surfaceFlags, Sys_Error(), face_s::texinfo, dMapTile_t::texinfo, texinfo_s::texture, v, texinfo_s::vecs, VectorCopy, VectorNormalize(), and face_s::w.
Referenced by SubdivideNodeFaces().
Definition at line 662 of file faces.cpp.
References f, node_s::faces, face_s::next, and SubdivideFace().
Referenced by MakeFaces_r().
Definition at line 256 of file faces.cpp.
References c_degenerate, c_tjunctions, curTile, DotProduct, edge_dir, edge_start, edge_verts, MAX_SUPERVERTS, num_edge_verts, numsuperverts, OFF_EPSILON, dBspVertex_t::point, superverts, Sys_Error(), VectorCopy, VectorLength(), VectorMA(), VectorSubtract, and dMapTile_t::vertexes.
Referenced by FixFaceEdges().
If two polygons share a common edge and the edges that meet at the common points are both inside the other polygons, merge them.
Definition at line 537 of file faces.cpp.
References c_merge, face_s::contentFlags, face_s::merged, NewFaceFromFace(), face_s::planenum, face_s::texinfo, TryMergeWinding(), and face_s::w.
Referenced by MergeNodeFaces().
|
static |
If two polygons share a common edge and the edges that meet at the common points are both inside the other polygons, merge them.
Definition at line 443 of file faces.cpp.
References AllocWinding(), CONTINUOUS_EPSILON, CrossProduct(), DotProduct, EQUAL_EPSILON, i, winding_s::numpoints, winding_s::p, VectorCopy, VectorNormalize(), and VectorSubtract.
Referenced by TryMerge().
|
static |
Definition at line 34 of file faces.cpp.
Referenced by FixFaceEdges(), and FixTjuncs().
|
static |
Definition at line 34 of file faces.cpp.
Referenced by FixTjuncs(), and TestEdge().
|
static |
Definition at line 34 of file faces.cpp.
Referenced by FixFaceEdges(), and FixTjuncs().
|
static |
Definition at line 34 of file faces.cpp.
Referenced by FaceFromSuperverts(), and FixTjuncs().
|
static |
Definition at line 34 of file faces.cpp.
Referenced by AllocFace(), BrushlistCalcStats(), and FreeFace().
|
static |
Definition at line 34 of file faces.cpp.
Referenced by MakeFaces(), and TryMerge().
|
static |
Definition at line 670 of file faces.cpp.
Referenced by MakeFaces(), and MakeFaces_r().
|
static |
Definition at line 34 of file faces.cpp.
Referenced by MakeFaces(), and SubdivideFace().
|
static |
Definition at line 34 of file faces.cpp.
Referenced by FixTjuncs(), and TestEdge().
|
static |
Definition at line 34 of file faces.cpp.
Referenced by EmitFaceVertexes(), FixTjuncs(), and GetVertexnum().
|
static |
Definition at line 34 of file faces.cpp.
Referenced by EmitFaceVertexes(), FixTjuncs(), and GetVertexnum().
|
static |
Definition at line 43 of file faces.cpp.
Referenced by FixFaceEdges(), and TestEdge().
|
static |
Definition at line 44 of file faces.cpp.
Referenced by FixFaceEdges(), and TestEdge().
|
static |
Definition at line 47 of file faces.cpp.
Referenced by FindEdgeVerts(), and TestEdge().
|
static |
int firstmodeledge = 1 |
Definition at line 41 of file faces.cpp.
Referenced by BeginModel(), and GetEdge().
Definition at line 52 of file faces.cpp.
Referenced by FindEdgeVerts(), FixTjuncs(), and GetVertexnum().
|
static |
Definition at line 46 of file faces.cpp.
Referenced by FindEdgeVerts(), and TestEdge().
|
static |
Definition at line 38 of file faces.cpp.
Referenced by EmitFaceVertexes(), FaceFromSuperverts(), FixFaceEdges(), and TestEdge().
|
static |
Definition at line 37 of file faces.cpp.
Referenced by EmitFaceVertexes(), FaceFromSuperverts(), and TestEdge().
|
static |
Definition at line 51 of file faces.cpp.
Referenced by FindEdgeVerts(), and GetVertexnum().