.. _program_listing_file_libs_mcg_include_mcg_AABB.h: Program Listing for File AABB.h =============================== |exhale_lsh| :ref:`Return to documentation for file ` (``libs/mcg/include/mcg/AABB.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #pragma once #include "Block.h" #include "Connection.h" #include "Door.h" #include "Entity.h" #include "Object.h" #include #include #include class AABB { protected: std::string id; std::string material; std::string type; Pos topLeft; Pos bottomRight; bool isHollow; bool hasRoof; bool autoAdjust; std::vector> blockList; std::vector> entityList; std::vector> objectList; std::vector> aabbList; std::vector> connectionList; void recalculateOverallBoundary(); public: std::string getID(); std::string getMaterial(); std::string getType(); Pos getTopLeft(); Pos getBottomRight(); std::vector>& getBlockList(); std::vector>& getEntityList(); std::vector>& getObjectList(); std::vector>& getAABBList(); std::vector>& getConnectionList(); int getMidpointX(); int getMidpointY(); int getMidpointZ(); int getSizeX(); int getSizeY(); int getSizeZ(); Pos virtual getRandomPos(std::mt19937_64& gen, int offsetPosX = 0, int offsetNegX = 0, int offsetPosY = 0, int offsetNegY = 0, int offsetPosZ = 0, int offsetNegZ = 0); std::vector virtual getEdgeMidpointAtBase(); AABB* getSubAABB(std::string id); void setTopLeft(Pos& topLeft); void setBottomRight(Pos& bottomRight); void setMaterial(std::string material); void addBlock(std::unique_ptr block); void addEntity(std::unique_ptr entity); void addObject(std::unique_ptr object); void addAABB(std::unique_ptr aabb); void addConnection(std::unique_ptr connection); bool virtual intersects(AABB& other); void virtual generateBox(std::string material, int offsetPosX = 0, int offsetNegX = 0, int offsetPosY = 0, int offsetNegY = 0, int offsetPosZ = 0, int offsetNegZ = 0); void virtual addRandomBlocks(int n, std::string material, std::mt19937_64& gen, int offsetPosX = 0, int offsetNegX = 0, int offsetPosY = 0, int offsetNegY = 0, int offsetPosZ = 0, int offsetNegZ = 0); void virtual generateAllDoorsInAABB(); void shiftX(int shift); void shiftY(int shift); void shiftZ(int shift); void shift(int shiftX, int shiftY, int shiftZ); void virtual toSemanticMapJSON(nlohmann::json& json_base); void virtual toLowLevelMapJSON(nlohmann::json& json_base); AABB(std::string id, std::string type, std::string material, Pos& topLeft, Pos& bottomRight, bool isHollow = true, bool hasRoof = false, bool autoAdjust = true); AABB(std::string id); virtual ~AABB(); };