UFO: Alien Invasion
|
#include <aabb.h>
Public Member Functions | |
AABB () | |
AABB (const vec3_t mini, const vec3_t maxi) | |
AABB (const vec_t minX, const vec_t minY, const vec_t minZ, const vec_t maxX, const vec_t maxY, const vec_t maxZ) | |
AABB (const Line &line) | |
void | set (const AABB &other) |
Copies the values from the given aabb. More... | |
void | set (const vec3_t mini, const vec3_t maxi) |
void | setMins (const vec3_t mini) |
void | setMaxs (const vec3_t maxi) |
void | setMins (int x, int y, int z) |
void | setMaxs (int x, int y, int z) |
void | setMaxZ (float zVal) |
void | reset () |
void | setFromLittleFloat (const AABB &other) |
void | setNegativeVolume () |
Sets mins and maxs to their starting points before using addPoint. More... | |
void | set (const AABB &trBox, const Line &trLine) |
Set from another box and a (trace)Line. More... | |
const vec3_t & | getMins () const |
float | getMinX () const |
float | getMinY () const |
float | getMinZ () const |
const vec3_t & | getMaxs () const |
float | getMaxX () const |
float | getMaxY () const |
float | getMaxZ () const |
float | getWidthX () const |
float | getWidthY () const |
float | getWidthZ () const |
void | getCenter (vec3_t center) const |
Calculates the center of the bounding box. More... | |
void | getDiagonal (vec3_t diagonal) const |
void | asIntString (char *str, size_t len) |
Prints a representation of the box. More... | |
bool | isZero () const |
bool | doesIntersect (const AABB &other) const |
Checks if the aabb touches or intersects with the given aabb. More... | |
bool | canBeHitBy (const Line &line) const |
Checks if the given line has a chance to hit our box. More... | |
bool | contains (const vec3_t point) const |
bool | contains (const AABB &other) const |
void | add (const vec3_t point) |
If the point is outside the box, expand the box to accommodate it. More... | |
void | add (const AABB &other) |
If the given box is outside our box, expand our box to accommodate it. More... | |
void | rotateAround (const vec3_t origin, const vec3_t angles) |
Rotates bounding box around given origin point; note that it will expand the box unless all angles are multiples of 90 degrees. More... | |
void | clipToWorld () |
clip the box to the maximum boundaries More... | |
void | expandXY (const float byVal) |
expand the box in four directions, but clip them to the maximum boundaries More... | |
void | expand (const float byVal) |
expand the box in all directions, but clip them to the maximum boundaries More... | |
void | shift (const vec3_t shiftVec) |
shove the whole box by the given vector More... | |
Data Fields | |
vec3_t | mins |
vec3_t | maxs |
Static Public Attributes | |
static const AABB | EMPTY |
AABB::AABB | ( | ) |
Definition at line 29 of file aabb.cpp.
References maxs, mins, vec3_origin, and VectorCopy.
Definition at line 34 of file aabb.cpp.
References maxs, mins, and VectorCopy.
AABB::AABB | ( | const Line & | line | ) |
Definition at line 48 of file aabb.cpp.
References maxs, mins, Line::start, Line::stop, and VectorSet.
If the point is outside the box, expand the box to accommodate it.
Definition at line 57 of file aabb.cpp.
Referenced by BeginModel(), BoundBrush(), BrushlistCalcStats(), BuildNodeChildren(), BuildTree(), CalcNodeBounds(), Check_MapSize(), LoadMapFile(), MakeBrushWindings(), MapBrushesBounds(), R_LoadObjModel(), R_ModLoadAliasMD2MeshIndexed(), R_ModLoadAliasMD2MeshUnindexed(), R_ModLoadAliasMD3Model(), set(), SV_ModLoadAliasMD2Model(), and SV_ModLoadAliasMD3Model().
|
inline |
Prints a representation of the box.
[out] | str | The output string, expected to be at least AABB_STRING wide |
[in] | len | The length of the output buffer |
Definition at line 167 of file aabb.h.
Referenced by LoadMapFile(), and SP_func_breakable().
|
inline |
Checks if the given line has a chance to hit our box.
[in] | line | The line that might hit us |
Definition at line 192 of file aabb.h.
References getMaxX(), getMaxY(), getMaxZ(), getMinX(), getMinY(), getMinZ(), Line::start, and Line::stop.
Referenced by CM_LineMissesModel().
|
inline |
|
inline |
Definition at line 200 of file aabb.h.
References getMaxX(), getMaxY(), getMaxZ(), getMinX(), getMinY(), and getMinZ().
Referenced by MakeBspBrushList(), MapBrushesBounds(), and SV_GridIsOnMap().
|
inline |
|
inline |
Checks if the aabb touches or intersects with the given aabb.
[in] | other | The other aabb |
Definition at line 183 of file aabb.h.
References getMaxX(), getMaxY(), getMaxZ(), getMinX(), getMinY(), and getMinZ().
Referenced by CM_CompleteBoxTrace(), CM_EntCompleteBoxTrace(), G_GetTouchingEdicts(), and SV_BoundingBoxesIntersect().
|
inline |
expand the box in all directions, but clip them to the maximum boundaries
Definition at line 240 of file aabb.h.
References expandXY(), maxs, and mins.
Referenced by MoveClip::calcBounds(), CM_CalculateWidestBoundingBox(), CMod_LoadSubmodels(), ConstructLevelNodes_r(), G_TouchEdicts(), G_TouchSolids(), ProcessSubModel(), R_CullBspModel(), and R_Trace().
|
inline |
expand the box in four directions, but clip them to the maximum boundaries
Definition at line 232 of file aabb.h.
References clipToWorld(), maxs, and mins.
Referenced by expand(), G_TriggerSpawn(), SV_LinkEdict(), and Weather::update().
Calculates the center of the bounding box.
[out] | center | The target center vector |
Definition at line 155 of file aabb.h.
References maxs, mins, VectorAdd, and VectorScale.
Referenced by CalculateMinsMaxs(), CL_CenterCameraIntoMap_f(), G_BuildForbiddenListForEntity(), G_EventSpawnSound(), G_FindRadius(), G_SplashDamage(), Grid_RecalcRouting(), LE_FindRadius(), ParseBrush(), R_ModelAutoScale(), R_SetSurfaceExtents(), and boxtrace_s::setLineAndBox().
Definition at line 159 of file aabb.h.
References maxs, mins, and VectorSubtract.
Referenced by Check_MapSize(), CL_AddBrushModel(), R_CreateSurfaceFlare(), SV_CreateWorldSector(), and SV_LinkEdict().
|
inline |
Definition at line 128 of file aabb.h.
References maxs.
Referenced by GridBox::GridBox(), R_CullBspModel(), and GridBox::set().
|
inline |
Definition at line 131 of file aabb.h.
References maxs.
Referenced by canBeHitBy(), CL_ClampCamToMap(), CL_OutsideMap(), contains(), doesIntersect(), G_Actor2x2Spawn(), G_ActorSpawn(), getWidthX(), LE_BrushModelAction(), and Weather::update().
|
inline |
Definition at line 134 of file aabb.h.
References maxs.
Referenced by canBeHitBy(), CL_ClampCamToMap(), CL_OutsideMap(), contains(), doesIntersect(), getWidthY(), LE_BrushModelAction(), uiRadarNode::onCapturedMouseMove(), UI_InitRadar(), and Weather::update().
|
inline |
Definition at line 137 of file aabb.h.
References maxs.
Referenced by canBeHitBy(), CM_EntCompleteBoxTrace(), contains(), doesIntersect(), getWidthZ(), and Weather::update().
|
inline |
Definition at line 116 of file aabb.h.
References mins.
Referenced by GridBox::GridBox(), R_CullBspModel(), and GridBox::set().
|
inline |
Definition at line 119 of file aabb.h.
References mins.
Referenced by canBeHitBy(), CL_ClampCamToMap(), CL_OutsideMap(), contains(), doesIntersect(), uiRadarNode::draw(), G_Actor2x2Spawn(), G_ActorSpawn(), getWidthX(), LE_BrushModelAction(), uiRadarNode::onCapturedMouseMove(), UI_InitRadar(), and Weather::update().
|
inline |
Definition at line 122 of file aabb.h.
References mins.
Referenced by canBeHitBy(), CL_ClampCamToMap(), CL_OutsideMap(), contains(), doesIntersect(), uiRadarNode::draw(), getWidthY(), LE_BrushModelAction(), UI_InitRadar(), and Weather::update().
|
inline |
Definition at line 125 of file aabb.h.
References mins.
Referenced by canBeHitBy(), CM_EntCompleteBoxTrace(), contains(), doesIntersect(), getWidthZ(), LE_BrushModelAction(), and Weather::update().
|
inline |
Definition at line 141 of file aabb.h.
References getMaxX(), and getMinX().
Referenced by CL_BattlescapeRadarMapInFrameBuffer(), CM_CalculateWidestBoundingBox(), uiRadarNode::draw(), uiRadarNode::onCapturedMouseMove(), R_ModelAutoScale(), UI_BuildRadarImageList(), and UI_InitRadar().
|
inline |
Definition at line 144 of file aabb.h.
References getMaxY(), and getMinY().
Referenced by CL_BattlescapeRadarMapInFrameBuffer(), CM_CalculateWidestBoundingBox(), uiRadarNode::draw(), uiRadarNode::onCapturedMouseMove(), UI_BuildRadarImageList(), and UI_InitRadar().
|
inline |
Definition at line 147 of file aabb.h.
References getMaxZ(), and getMinZ().
Referenced by CM_CalculateWidestBoundingBox(), and R_ModelAutoScale().
|
inline |
Definition at line 176 of file aabb.h.
References maxs, mins, and VectorEmpty.
Definition at line 83 of file aabb.h.
Referenced by MakeBrushWindings(), ProcessSubModel(), and SV_LoadModelAABB().
Rotates bounding box around given origin point; note that it will expand the box unless all angles are multiples of 90 degrees.
Rotates AABB around given origin point; note that it will expand the box unless all angles are multiples of 90 degrees.
Definition at line 86 of file aabb.cpp.
References f, m, maxs, mins, VectorAbs, VectorAdd, VectorCreateRotationMatrix(), VectorEmpty, VectorInterpolation, VectorRotate(), and VectorSubtract.
Copies the values from the given aabb.
[in] | other | The other aabb |
Definition at line 60 of file aabb.h.
References maxs, mins, and VectorCopy.
Referenced by BeginModel(), MoveClip::calcBounds(), CalculateMinsMaxs(), CL_AddBrushModel(), CL_AddEdict(), CL_Trace(), CM_CalculateWidestBoundingBox(), CM_CompleteBoxTrace(), CM_EntCompleteBoxTrace(), ConstructLevelNodes_r(), G_InitCamera(), G_TriggerSpawn(), Grid_RecalcRouting(), LE_BrushModelAction(), MakeBspBrushList(), PTL_Trace(), R_SetSurfaceExtents(), R_SetupSubmodels(), RT_CheckCell(), set(), SP_misc_model(), SV_AreaEdicts(), SV_LinkEdict(), SV_LoadModelAABB(), SV_SetModel(), and SV_Trace().
Definition at line 64 of file aabb.h.
References maxs, mins, and VectorCopy.
Set from another box and a (trace)Line.
Definition at line 105 of file aabb.h.
References add(), set(), shift(), Line::start, and Line::stop.
Definition at line 87 of file aabb.h.
References LittleFloat, maxs, and mins.
Referenced by CMod_LoadSubmodels().
Definition at line 71 of file aabb.h.
References maxs, and VectorCopy.
Referenced by CL_ActorAppear(), CL_ActorDie(), CL_ActorRevitalised(), CL_ActorStateChange(), ConstructLevelNodes_r(), G_Actor2x2Spawn(), G_ActorSetMaxs(), G_ActorSpawn(), G_SpawnField(), SP_2x2_start(), and SP_misc_mission().
|
inline |
Definition at line 68 of file aabb.h.
References mins, and VectorCopy.
Referenced by CL_ActorAppear(), G_Actor2x2Spawn(), G_ActorSpawn(), G_SpawnField(), SP_2x2_start(), and SP_misc_mission().
|
inline |
Sets mins and maxs to their starting points before using addPoint.
Definition at line 98 of file aabb.h.
Referenced by AllocTree(), BeginModel(), BoundBrush(), BuildNodeChildren(), BuildTree(), CalcNodeBounds(), Check_MapSize(), LoadMapFile(), MakeBrushWindings(), MapBrushesBounds(), R_ModLoadAliasMD2Model(), R_ModLoadAliasMD3Model(), and SV_LoadModelAABB().
shove the whole box by the given vector
Definition at line 246 of file aabb.h.
References clipToWorld(), maxs, mins, and VectorAdd.
Referenced by CalculateMinsMaxs(), CL_GridRecalcRouting(), CM_CalculateWidestBoundingBox(), CMod_LoadSubmodels(), Grid_RecalcRouting(), LET_SlideDoor(), R_CullBspModel(), RT_CheckCell(), and set().
|
static |
Definition at line 44 of file aabb.h.
Referenced by CL_ActorVis(), CL_TargetingGrenade(), CL_TargetingStraight(), Edict::init(), le_s::init(), LE_PlayFootStepSound(), SV_PointContents(), and Weather::update().
vec3_t AABB::maxs |
Definition at line 258 of file aabb.h.
Referenced by AABB(), add(), AddBrushBevels(), asIntString(), BrushesDisjoint(), BuildNodeChildren(), CalculateMinsMaxs(), Check_BoundingBoxIntersects(), CL_AddEdict(), ClipBrushToBox(), clipToWorld(), CM_HeadnodeForBox(), CMod_LoadEntityString(), ConstructLevelNodes_r(), DoRouting(), EmitBrushes(), EmitDrawNode_r(), EmitLeaf(), expand(), expandXY(), G_BuildForbiddenListForEntity(), G_DamageActor(), G_EventSendEdict(), G_SmokeVis(), getCenter(), getDiagonal(), getMaxs(), getMaxX(), getMaxY(), getMaxZ(), MapTile::getTileBox(), Grid_RecalcRouting(), isZero(), MakeBrushWindings(), MakeBspBrushList(), MakeHeadnodePortals(), MakeTreePortals_r(), ParseBrush(), ProcessSubModel(), PTL_Trace(), R_DrawBoundingBox(), R_DrawBoundingBoxBatched(), R_ModLoadAliasMD3Model(), R_ModLoadLeafs(), R_ModLoadNodes(), R_ModLoadSubmodels(), R_RecursiveWorldNode(), RayIntersectAABB(), reset(), rotateAround(), RT_CheckCell(), RT_GetMapSize(), RT_ObstructedTrace(), set(), setFromLittleFloat(), boxtrace_s::setLineAndBox(), setMaxs(), setMaxZ(), setNegativeVolume(), shift(), SL_BSPSlice(), SplitBrush(), SV_AreaEdicts_r(), SV_ClipMoveToEntities(), SV_CreateWorldSector(), SV_LinkEdict(), SwapBSPFile(), TestBrushToPlanenum(), UI_InitRadar(), and Weather::update().
vec3_t AABB::mins |
we explicitly don't make them private for now, because the goal of this class is to NOT handle them separately
Definition at line 257 of file aabb.h.
Referenced by AABB(), add(), AddBrushBevels(), asIntString(), BrushesDisjoint(), BuildNodeChildren(), Check_BoundingBoxIntersects(), CL_AddEdict(), ClipBrushToBox(), clipToWorld(), CM_HeadnodeForBox(), CMod_LoadEntityString(), ConstructLevelNodes_r(), DoRouting(), EmitBrushes(), EmitDrawNode_r(), EmitLeaf(), expand(), expandXY(), G_BuildForbiddenListForEntity(), G_DamageActor(), G_EventSendEdict(), G_SmokeVis(), getCenter(), getDiagonal(), getMins(), getMinX(), getMinY(), getMinZ(), MapTile::getTileBox(), isZero(), MakeBrushWindings(), MakeBspBrushList(), MakeHeadnodePortals(), MakeTreePortals_r(), ParseBrush(), ProcessSubModel(), PTL_Trace(), R_DrawBoundingBox(), R_DrawBoundingBoxBatched(), R_ModLoadAliasMD3Model(), R_ModLoadLeafs(), R_ModLoadNodes(), R_ModLoadSubmodels(), R_RecursiveWorldNode(), RayIntersectAABB(), reset(), rotateAround(), RT_GetMapSize(), RT_ObstructedTrace(), set(), setFromLittleFloat(), boxtrace_s::setLineAndBox(), setMins(), setNegativeVolume(), shift(), SL_BSPSlice(), SV_AreaEdicts_r(), SV_ClipMoveToEntities(), SV_CreateWorldSector(), SV_LinkEdict(), SwapBSPFile(), TestBrushToPlanenum(), and UI_InitRadar().