From 0bfe80ec281f856e99d158647436f3470b3013c7 Mon Sep 17 00:00:00 2001 From: Elisey Puzko Date: Fri, 23 Feb 2018 13:11:49 +0300 Subject: I forgot about these functions --- src/GameState.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GameState.cpp b/src/GameState.cpp index 4128fd6..9478085 100644 --- a/src/GameState.cpp +++ b/src/GameState.cpp @@ -594,11 +594,11 @@ BlockFacing detectHitFace(VectorF raycastHit, Vector selectedBlock) { static const auto vecRight = VectorF(1, 0, 0); static const auto vecForward = VectorF(0, 0, -1); - auto up = (vec.dot(vecUp))/(vec.GetLength()*vecUp.GetLength()); + auto up = vec.cosBetween(vecUp); auto down = -up; - auto right = (vec.dot(vecRight))/(vec.GetLength()*vecRight.GetLength()); + auto right = vec.cosBetween(vecRight); auto left = -right; - auto forward = (vec.dot(vecForward))/(vec.GetLength()*vecForward.GetLength()); + auto forward = vec.cosBetween(vecForward); auto backward = -forward; // TODO: create a min/max function for the variable number of arguments -- cgit v1.2.3