X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Finterface.hpp;fp=src%2Finterface.hpp;h=0000000000000000000000000000000000000000;hb=b7d09e1e35ef90282c97509e0020b20db3c7ea9f;hp=9f43f4f6f662b6ba10b71d0706ebf5b202e9887b;hpb=e53a0e2e711a7d8bd9b0ddacd1360aa14370643f;p=blank.git diff --git a/src/interface.hpp b/src/interface.hpp deleted file mode 100644 index 9f43f4f..0000000 --- a/src/interface.hpp +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef BLANK_INTERFACE_HPP_ -#define BLANK_INTERFACE_HPP_ - -#include "block.hpp" -#include "controller.hpp" -#include "geometry.hpp" -#include "hud.hpp" -#include "model.hpp" -#include "shader.hpp" -#include "timer.hpp" - -#include -#include - - -namespace blank { - -class Chunk; -class World; - -class Interface { - -public: - struct Config { - float move_velocity = 0.005f; - float pitch_sensitivity = -0.0025f; - float yaw_sensitivity = -0.001f; - - bool keyboard_disabled = false; - bool mouse_disabled = false; - bool visual_disabled = false; - }; - - Interface(const Config &, World &); - - void HandlePress(const SDL_KeyboardEvent &); - void HandleRelease(const SDL_KeyboardEvent &); - void Handle(const SDL_MouseMotionEvent &); - void HandlePress(const SDL_MouseButtonEvent &); - void HandleRelease(const SDL_MouseButtonEvent &); - void Handle(const SDL_MouseWheelEvent &); - void Handle(const SDL_WindowEvent &) noexcept; - - void FaceBlock(); - void TurnBlock(); - - void PickBlock(); - void PlaceBlock(); - void RemoveBlock() noexcept; - - void PrintBlockInfo(); - void PrintChunkInfo(); - void PrintLightInfo(); - void PrintSelectionInfo(); - void Print(const Block &); - - void SelectNext(); - void SelectPrevious(); - - void Update(int dt); - - void Render(DirectionalLighting &) noexcept; - -private: - void CheckAim(); - -private: - World &world; - FPSController ctrl; - HUD hud; - - Ray aim; - Chunk *aim_chunk; - int aim_block; - glm::vec3 aim_normal; - - OutlineModel outline; - glm::mat4 outline_transform; - - Config config; - - IntervalTimer place_timer; - IntervalTimer remove_timer; - - Block remove; - Block selection; - - glm::tvec3 fwd, rev; - -}; - -} - -#endif