Table of Contents

Struct WorldVoxelIndex

Namespace
GridForge.Spatial
Assembly
GridForge.dll

Represents the world-scoped runtime identity of a voxel. Used for uniquely identifying voxels across multiple grids and world instances.

public struct WorldVoxelIndex : IEquatable<WorldVoxelIndex>
Implements
Inherited Members

Constructors

WorldVoxelIndex(long, ushort, long, VoxelIndex)

Initializes a new instance of WorldVoxelIndex, linking a voxel to a specific world and grid instance.

public WorldVoxelIndex(long worldSpawnToken, ushort gridIndex, long gridSpawnToken, VoxelIndex coord)

Parameters

worldSpawnToken long
gridIndex ushort
gridSpawnToken long
coord VoxelIndex

Fields

GridIndex

The world-local slot index of the grid in ActiveGrids.

public ushort GridIndex

Field Value

ushort

GridSpawnToken

The 64-bit world-local allocation generation assigned to the grid during initialization. Used to ensure the correct instance is at the assigned GridIndex.

public long GridSpawnToken

Field Value

long

VoxelIndex

The local coordinate of a voxel within the grid at GridIndex.

public VoxelIndex VoxelIndex

Field Value

VoxelIndex

WorldSpawnToken

The process-unique 64-bit runtime allocation token of the owning GridWorld instance. Used to reject stale or cross-world identities safely.

public long WorldSpawnToken

Field Value

long

Methods

Equals(WorldVoxelIndex)

public readonly bool Equals(WorldVoxelIndex other)

Parameters

other WorldVoxelIndex

Returns

bool

Equals(object?)

public override readonly bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

Computes a hash code for hash-based lookup. Exact equality remains authoritative.

public override readonly int GetHashCode()

Returns

int

ToString()

Returns a string representation of the world-scoped voxel identity.

public override readonly string ToString()

Returns

string

Operators

operator ==(WorldVoxelIndex, WorldVoxelIndex)

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

Parameters

left WorldVoxelIndex
right WorldVoxelIndex

Returns

bool

operator !=(WorldVoxelIndex, WorldVoxelIndex)

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

Parameters

left WorldVoxelIndex
right WorldVoxelIndex

Returns

bool