|
UFO: Alien Invasion
|
imagine you have a series of rooms connected by doorways. Each doorway has a portal in it. If two portals can see eachother, the rooms become linked in the pvs More...
#include "bsp.h"
Go to the source code of this file.
Macros | |
| #define | SIDESPACE 8 |
| #define | BASE_WINDING_EPSILON 0.001 |
| #define | SPLIT_WINDING_EPSILON 0.001 |
Functions | |
| static portal_t * | AllocPortal (void) |
| void | FreePortal (portal_t *p) |
| uint32_t | VisibleContents (uint32_t contentFlags) |
| Returns the single content bit of the strongest visible content present. | |
| static void | AddPortalToNodes (portal_t *p, node_t *front, node_t *back) |
| Links a portal into the given back and front nodes. | |
| void | RemovePortalFromNode (portal_t *portal, node_t *l) |
| Removes references to the given portal from the given node. | |
| static void | MakeHeadnodePortals (tree_t *tree) |
| The created portals will face the global outside_node. | |
| static winding_t * | BaseWindingForNode (node_t *node) |
| static void | MakeNodePortal (node_t *node) |
| Create the new portal by taking the full plane winding for the cutting plane and clipping it by all of parents of this node. | |
| static void | SplitNodePortals (node_t *node) |
| Move or split the portals that bound node so that the node's children have portals instead of node. | |
| static void | CalcNodeBounds (node_t *node) |
| static void | MakeTreePortals_r (node_t *node) |
| void | MakeTreePortals (tree_t *tree) |
| static void | FindPortalSide (portal_t *p) |
| Finds a brush side to use for texturing the given portal. | |
| static void | MarkVisibleSides_r (node_t *node) |
| void | MarkVisibleSides (tree_t *tree, int startbrush, int endbrush) |
Variables | |
| static int | c_active_portals = 0 |
| static int | c_peak_portals = 0 |
| static int | c_tinyportals = 0 |
imagine you have a series of rooms connected by doorways. Each doorway has a portal in it. If two portals can see eachother, the rooms become linked in the pvs
Definition in file portals.cpp.
| #define BASE_WINDING_EPSILON 0.001 |
Definition at line 187 of file portals.cpp.
Referenced by BaseWindingForNode().
| #define SIDESPACE 8 |
Definition at line 133 of file portals.cpp.
Referenced by MakeHeadnodePortals().
| #define SPLIT_WINDING_EPSILON 0.001 |
Definition at line 188 of file portals.cpp.
Referenced by SplitNodePortals().
Links a portal into the given back and front nodes.
| [in,out] | p | The portal to link into the front and back nodes |
| [in,out] | front | The front node |
| [in,out] | back | The back node |
Definition at line 82 of file portals.cpp.
References AddPortalToNodes(), portal_t::next, portal_t::nodes, node_t::portals, and Sys_Error().
Referenced by AddPortalToNodes(), MakeHeadnodePortals(), MakeNodePortal(), and SplitNodePortals().
Definition at line 39 of file portals.cpp.
References AllocPortal(), c_active_portals, c_peak_portals, Mem_AllocType, threadstate_t::numthreads, and threadstate.
Referenced by AllocPortal(), MakeHeadnodePortals(), MakeNodePortal(), and SplitNodePortals().
Definition at line 190 of file portals.cpp.
References BASE_WINDING_EPSILON, BaseWindingForNode(), BaseWindingForPlane(), node_t::children, ChopWindingInPlace(), plane_t::dist, mapplanes, plane_t::normal, node_t::parent, node_t::planenum, vec3_origin, and VectorSubtract.
Referenced by BaseWindingForNode(), and MakeNodePortal().
Definition at line 352 of file portals.cpp.
References AABB::add(), CalcNodeBounds(), i, node_t::nBox, node_t::portals, and AABB::setNegativeVolume().
Referenced by CalcNodeBounds(), and MakeTreePortals_r().
Finds a brush side to use for texturing the given portal.
Definition at line 400 of file portals.cpp.
References side_t::bevel, node_t::brushlist, mapbrush_t::contentFlags, DotProduct, FindPortalSide(), i, mapplanes, bspbrush_t::next, portal_t::nodes, plane_t::normal, mapbrush_t::numsides, portal_t::onnode, mapbrush_t::original_sides, side_t::planenum, portal_t::side, portal_t::sidefound, side_t::texinfo, TEXINFO_NODE, VERB_EXTRA, Verb_Printf(), and VisibleContents().
Referenced by FindPortalSide(), and MarkVisibleSides_r().
Definition at line 52 of file portals.cpp.
References c_active_portals, FreePortal(), FreeWinding(), Mem_Free, threadstate_t::numthreads, threadstate, and portal_t::winding.
Referenced by FreePortal(), and FreeTreePortals_r().
The created portals will face the global outside_node.
Definition at line 137 of file portals.cpp.
References tree_t::aabb, AddPortalToNodes(), AllocPortal(), BaseWindingForPlane(), ChopWindingInPlace(), plane_t::dist, tree_t::headnode, i, MakeHeadnodePortals(), AABB::maxs, AABB::mins, plane_t::normal, OBJZERO, ON_EPSILON, tree_t::outside_node, portal_t::plane, PLANENUM_LEAF, SIDESPACE, and portal_t::winding.
Referenced by MakeHeadnodePortals(), and MakeTreePortals().
Create the new portal by taking the full plane winding for the cutting plane and clipping it by all of parents of this node.
Definition at line 223 of file portals.cpp.
References AddPortalToNodes(), AllocPortal(), BaseWindingForNode(), c_tinyportals, node_t::children, ChopWindingInPlace(), plane_t::dist, FreeWinding(), MakeNodePortal(), mapplanes, portal_t::next, portal_t::nodes, plane_t::normal, portal_t::onnode, portal_t::plane, node_t::planenum, node_t::portals, Sys_Error(), vec3_origin, VectorCopy, VectorSubtract, portal_t::winding, and WindingIsTiny().
Referenced by MakeNodePortal(), and MakeTreePortals_r().
Definition at line 391 of file portals.cpp.
References tree_t::headnode, MakeHeadnodePortals(), MakeTreePortals(), and MakeTreePortals_r().
Referenced by ConstructLevelNodes_r(), MakeTreePortals(), and ProcessSubModel().
Definition at line 368 of file portals.cpp.
References CalcNodeBounds(), node_t::children, Com_Printf(), i, MakeNodePortal(), MakeTreePortals_r(), MAX_WORLD_WIDTH, AABB::maxs, AABB::mins, node_t::nBox, node_t::planenum, PLANENUM_LEAF, and SplitNodePortals().
Referenced by MakeTreePortals(), and MakeTreePortals_r().
Definition at line 482 of file portals.cpp.
References tree_t::headnode, i, mapbrushes, MarkVisibleSides(), MarkVisibleSides_r(), mapbrush_t::numsides, mapbrush_t::original_sides, VERB_EXTRA, and Verb_Printf().
Referenced by ConstructLevelNodes_r(), MarkVisibleSides(), and ProcessSubModel().
Definition at line 455 of file portals.cpp.
References node_t::children, node_t::contentFlags, FindPortalSide(), MarkVisibleSides_r(), portal_t::next, portal_t::nodes, portal_t::onnode, node_t::planenum, PLANENUM_LEAF, node_t::portals, portal_t::side, and portal_t::sidefound.
Referenced by MarkVisibleSides(), and MarkVisibleSides_r().
Removes references to the given portal from the given node.
| [in,out] | portal | The portal to remove from the node |
| [in,out] | l | The node to remove the portal from |
Definition at line 102 of file portals.cpp.
References portal_t::next, portal_t::nodes, node_t::portals, RemovePortalFromNode(), and Sys_Error().
Referenced by FreeTreePortals_r(), RemovePortalFromNode(), and SplitNodePortals().
Move or split the portals that bound node so that the node's children have portals instead of node.
Definition at line 270 of file portals.cpp.
References AddPortalToNodes(), AllocPortal(), c_tinyportals, node_t::children, ClipWindingEpsilon(), plane_t::dist, f, FreeWinding(), mapplanes, portal_t::next, portal_t::nodes, plane_t::normal, node_t::planenum, node_t::portals, RemovePortalFromNode(), SPLIT_WINDING_EPSILON, SplitNodePortals(), Sys_Error(), portal_t::winding, and WindingIsTiny().
Referenced by MakeTreePortals_r(), and SplitNodePortals().
| uint32_t VisibleContents | ( | uint32_t | contentFlags | ) |
Returns the single content bit of the strongest visible content present.
Definition at line 64 of file portals.cpp.
References i, LAST_VISIBLE_CONTENTS, and VisibleContents().
Referenced by FaceFromPortal(), FindPortalSide(), and VisibleContents().
|
static |
Definition at line 32 of file portals.cpp.
Referenced by AllocPortal(), and FreePortal().
|
static |
Definition at line 33 of file portals.cpp.
Referenced by AllocPortal().
|
static |
Definition at line 34 of file portals.cpp.
Referenced by MakeNodePortal(), and SplitNodePortals().