X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2Fui.cpp;h=02f2781c5e8f9cdb2326c1933092fd9105569ff1;hb=f40ef0f5cc3d451c3789112e760719abb393ac03;hp=f5664dc0f4828b894f80e983b233441c1397ebb7;hpb=0d580658b896dfec07466c31ae4847455724ee95;p=blank.git diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index f5664dc..02f2781 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -13,6 +13,7 @@ #include "../app/init.hpp" #include "../audio/Audio.hpp" #include "../audio/SoundBank.hpp" +#include "../geometry/distance.hpp" #include "../graphics/Font.hpp" #include "../graphics/Viewport.hpp" #include "../io/TokenStreamReader.hpp" @@ -96,10 +97,10 @@ void PlayerController::Invalidate() noexcept { void PlayerController::UpdatePlayer() noexcept { if (dirty) { Ray aim = player.Aim(); - if (!world.Intersection(aim, glm::mat4(1.0f), player.GetEntity().ChunkCoords(), aim_world)) { + if (!world.Intersection(aim, player.GetEntity().ChunkCoords(), aim_world)) { aim_world = WorldCollision(); } - if (!world.Intersection(aim, glm::mat4(1.0f), player.GetEntity(), aim_entity)) { + if (!world.Intersection(aim, player.GetEntity(), aim_entity)) { aim_entity = EntityCollision(); } if (aim_world && aim_entity) { @@ -374,8 +375,8 @@ void HUD::UpdatePosition() { void HUD::UpdateOrientation() { std::stringstream s; - s << std::setprecision(3) << "pitch: " << rad2deg(player.GetEntity().Pitch()) - << ", yaw: " << rad2deg(player.GetEntity().Yaw()); + s << std::setprecision(3) << "pitch: " << glm::degrees(player.GetEntity().Pitch()) + << ", yaw: " << glm::degrees(player.GetEntity().Yaw()); orientation_text.Set(env.assets.small_ui_font, s.str()); }