From 5890f94fe5decfdf55af3515a4ed3522f8fcb7f6 Mon Sep 17 00:00:00 2001 From: bailwillharr Date: Mon, 13 Feb 2023 11:27:18 +0000 Subject: [PATCH] Do things --- CMakeLists.txt | 2 -- include/event_system.hpp | 4 ++-- src/event_system.cpp | 15 --------------- src/systems/collisions.cpp | 1 - test/src/camera_controller.cpp | 10 +++++----- 5 files changed, 7 insertions(+), 25 deletions(-) delete mode 100644 src/event_system.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index af389b8..d1fc79a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,8 +23,6 @@ set(SRC_FILES "src/resources/mesh.cpp" "src/resources/texture.cpp" - "src/event_system.cpp" - "src/scene.cpp" "src/gfx_device_vulkan.cpp" diff --git a/include/event_system.hpp b/include/event_system.hpp index 0540531..1582516 100644 --- a/include/event_system.hpp +++ b/include/event_system.hpp @@ -71,10 +71,10 @@ namespace engine { class EventSystem { public: - EventSystem(); + EventSystem() {} EventSystem(const EventSystem&) = delete; EventSystem& operator=(const EventSystem&) = delete; - ~EventSystem(); + ~EventSystem() {} template void registerEventType() diff --git a/src/event_system.cpp b/src/event_system.cpp deleted file mode 100644 index 6dbcf88..0000000 --- a/src/event_system.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "event_system.hpp" - -namespace engine { - - EventSystem::EventSystem() - { - - } - - EventSystem::~EventSystem() - { - - } - -} diff --git a/src/systems/collisions.cpp b/src/systems/collisions.cpp index 28995a2..6a59e22 100644 --- a/src/systems/collisions.cpp +++ b/src/systems/collisions.cpp @@ -150,7 +150,6 @@ namespace engine { AABB object = possibleCollision.staticAABB; info.point = object.pos2; - m_collisionInfos.emplace_back(possibleCollision.dynamicEntity, info); } } diff --git a/test/src/camera_controller.cpp b/test/src/camera_controller.cpp index 19a61f6..04af8bc 100644 --- a/test/src/camera_controller.cpp +++ b/test/src/camera_controller.cpp @@ -41,16 +41,16 @@ void CameraControllerSystem::onUpdate(float ts) const float dt = ts; constexpr float G = 9.8f; -// constexpr float MAX_SLOPE_ANGLE = glm::radians(20.0f); - constexpr float MAX_SLOPE_ANGLE = glm::radians(1000.0f); // treat every collider as a floor, (TODO: get wall collisions working so this can be removed) + const float MAX_SLOPE_ANGLE = glm::cos(glm::radians(20.0f)); +// constexpr float MAX_SLOPE_ANGLE = glm::radians(1000.0f); // treat every collider as a floor, (TODO: get wall collisions working so this can be removed) constexpr float FLOOR_SINK_LEVEL = 0.05f; // how far into the floor to ground the player glm::vec3 norm = c->lastCollisionNormal; - norm.y = 0.0f; - glm::vec3 dir = glm::normalize(glm::rotateY(glm::vec3{ 1.0f, 0.0f, 0.0f }, c->m_yaw) + glm::rotateY(glm::vec3{ 0.0f, 0.0f, 1.0f }, c->m_yaw)); - const float slope = glm::length(glm::half_pi() - glm::acos(glm::dot(dir, norm))); + const float slope = glm::dot(dir, norm); + + INFO("slope: {}", slope); bool isSliding = false;