From 563d978b4ba721370441eaaca3f8471ec383deff Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Fri, 20 Oct 2017 08:00:57 -0400 Subject: arrow rotation and actual pausing --- src/systems/render.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/systems/render.cpp') diff --git a/src/systems/render.cpp b/src/systems/render.cpp index a25b152..f72832b 100644 --- a/src/systems/render.cpp +++ b/src/systems/render.cpp @@ -78,7 +78,9 @@ void RenderSystem::render(void) if (S.first.veltate) { auto vel = entity.component(); - float angle = static_cast(std::atan(vel->y / vel->x)) * 180 / 3.14f; + float angle = std::atan(vel->y / vel->x); + if (vel->x < 0) + angle += 3.14f; auto toOrigin = glm::translate(glm::mat4(1.0f), glm::vec3(-pos.x, -pos.y, 0.0f)); auto rotation = glm::rotate(glm::mat4(1.0f), angle, glm::vec3(0.0f, 0.0f, 1.0f)); auto toBack = glm::translate(glm::mat4(1.0f), glm::vec3(pos.x, pos.y, 0.0f)); -- cgit v1.2.3