summaryrefslogtreecommitdiffstats
path: root/src/Tracer.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-12-05 16:59:11 +0100
committerMattes D <github@xoft.cz>2014-12-05 16:59:11 +0100
commite2a04f580a0813206f527a61244cb3382248fd12 (patch)
tree39f0a5026d619e89ce353cf8addf18e4a696b067 /src/Tracer.cpp
parentCheckBasicStyle: Added a check for parentheses around comparisons. (diff)
downloadcuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.gz
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.bz2
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.lz
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.xz
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.tar.zst
cuberite-e2a04f580a0813206f527a61244cb3382248fd12.zip
Diffstat (limited to '')
-rw-r--r--src/Tracer.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/Tracer.cpp b/src/Tracer.cpp
index 53884dee8..e604f4a5b 100644
--- a/src/Tracer.cpp
+++ b/src/Tracer.cpp
@@ -39,8 +39,14 @@ cTracer::~cTracer()
float cTracer::SigNum(float a_Num)
{
- if (a_Num < 0.f) return -1.f;
- if (a_Num > 0.f) return 1.f;
+ if (a_Num < 0.f)
+ {
+ return -1.f;
+ }
+ if (a_Num > 0.f)
+ {
+ return 1.f;
+ }
return 0.f;
}
@@ -59,7 +65,10 @@ void cTracer::SetValues(const Vector3f & a_Start, const Vector3f & a_Direction)
step.z = (int) SigNum(dir.z);
// normalize the direction vector
- if (dir.SqrLength() > 0.f) dir.Normalize();
+ if (dir.SqrLength() > 0.f)
+ {
+ dir.Normalize();
+ }
// how far we must move in the ray direction before
// we encounter a new voxel in x-direction