]> git.localhorst.tv Git - blank.git/blobdiff - src/ui/ui.cpp
fix forward axis in block placement orientation
[blank.git] / src / ui / ui.cpp
index 89c34109be2340b9214a6f3e8854cddb49672b06..2d3b4679552045ad557e1b62fa978046619bc36f 100644 (file)
@@ -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