47 bool Trace(
double a_StartX,
double a_StartY,
double a_StartZ,
double a_EndX,
double a_EndY,
double a_EndZ);
52 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);
int m_CurrentX
The current block.
eBlockFace m_CurrentFace
The face through which the current block has been entered.
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 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).
double m_EndX
The end point of the trace.
void FixStartAboveWorld(void)
Adjusts the start point above the world to just at the world's top.
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...
double m_DiffX
The difference in coords, End - Start.
void FixStartBelowWorld(void)
Adjusts the start point below the world to just at the world's bottom.
int m_DirX
The increment at which the block coords are going from Start to End; either +1 or -1...
bool ChunkCallback(cChunk *a_Chunk)
eBlockFace
Block face constants, used in PlayerDigging and PlayerBlockPlacement packets and bbox collision calc...
bool Trace(double a_StartX, double a_StartY, double a_StartZ, double a_EndX, double a_EndY, double a_EndZ)
Traces one line between Start and End; returns true if the entire line was traced (until OnNoMoreHits...
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.
double m_StartX
The start point of the trace.
cLineBlockTracer(cWorld &a_World, cCallbacks &a_Callbacks)