#include <LineBlockTracer.h>
|
| cLineBlockTracer (cWorld &a_World, cCallbacks &a_Callbacks) |
|
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()) More...
|
|
|
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. More...
|
|
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). More...
|
|
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) |
| Traces one line between Start and End; returns true if the entire line was traced (until OnNoMoreHits()) More...
|
|
static bool | Trace (cWorld &a_World, cCallbacks &a_Callbacks, const Vector3d &a_Start, const Vector3d &a_End) |
| Traces one line between Start and End; returns true if the entire line was traced (until OnNoMoreHits()) More...
|
|
|
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 intersection exists. More...
|
|
bool | ChunkCallback (cChunk *a_Chunk) |
|
void | FixStartAboveWorld (void) |
| Adjusts the start point above the world to just at the world's top. More...
|
|
void | FixStartBelowWorld (void) |
| Adjusts the start point below the world to just at the world's bottom. More...
|
|
bool | MoveToNextBlock (void) |
| Moves m_Current to the next block on the line; returns false if no move is possible (reached the end) More...
|
|
|
typedef cBlockTracer | super |
|
Definition at line 25 of file LineBlockTracer.h.
Enumerator |
---|
losAir |
|
losWater |
|
losLava |
|
losAirWaterLava |
|
losAirWater |
|
Definition at line 31 of file LineBlockTracer.h.
cLineBlockTracer::cLineBlockTracer |
( |
cWorld & |
a_World, |
|
|
cCallbacks & |
a_Callbacks |
|
) |
| |
void cLineBlockTracer::CalcXZIntersection |
( |
double |
a_Y, |
|
|
double & |
a_IntersectX, |
|
|
double & |
a_IntersectZ |
|
) |
| |
|
protected |
Calculates the XZ coords of an intersection with the specified Yconst plane; assumes that such an intersection exists.
Definition at line 236 of file LineBlockTracer.cpp.
bool cLineBlockTracer::ChunkCallback |
( |
cChunk * |
a_Chunk | ) |
|
|
protected |
Traces until the first solid block is hit (or until end, whichever comes first.
If a solid block was hit, returns true and fills a_HitCoords, a_HitBlockCoords and a_HitBlockFace. If a_End is encountered without hitting any solid block, returns false and doesn't touch a_HitCoords, a_HitBlockCoords nor a_HitBlockFace. a_HitCoords is the exact coords of the hit, a_HitBlockCoords are the coords of the solid block that was hit, a_HitBlockFace is the face of the solid block that was hit.
Definition at line 90 of file LineBlockTracer.cpp.
void cLineBlockTracer::FixStartAboveWorld |
( |
void |
| ) |
|
|
protected |
Adjusts the start point above the world to just at the world's top.
Definition at line 213 of file LineBlockTracer.cpp.
void cLineBlockTracer::FixStartBelowWorld |
( |
void |
| ) |
|
|
protected |
Adjusts the start point below the world to just at the world's bottom.
Definition at line 226 of file LineBlockTracer.cpp.
bool cLineBlockTracer::LineOfSightTrace |
( |
cWorld & |
a_World, |
|
|
const Vector3d & |
a_Start, |
|
|
const Vector3d & |
a_End, |
|
|
int |
a_Sight |
|
) |
| |
|
static |
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.
Definition at line 51 of file LineBlockTracer.cpp.
bool cLineBlockTracer::MoveToNextBlock |
( |
void |
| ) |
|
|
protected |
Moves m_Current to the next block on the line; returns false if no move is possible (reached the end)
Definition at line 247 of file LineBlockTracer.cpp.
bool cLineBlockTracer::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())
Definition at line 156 of file LineBlockTracer.cpp.
bool cLineBlockTracer::Trace |
( |
cWorld & |
a_World, |
|
|
cBlockTracer::cCallbacks & |
a_Callbacks, |
|
|
double |
a_StartX, |
|
|
double |
a_StartY, |
|
|
double |
a_StartZ, |
|
|
double |
a_EndX, |
|
|
double |
a_EndY, |
|
|
double |
a_EndZ |
|
) |
| |
|
static |
Traces one line between Start and End; returns true if the entire line was traced (until OnNoMoreHits())
Definition at line 146 of file LineBlockTracer.cpp.
bool cLineBlockTracer::Trace |
( |
cWorld & |
a_World, |
|
|
cBlockTracer::cCallbacks & |
a_Callbacks, |
|
|
const Vector3d & |
a_Start, |
|
|
const Vector3d & |
a_End |
|
) |
| |
|
static |
Traces one line between Start and End; returns true if the entire line was traced (until OnNoMoreHits())
Definition at line 41 of file LineBlockTracer.cpp.
The face through which the current block has been entered.
Definition at line 92 of file LineBlockTracer.h.
int cLineBlockTracer::m_CurrentX |
|
protected |
int cLineBlockTracer::m_CurrentY |
|
protected |
int cLineBlockTracer::m_CurrentZ |
|
protected |
double cLineBlockTracer::m_DiffX |
|
protected |
double cLineBlockTracer::m_DiffY |
|
protected |
double cLineBlockTracer::m_DiffZ |
|
protected |
int cLineBlockTracer::m_DirX |
|
protected |
The increment at which the block coords are going from Start to End; either +1 or -1.
Definition at line 86 of file LineBlockTracer.h.
int cLineBlockTracer::m_DirY |
|
protected |
int cLineBlockTracer::m_DirZ |
|
protected |
double cLineBlockTracer::m_EndX |
|
protected |
double cLineBlockTracer::m_EndY |
|
protected |
double cLineBlockTracer::m_EndZ |
|
protected |
double cLineBlockTracer::m_StartX |
|
protected |
double cLineBlockTracer::m_StartY |
|
protected |
double cLineBlockTracer::m_StartZ |
|
protected |
The documentation for this class was generated from the following files: