UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GridBox Class Reference

#include <mathlib.h>

Public Member Functions

 GridBox ()
 
 GridBox (const ipos3_t mini, const ipos3_t maxi)
 
 GridBox (const pos3_t mini, const pos3_t maxi)
 
 GridBox (const AABB &aabb)
 
void set (const pos3_t mini, const pos3_t maxi)
 
void set (const AABB &aabb)
 
void setFromMapBounds (const vec3_t mini, const vec3_t maxi)
 Set the box correctly if the maxs value is the upper corner of a cell. VecToPos considers the upper bounds of a cell as belonging to the next cell. If this is not compensated, boxes derived from a map bounding box have one surplus cell in each direction. More...
 
pos_t getMinX () const
 
pos_t getMinY () const
 
pos_t getMinZ () const
 
pos_t getMaxX () const
 
pos_t getMaxY () const
 
pos_t getMaxZ () const
 
bool isZero () const
 
void expandXY (const int byVal)
 expand the box in four directions, but clip them to the maximum boundaries More...
 
void addOneZ ()
 
void clipToMaxBoundaries ()
 

Data Fields

pos3_t mins
 
pos3_t maxs
 

Static Public Attributes

static const GridBox EMPTY
 

Detailed Description

Definition at line 120 of file mathlib.h.

Constructor & Destructor Documentation

GridBox::GridBox ( )
inline

Definition at line 127 of file mathlib.h.

References maxs, mins, vec3_origin, and VectorCopy.

GridBox::GridBox ( const ipos3_t  mini,
const ipos3_t  maxi 
)
inline

Definition at line 131 of file mathlib.h.

References maxs, mins, and VectorCopy.

GridBox::GridBox ( const pos3_t  mini,
const pos3_t  maxi 
)
inline

Definition at line 135 of file mathlib.h.

References maxs, mins, and VectorCopy.

GridBox::GridBox ( const AABB aabb)
inline

Definition at line 140 of file mathlib.h.

References AABB::getMaxs(), AABB::getMins(), maxs, mins, and VecToPos.

Member Function Documentation

void GridBox::addOneZ ( )
inline

Definition at line 212 of file mathlib.h.

References maxs, and PATHFINDING_HEIGHT.

Referenced by Grid_RecalcBoxRouting().

void GridBox::clipToMaxBoundaries ( )
inline

Definition at line 215 of file mathlib.h.

Referenced by CMod_RerouteMap(), Grid_RecalcRouting(), and TEST_F().

void GridBox::expandXY ( const int  byVal)
inline

expand the box in four directions, but clip them to the maximum boundaries

Note
this is pretty much nonsense with the current setting of PATHFINDING_WIDTH and the data type of pos3_t, but who knows the future...

Definition at line 206 of file mathlib.h.

References maxs, mins, and PATHFINDING_WIDTH.

Referenced by Grid_RecalcBoxRouting(), and TEST_F().

pos_t GridBox::getMaxX ( ) const
inline

Definition at line 183 of file mathlib.h.

References maxs.

Referenced by CMod_RerouteMap(), Grid_RecalcBoxRouting(), RT_WriteCSVFiles(), and TEST_F().

pos_t GridBox::getMaxY ( ) const
inline

Definition at line 186 of file mathlib.h.

References maxs.

Referenced by CMod_RerouteMap(), Grid_RecalcBoxRouting(), RT_WriteCSVFiles(), and TEST_F().

pos_t GridBox::getMaxZ ( ) const
inline

Definition at line 189 of file mathlib.h.

References maxs.

Referenced by CMod_RerouteMap(), Grid_RecalcBoxRouting(), RT_WriteCSVFiles(), and TEST_F().

pos_t GridBox::getMinX ( ) const
inline

Definition at line 174 of file mathlib.h.

References mins.

Referenced by CMod_RerouteMap(), Grid_RecalcBoxRouting(), RT_WriteCSVFiles(), and TEST_F().

pos_t GridBox::getMinY ( ) const
inline

Definition at line 177 of file mathlib.h.

References mins.

Referenced by CMod_RerouteMap(), Grid_RecalcBoxRouting(), RT_WriteCSVFiles(), and TEST_F().

pos_t GridBox::getMinZ ( ) const
inline

Definition at line 180 of file mathlib.h.

References mins.

Referenced by CMod_RerouteMap(), Grid_RecalcBoxRouting(), RT_WriteCSVFiles(), and TEST_F().

bool GridBox::isZero ( ) const
inline

Definition at line 196 of file mathlib.h.

References maxs, mins, and VectorIntZero.

Referenced by Grid_RecalcRouting().

void GridBox::set ( const pos3_t  mini,
const pos3_t  maxi 
)
inline

Definition at line 148 of file mathlib.h.

References maxs, mins, and VectorCopy.

Referenced by Destroy_Breakable(), Door_Use(), Grid_RecalcRouting(), and TEST_F().

void GridBox::set ( const AABB aabb)
inline

Definition at line 152 of file mathlib.h.

References AABB::getMaxs(), AABB::getMins(), maxs, mins, and VecToPos.

void GridBox::setFromMapBounds ( const vec3_t  mini,
const vec3_t  maxi 
)
inline

Set the box correctly if the maxs value is the upper corner of a cell. VecToPos considers the upper bounds of a cell as belonging to the next cell. If this is not compensated, boxes derived from a map bounding box have one surplus cell in each direction.

Definition at line 163 of file mathlib.h.

References maxs, mins, and VecToPos.

Field Documentation

const GridBox GridBox::EMPTY
static

Definition at line 122 of file mathlib.h.

Referenced by G_CompleteRecalcRouting().

pos3_t GridBox::maxs
pos3_t GridBox::mins

Definition at line 222 of file mathlib.h.

Referenced by expandXY(), getMinX(), getMinY(), getMinZ(), GridBox(), isZero(), set(), and setFromMapBounds().


The documentation for this class was generated from the following files: