|
Botcraft 26.1.2
|
#include <RenderingManager.hpp>
Public Member Functions | |
| ~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 | 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 |
Static Public Member Functions | |
| static std::shared_ptr< RenderingManager > | CreateRenderingManagerIfPossible (std::shared_ptr< World > world_, std::shared_ptr< InventoryManager > inventory_manager_, std::shared_ptr< EntityManager > entity_manager_) |
Private Member Functions | |
| RenderingManager (std::shared_ptr< World > world_, std::shared_ptr< InventoryManager > inventory_manager_, std::shared_ptr< EntityManager > entity_manager_, const unsigned int section_height_=16) | |
| bool | Init () |
| void | Run () |
| 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) |
Static Private Attributes | |
| static std::weak_ptr< RenderingManager > | current_instance |
| static std::mutex | instance_mutex |
Definition at line 51 of file RenderingManager.hpp.
|
private |
Definition at line 70 of file RenderingManager.cpp.
References behaviour_open, behaviour_renderer, current_vsync, current_window_headless, current_window_height, current_window_width, day_time, deltaTime, entity_manager, first_mouse, has_proj_changed, Botcraft::Renderer::Settings::headless, Botcraft::Renderer::Settings::height, 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, thread_updating_renderable, Botcraft::Renderer::Settings::vsync, WaitForRenderingUpdate(), Botcraft::Renderer::Settings::width, window, world, and world_renderer.
| Botcraft::Renderer::RenderingManager::~RenderingManager | ( | ) |
Definition at line 117 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 688 of file RenderingManager.cpp.
References chunks_to_udpate, condition_update, and mutex_updating.
| void Botcraft::Renderer::RenderingManager::AddEntityToUpdate | ( | const int | id | ) |
Definition at line 701 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 493 of file RenderingManager.cpp.
References behaviour_renderer.
| void Botcraft::Renderer::RenderingManager::BehaviourStartTick | ( | ) | const |
Definition at line 488 of file RenderingManager.cpp.
References behaviour_renderer.
| void Botcraft::Renderer::RenderingManager::BehaviourTickChild | ( | const size_t | i | ) | const |
Definition at line 498 of file RenderingManager.cpp.
References behaviour_renderer.
| void Botcraft::Renderer::RenderingManager::Close | ( | ) |
Definition at line 462 of file RenderingManager.cpp.
|
static |
Definition at line 50 of file RenderingManager.cpp.
References current_instance, and instance_mutex.
Referenced by Botcraft::ManagersClient::Handle().
|
overrideprotectedvirtual |
Definition at line 843 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
overrideprotectedvirtual |
Definition at line 810 of file RenderingManager.cpp.
References AddChunkToUpdate(), Botcraft::Chunk::BlockCoordsToChunkCoords(), Botcraft::Vector3< T >::x, and Botcraft::Vector3< T >::z.
|
overrideprotectedvirtual |
Definition at line 825 of file RenderingManager.cpp.
References AddChunkToUpdate().
|
overrideprotectedvirtual |
Definition at line 837 of file RenderingManager.cpp.
|
overrideprotectedvirtual |
Definition at line 881 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
overrideprotectedvirtual |
Definition at line 886 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
overrideprotectedvirtual |
Definition at line 891 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
overrideprotectedvirtual |
Definition at line 912 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
overrideprotectedvirtual |
Definition at line 954 of file RenderingManager.cpp.
References world_renderer.
|
overrideprotectedvirtual |
Definition at line 816 of file RenderingManager.cpp.
References AddChunkToUpdate().
|
overrideprotectedvirtual |
Definition at line 896 of file RenderingManager.cpp.
References AddEntityToUpdate(), entity_manager, and local_player.
|
overrideprotectedvirtual |
Definition at line 921 of file RenderingManager.cpp.
|
overrideprotectedvirtual |
Definition at line 869 of file RenderingManager.cpp.
References AddEntityToUpdate().
|
private |
Definition at line 523 of file RenderingManager.cpp.
References behaviour_renderer, current_vsync, current_window_headless, current_window_height, current_window_width, InternalMouseCallback(), LOG_ERROR, my_shader, ResizeCallback(), window, and world_renderer.
Referenced by Run().
|
staticprivate |
Definition at line 607 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 632 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, Botcraft::Renderer::Settings::screenhsot_path, Botcraft::Renderer::Settings::screenshot_mutex, Botcraft::Renderer::SHIFT, Botcraft::Renderer::SPACE, and window.
Referenced by Run().
| bool Botcraft::Renderer::RenderingManager::IsBehaviourGUIPaused | ( | ) | const |
Definition at line 503 of file RenderingManager.cpp.
References behaviour_renderer.
| void Botcraft::Renderer::RenderingManager::RemoveBlackboardValue | ( | const std::string & | key | ) | const |
Definition at line 518 of file RenderingManager.cpp.
References behaviour_renderer.
| void Botcraft::Renderer::RenderingManager::ResetBehaviourState | ( | ) | const |
Definition at line 483 of file RenderingManager.cpp.
References behaviour_renderer.
| void Botcraft::Renderer::RenderingManager::ResetBlackboard | ( | ) | const |
Definition at line 508 of file RenderingManager.cpp.
References behaviour_renderer.
|
staticprivate |
Definition at line 596 of file RenderingManager.cpp.
References current_window_height, current_window_width, has_proj_changed, Botcraft::Renderer::Settings::height, Botcraft::Renderer::Settings::width, and window.
Referenced by Init().
|
private |
Definition at line 136 of file RenderingManager.cpp.
References behaviour_open, behaviour_renderer, color_day(), color_night(), current_vsync, current_window_headless, 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, Botcraft::Renderer::Settings::headless, Botcraft::Renderer::Settings::height, 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(), Botcraft::Renderer::Settings::screenhsot_path, Botcraft::Renderer::Settings::screenshot_callback, Botcraft::Renderer::Settings::screenshot_mutex, Botcraft::Utilities::SleepFor(), Botcraft::Renderer::Settings::target_fps, Botcraft::Renderer::Settings::vsync, Botcraft::Renderer::Settings::width, 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::SetCurrentBehaviourTree | ( | const BaseNode * | root | ) | const |
Definition at line 478 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 473 of file RenderingManager.cpp.
References KeyboardCallback.
| void Botcraft::Renderer::RenderingManager::SetMouseCallback | ( | std::function< void(double, double)> | callback | ) |
Definition at line 468 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 708 of file RenderingManager.cpp.
References world_renderer.
| void Botcraft::Renderer::RenderingManager::UpdateBlackboardValue | ( | const std::string & | key, |
| const std::any & | value | ||
| ) | const |
Definition at line 513 of file RenderingManager.cpp.
References behaviour_renderer.
|
protected |
Definition at line 716 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 169 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), InternalProcessInput(), RenderingManager(), and Run().
|
private |
Definition at line 192 of file RenderingManager.hpp.
Referenced by BehaviourEndTick(), BehaviourStartTick(), BehaviourTickChild(), Init(), IsBehaviourGUIPaused(), RemoveBlackboardValue(), RenderingManager(), ResetBehaviourState(), ResetBlackboard(), Run(), SetCurrentBehaviourTree(), and UpdateBlackboardValue().
|
private |
Definition at line 199 of file RenderingManager.hpp.
Referenced by AddChunkToUpdate(), and WaitForRenderingUpdate().
|
private |
Definition at line 202 of file RenderingManager.hpp.
Referenced by AddChunkToUpdate(), AddEntityToUpdate(), WaitForRenderingUpdate(), and ~RenderingManager().
|
staticprivate |
Definition at line 70 of file RenderingManager.hpp.
Referenced by CreateRenderingManagerIfPossible().
|
private |
Definition at line 184 of file RenderingManager.hpp.
Referenced by Init(), RenderingManager(), and Run().
|
private |
Definition at line 183 of file RenderingManager.hpp.
Referenced by Init(), RenderingManager(), and Run().
|
private |
Definition at line 182 of file RenderingManager.hpp.
Referenced by Init(), RenderingManager(), ResizeCallback(), and Run().
|
private |
Definition at line 181 of file RenderingManager.hpp.
Referenced by Init(), RenderingManager(), ResizeCallback(), and Run().
|
private |
Definition at line 188 of file RenderingManager.hpp.
Referenced by Handle(), RenderingManager(), and Run().
|
private |
Definition at line 177 of file RenderingManager.hpp.
Referenced by InternalProcessInput(), RenderingManager(), and Run().
|
private |
Definition at line 200 of file RenderingManager.hpp.
Referenced by AddEntityToUpdate(), and WaitForRenderingUpdate().
|
private |
Definition at line 163 of file RenderingManager.hpp.
Referenced by Handle(), RenderingManager(), Run(), and WaitForRenderingUpdate().
|
private |
Definition at line 175 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), and RenderingManager().
|
private |
Definition at line 185 of file RenderingManager.hpp.
Referenced by RenderingManager(), ResizeCallback(), and Run().
|
staticprivate |
Definition at line 71 of file RenderingManager.hpp.
Referenced by CreateRenderingManagerIfPossible().
|
private |
Definition at line 162 of file RenderingManager.hpp.
Referenced by RenderingManager(), and Run().
|
private |
Definition at line 168 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), InternalProcessInput(), RenderingManager(), and Run().
|
private |
Definition at line 166 of file RenderingManager.hpp.
Referenced by InternalProcessInput(), and RenderingManager().
|
private |
Definition at line 195 of file RenderingManager.hpp.
Referenced by InternalProcessInput(), RenderingManager(), SetKeyboardCallback(), and ~RenderingManager().
|
private |
Definition at line 178 of file RenderingManager.hpp.
Referenced by RenderingManager(), and Run().
|
private |
Definition at line 164 of file RenderingManager.hpp.
Referenced by Handle(), RenderingManager(), and Run().
|
private |
Definition at line 173 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), and RenderingManager().
|
private |
Definition at line 174 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), and RenderingManager().
|
private |
Definition at line 194 of file RenderingManager.hpp.
Referenced by InternalMouseCallback(), RenderingManager(), SetMouseCallback(), and ~RenderingManager().
|
private |
Definition at line 201 of file RenderingManager.hpp.
Referenced by AddChunkToUpdate(), AddEntityToUpdate(), and WaitForRenderingUpdate().
|
private |
Definition at line 190 of file RenderingManager.hpp.
|
private |
Definition at line 171 of file RenderingManager.hpp.
Referenced by RenderingManager(), and ~RenderingManager().
|
private |
Definition at line 197 of file RenderingManager.hpp.
Referenced by Close(), RenderingManager(), WaitForRenderingUpdate(), and ~RenderingManager().
|
private |
Definition at line 204 of file RenderingManager.hpp.
Referenced by RenderingManager(), and ~RenderingManager().
|
private |
Definition at line 180 of file RenderingManager.hpp.
Referenced by Close(), Init(), InternalMouseCallback(), InternalProcessInput(), RenderingManager(), ResizeCallback(), and Run().
|
private |
Definition at line 161 of file RenderingManager.hpp.
Referenced by Handle(), RenderingManager(), Run(), and WaitForRenderingUpdate().
|
private |
Definition at line 191 of file RenderingManager.hpp.
Referenced by Handle(), Init(), RenderingManager(), Run(), SetPosOrientation(), and WaitForRenderingUpdate().