public sealed class NavAreaVolumeA piece of the world that stamps an area id onto whatever walkable surface is inside it.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Areas are how a navmesh knows that this ground is water, that one is a road, and the other is somewhere the guards would rather not walk. Nothing about the geometry says so — a puddle and a paving stone are both a floor — so it is authored, and this is the authoring shape: a convex prism, an area id, and a height range.
It is applied before the surface is partitioned, which is what makes the area boundary a polygon boundary: the region sweep only continues a run through cells of the same area, so a polygon is never half road. Stamping the finished polygons instead would put the boundary wherever the polygons happened to fall.
Convex, because the containment test is per voxel column of the volume's footprint and a concave test is several times the work for a shape that can be expressed as two volumes. Box is the case everyone actually authors.
Fields and properties (5)
public byte AreaThe area id stamped onto everything inside.
public float MinimumYThe lowest surface height it affects.
public float MaximumYThe highest.
public ReadOnlySpan<Vector3> ShapeThe footprint, for a caller that wants to draw it.
public BoundingBox BoundsWhat the footprint spans in XZ. The Y of this is the footprint's, not the volume's.
Methods (3)
public static NavAreaVolume Box(BoundingBox bounds, byte area)A volume shaped like a box.
public static NavAreaVolume Convex(ReadOnlySpan<Vector3> footprint, float minimumY, float maximumY, byte area)A volume shaped like a prism over a convex footprint.
public static NavAreaVolume Cylinder(Vector3 centre, float radius, float height, byte area, int segments = 12)A volume shaped like an upright cylinder.
Used by (9)
- CachedTileVixen.Navigation
- CompactHeightfieldVixen.Navigation
- CrowdRetargetTestsVixen.Navigation.Tests
- NavAreaVolumeTestsVixen.Navigation.Tests
- NavMeshBakerVixen.Navigation
- NavTileCacheVixen.Navigation
- NavTileCacheTestsVixen.Navigation.Tests
- ObstacleVixen.Navigation
- NavMeshImporterVixen.Editor.Assets