From 73cd2216a7b5a6234fd89edefd28b9ebafca4fd0 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 9 Nov 2013 19:49:36 +0100 Subject: Fixed cTracer's tolua markup. Cleaned up unneeded member variables. --- source/Tracer.h | 56 ++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/source/Tracer.h b/source/Tracer.h index bc348d955..6c2ab6792 100644 --- a/source/Tracer.h +++ b/source/Tracer.h @@ -1,20 +1,41 @@ + #pragma once #include "Vector3i.h" #include "Vector3f.h" + + + +// fwd: class cWorld; -class cTracer // tolua_export -{ // tolua_export -public: // tolua_export - Vector3f DotPos; - Vector3f BoxOffset; - cTracer( cWorld* a_World); // tolua_export - ~cTracer(); // tolua_export + + + + + +// tolua_begin + +class cTracer +{ +public: + + /// Contains the position of the block that caused the collision + Vector3f BlockHitPosition; + + /// Contains which face was hit + Vector3f HitNormal; + + /// Contains the exact position where a collision occured. (BlockHitPosition + Offset on block) + Vector3f RealHit; + + + cTracer(cWorld * a_World); + ~cTracer(); /// Determines if a collision occures along a line. Returns true if a collision occurs. - bool Trace( const Vector3f & a_Start, const Vector3f & a_Direction, int a_Distance) // tolua_export + bool Trace(const Vector3f & a_Start, const Vector3f & a_Direction, int a_Distance) { return Trace(a_Start, a_Direction, a_Distance, false); } @@ -22,16 +43,9 @@ public: // tolua_export /// Determines if a collision occures along a line. Returns true if a collision occurs. /// When a_LineOfSight is true, we don't use the standard collision detection rules. Instead we use /// the rules for monster vision. E.g. Only water and air do not block vision. - bool Trace( const Vector3f & a_Start, const Vector3f & a_Direction, int a_Distance, bool a_LineOfSight); // tolua_export - - /// Contains the position of the block that caused the collision - Vector3f BlockHitPosition; // tolua_export - - /// Contains which face was hit - Vector3f HitNormal; // tolua_export + /// a_Distance is the number of iterations (blocks hits) that are tested. + bool Trace(const Vector3f & a_Start, const Vector3f & a_Direction, int a_Distance, bool a_LineOfSight); - /// Contains the exact position where a collision occured. (BlockHitPosition + Offset on block) - Vector3f RealHit; // tolua_export private: /// Preps Tracer object for call of Trace function. Only used internally. @@ -59,4 +73,10 @@ private: Vector3i end1; Vector3i step; Vector3f tMax; -}; // tolua_export +}; + +// tolua_end + + + + -- cgit v1.2.3