From 496e5b10002900b4fb12b053523f83b943ef3806 Mon Sep 17 00:00:00 2001 From: Woazboat Date: Tue, 28 Apr 2015 02:51:21 +0200 Subject: Tracer signum function now returns int --- src/Tracer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Tracer.h') diff --git a/src/Tracer.h b/src/Tracer.h index ec87d449e..821131539 100644 --- a/src/Tracer.h +++ b/src/Tracer.h @@ -61,7 +61,8 @@ private: /// Return 1 through 6 for the following block faces, repectively: -x, -z, x, z, y, -y int GetHitNormal( const Vector3f & start, const Vector3f & end, const Vector3i & a_BlockPos); - float SigNum( float a_Num); + /// Signum function + int SigNum( float a_Num); cWorld* m_World; Vector3f m_NormalTable[6]; -- cgit v1.2.3 From 3d1bd544b08ab67a6d1e9c89fa66ad3c28426360 Mon Sep 17 00:00:00 2001 From: Woazboat Date: Wed, 29 Apr 2015 00:14:42 +0200 Subject: Changed Tracer::m_NormalTable to static array Was previously instantiated for every trace --- src/Tracer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Tracer.h') diff --git a/src/Tracer.h b/src/Tracer.h index 821131539..ec23b340e 100644 --- a/src/Tracer.h +++ b/src/Tracer.h @@ -3,6 +3,8 @@ #include "Vector3.h" +#include + @@ -65,7 +67,7 @@ private: int SigNum( float a_Num); cWorld* m_World; - Vector3f m_NormalTable[6]; + static const std::array m_NormalTable; Vector3f dir; Vector3f tDelta; -- cgit v1.2.3