New BlockTracer classes
#20
No, all the functions in cBlockTracer::cCallbacks are available to Lua:
/** Called on each block encountered along the path, including the first block (path start)
When this callback returns true, the tracing is aborted.
*/
bool OnNextBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);

/** Called on each block encountered along the path, including the first block (path start), if chunk data is not loaded
When this callback returns true, the tracing is aborted.
*/
bool OnNextBlockNoData(int a_BlockX, int a_BlockY, int a_BlockZ);

/** Called when the path goes out of world, either below (a_BlockY < 0) or above (a_BlockY >= cChunkDef::Height)
The coords specify the exact point at which the path exited the world.
If this callback returns true, the tracing is aborted.
Note that some paths can go out of the world and come back again (parabola),
in such a case this callback is followed by OnIntoWorld() and further OnNextBlock() calls
*/
bool OnOutOfWorld(double a_BlockX, double a_BlockY, double a_BlockZ);

/** Called when the path goes into the world, from either below (a_BlockY < 0) or above (a_BlockY >= cChunkDef::Height)
The coords specify the exact point at which the path entered the world.
If this callback returns true, the tracing is aborted.
Note that some paths can go out of the world and come back again (parabola),
in such a case this callback is followed by further OnNextBlock() calls
*/
bool OnIntoWorld(double a_BlockX, double a_BlockY, double a_BlockZ);

/** Called when the path is sure not to hit any more blocks.
Note that for some shapes this might never happen (line with constant Y)
*/
void OnNoMoreHits(void);

/** Called when the block tracing walks into a chunk that is not allocated.
This usually means that the tracing is aborted.
*/
void OnNoChunk(void);

Care to document all this in the wiki?
Note: There will be a cParabolaBlockTracer later on that will use the same callbacks, but for a parabolic path, so it will be useful to document the callbacks separately
Reply
Thanks given by:


Messages In This Thread
New BlockTracer classes - by xoft - 07-22-2013, 06:33 AM
RE: New BlockTracer classes - by NiLSPACE - 07-27-2013, 09:03 PM
RE: New BlockTracer classes - by xoft - 07-27-2013, 09:18 PM
RE: New BlockTracer classes - by NiLSPACE - 07-27-2013, 09:19 PM
RE: New BlockTracer classes - by xoft - 08-04-2013, 02:18 AM
RE: New BlockTracer classes - by bearbin - 08-04-2013, 02:19 AM
RE: New BlockTracer classes - by xoft - 08-04-2013, 02:49 AM
RE: New BlockTracer classes - by xoft - 08-05-2013, 12:30 AM
RE: New BlockTracer classes - by NiLSPACE - 08-05-2013, 04:02 AM
RE: New BlockTracer classes - by bearbin - 08-05-2013, 05:13 AM
RE: New BlockTracer classes - by NiLSPACE - 08-07-2013, 10:23 PM
RE: New BlockTracer classes - by xoft - 08-07-2013, 10:44 PM
RE: New BlockTracer classes - by NiLSPACE - 08-07-2013, 11:06 PM
RE: New BlockTracer classes - by ThuGie - 08-08-2013, 03:57 AM
RE: New BlockTracer classes - by NiLSPACE - 08-08-2013, 04:09 AM
RE: New BlockTracer classes - by tonibm19 - 08-08-2013, 04:35 AM
RE: New BlockTracer classes - by xoft - 08-08-2013, 05:57 AM
RE: New BlockTracer classes - by ThuGie - 08-08-2013, 06:09 AM
RE: New BlockTracer classes - by NiLSPACE - 08-09-2013, 02:11 AM
RE: New BlockTracer classes - by xoft - 08-09-2013, 03:38 AM



Users browsing this thread: 4 Guest(s)