PathEngine home previous: Overviewnext: Tile‑by‑tile Construction with the 2D Process
Contents, Programmers Guide, World Representation, Mesh Federations, Constructing Mesh Federations

Constructing Mesh Federations

Construction from a pregenerated 'world mesh'

The simplest way to build a mesh federation is with iPathEngine::buildMeshFederation_FromWorldMesh().

In this case, you simply combine all of the geometry to be considered into a (potentially very large) world mesh, and then tell PathEngine to build both the mesh federation object and associated tile meshes directly from this world mesh.

At tile mesh generation time, the client application supplies an object deriving from Interface iMeshFederationTileGeneratedCallBack, which will usually store the resulting meshes to disk, but which can also choose to retain generated tile meshes in memory.

'Tile by tile' construction

Although it is straightforward and quick to implement, approaches based on generating mesh federations from a pregenerated world mesh have some potentially significant disadvantages.

Most importantly generation of a world mesh can get very expensive (both in terms of generation time and memory footprint) when this kind of approach is applied to very large worlds.
Also, while PathEngine's coordinate range constraint does not generally apply to mesh federations, it does apply when pregenerating a world mesh, putting a hard limit on the size of worlds that can be processed in this way.

An alternative 'tile by tile' approach to federation generation is provided, therefore, to avoid both of these issues.
With this approach, each federation tile mesh is generated directly from the set of source content data that overlaps the tiles represented region.

The working data set for this approach is determined purely on the basis of the federation tiling parameters, and the amount of geometry that can be overlapped by the resulting represented regions, making it possible to process extremely large worlds without memory issues.
And, with this approach, PathEngine's coordinate range applies just to the size of individual tile represented regions, and not to the federation as a whole.

2D and 3D content processing

Tile-by-tile federation construction is supported with both 2D and 3D content processes.

Incremental updates

When updating the federation after changes to world geometry it is only necessary to rebuild federation tiles whose represented regions are overlapped by modified geometry.
This can enable extremely fast content modification iterations whilst maintaining support for whole world pathfinding.

Switching construction methods in the example code

The 'MeshFederation' example includes code for both methods of federation construction, with the calls for 'tile by tile' construction (for both 2D and 3D content processes) commented out.
You can comment this call back in, then, to quickly try out 'tile by tile' construction, or to provide a starting for further experimentation or benchmarking.
Note that the code path for the 3D content process requires the 3D Content Processing Demo to be run first, to generate a suitable set of tiled ground pieces.


Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: Tile‑by‑tile Construction with the 2D Process