Skip to main content

generate

Function generate 

Source
pub fn generate(
    source: Source,
    options: &GenerateOptions,
    progress: &mut dyn FnMut(&Progress),
    warnings: &mut dyn WarningSink,
) -> Result<GenerateReport>
Expand description

Generates a navmesh from source.

The steps are those of the spec’s section 2.3: world params, the target mesh (from base or a fresh one), the tile plan, then fetchers, builders and the assembler (see the module docs), the island filter, and the report. The mesh is in GenerateReport::set; the caller saves it. A failing checkpoint or capture write stops the run but is not an Err: the report has GenerateReport::stopped, and the caller should save set and then fail. A failed tile does not stop the run: it is in GenerateReport::failed and raises the warning navmesh-tile-failed. progress is called on the calling thread after each applied tile and once at the end. The result does not depend on threads or connections. Memory: the queues between fetchers, builders and the assembler are bounded in tiles, not in bytes; a tile input can be large (frames up to 1 GiB) and there is no aggregate byte budget.

§Errors

“–skip-existing needs –base”; threads or connections above MAX_WORKERS, or more than MAX_WORKERS hosts without an explicit connections (the default is one connection per host); both are checked before anything is allocated, spawned or connected; “empty tile range”; an unusable base or world grid; a world params request that fails; “tile range too large”; a capture file that cannot be created.