From 54cead1fdf3d1df9187f0cd249322f1e4d85a639 Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 7 Jan 2016 10:53:06 +0100 Subject: [PATCH] fix forward axis in block placement orientation oh shoot, I'm such an idiot -.- --- src/ui/ui.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index 89c3410..2d3b467 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -217,7 +217,7 @@ void DirectInput::PlaceBlock() { // when aligned with player's up (first mode, and currently the only one implemented) // project the player's view forward onto his entity's XZ plane and // use the closest cardinal direction it's pointing in - const glm::vec3 view_forward(-GetPlayer().GetEntity().ViewTransform(GetPlayer().GetEntity().ChunkCoords())[3]); + const glm::vec3 view_forward(-GetPlayer().GetEntity().ViewTransform(GetPlayer().GetEntity().ChunkCoords())[2]); // if view is straight up or down, this will be a null vector (NaN after normalization) // in that case maybe the model forward should be used? // the current implementation implicitly falls back to TURN_NONE which is -Z -- 2.39.2