Table of Contents

Struct GridTopologyMetrics

Namespace
GridForge.Grids.Topology
Assembly
GridForge.dll

Stores deterministic cell geometry for a grid topology.

[MemoryPackable(GenerateType.Object)]
public readonly struct GridTopologyMetrics : IEquatable<GridTopologyMetrics>, IMemoryPackable<GridTopologyMetrics>, IMemoryPackFormatterRegister
Implements
IMemoryPackable<GridTopologyMetrics>
IMemoryPackFormatterRegister
Inherited Members

Remarks

MemoryPack GenerateType: unmanaged

FixedMathSharp.Fixed64 CellRadius
FixedMathSharp.Fixed64 CellWidth
FixedMathSharp.Fixed64 LayerHeight
FixedMathSharp.Fixed64 CellLength
GridForge.Grids.Topology.HexOrientation HexOrientation

Constructors

GridTopologyMetrics(Fixed64, Fixed64, Fixed64, Fixed64, HexOrientation)

Initializes deterministic topology metrics.

[JsonConstructor]
public GridTopologyMetrics(Fixed64 cellRadius, Fixed64 cellWidth, Fixed64 layerHeight, Fixed64 cellLength, HexOrientation hexOrientation = HexOrientation.PointyTop)

Parameters

cellRadius Fixed64
cellWidth Fixed64
layerHeight Fixed64
cellLength Fixed64
hexOrientation HexOrientation

Fields

CellLength

Rectangular-prism cell length along world Z.

[JsonInclude]
[MemoryPackInclude]
public readonly Fixed64 CellLength

Field Value

Fixed64

CellRadius

Horizontal center-to-corner radius for hex-prism cells. Rectangular-prism grids leave this as zero.

[JsonInclude]
[MemoryPackInclude]
public readonly Fixed64 CellRadius

Field Value

Fixed64

CellWidth

Rectangular-prism cell width along world X.

[JsonInclude]
[MemoryPackInclude]
public readonly Fixed64 CellWidth

Field Value

Fixed64

HexOrientation

Hex-prism horizontal projection orientation. Rectangular-prism grids ignore this value. The orientation affects fixed-point world XZ projection only; it is not an engine rendering setting.

[JsonInclude]
[MemoryPackInclude]
public readonly HexOrientation HexOrientation

Field Value

HexOrientation

LayerHeight

Vertical layer height along world Y for rectangular-prism and hex-prism grids.

[JsonInclude]
[MemoryPackInclude]
public readonly Fixed64 LayerHeight

Field Value

Fixed64

Methods

Equals(GridTopologyMetrics)

public bool Equals(GridTopologyMetrics other)

Parameters

other GridTopologyMetrics

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Hex(Fixed64, Fixed64, HexOrientation)

Creates hex-prism metrics with the supplied horizontal radius, vertical layer height, and orientation.

public static GridTopologyMetrics Hex(Fixed64 cellRadius, Fixed64 layerHeight, HexOrientation hexOrientation = HexOrientation.PointyTop)

Parameters

cellRadius Fixed64
layerHeight Fixed64
hexOrientation HexOrientation

Returns

GridTopologyMetrics

Rectangular(Fixed64)

Creates cubic rectangular-prism metrics.

public static GridTopologyMetrics Rectangular(Fixed64 cellSize)

Parameters

cellSize Fixed64

Returns

GridTopologyMetrics

Rectangular(Fixed64, Fixed64, Fixed64)

Creates rectangular-prism metrics with independent X, Y, and Z cell edges.

public static GridTopologyMetrics Rectangular(Fixed64 cellWidth, Fixed64 layerHeight, Fixed64 cellLength)

Parameters

cellWidth Fixed64
layerHeight Fixed64
cellLength Fixed64

Returns

GridTopologyMetrics

Operators

operator ==(GridTopologyMetrics, GridTopologyMetrics)

public static bool operator ==(GridTopologyMetrics left, GridTopologyMetrics right)

Parameters

left GridTopologyMetrics
right GridTopologyMetrics

Returns

bool

operator !=(GridTopologyMetrics, GridTopologyMetrics)

public static bool operator !=(GridTopologyMetrics left, GridTopologyMetrics right)

Parameters

left GridTopologyMetrics
right GridTopologyMetrics

Returns

bool