Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
AABB.hpp File Reference
#include <glm/vec3.hpp>
#include <memory>
#include <string>
#include <vector>
Include dependency graph for AABB.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  AABB
 Axis Aligned Bounding Box data structure. More...
 
struct  MapAABBData
 Helper struct to store all the data necessary for creating a map AABB tree. More...
 

Functions

glm::vec3 minVector (const glm::vec3 &a, const glm::vec3 &b)
 Constructs a minimum vector from two vectors. More...
 
glm::vec3 maxVector (const glm::vec3 &a, const glm::vec3 &b)
 Constructs a maximum vector from two vectors. More...
 
std::vector< std::unique_ptr< AABB > > createMapAABB (const MapAABBData &data)
 Creates a list of AABBs trees for each area in the areaMatrix. More...
 
std::unique_ptr< AABBcreateAreaAABB (AABB *aabb, const int x, const int y, const int xsize, const int ysize, const MapAABBData &input, bool burgerFlip)
 Recursively creates an AABB tree for a single area. More...
 

Function Documentation

◆ createAreaAABB()

std::unique_ptr<AABB> createAreaAABB ( AABB aabb,
const int  x,
const int  y,
const int  xsize,
const int  ysize,
const MapAABBData input,
bool  burgerFlip 
)

Recursively creates an AABB tree for a single area.

Parameters
aabbThe parent AABB. If this is the root AABB, then this is nullptr.
xThe min x coordinate of the area.
yThe min y coordinate of the area.
xsizeThe width of the area.
ysizeThe height of the area.
inputThe input data for the AABB tree.
burgerFlipUsed to change the direction during recursion.
Returns
The root AABB of the area
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createMapAABB()

std::vector<std::unique_ptr<AABB> > createMapAABB ( const MapAABBData data)

Creates a list of AABBs trees for each area in the areaMatrix.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ maxVector()

glm::vec3 maxVector ( const glm::vec3 &  a,
const glm::vec3 &  b 
)

Constructs a maximum vector from two vectors.

Parameters
avector a
bvector b
Returns
maximum vector
Here is the caller graph for this function:

◆ minVector()

glm::vec3 minVector ( const glm::vec3 &  a,
const glm::vec3 &  b 
)

Constructs a minimum vector from two vectors.

Parameters
avector a
bvector b
Returns
minimum vector
Here is the caller graph for this function: