< Summary

Information
Class: Trailblazer.Pathing.NavigationChart
Assembly: Trailblazer
File(s): /home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Chart/NavigationChart.cs
Line coverage
98%
Covered lines: 232
Uncovered lines: 3
Coverable lines: 235
Total lines: 565
Line coverage: 98.7%
Branch coverage
95%
Covered branches: 84
Total branches: 88
Branch coverage: 95.4%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)66.66%121292.1%
.ctor(...)100%11100%
ToIndex(...)100%11100%
TryWorldToIndex(...)100%1212100%
IsWalkable(...)100%22100%
TryGetCell(...)100%22100%
GetWalkablePositions()100%22100%
GetSurfaceCells()100%22100%
GetAuthoredCells()100%22100%
From3D(...)100%66100%
From3D(...)100%66100%
IsInBounds(...)100%1010100%
GetWorldPosition(...)100%11100%
DecodeIndex(...)100%11100%
TrySetCell(...)100%44100%
GetCell(...)100%11100%
GetGeneratedTransitionIndices()100%11100%
BuildCellIndexCaches()100%88100%
ShouldTrackGeneratedTransitionCell(...)100%22100%
UpdateIndexMembership(...)100%44100%
GetSortedAuthoredCellIndices()100%11100%
GetSortedSurfaceCellIndices()100%11100%
GetSortedGeneratedTransitionCellIndices()100%11100%
GetSortedIndexCache(...)100%66100%
CreateCells(...)100%88100%

File(s)

/home/runner/work/Trailblazer/Trailblazer/src/Trailblazer/Pathing/Chart/NavigationChart.cs

#LineLine coverage
 1using FixedMathSharp;
 2using SwiftCollections;
 3using System;
 4using System.Collections.Generic;
 5using System.Runtime.CompilerServices;
 6
 7namespace Trailblazer.Pathing;
 8
 9/// <summary>
 10/// Represents dense authored traversal data across surface and volume spaces.
 11/// Provides utility methods for querying authored cells and converting world positions into discrete grid indices.
 12/// </summary>
 13[Serializable]
 14public class NavigationChart
 15{
 16    /// <summary>
 17    /// The name identifier for this navigation chart.
 18    /// </summary>
 19    public readonly string Name;
 20
 21    /// <summary>
 22    /// The minimum world-space bounds of the grid. Determines the starting point for grid indexing.
 23    /// </summary>
 24    public readonly Vector3d MinBounds;
 25
 26    /// <summary>
 27    /// Higher values take precedence when this chart overlaps another chart on the same voxel.
 28    /// </summary>
 29    public readonly int Priority;
 30
 31    /// <summary>
 32    /// The maximum world-space bounds of the grid, computed as MinBounds + grid size * Interval.
 33    /// Represents the exclusive upper bound of the grid.
 34    /// </summary>
 35    public readonly Vector3d MaxBounds;
 36
 37    /// <summary>
 38    /// The distance between chart cells along each axis. This must match the owning context's voxel size when registere
 39    /// </summary>
 40    public readonly Fixed64 Interval;
 41
 42    /// <summary>
 43    /// The number of cells along the X axis.
 44    /// </summary>
 45    public readonly int SizeX;
 46
 47    /// <summary>
 48    /// The number of cells along the Y axis.
 49    /// </summary>
 50    public readonly int SizeY;
 51
 52    /// <summary>
 53    /// The number of cells along the Z axis.
 54    /// </summary>
 55    public readonly int SizeZ;
 56
 57    /// <summary>
 58    /// A flattened 3D map of authored chart cells indexed in row-major order across Y, X, then Z.
 59    /// </summary>
 60    private readonly NavigationChartCell[] _cells;
 61
 97062    private readonly SwiftHashSet<int> _authoredCellIndices = new();
 63
 97064    private readonly SwiftHashSet<int> _surfaceCellIndices = new();
 65
 97066    private readonly SwiftHashSet<int> _generatedTransitionCellIndices = new();
 67
 97068    private int[] _cachedAuthoredCellIndices = Array.Empty<int>();
 69
 97070    private int[] _cachedSurfaceCellIndices = Array.Empty<int>();
 71
 97072    private int[] _cachedGeneratedTransitionCellIndices = Array.Empty<int>();
 73
 74    private bool _authoredCellIndicesDirty;
 75
 76    private bool _surfaceCellIndicesDirty;
 77
 78    private bool _generatedTransitionCellIndicesDirty;
 79
 80    /// <summary>
 81    /// Creates a new navigation chart using a pre-flattened map array and spatial parameters.
 82    /// </summary>
 83    /// <param name="name">The chart's unique identifier.</param>
 84    /// <param name="map">A flattened boolean array representing authored surface cells and empty cells.</param>
 85    /// <param name="sizeX">Number of cells along the X axis.</param>
 86    /// <param name="sizeY">Number of cells along the Y axis.</param>
 87    /// <param name="sizeZ">Number of cells along the Z axis.</param>
 88    /// <param name="minBounds">The minimum world-space bounds of the grid.</param>
 89    /// <param name="maxBounds">The maximum world-space bounds of the grid.</param>
 90    /// <param name="interval">Distance between adjacent chart cells. Must be greater than zero.</param>
 91    /// <param name="medium">The authored traversal medium emitted for each <c>true</c> cell.</param>
 92    /// <param name="priority">The authored precedence used when this chart overlaps another chart on the same voxel.</p
 93    /// <exception cref="ArgumentNullException">Thrown when <paramref name="map"/> is null.</exception>
 94    /// <exception cref="ArgumentOutOfRangeException">
 95    /// Thrown when <paramref name="interval"/> is not greater than zero, when any dimension is not greater than zero,
 96    /// or when <paramref name="medium"/> is not <see cref="TraversalMedium.Solid"/>,
 97    /// <see cref="TraversalMedium.Gas"/>, or <see cref="TraversalMedium.Liquid"/>.
 98    /// </exception>
 99    public NavigationChart(
 100        string name,
 101        bool[] map,
 102        int sizeX,
 103        int sizeY,
 104        int sizeZ,
 105        Vector3d minBounds,
 106        Vector3d maxBounds,
 107        Fixed64 interval,
 108        TraversalMedium medium = TraversalMedium.Solid,
 109        int priority = 0)
 1110        : this(
 1111            name,
 1112            CreateCells(map, medium),
 1113            sizeX,
 1114            sizeY,
 1115            sizeZ,
 1116            minBounds,
 1117            maxBounds,
 1118            interval,
 1119            priority)
 1120    { }
 121
 122    /// <summary>
 123    /// Creates a new navigation chart using a pre-flattened cell array and spatial parameters.
 124    /// </summary>
 125    /// <param name="name">The chart's unique identifier.</param>
 126    /// <param name="cells">A flattened array representing authored chart cell payloads.</param>
 127    /// <param name="sizeX">Number of cells along the X axis.</param>
 128    /// <param name="sizeY">Number of cells along the Y axis.</param>
 129    /// <param name="sizeZ">Number of cells along the Z axis.</param>
 130    /// <param name="minBounds">The minimum world-space bounds of the grid.</param>
 131    /// <param name="maxBounds">The maximum world-space bounds of the grid.</param>
 132    /// <param name="interval">Distance between adjacent chart cells. Must be greater than zero.</param>
 133    /// <param name="priority">The authored precedence used when this chart overlaps another chart on the same voxel.</p
 134    /// <exception cref="ArgumentOutOfRangeException">
 135    /// Thrown when <paramref name="interval"/> is not greater than zero, or when any dimension is not greater than zero
 136    /// </exception>
 970137    public NavigationChart(
 970138        string name,
 970139        NavigationChartCell[] cells,
 970140        int sizeX,
 970141        int sizeY,
 970142        int sizeZ,
 970143        Vector3d minBounds,
 970144        Vector3d maxBounds,
 970145        Fixed64 interval,
 970146        int priority = 0)
 147    {
 970148        Name = name;
 970149        _cells = cells ?? throw new ArgumentNullException(nameof(cells));
 970150        SizeX = sizeX;
 970151        SizeY = sizeY;
 970152        SizeZ = sizeZ;
 970153        MinBounds = minBounds;
 970154        MaxBounds = maxBounds;
 970155        Interval = interval;
 970156        Priority = priority;
 157
 970158        if (interval <= Fixed64.Zero)
 1159            throw new ArgumentOutOfRangeException(nameof(interval), interval, "Navigation chart interval must be greater
 160
 969161        if (sizeX <= 0)
 0162            throw new ArgumentOutOfRangeException(nameof(sizeX), sizeX, "Navigation chart size must be greater than zero
 969163        if (sizeY <= 0)
 0164            throw new ArgumentOutOfRangeException(nameof(sizeY), sizeY, "Navigation chart size must be greater than zero
 969165        if (sizeZ <= 0)
 0166            throw new ArgumentOutOfRangeException(nameof(sizeZ), sizeZ, "Navigation chart size must be greater than zero
 167
 969168        int expectedCellCount = checked(sizeX * sizeY * sizeZ);
 969169        if (_cells.Length != expectedCellCount)
 1170            throw new ArgumentException($"Expected {expectedCellCount} chart cells but received {_cells.Length}.", nameo
 171
 968172        BuildCellIndexCaches();
 968173    }
 174
 175    /// <summary>
 176    /// Converts 3D grid indices (x, y, z) into a 1D flattened index for accessing the internal map.
 177    /// </summary>
 178    /// <param name="x">The X index in the grid.</param>
 179    /// <param name="y">The Y index in the grid.</param>
 180    /// <param name="z">The Z index in the grid.</param>
 181    /// <returns>The flattened index corresponding to the provided 3D coordinates.</returns>
 182    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 676183    private int ToIndex(int x, int y, int z) => (y * SizeX * SizeZ) + (x * SizeZ) + z;
 184
 185    /// <summary>
 186    /// Attempts to convert a world-space position into the grid's local indices.
 187    /// </summary>
 188    /// <param name="pos">The world-space position.</param>
 189    /// <param name="x">Resulting X index.</param>
 190    /// <param name="y">Resulting Y index.</param>
 191    /// <param name="z">Resulting Z index.</param>
 192    /// <returns>True if the position is within bounds; otherwise, false.</returns>
 193    public bool TryWorldToIndex(Vector3d pos, out int x, out int y, out int z)
 194    {
 149195        x = ((pos.x - MinBounds.x) / Interval).FloorToInt();
 149196        y = ((pos.y - MinBounds.y) / Interval).FloorToInt();
 149197        z = ((pos.z - MinBounds.z) / Interval).FloorToInt();
 198
 149199        bool valid = x >= 0 && x < SizeX &&
 149200                     y >= 0 && y < SizeY &&
 149201                     z >= 0 && z < SizeZ;
 202
 149203        if (!valid)
 204        {
 6205            x = y = z = -1;
 6206            return false;
 207        }
 208
 143209        return true;
 210    }
 211
 212    /// <summary>
 213    /// Checks if the given world-space position corresponds to an authored surface traversal cell.
 214    /// </summary>
 215    /// <param name="worldPos">The position to query.</param>
 216    /// <returns>True if traversable; otherwise, false.</returns>
 217    public bool IsWalkable(Vector3d worldPos)
 218    {
 7219        if (!TryGetCell(worldPos, out NavigationChartCell cell))
 2220            return false;
 221
 5222        return cell.HasSolid;
 223    }
 224
 225    /// <summary>
 226    /// Attempts to retrieve the authored chart cell at the provided world-space position.
 227    /// </summary>
 228    /// <param name="worldPos">The world-space position to query.</param>
 229    /// <param name="cell">The authored chart cell payload.</param>
 230    /// <returns>True if the position resolves inside this chart; otherwise, false.</returns>
 231    public bool TryGetCell(Vector3d worldPos, out NavigationChartCell cell)
 232    {
 37233        if (!TryWorldToIndex(worldPos, out int x, out int y, out int z))
 234        {
 3235            cell = default;
 3236            return false;
 237        }
 238
 34239        cell = GetCell(x, y, z);
 34240        return true;
 241    }
 242
 243    /// <summary>
 244    /// Returns all authored surface traversal positions within the chart.
 245    /// </summary>
 246    /// <returns>A collection of traversable surface positions.</returns>
 247    public IEnumerable<Vector3d> GetWalkablePositions()
 248    {
 6249        foreach ((Vector3d position, _) in GetSurfaceCells())
 2250            yield return position;
 1251    }
 252
 253    /// <summary>
 254    /// Returns each authored surface traversal position together with its authored cell payload.
 255    /// </summary>
 256    internal IEnumerable<(Vector3d Position, NavigationChartCell Cell)> GetSurfaceCells()
 257    {
 3258        int[] surfaceIndices = GetSortedSurfaceCellIndices();
 16259        for (int i = 0; i < surfaceIndices.Length; i++)
 260        {
 5261            int flatIndex = surfaceIndices[i];
 5262            DecodeIndex(flatIndex, out int x, out int y, out int z);
 5263            yield return (GetWorldPosition(x, y, z), _cells[flatIndex]);
 264        }
 3265    }
 266
 267    /// <summary>
 268    /// Returns each authored traversal position together with its authored cell payload.
 269    /// </summary>
 270    internal IEnumerable<(Vector3d Position, NavigationChartCell Cell)> GetAuthoredCells()
 271    {
 1238272        int[] authoredIndices = GetSortedAuthoredCellIndices();
 13994273        for (int i = 0; i < authoredIndices.Length; i++)
 274        {
 5767275            int flatIndex = authoredIndices[i];
 5767276            DecodeIndex(flatIndex, out int x, out int y, out int z);
 5767277            yield return (GetWorldPosition(x, y, z), _cells[flatIndex]);
 278        }
 1230279    }
 280
 281    /// <summary>
 282    /// Creates a navigation chart from a 3D boolean array representing authored traversal voxels.
 283    /// </summary>
 284    /// <param name="name">Name identifier for the chart.</param>
 285    /// <param name="sourceMap">3D map of authored cells (true = authored traversal).</param>
 286    /// <param name="minBounds">The minimum world-space bounds of the grid.</param>
 287    /// <param name="interval">The spacing between each chart cell. Must be greater than zero.</param>
 288    /// <param name="medium">The authored traversal medium emitted for each <c>true</c> cell.</param>
 289    /// <param name="priority">The authored precedence used when this chart overlaps another chart on the same voxel.</p
 290    /// <returns>A constructed NavigationChart instance.</returns>
 291    /// <exception cref="ArgumentNullException">Thrown when <paramref name="sourceMap"/> is null.</exception>
 292    /// <exception cref="ArgumentOutOfRangeException">
 293    /// Thrown when <paramref name="interval"/> is not greater than zero, or when <paramref name="medium"/> is not <see 
 294    /// <see cref="TraversalMedium.Gas"/>, or <see cref="TraversalMedium.Liquid"/>.
 295    /// </exception>
 296    public static NavigationChart From3D(
 297        string name,
 298        bool[,,] sourceMap,
 299        Vector3d minBounds,
 300        Fixed64 interval,
 301        TraversalMedium medium = TraversalMedium.Solid,
 302        int priority = 0)
 303    {
 461304        SwiftThrowHelper.ThrowIfNull(sourceMap, nameof(sourceMap));
 305
 461306        int sizeY = sourceMap.GetLength(0);
 461307        int sizeX = sourceMap.GetLength(1);
 461308        int sizeZ = sourceMap.GetLength(2);
 309
 461310        Vector3d maxBounds = minBounds + new Vector3d(
 461311            sizeX * interval,
 461312            sizeY * interval,
 461313            sizeZ * interval
 461314        );
 315
 461316        var flat = new bool[sizeX * sizeY * sizeZ];
 2614317        for (int y = 0; y < sizeY; y++)
 6870318            for (int x = 0; x < sizeX; x++)
 19758319                for (int z = 0; z < sizeZ; z++)
 7290320                    flat[(y * sizeX * sizeZ) + (x * sizeZ) + z] = sourceMap[y, x, z];
 321
 461322        return new(
 461323            name,
 461324            CreateCells(flat, medium),
 461325            sizeX,
 461326            sizeY,
 461327            sizeZ,
 461328            minBounds,
 461329            maxBounds,
 461330            interval,
 461331            priority);
 332    }
 333
 334    /// <summary>
 335    /// Creates a navigation chart from a 3D array of authored chart cell payloads.
 336    /// </summary>
 337    /// <param name="name">Name identifier for the chart.</param>
 338    /// <param name="sourceMap">3D map of authored chart cells.</param>
 339    /// <param name="minBounds">The minimum world-space bounds of the grid.</param>
 340    /// <param name="interval">The spacing between each chart cell. Must be greater than zero.</param>
 341    /// <param name="priority">The authored precedence used when this chart overlaps another chart on the same voxel.</p
 342    /// <returns>A constructed NavigationChart instance.</returns>
 343    /// <exception cref="ArgumentNullException">Thrown when <paramref name="sourceMap"/> is null.</exception>
 344    /// <exception cref="ArgumentOutOfRangeException">Thrown when <paramref name="interval"/> is not greater than zero.<
 345    public static NavigationChart From3D(
 346        string name,
 347        NavigationChartCell[,,] sourceMap,
 348        Vector3d minBounds,
 349        Fixed64 interval,
 350        int priority = 0)
 351    {
 509352        SwiftThrowHelper.ThrowIfNull(sourceMap, nameof(sourceMap));
 353
 509354        int sizeY = sourceMap.GetLength(0);
 509355        int sizeX = sourceMap.GetLength(1);
 509356        int sizeZ = sourceMap.GetLength(2);
 357
 509358        Vector3d maxBounds = minBounds + new Vector3d(
 509359            sizeX * interval,
 509360            sizeY * interval,
 509361            sizeZ * interval
 509362        );
 363
 509364        var flat = new NavigationChartCell[sizeX * sizeY * sizeZ];
 3658365        for (int y = 0; y < sizeY; y++)
 10444366            for (int x = 0; x < sizeX; x++)
 30428367                for (int z = 0; z < sizeZ; z++)
 11312368                    flat[(y * sizeX * sizeZ) + (x * sizeZ) + z] = sourceMap[y, x, z];
 369
 509370        return new(
 509371            name,
 509372            flat,
 509373            sizeX,
 509374            sizeY,
 509375            sizeZ,
 509376            minBounds,
 509377            maxBounds,
 509378            interval,
 509379            priority);
 380    }
 381
 382    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 383    internal bool IsInBounds(int x, int y, int z)
 384    {
 1237385        return x >= 0 && x < SizeX
 1237386            && y >= 0 && y < SizeY
 1237387            && z >= 0 && z < SizeZ;
 388    }
 389
 390    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 391    internal Vector3d GetWorldPosition(int x, int y, int z)
 392    {
 6734393        return new Vector3d(
 6734394            MinBounds.x + x * Interval,
 6734395            MinBounds.y + y * Interval,
 6734396            MinBounds.z + z * Interval);
 397    }
 398
 399    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 400    internal void DecodeIndex(int flatIndex, out int x, out int y, out int z)
 401    {
 5878402        int yStride = SizeX * SizeZ;
 5878403        y = flatIndex / yStride;
 5878404        int remainder = flatIndex - (y * yStride);
 5878405        x = remainder / SizeZ;
 5878406        z = remainder - (x * SizeZ);
 5878407    }
 408
 409    internal bool TrySetCell(int x, int y, int z, NavigationChartCell cell, out NavigationChartCell previousCell)
 410    {
 33411        if (!IsInBounds(x, y, z))
 412        {
 5413            previousCell = default;
 5414            return false;
 415        }
 416
 28417        int index = ToIndex(x, y, z);
 28418        previousCell = _cells[index];
 28419        if (previousCell.Equals(cell))
 4420            return false;
 421
 24422        _cells[index] = cell;
 24423        UpdateIndexMembership(
 24424            _authoredCellIndices,
 24425            index,
 24426            previousCell.HasTraversalData,
 24427            cell.HasTraversalData,
 24428            ref _authoredCellIndicesDirty);
 24429        UpdateIndexMembership(
 24430            _surfaceCellIndices,
 24431            index,
 24432            previousCell.HasSolid,
 24433            cell.HasSolid,
 24434            ref _surfaceCellIndicesDirty);
 24435        UpdateIndexMembership(
 24436            _generatedTransitionCellIndices,
 24437            index,
 24438            ShouldTrackGeneratedTransitionCell(previousCell),
 24439            ShouldTrackGeneratedTransitionCell(cell),
 24440            ref _generatedTransitionCellIndicesDirty);
 24441        return true;
 442    }
 443
 444    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 648445    internal NavigationChartCell GetCell(int x, int y, int z) => _cells[ToIndex(x, y, z)];
 446
 1953447    internal int[] GetGeneratedTransitionIndices() => GetSortedGeneratedTransitionCellIndices();
 448
 449    private void BuildCellIndexCaches()
 450    {
 39142451        for (int i = 0; i < _cells.Length; i++)
 452        {
 18603453            NavigationChartCell cell = _cells[i];
 18603454            if (cell.HasTraversalData)
 3187455                _authoredCellIndices.Add(i);
 456
 18603457            if (cell.HasSolid)
 2685458                _surfaceCellIndices.Add(i);
 459
 18603460            if (ShouldTrackGeneratedTransitionCell(cell))
 78461                _generatedTransitionCellIndices.Add(i);
 462        }
 463
 968464        _authoredCellIndicesDirty = true;
 968465        _surfaceCellIndicesDirty = true;
 968466        _generatedTransitionCellIndicesDirty = true;
 968467    }
 468
 469    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 470    private static bool ShouldTrackGeneratedTransitionCell(NavigationChartCell cell)
 471    {
 18651472        return cell.CanGenerateTransition
 18651473            || (cell.Flags & NavigationChartCellFlags.ClimbSurfaceHint) != 0;
 474    }
 475
 476    private static void UpdateIndexMembership(
 477        SwiftHashSet<int> indices,
 478        int flatIndex,
 479        bool wasPresent,
 480        bool isPresent,
 481        ref bool cacheDirty)
 482    {
 72483        if (wasPresent == isPresent)
 32484            return;
 485
 40486        if (isPresent)
 18487            indices.Add(flatIndex);
 488        else
 22489            indices.Remove(flatIndex);
 490
 40491        cacheDirty = true;
 40492    }
 493
 494    private int[] GetSortedAuthoredCellIndices()
 495    {
 1238496        return GetSortedIndexCache(
 1238497            _authoredCellIndices,
 1238498            ref _cachedAuthoredCellIndices,
 1238499            ref _authoredCellIndicesDirty);
 500    }
 501
 502    private int[] GetSortedSurfaceCellIndices()
 503    {
 3504        return GetSortedIndexCache(
 3505            _surfaceCellIndices,
 3506            ref _cachedSurfaceCellIndices,
 3507            ref _surfaceCellIndicesDirty);
 508    }
 509
 510    private int[] GetSortedGeneratedTransitionCellIndices()
 511    {
 1953512        return GetSortedIndexCache(
 1953513            _generatedTransitionCellIndices,
 1953514            ref _cachedGeneratedTransitionCellIndices,
 1953515            ref _generatedTransitionCellIndicesDirty);
 516    }
 517
 518    private static int[] GetSortedIndexCache(
 519        SwiftHashSet<int> source,
 520        ref int[] cache,
 521        ref bool cacheDirty)
 522    {
 3194523        if (!cacheDirty)
 1362524            return cache;
 525
 1832526        if (source.Count == 0)
 527        {
 906528            cache = Array.Empty<int>();
 906529            cacheDirty = false;
 906530            return cache;
 531        }
 532
 926533        int[] sorted = new int[source.Count];
 926534        int index = 0;
 8172535        foreach (int value in source)
 3160536            sorted[index++] = value;
 537
 926538        Array.Sort(sorted);
 926539        cache = sorted;
 926540        cacheDirty = false;
 926541        return cache;
 542    }
 543
 544    private static NavigationChartCell[] CreateCells(bool[] map, TraversalMedium medium)
 545    {
 462546        SwiftThrowHelper.ThrowIfNull(map, nameof(map));
 547
 462548        NavigationChartCell traversableCell = medium switch
 462549        {
 457550            TraversalMedium.Solid => NavigationChartCell.Solid,
 2551            TraversalMedium.Gas => NavigationChartCell.Gas,
 1552            TraversalMedium.Liquid => NavigationChartCell.Liquid,
 2553            _ => throw new ArgumentOutOfRangeException(
 2554                nameof(medium),
 2555                medium,
 2556                "Boolean chart factories support Solid, Gas, or Liquid traversal only.")
 462557        };
 558
 460559        var cells = new NavigationChartCell[map.Length];
 15504560        for (int i = 0; i < map.Length; i++)
 7292561            cells[i] = map[i] ? traversableCell : NavigationChartCell.Empty;
 562
 460563        return cells;
 564    }
 565}

Methods/Properties

.ctor(System.String,Trailblazer.Pathing.NavigationChartCell[],System.Int32,System.Int32,System.Int32,FixedMathSharp.Vector3d,FixedMathSharp.Vector3d,FixedMathSharp.Fixed64,System.Int32)
.ctor(System.String,System.Boolean[],System.Int32,System.Int32,System.Int32,FixedMathSharp.Vector3d,FixedMathSharp.Vector3d,FixedMathSharp.Fixed64,Trailblazer.TraversalMedium,System.Int32)
ToIndex(System.Int32,System.Int32,System.Int32)
TryWorldToIndex(FixedMathSharp.Vector3d,System.Int32&,System.Int32&,System.Int32&)
IsWalkable(FixedMathSharp.Vector3d)
TryGetCell(FixedMathSharp.Vector3d,Trailblazer.Pathing.NavigationChartCell&)
GetWalkablePositions()
GetSurfaceCells()
GetAuthoredCells()
From3D(System.String,System.Boolean[0...,0...,0...],FixedMathSharp.Vector3d,FixedMathSharp.Fixed64,Trailblazer.TraversalMedium,System.Int32)
From3D(System.String,Trailblazer.Pathing.NavigationChartCell[0...,0...,0...],FixedMathSharp.Vector3d,FixedMathSharp.Fixed64,System.Int32)
IsInBounds(System.Int32,System.Int32,System.Int32)
GetWorldPosition(System.Int32,System.Int32,System.Int32)
DecodeIndex(System.Int32,System.Int32&,System.Int32&,System.Int32&)
TrySetCell(System.Int32,System.Int32,System.Int32,Trailblazer.Pathing.NavigationChartCell,Trailblazer.Pathing.NavigationChartCell&)
GetCell(System.Int32,System.Int32,System.Int32)
GetGeneratedTransitionIndices()
BuildCellIndexCaches()
ShouldTrackGeneratedTransitionCell(Trailblazer.Pathing.NavigationChartCell)
UpdateIndexMembership(SwiftCollections.SwiftHashSet`1<System.Int32>,System.Int32,System.Boolean,System.Boolean,System.Boolean&)
GetSortedAuthoredCellIndices()
GetSortedSurfaceCellIndices()
GetSortedGeneratedTransitionCellIndices()
GetSortedIndexCache(SwiftCollections.SwiftHashSet`1<System.Int32>,System.Int32[]&,System.Boolean&)
CreateCells(System.Boolean[],Trailblazer.TraversalMedium)