diff options
author | madmaxoft <github@xoft.cz> | 2013-11-09 19:49:36 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-11-09 19:49:36 +0100 |
commit | 73cd2216a7b5a6234fd89edefd28b9ebafca4fd0 (patch) | |
tree | c2f509e0e64fb64ec382484ba5ba2c33ca15c24e /source/Tracer.h | |
parent | APIDump: Documented TakeDamageInfo. (diff) | |
download | cuberite-73cd2216a7b5a6234fd89edefd28b9ebafca4fd0.tar cuberite-73cd2216a7b5a6234fd89edefd28b9ebafca4fd0.tar.gz cuberite-73cd2216a7b5a6234fd89edefd28b9ebafca4fd0.tar.bz2 cuberite-73cd2216a7b5a6234fd89edefd28b9ebafca4fd0.tar.lz cuberite-73cd2216a7b5a6234fd89edefd28b9ebafca4fd0.tar.xz cuberite-73cd2216a7b5a6234fd89edefd28b9ebafca4fd0.tar.zst cuberite-73cd2216a7b5a6234fd89edefd28b9ebafca4fd0.zip |
Diffstat (limited to 'source/Tracer.h')
-rw-r--r-- | source/Tracer.h | 56 |
1 files 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 + + + + |