Vixen
02b45cc4
csharp
public readonly record struct NavMeshBuildSettings

What the bake is being asked for: how finely to voxelise, and what the agent that will walk the result can do.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A navmesh is baked for one agent. Radius, height and step height are not properties of the level, they are properties of who is walking it, and they are baked in: the surface is eroded by the radius so that a path never passes closer to a wall than the agent's body, and anything with less headroom than the height is not surface at all. Two agent sizes are two navmeshes, which is what every engine that does this does.

Cell size is the quality dial and the cost dial at once. Halving it quadruples the voxel count and the bake time, and buys a surface that follows the geometry twice as closely. A third of the agent radius is the usual starting point.

Fields and properties (19)

  • public float CellSize

    The width and depth of one voxel column, in world units.

  • public float CellHeight

    The height of one voxel, in world units.

  • public float AgentHeight

    How tall the agent is. Anything with less headroom is not walkable.

  • public float AgentRadius

    How wide the agent is. The walkable surface is eroded by this.

  • public float AgentMaxClimb

    The tallest step the agent can walk up without jumping.

  • public float AgentMaxSlope

    The steepest ground the agent can stand on, in degrees.

  • public int MinRegionArea

    The smallest region to keep, in voxel columns. Anything smaller is discarded rather than turned into polygons.

  • public int MergeRegionArea

    The size below which a region is absorbed into a neighbour, in voxel columns.

  • public NavMeshPartitioning Partitioning

    How the walkable surface is cut into regions.

  • public float MaxSimplificationError

    How far a simplified contour may stray from the voxel outline, in voxels.

  • public float MaxEdgeLength

    The longest edge a contour may have along a wall, in world units. Zero disables the split.

  • public int MaxVerticesPerPoly

    How many vertices a polygon may have, up to MaxVerticesPerPoly.

  • public float DetailSampleDistance

    How far apart to sample the ground inside a polygon, in world units. Zero builds no detail.

  • public float DetailSampleMaxError

    How far the flat polygon may be from the ground before a vertex is added, in world units.

  • public byte WalkableArea

    The area id given to every triangle the slope test accepted.

  • public NavPolyFlags WalkableFlags

    The flags given to every polygon produced.

  • public int WalkableHeightInCells

    The agent's height in voxels, rounded up.

  • public int WalkableClimbInCells

    The agent's step height in voxels, rounded down.

  • public int WalkableRadiusInCells

    The agent's radius in voxels, rounded up.

Methods (2)

  • public NavMeshBuildSettings()

    The default settings: a human-sized agent on a 0.3 m grid.

  • public void Validate()

    Throws if a setting cannot produce a mesh.

Used by (28)

  • BakeBenchmarksVixen.Benchmarks.Navigation
  • CrowdBenchmarksVixen.Benchmarks.Navigation
  • PathQueueBenchmarksVixen.Benchmarks.Navigation
  • QueryBenchmarksVixen.Benchmarks.Navigation
  • CrossTileConnectionTestsVixen.Navigation.Tests
  • CrowdRetargetTestsVixen.Navigation.Tests
  • CrowdTestsVixen.Navigation.Tests
  • DetailMeshTestsVixen.Navigation.Tests
  • HeightfieldTestsVixen.Navigation.Tests
  • NavAreaVolumeTestsVixen.Navigation.Tests
  • NavMeshAssetTestsVixen.Navigation.Tests
  • NavMeshBakeTestsVixen.Navigation.Tests
  • NavMeshBakerVixen.Navigation
  • NavMeshDebugDrawTestsVixen.Navigation.Tests
  • NavMeshQueryTestsVixen.Navigation.Tests
  • NavPathQueueJobTestsVixen.Navigation.Tests
  • NavPathQueueTestsVixen.Navigation.Tests
  • NavTileCacheVixen.Navigation
  • NavTileCacheTestsVixen.Navigation.Tests
  • NavigationAllocationTestsVixen.Navigation.Tests
  • NavigationSystemTestsVixen.Navigation.Tests
  • OffMeshConnectionTestsVixen.Navigation.Tests
  • RegionMergeTestsVixen.Navigation.Tests
  • TilePlacementVixen.Navigation
  • WatershedTestsVixen.Navigation.Tests
  • EditorApplicationVixen.Editor.App
  • NavMeshImportSettingsVixen.Editor.Assets
  • NavMeshImporterVixen.Editor.Assets