UFO: Alien Invasion
Loading...
Searching...
No Matches
GridBox Class Reference

#include <mathlib.h>

Collaboration diagram for GridBox:
Collaboration graph

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.
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
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() [1/4]

GridBox::GridBox ( )
inline

Definition at line 127 of file mathlib.h.

References maxs, mins, vec3_origin, and VectorCopy.

◆ GridBox() [2/4]

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() [3/4]

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() [4/4]

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

◆ addOneZ()

void GridBox::addOneZ ( )
inline

Definition at line 212 of file mathlib.h.

References maxs, and PATHFINDING_HEIGHT.

Referenced by Grid_RecalcBoxRouting().

◆ clipToMaxBoundaries()

void GridBox::clipToMaxBoundaries ( )
inline

Definition at line 215 of file mathlib.h.

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

◆ expandXY()

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().

◆ getMaxX()

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().

◆ getMaxY()

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().

◆ getMaxZ()

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().

◆ getMinX()

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().

◆ getMinY()

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().

◆ getMinZ()

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().

◆ isZero()

bool GridBox::isZero ( ) const
inline

Definition at line 196 of file mathlib.h.

References maxs, mins, and VectorIntZero.

Referenced by Grid_RecalcRouting().

◆ set() [1/2]

void GridBox::set ( const AABB & aabb)
inline

Definition at line 152 of file mathlib.h.

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

◆ set() [2/2]

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().

◆ setFromMapBounds()

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

◆ EMPTY

const GridBox GridBox::EMPTY
static

Definition at line 122 of file mathlib.h.

Referenced by G_CompleteRecalcRouting().

◆ maxs

◆ mins

pos3_t GridBox::mins

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