diff options
author | mBornand <63592189+mBornand@users.noreply.github.com> | 2020-05-08 11:04:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 11:04:07 +0200 |
commit | 1565d9b3ce8e74cdf8d2c95181f98531794f2c36 (patch) | |
tree | 09f6d9158cd2c583789d5c23bc174be115178972 /src/LineBlockTracer.h | |
parent | Fix SetBlockMeta call in observer handler (#4728) (diff) | |
download | cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar.gz cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar.bz2 cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar.lz cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar.xz cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar.zst cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.zip |
Diffstat (limited to 'src/LineBlockTracer.h')
-rw-r--r-- | src/LineBlockTracer.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/LineBlockTracer.h b/src/LineBlockTracer.h index 0dca6dfcb..b1dacee20 100644 --- a/src/LineBlockTracer.h +++ b/src/LineBlockTracer.h @@ -45,15 +45,13 @@ public: cLineBlockTracer(cWorld & a_World, cCallbacks & a_Callbacks); /** Traces one line between Start and End; returns true if the entire line was traced (until OnNoMoreHits()) */ - bool Trace(double a_StartX, double a_StartY, double a_StartZ, double a_EndX, double a_EndY, double a_EndZ); + bool Trace(Vector3d a_Start, Vector3d a_End); - // Utility functions for simple one-line usage: - /** Traces one line between Start and End; returns true if the entire line was traced (until OnNoMoreHits()) */ - static bool Trace(cWorld & a_World, cCallbacks & a_Callbacks, double a_StartX, double a_StartY, double a_StartZ, double a_EndX, double a_EndY, double a_EndZ); + // Utility functions for simple one-line usage: /** Traces one line between Start and End; returns true if the entire line was traced (until OnNoMoreHits()) */ - static bool Trace(cWorld & a_World, cCallbacks & a_Callbacks, const Vector3d & a_Start, const Vector3d & a_End); + static bool Trace(cWorld & a_World, cCallbacks & a_Callbacks, const Vector3d a_Start, const Vector3d a_End); /** Returns true if the two positions are within line of sight (not obscured by blocks). a_Sight specifies which blocks are considered transparent for the trace, is an OR-combination of eLineOfSight constants. */ @@ -75,19 +73,19 @@ public: protected: /** The start point of the trace */ - double m_StartX, m_StartY, m_StartZ; + Vector3d m_Start; /** The end point of the trace */ - double m_EndX, m_EndY, m_EndZ; + Vector3d m_End; /** The difference in coords, End - Start */ - double m_DiffX, m_DiffY, m_DiffZ; + Vector3d m_Diff; /** The increment at which the block coords are going from Start to End; either +1 or -1 */ - int m_DirX, m_DirY, m_DirZ; + Vector3i m_Dir; /** The current block */ - int m_CurrentX, m_CurrentY, m_CurrentZ; + Vector3i m_Current; /** The face through which the current block has been entered */ eBlockFace m_CurrentFace; @@ -110,5 +108,3 @@ protected: - - |