From: Daniel Karbach Date: Thu, 7 Jan 2016 09:53:06 +0000 (+0100) Subject: fix forward axis in block placement orientation X-Git-Url: https://git.localhorst.tv/?a=commitdiff_plain;h=54cead1fdf3d1df9187f0cd249322f1e4d85a639;p=blank.git fix forward axis in block placement orientation oh shoot, I'm such an idiot -.- --- 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