Struct GridTopologyMetrics
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
cellRadiusFixed64cellWidthFixed64layerHeightFixed64cellLengthFixed64hexOrientationHexOrientation
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
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
otherGridTopologyMetrics
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
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
cellRadiusFixed64layerHeightFixed64hexOrientationHexOrientation
Returns
Rectangular(Fixed64)
Creates cubic rectangular-prism metrics.
public static GridTopologyMetrics Rectangular(Fixed64 cellSize)
Parameters
cellSizeFixed64
Returns
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
cellWidthFixed64layerHeightFixed64cellLengthFixed64
Returns
Operators
operator ==(GridTopologyMetrics, GridTopologyMetrics)
public static bool operator ==(GridTopologyMetrics left, GridTopologyMetrics right)
Parameters
leftGridTopologyMetricsrightGridTopologyMetrics
Returns
operator !=(GridTopologyMetrics, GridTopologyMetrics)
public static bool operator !=(GridTopologyMetrics left, GridTopologyMetrics right)
Parameters
leftGridTopologyMetricsrightGridTopologyMetrics