eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc.
void FixStartBelowWorld(void)
Adjusts the start point below the world to just at the world's bottom.
void CalcXZIntersection(double a_Y, double &a_IntersectX, double &a_IntersectZ)
Calculates the XZ coords of an intersection with the specified Yconst plane; assumes that such an int...
Vector3i m_Dir
The increment at which the block coords are going from Start to End; either +1 or -1.
static bool LineOfSightTrace(cWorld &a_World, const Vector3d &a_Start, const Vector3d &a_End, int a_Sight)
Returns true if the two positions are within line of sight (not obscured by blocks).
Vector3d m_Diff
The difference in coords, End - Start.
bool Trace(Vector3d a_Start, Vector3d a_End)
Traces one line between Start and End; returns true if the entire line was traced (until OnNoMoreHits...
bool ChunkCallback(cChunk *a_Chunk)
Vector3d m_End
The end point of the trace.
Vector3d m_Start
The start point of the trace.
bool MoveToNextBlock(void)
Moves m_Current to the next block on the line; returns false if no move is possible (reached the end)
static bool FirstSolidHitTrace(cWorld &a_World, const Vector3d &a_Start, const Vector3d &a_End, Vector3d &a_HitCoords, Vector3i &a_HitBlockCoords, eBlockFace &a_HitBlockFace)
Traces until the first solid block is hit (or until end, whichever comes first.
Vector3i m_Current
The current block.
eBlockFace m_CurrentFace
The face through which the current block has been entered.
void FixStartAboveWorld(void)
Adjusts the start point above the world to just at the world's top.
cLineBlockTracer(cWorld &a_World, cCallbacks &a_Callbacks)