class

FNavGeometryCache

The geometry a runtime navmesh rebuild bakes from, refreshed on the game thread a few meshes per frame instead of copied whole when a rebuild starts. The game thread queues the entities whose mesh changed, Pump rebuilds their pieces within a vertex budget, and a bake thread reads Published() — a vector of immutable pieces — without ever touching the scene.

Module
AINavigation
Header
#include "AINavigation/NavGeometryCache.h"
Namespace
Mowo

Type aliases

AliasDescription
using FBuildPiece = std::function<bool(EntityID, FNavGeometryPiece&)>

Public functions

ReturnsNameDescription
voidRequestMarks an entity's piece stale (new, moved or re-meshed).
voidRemoveThe entity left the scene or stopped being nav-relevant.
size_tPumpRebuilds queued pieces until vertexBudget vertices were produced; always at least one piece per call so a single large mesh cannot stall forever.
size_tPendingCountEntities still waiting for their piece.
std::vector<std::shared_ptr<const FNavGeometryPiece>>PublishedA copy of the published piece list.
size_tPieceCount
voidClear
voidAssembleWorker side: appends every piece whose ground-plane box reaches the region (all of them when regionMin is null) to out, moved into out.originOffset's frame; the region is in that frame too.

Function details

Request

C++
void Request(EntityID id)

Marks an entity's piece stale (new, moved or re-meshed).

Remove

C++
void Remove(const World& world, EntityID id)

The entity left the scene or stopped being nav-relevant.

Pump

C++
size_t Pump(const World& world, size_t vertexBudget, const FBuildPiece& build)

Rebuilds queued pieces until vertexBudget vertices were produced; always at least one piece per call so a single large mesh cannot stall forever. build fills the piece (false = the entity has no nav geometry any more). Returns how many pieces were processed.

PendingCount

C++
size_t PendingCount() const

Entities still waiting for their piece. A rebuild must not start while this is non-empty, or it would bake a level with holes.

Published

C++
std::vector<std::shared_ptr<const FNavGeometryPiece>> Published() const

A copy of the published piece list. Safe to hand to another thread.

PieceCount

C++
size_t PieceCount() const

Clear

C++
void Clear()

Assemble

C++
static void Assemble(const std::vector<std::shared_ptr<const FNavGeometryPiece>>& pieces, const Vec3* regionMin, const Vec3* regionMax, NavMeshBuilder::Snapshot& out)

Worker side: appends every piece whose ground-plane box reaches the region (all of them when regionMin is null) to out, moved into out.originOffset's frame; the region is in that frame too.

Generated from AINavigation/NavGeometryCache.h via ainavigation.json · Dec 5, 2026Version 1.1.0