Vixen
02b45cc4
csharp
public sealed class NavMeshTileData

A baked tile: the polygons, their vertices, and which of them touch each other. No links to any other tile, and nothing that depends on where it is loaded.

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

Remarks

This is the artefact — what a bake produces, what a content build would write to disk, and what AddTile takes. It is deliberately inert: arrays of numbers, no references out, and no notion of the mesh it will join. Everything that is about the surrounding mesh — the salt, the slot, the links across the tile border — is computed when it is added and thrown away when it is removed, so the same data can be loaded into two meshes at once, or into the same slot twice.

Vertices are in world space, not tile-local. That costs nothing here — a tile is baked at the position it will be loaded at — and it saves every query from a per-tile offset that is right in all the ordinary cases and wrong in the one where a tile is loaded somewhere else, which is a thing this design does not offer.

Fields and properties (11)

  • public int X

    The tile's column in the mesh's tile grid.

  • public int Z

    The tile's row in the mesh's tile grid.

  • public Vector3[] Vertices

    Everything the tile's polygons are made of, in world space.

  • public NavMeshPolyData[] Polys

    The polygons.

  • public int[] PolyVertices

    Vertex indices, referenced by range from Polys.

  • public int[] PolyNeighbours

    Interior adjacency, parallel to PolyVertices. -1 where there is none.

  • public NavMeshDetailData[] Detail

    One entry per polygon, or empty if the bake did not sample the ground.

  • public Vector3[] DetailVertices

    The vertices the detail added, in world space. The polygons' own are not repeated here.

  • public int[] DetailTriangles

    Three indices per detail triangle, resolved through NavMeshDetailData.

  • public NavOffMeshConnectionData[] OffMeshConnections

    The authored ways off the surface that start in this tile.

  • public BoundingBox Bounds

    What the tile's geometry spans.

Methods (3)

  • public NavMeshTileData(int x, int z, Vector3[] vertices, NavMeshPolyData[] polys, int[] polyVertices, int[] polyNeighbours)

    Creates a tile.

  • public NavMeshTileData()

    Creates an empty tile, for an object initialiser or a deserialiser to fill.

  • public void Validate()

    Throws if the arrays do not describe a tile.

Used by (25)

  • BakeBenchmarksVixen.Benchmarks.Navigation
  • CrossTileConnectionTestsVixen.Navigation.Tests
  • DetailMeshTestsVixen.Navigation.Tests
  • HeightfieldTestsVixen.Navigation.Tests
  • NavMeshVixen.Navigation
  • NavMeshAssetVixen.Navigation
  • NavMeshAssetTestsVixen.Navigation.Tests
  • NavMeshBakeResultVixen.Navigation
  • NavMeshBakeTestsVixen.Navigation.Tests
  • NavMeshBakerVixen.Navigation
  • NavMeshDebugDrawVixen.Navigation
  • NavMeshDebugDrawTestsVixen.Navigation.Tests
  • NavMeshQueryVixen.Navigation
  • NavMeshQueryTestsVixen.Navigation.Tests
  • NavMeshTileVixen.Navigation
  • NavTileCacheVixen.Navigation
  • NavTileCacheTestsVixen.Navigation.Tests
  • OffMeshConnectionTestsVixen.Navigation.Tests
  • RegionMergeTestsVixen.Navigation.Tests
  • Vixen_Navigation_NavMeshAssetSerializerVixen.Navigation
  • Vixen_Navigation_NavMeshTileDataSerializerVixen.Navigation
  • WatershedTestsVixen.Navigation.Tests
  • EditorApplicationVixen.Editor.App
  • NavMeshImporterVixen.Editor.Assets
  • NavMeshImporterTestsVixen.Editor.Assets.Tests