Vixen
02b45cc4
csharp
public sealed class NavMeshQuery

Asks a NavMesh questions: which polygon is under a point, how to get from one to another, and what a straight line runs into on the way.

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

Remarks

One per thread, reused. Everything a search needs — the node pool, the open list, the visited set — lives here and is cleared rather than reallocated, so a query costs no allocation after the first. That is the whole reason this is an object and not a static class over the mesh: sharing one between two threads is a data race, and making the state local to a call would allocate it every frame.

The mesh may change under it. Nothing here caches a tile or a polygon between calls, and every reference is resolved through the salt, so a tile unloaded between two queries makes the second one fail rather than read freed data.

Fields and properties (3)

  • public NavMesh Mesh

    The mesh being queried.

  • public int LastSearchNodes

    How many polygons the last search expanded. Diagnostic.

  • public int LastStraightPathSteps

    How many corridor steps the last string-pull walked, restarts included. Diagnostic.

Methods (12)

Used by (25)

  • CrowdBenchmarksVixen.Benchmarks.Navigation
  • PathQueueBenchmarksVixen.Benchmarks.Navigation
  • QueryBenchmarksVixen.Benchmarks.Navigation
  • CrossTileConnectionTestsVixen.Navigation.Tests
  • CrowdVixen.Navigation
  • CrowdRetargetTestsVixen.Navigation.Tests
  • CrowdTestsVixen.Navigation.Tests
  • DetailMeshTestsVixen.Navigation.Tests
  • HeightfieldTestsVixen.Navigation.Tests
  • NavAreaVolumeTestsVixen.Navigation.Tests
  • NavMeshAssetTestsVixen.Navigation.Tests
  • NavMeshBakeTestsVixen.Navigation.Tests
  • NavMeshDebugDrawTestsVixen.Navigation.Tests
  • NavMeshQueryTestsVixen.Navigation.Tests
  • NavPathQueueVixen.Navigation
  • NavPathQueueJobTestsVixen.Navigation.Tests
  • NavPathQueueTestsVixen.Navigation.Tests
  • NavTileCacheTestsVixen.Navigation.Tests
  • NavigationAllocationTestsVixen.Navigation.Tests
  • OffMeshConnectionTestsVixen.Navigation.Tests
  • PathCorridorVixen.Navigation
  • RegionMergeTestsVixen.Navigation.Tests
  • SliceJobVixen.Navigation
  • WatershedTestsVixen.Navigation.Tests
  • NavMeshImporterTestsVixen.Editor.Assets.Tests