Getting started

Maul Nav turns level geometry into a navmesh and answers the questions agents ask of it: where can I stand, how do I get there, what is in my way. This page covers building and installing the library and the rules every part of its API follows.

Requirements

Building and installing

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
ctest --test-dir build
cmake --install build --prefix "$PWD/package"

A program finds the installed package with CMake:

find_package(maul-nav REQUIRED CONFIG)
target_link_libraries(app PRIVATE maul-nav::maul-nav)

or through pkg-config as maul-nav. samples/minimal is such a program: it checks the linked version, bakes one tile and finds a path across it.

Option Default Effect
MAUL_NAV_BUILD_SHARED OFF A shared library instead of a static one.
MAUL_NAV_BUILD_TESTS, _BENCH, _SAMPLES on when built on its own The test suites, the benchmark and the samples.
MAUL_NAV_INSTALL on when built on its own Install rules and the CMake and pkg-config packages.

Samples

The programs in samples/ are built with the library when it is the top-level project.

Program What it shows
walk.c From geometry to a walking agent: four tiles baked from a floor with a wall, a path round the wall, and an agent following it through a corridor at the velocity mnavSteer gives.
bake_world.c A world baked from one large mesh on four worker threads sharing one tile index, checked to the byte against a one-thread bake without the index.
crowd.c Avoidance alone, with no navmesh: two rows of agents swap sides round a pillar.
navcrowd.c A crowd on a navmesh: two groups cross a room and meet head on in a corridor, with corners, steering, walls, avoidance and surface moves each step.
flight.c Fliers among pillars in a flight volume, with avoidance in space; a new pillar rises and only its tile is baked again.
obstacles.c Crates dropped on a navmesh through a tile cache; only the tiles they reach are rebuilt, and the agents whose corridors broke plan again.

How the API works

The API reference

Every public function is documented in its header, with what each parameter takes, what each result means and what may run beside it. The documentation site has the same reference generated from the headers.