PathEngine home | previous: | next: |
A helper method for building ground mesh around a set of tiled obstructions.
std::unique_ptr<iMesh> buildMeshAroundTiledObstructions(char const * data_Buffer, uint32_t data_BufferEntries, int32_t tilesInX, int32_t tilesInY, int32_t originX, int32_t originY, int32_t tileSize, const char *const* options) |
data_Buffer, data_BufferEntries |
(See | ||
tilesInX | The number of tiles across the tiled obstruction set, in the X direction. This value must be greater than or equal to 1 | ||
tilesInY | The number of tiles across the tiled obstruction set, in the Y direction. This value must be greater than or equal to 1 | ||
originX | The X coordinate value corresponding to the start of the tiled obstructions data. | ||
originY | The T coordinate value corresponding to the start of the tiled obstructions data. | ||
tileSize | The size of the tiling. This value must be greater than or equal to 1. | ||
options |
A set of named attributes to control exactly how the mesh result is created.
|
The data buffer is interpreted as a bit sequence, with each byte in the buffer being treated as unsigned and interpreted as a 'little-endian' byte (regardless of actual platform endianness) and supplying 8 bits in the sequence.
So, for example, the following buffer data is interpreted as the bit sequence (1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1):
const unsigned char buffer[2] = {0x01, 0x80}; |
The bit sequence is mapped to a 2 dimensional tiling, according to the values passed in for tilesInX and tilesInY, with X increasing from zero first, and then Y increasing from zero after every span of tilesInX. (There is no padding between spans.)
Bits that are turned on, in this sequence, mark tiles that obstruct movement.
The buffer size value passed in must be equal to the number of bytes required to represent the tiling, so this must be equal to (tilesInX * tilesInY + 7) / 8.
Vertex coordinates generated based on the origin and tile size parameters must all be within the range -1500000 to 1500000 inclusive.
The resulting mesh is generated for the unobstructed space in the tiling,
with any non-boundary detail stripped out.
Note that the resultiong mesh has all heights set to zero, and the sectionID face attribute value set to zero,
and this is basically designed for generation of 'terrain stand-in' geometry.
(See
Mesh buildMeshAroundTiledObstructions(byte[] data, int tilesInX, int tilesInY, int originX, int originY, int tileSize, string[] options); |
Mesh buildMeshAroundTiledObstructions(byte[] data, int tilesInX, int tilesInY, int originX, int originY, int tileSize, String[] options); |
Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEngine | next: |