diff --git a/include/Engine/Editor/EditorSystem.h b/include/Engine/Editor/EditorSystem.h index 28088823..949795ff 100644 --- a/include/Engine/Editor/EditorSystem.h +++ b/include/Engine/Editor/EditorSystem.h @@ -1,4 +1,5 @@ #include +#include #include "../Core/System.h" #include "../Core/EMousePress.h" #include "../Rendering/EPicking.h" diff --git a/src/Engine/Editor/EditorSystem.cpp b/src/Engine/Editor/EditorSystem.cpp index bc879a11..80b41bf9 100644 --- a/src/Engine/Editor/EditorSystem.cpp +++ b/src/Engine/Editor/EditorSystem.cpp @@ -141,12 +141,8 @@ void EditorSystem::drawUI(World* world, double dt) if (field == "Scale") { ImGui::DragFloat3(field.c_str(), glm::value_ptr(val), 0.1f, 0.f, std::numeric_limits::max()); } else if (field == "Orientation") { - glm::vec3 times = val / glm::vec3(glm::pi()); - times.x = std::floor(times.x); - times.y = std::floor(times.y); - times.z = std::floor(times.z); - glm::vec3 tempVal = val - (times*glm::pi()); - if (ImGui::SliderFloat3(field.c_str(), glm::value_ptr(tempVal), 0.f, glm::pi())) { + glm::vec3 tempVal = glm::fmod(val, glm::vec3(glm::two_pi())); + if (ImGui::SliderFloat3(field.c_str(), glm::value_ptr(tempVal), 0.f, glm::two_pi())) { val = tempVal; } } else {