![]() |
Botcraft 1.21.4
|
#include <RenderingManager.hpp>
Public Member Functions | |
RenderingManager (std::shared_ptr< World > world_, std::shared_ptr< InventoryManager > inventory_manager_, std::shared_ptr< EntityManager > entity_manager_, const unsigned int &window_width, const unsigned int &window_height, const unsigned int section_height_=16, const bool headless=false) | |
~RenderingManager () | |
void | Close () |
void | SetMouseCallback (std::function< void(double, double)> callback) |
void | SetKeyboardCallback (std::function< void(std::array< bool, static_cast< int >(KEY_CODE::NUMBER_OF_KEYS)>, double)> callback) |
void | AddChunkToUpdate (const int x, const int z) |
void | AddEntityToUpdate (const int id) |
void | SetPosOrientation (const double x_, const double y_, const double z_, const float yaw_, const float pitch_) |
void | Screenshot (const std::string &path) |
void | SetCurrentBehaviourTree (const BaseNode *root) const |
void | ResetBehaviourState () const |
void | BehaviourStartTick () const |
void | BehaviourEndTick (const bool b) const |
void | BehaviourTickChild (const size_t i) const |
bool | IsBehaviourGUIPaused () const |
void | ResetBlackboard () const |
void | UpdateBlackboardValue (const std::string &key, const std::any &value) const |
void | RemoveBlackboardValue (const std::string &key) const |
Private Member Functions | |
bool | Init (const bool headless) |
void | Run (const bool headless) |
void | InternalProcessInput (GLFWwindow *window) |
Static Private Member Functions | |
static void | ResizeCallback (GLFWwindow *window, int width, int height) |
static void | InternalMouseCallback (GLFWwindow *window, double xpos, double ypos) |
Definition at line 50 of file RenderingManager.hpp.
Botcraft::Renderer::RenderingManager::RenderingManager | ( | std::shared_ptr< World > | world_, |
std::shared_ptr< InventoryManager > | inventory_manager_, | ||
std::shared_ptr< EntityManager > | entity_manager_, | ||
const unsigned int & | window_width, | ||
const unsigned int & | window_height, | ||
const unsigned int | section_height_ = 16 , |
||
const bool | headless = false |
||
) |
Definition at line 46 of file RenderingManager.cpp.
References behaviour_open, behaviour_renderer, current_window_height, current_window_width, day_time, deltaTime, entity_manager, first_mouse, has_proj_changed, inventory_manager, inventory_open, is_key_pressed, KeyboardCallback, lastFrameTime, local_player, mouse_last_x, mouse_last_y, MouseCallback, Botcraft::Renderer::NUMBER_OF_KEYS, rendering_thread, Run(), running, take_screenshot, thread_updating_renderable, WaitForRenderingUpdate(), world, and world_renderer.
Botcraft::Renderer::RenderingManager::~RenderingManager | ( | ) |
Definition at line 90 of file RenderingManager.cpp.
References condition_update, KeyboardCallback, MouseCallback, Botcraft::Renderer::NUMBER_OF_KEYS, rendering_thread, running, and thread_updating_renderable.
void Botcraft::Renderer::RenderingManager::AddChunkToUpdate | ( | const int | x, |
const int | z | ||
) |
Definition at line 599 of file RenderingManager.cpp.
References chunks_to_udpate, condition_update, and mutex_updating.
void Botcraft::Renderer::RenderingManager::AddEntityToUpdate | ( | const int | id | ) |
Definition at line 612 of file RenderingManager.cpp.
References condition_update, entities_to_update, and mutex_updating.
Referenced by Handle(), Handle(), Handle(), Handle(), Handle(), Handle(), and Handle().
void Botcraft::Renderer::RenderingManager::BehaviourEndTick | ( | const bool | b | ) | const |
Definition at line 406 of file RenderingManager.cpp.
References behaviour_renderer.
void Botcraft::Renderer::RenderingManager::BehaviourStartTick | ( | ) | const |
Definition at line 401 of file RenderingManager.cpp.
References behaviour_renderer.
void Botcraft::Renderer::RenderingManager::BehaviourTickChild | ( | const size_t | i | ) | const |
Definition at line 411 of file RenderingManager.cpp.
References behaviour_renderer.
void Botcraft::Renderer::RenderingManager::Close | ( | ) |
Definition at line 369 of file RenderingManager.cpp.
|
overrideprotectedvirtual |
Definition at line 754 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
overrideprotectedvirtual |
Definition at line 721 of file RenderingManager.cpp.
References AddChunkToUpdate(), Botcraft::Chunk::BlockCoordsToChunkCoords(), Botcraft::Vector3< T >::x, and Botcraft::Vector3< T >::z.
|
overrideprotectedvirtual |
Definition at line 736 of file RenderingManager.cpp.
References AddChunkToUpdate().
|
overrideprotectedvirtual |
Definition at line 748 of file RenderingManager.cpp.
|
overrideprotectedvirtual |
Definition at line 792 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
overrideprotectedvirtual |
Definition at line 797 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
overrideprotectedvirtual |
Definition at line 802 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
overrideprotectedvirtual |
Definition at line 823 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
overrideprotectedvirtual |
Definition at line 837 of file RenderingManager.cpp.
References world_renderer.
|
overrideprotectedvirtual |
Definition at line 727 of file RenderingManager.cpp.
References AddChunkToUpdate().
|
overrideprotectedvirtual |
Definition at line 807 of file RenderingManager.cpp.
References AddEntityToUpdate(), entity_manager, and local_player.
|
overrideprotectedvirtual |
Definition at line 832 of file RenderingManager.cpp.
References day_time.
|
overrideprotectedvirtual |
Definition at line 780 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
private |
Definition at line 436 of file RenderingManager.cpp.
References behaviour_renderer, current_window_height, current_window_width, InternalMouseCallback(), LOG_ERROR, my_shader, ResizeCallback(), window, and world_renderer.
Referenced by Run().
|
staticprivate |
Definition at line 518 of file RenderingManager.cpp.
References behaviour_open, first_mouse, inventory_open, mouse_last_x, mouse_last_y, MouseCallback, and window.
Referenced by Init().
|
private |
Definition at line 543 of file RenderingManager.cpp.
References Botcraft::Renderer::BACKWARD, Botcraft::Renderer::BEHAVIOUR, behaviour_open, Botcraft::Renderer::CTRL, deltaTime, Botcraft::Renderer::ESC, Botcraft::Renderer::FORWARD, Botcraft::Renderer::INVENTORY, inventory_open, is_key_pressed, KeyboardCallback, Botcraft::Renderer::LEFT, Botcraft::Renderer::MOUSE_LEFT, Botcraft::Renderer::RIGHT, screenshot_path, Botcraft::Renderer::SHIFT, Botcraft::Renderer::SPACE, take_screenshot, and window.
Referenced by Run().
bool Botcraft::Renderer::RenderingManager::IsBehaviourGUIPaused | ( | ) | const |
Definition at line 416 of file RenderingManager.cpp.
References behaviour_renderer.
void Botcraft::Renderer::RenderingManager::RemoveBlackboardValue | ( | const std::string & | key | ) | const |
Definition at line 431 of file RenderingManager.cpp.
References behaviour_renderer.
void Botcraft::Renderer::RenderingManager::ResetBehaviourState | ( | ) | const |
Definition at line 396 of file RenderingManager.cpp.
References behaviour_renderer.
void Botcraft::Renderer::RenderingManager::ResetBlackboard | ( | ) | const |
Definition at line 421 of file RenderingManager.cpp.
References behaviour_renderer.
|
staticprivate |
Definition at line 509 of file RenderingManager.cpp.
References current_window_height, current_window_width, has_proj_changed, and window.
Referenced by Init().
|
private |
Definition at line 109 of file RenderingManager.cpp.
References behaviour_open, behaviour_renderer, color_day(), color_night(), current_window_height, current_window_width, day_time, deltaTime, entity_manager, Botcraft::Blockstate::GetFluidHeight(), Botcraft::Blockstate::GetFriction(), Botcraft::Blockstate::GetHardness(), Botcraft::AssetsManager::getInstance(), Botcraft::Logger::GetInstance(), Botcraft::Blockstate::GetName(), has_proj_changed, Init(), InternalProcessInput(), Botcraft::Window::INVENTORY_ARMOR_START, Botcraft::Window::INVENTORY_CRAFTING_INPUT_START, Botcraft::Window::INVENTORY_CRAFTING_OUTPUT_INDEX, Botcraft::Window::INVENTORY_HOTBAR_START, inventory_manager, Botcraft::Window::INVENTORY_OFFHAND_INDEX, inventory_open, Botcraft::Window::INVENTORY_STORAGE_START, Botcraft::Blockstate::IsAir(), Botcraft::Blockstate::IsBed(), Botcraft::Blockstate::IsBerryBush(), Botcraft::Blockstate::IsClimbable(), Botcraft::Blockstate::IsCobweb(), Botcraft::Blockstate::IsDownBubbleColumn(), Botcraft::Blockstate::IsFluidFalling(), Botcraft::Blockstate::IsHazardous(), Botcraft::Blockstate::IsHoney(), Botcraft::Blockstate::IsLava(), Botcraft::Blockstate::IsPowderSnow(), Botcraft::Blockstate::IsScaffolding(), Botcraft::Blockstate::IsSlime(), Botcraft::Blockstate::IsSolid(), Botcraft::Blockstate::IsSoulSand(), Botcraft::Blockstate::IsTransparent(), Botcraft::Blockstate::IsUpBubbleColumn(), Botcraft::Blockstate::IsWater(), Botcraft::Blockstate::IsWaterlogged(), Botcraft::AssetsManager::Items(), lastFrameTime, local_player, LOG_ERROR, my_shader, Botcraft::Logger::RegisterThread(), screenshot_path, Botcraft::Utilities::SleepUntil(), take_screenshot, window, world, world_renderer, Botcraft::Renderer::WriteImage(), Botcraft::Vector3< T >::x, Botcraft::Vector3< T >::y, and Botcraft::Vector3< T >::z.
Referenced by RenderingManager().
void Botcraft::Renderer::RenderingManager::Screenshot | ( | const std::string & | path | ) |
Definition at line 385 of file RenderingManager.cpp.
References screenshot_path, and take_screenshot.
void Botcraft::Renderer::RenderingManager::SetCurrentBehaviourTree | ( | const BaseNode * | root | ) | const |
Definition at line 391 of file RenderingManager.cpp.
References behaviour_renderer.
void Botcraft::Renderer::RenderingManager::SetKeyboardCallback | ( | std::function< void(std::array< bool, static_cast< int >(KEY_CODE::NUMBER_OF_KEYS)>, double)> | callback | ) |
Definition at line 380 of file RenderingManager.cpp.
References KeyboardCallback.
void Botcraft::Renderer::RenderingManager::SetMouseCallback | ( | std::function< void(double, double)> | callback | ) |
Definition at line 375 of file RenderingManager.cpp.
References MouseCallback.
void Botcraft::Renderer::RenderingManager::SetPosOrientation | ( | const double | x_, |
const double | y_, | ||
const double | z_, | ||
const float | yaw_, | ||
const float | pitch_ | ||
) |
Definition at line 619 of file RenderingManager.cpp.
References world_renderer.
void Botcraft::Renderer::RenderingManager::UpdateBlackboardValue | ( | const std::string & | key, |
const std::any & | value | ||
) | const |
Definition at line 426 of file RenderingManager.cpp.
References behaviour_renderer.
|
protected |
Definition at line 627 of file RenderingManager.cpp.
References chunks_to_udpate, condition_update, entities_to_update, entity_manager, Botcraft::Logger::GetInstance(), mutex_updating, Botcraft::Logger::RegisterThread(), running, world, world_renderer, Botcraft::Vector3< T >::x, and Botcraft::Vector3< T >::z.
Referenced by RenderingManager().
|
private |
Definition at line 159 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), InternalProcessInput(), RenderingManager(), and Run().
|
private |
Definition at line 180 of file RenderingManager.hpp.
Referenced by BehaviourEndTick(), BehaviourStartTick(), BehaviourTickChild(), Init(), IsBehaviourGUIPaused(), RemoveBlackboardValue(), RenderingManager(), ResetBehaviourState(), ResetBlackboard(), Run(), SetCurrentBehaviourTree(), and UpdateBlackboardValue().
|
private |
Definition at line 190 of file RenderingManager.hpp.
Referenced by AddChunkToUpdate(), and WaitForRenderingUpdate().
|
private |
Definition at line 193 of file RenderingManager.hpp.
Referenced by AddChunkToUpdate(), AddEntityToUpdate(), WaitForRenderingUpdate(), and ~RenderingManager().
|
private |
Definition at line 172 of file RenderingManager.hpp.
Referenced by Init(), RenderingManager(), ResizeCallback(), and Run().
|
private |
Definition at line 171 of file RenderingManager.hpp.
Referenced by Init(), RenderingManager(), ResizeCallback(), and Run().
|
private |
Definition at line 176 of file RenderingManager.hpp.
Referenced by Handle(), RenderingManager(), and Run().
|
private |
Definition at line 167 of file RenderingManager.hpp.
Referenced by InternalProcessInput(), RenderingManager(), and Run().
|
private |
Definition at line 191 of file RenderingManager.hpp.
Referenced by AddEntityToUpdate(), and WaitForRenderingUpdate().
|
private |
Definition at line 153 of file RenderingManager.hpp.
Referenced by Handle(), RenderingManager(), Run(), and WaitForRenderingUpdate().
|
private |
Definition at line 165 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), and RenderingManager().
|
private |
Definition at line 173 of file RenderingManager.hpp.
Referenced by RenderingManager(), ResizeCallback(), and Run().
|
private |
Definition at line 152 of file RenderingManager.hpp.
Referenced by RenderingManager(), and Run().
|
private |
Definition at line 158 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), InternalProcessInput(), RenderingManager(), and Run().
|
private |
Definition at line 156 of file RenderingManager.hpp.
Referenced by InternalProcessInput(), and RenderingManager().
|
private |
Definition at line 183 of file RenderingManager.hpp.
Referenced by InternalProcessInput(), RenderingManager(), SetKeyboardCallback(), and ~RenderingManager().
|
private |
Definition at line 168 of file RenderingManager.hpp.
Referenced by RenderingManager(), and Run().
|
private |
Definition at line 154 of file RenderingManager.hpp.
Referenced by Handle(), RenderingManager(), and Run().
|
private |
Definition at line 163 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), and RenderingManager().
|
private |
Definition at line 164 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), and RenderingManager().
|
private |
Definition at line 182 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), RenderingManager(), SetMouseCallback(), and ~RenderingManager().
|
private |
Definition at line 192 of file RenderingManager.hpp.
Referenced by AddChunkToUpdate(), AddEntityToUpdate(), and WaitForRenderingUpdate().
|
private |
Definition at line 178 of file RenderingManager.hpp.
|
private |
Definition at line 161 of file RenderingManager.hpp.
Referenced by RenderingManager(), and ~RenderingManager().
|
private |
Definition at line 188 of file RenderingManager.hpp.
Referenced by Close(), RenderingManager(), WaitForRenderingUpdate(), and ~RenderingManager().
|
private |
Definition at line 185 of file RenderingManager.hpp.
Referenced by InternalProcessInput(), Run(), and Screenshot().
|
private |
Definition at line 186 of file RenderingManager.hpp.
Referenced by InternalProcessInput(), RenderingManager(), Run(), and Screenshot().
|
private |
Definition at line 195 of file RenderingManager.hpp.
Referenced by RenderingManager(), and ~RenderingManager().
|
private |
Definition at line 170 of file RenderingManager.hpp.
Referenced by Close(), Init(), InternalMouseCallback(), InternalProcessInput(), ResizeCallback(), and Run().
|
private |
Definition at line 151 of file RenderingManager.hpp.
Referenced by RenderingManager(), Run(), and WaitForRenderingUpdate().
|
private |
Definition at line 179 of file RenderingManager.hpp.
Referenced by Handle(), Init(), RenderingManager(), Run(), SetPosOrientation(), and WaitForRenderingUpdate().