Table of Contents

Class HexDirectionUtility

Namespace
GridForge.Spatial
Assembly
GridForge.dll

Provides hex-prism neighbor direction utilities.

public static class HexDirectionUtility
Inheritance
HexDirectionUtility
Inherited Members

Properties

AboveLayer

All 7 neighbor directions on the layer above.

public static ReadOnlySpan<HexDirection> AboveLayer { get; }

Property Value

ReadOnlySpan<HexDirection>

All

All 20 hex-prism neighbor directions excluding None.

public static ReadOnlySpan<HexDirection> All { get; }

Property Value

ReadOnlySpan<HexDirection>

BelowLayer

All 7 neighbor directions on the layer below.

public static ReadOnlySpan<HexDirection> BelowLayer { get; }

Property Value

ReadOnlySpan<HexDirection>

Offsets

Hex-prism neighbor offsets in deterministic direction order.

public static ReadOnlySpan<VoxelIndex> Offsets { get; }

Property Value

ReadOnlySpan<VoxelIndex>

Planar

All 6 planar axial hex directions.

public static ReadOnlySpan<HexDirection> Planar { get; }

Property Value

ReadOnlySpan<HexDirection>

Primary

The 8 face-adjacent hex-prism directions.

public static ReadOnlySpan<HexDirection> Primary { get; }

Property Value

ReadOnlySpan<HexDirection>

Vertical

All 2 vertical hex-prism directions.

public static ReadOnlySpan<HexDirection> Vertical { get; }

Property Value

ReadOnlySpan<HexDirection>

VerticalDiagonal

All 12 non-vertical directions on the layers above and below.

public static ReadOnlySpan<HexDirection> VerticalDiagonal { get; }

Property Value

ReadOnlySpan<HexDirection>

Methods

GetOffset(HexDirection)

Gets the topology-local index offset for a hex direction.

public static VoxelIndex GetOffset(HexDirection direction)

Parameters

direction HexDirection

Returns

VoxelIndex

IsPlanar(HexDirection)

True for planar axial directions.

public static bool IsPlanar(HexDirection direction)

Parameters

direction HexDirection

Returns

bool

IsVertical(HexDirection)

True for vertical layer directions.

public static bool IsVertical(HexDirection direction)

Parameters

direction HexDirection

Returns

bool