1 #include <glm/vec3.hpp>
15 AABB(glm::vec3
min = glm::vec3(0.f), glm::vec3
max = glm::vec3(0.f), std::unique_ptr<AABB>
pLeft =
nullptr, std::unique_ptr<AABB>
pRight =
nullptr);
33 glm::vec3
minVector(
const glm::vec3& a,
const glm::vec3& b);
42 glm::vec3
maxVector(
const glm::vec3& a,
const glm::vec3& b);
73 std::unique_ptr<AABB>
createAreaAABB(
AABB* aabb,
const int x,
const int y,
const int xsize,
const int ysize,
const MapAABBData& input,
bool burgerFlip);
glm::vec3 maxVector(const glm::vec3 &a, const glm::vec3 &b)
Constructs a maximum vector from two vectors.
Definition: AABB.cpp:43
std::vector< std::unique_ptr< AABB > > createMapAABB(const MapAABBData &data)
Creates a list of AABBs trees for each area in the areaMatrix.
Definition: AABB.cpp:48
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.
Definition: AABB.cpp:61
glm::vec3 minVector(const glm::vec3 &a, const glm::vec3 &b)
Constructs a minimum vector from two vectors.
Definition: AABB.cpp:38
Axis Aligned Bounding Box data structure.
Definition: AABB.hpp:14
glm::vec3 min
Definition: AABB.hpp:18
std::unique_ptr< AABB > pRight
Definition: AABB.hpp:21
AABB(glm::vec3 min=glm::vec3(0.f), glm::vec3 max=glm::vec3(0.f), std::unique_ptr< AABB > pLeft=nullptr, std::unique_ptr< AABB > pRight=nullptr)
Definition: AABB.cpp:6
glm::vec3 getCenter() const
Definition: AABB.cpp:33
std::unique_ptr< AABB > pLeft
Definition: AABB.hpp:20
AABB & operator=(AABB &other)
Definition: AABB.cpp:19
bool isLeaf() const
Definition: AABB.cpp:28
glm::vec3 max
Definition: AABB.hpp:19
Helper struct to store all the data necessary for creating a map AABB tree.
Definition: AABB.hpp:48
const std::vector< std::vector< std::string > > areaMatrix
Matrix cell contains the name of the area for the given column (x) and row (y). This gives important ...
Definition: AABB.hpp:50
const float sideUnit
The size of the side of a tile in the original unit.
Definition: AABB.hpp:53
const std::vector< std::vector< int > > heightMatrix
Matrix cell contains the height of the tile for the given column (x) and row (y). This matrix contain...
Definition: AABB.hpp:49
const float sideScale
Percentage value of how much the side is scaled from the original unit.
Definition: AABB.hpp:54
const unsigned int areaSize
The size of the area in tiles. Width and height of the area are the same.
Definition: AABB.hpp:51
const float heightScale
Percentage value of how much the height is scaled from the original unit.
Definition: AABB.hpp:52