Table of Contents

Struct GridNavigationCorridorValidationCursor

Namespace
GridForge.Grids.Topology
Assembly
GridForge.dll

Resumably validates one deterministic navigation corridor into caller-owned storage.

public struct GridNavigationCorridorValidationCursor
Inherited Members

Remarks

The ordered cell and waypoint spans are not retained. Their lengths and contents must remain stable between calls. A successful corridor of N cells consumes exactly 2N+1 work units. Advance one work unit at a time and call TryGetCurrentPortal(out GridNavigationPortal) after each call to consume every portal certificate in order.

Constructors

GridNavigationCorridorValidationCursor(int, Vector3d, Vector3d, Fixed64, Fixed64)

Creates a cursor for one ordered source, witness, and destination cell chain.

public GridNavigationCorridorValidationCursor(int cellCount, Vector3d entryAnchor, Vector3d exitAnchor, Fixed64 radiusClearance, Fixed64 heightClearance)

Parameters

cellCount int

The stable number of ordered cells supplied to every advance.

entryAnchor Vector3d

The source-cell foot anchor.

exitAnchor Vector3d

The destination-cell foot anchor.

radiusClearance Fixed64

The required nonnegative horizontal body radius.

heightClearance Fixed64

The required positive body height.

Properties

GeometricCost

The checked canonical polyline length accumulated so far.

public readonly Fixed64 GeometricCost { get; }

Property Value

Fixed64

PortalWaypointCount

The number of canonical waypoints written, or zero after failure.

public readonly int PortalWaypointCount { get; }

Property Value

int

Status

The current validation state.

public readonly GridNavigationCorridorValidationStatus Status { get; }

Property Value

GridNavigationCorridorValidationStatus

Methods

Advance(ReadOnlySpan<GridCellPrism>, Span<Vector3d>, int)

Performs at most maxWork bounded validation units.

public GridNavigationCorridorValidationStatus Advance(ReadOnlySpan<GridCellPrism> orderedCells, Span<Vector3d> portalWaypoints, int maxWork)

Parameters

orderedCells ReadOnlySpan<GridCellPrism>

The unchanged ordered cells supplied for this cursor.

portalWaypoints Span<Vector3d>

Caller-owned storage for twice the portal count.

maxWork int

The nonnegative maximum number of work units to perform.

Returns

GridNavigationCorridorValidationStatus

The resulting validation state.

TryGetCurrentPortal(out GridNavigationPortal)

Attempts to get the portal certificate produced by the last completed work unit.

public readonly bool TryGetCurrentPortal(out GridNavigationPortal portal)

Parameters

portal GridNavigationPortal

The produced portal, or default when unavailable.

Returns

bool

true when a portal certificate is available.

Remarks

The value is available only when the final work unit completed by the most recent advance was successful portal work. Use a one-unit budget to consume every certificate in order.