summaryrefslogtreecommitdiffstats
path: root/src/GameState.cpp
diff options
context:
space:
mode:
authorElisey Puzko <puzko.e02@gmail.com>2018-02-23 11:11:49 +0100
committerElisey Puzko <puzko.e02@gmail.com>2018-02-23 11:11:49 +0100
commit0bfe80ec281f856e99d158647436f3470b3013c7 (patch)
tree77e3ea028fac6b5096aa2debeb0990bacd7deb23 /src/GameState.cpp
parentSome more tabs -> spaces conversions (diff)
downloadAltCraft-0bfe80ec281f856e99d158647436f3470b3013c7.tar
AltCraft-0bfe80ec281f856e99d158647436f3470b3013c7.tar.gz
AltCraft-0bfe80ec281f856e99d158647436f3470b3013c7.tar.bz2
AltCraft-0bfe80ec281f856e99d158647436f3470b3013c7.tar.lz
AltCraft-0bfe80ec281f856e99d158647436f3470b3013c7.tar.xz
AltCraft-0bfe80ec281f856e99d158647436f3470b3013c7.tar.zst
AltCraft-0bfe80ec281f856e99d158647436f3470b3013c7.zip
Diffstat (limited to 'src/GameState.cpp')
-rw-r--r--src/GameState.cpp6
1 files 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