A grid is assumed to divide the world into equally-sized 3D cells. Each cell measures VoxelFarmConstant.CELL_SIZE units along each direction.


From a given 3D point in Voxel Farm coordinates, it is possible to determine the coordinates of the cell containing the point. This is simply done by dividing each coordinate by VoxelFarmConstant.CELL_SIZE and keeping the integer part. Each cell can be uniquely described by its integer coordinates in this grid. This grid is known as VoxelFarmConstant.LOD_0 because these are the smallest cells possible.


The engine then assumes the existence of an array of additional grids, each one having cells with dimensions twice the size of the previous grid. These are known as the LOD 1..N cells.


Since the grids are aligned, it can be assumed that one cell at LOD(N) will contain eight cells at LOD(N-1).


Any cell, no matter on which LOD grid, can be uniquely described by four coordinates:


  1. LOD of the cell
  2. X index of the cell in the LOD grid
  3. Y index of the cell in the LOD grid
  4. Z index of the cell in the LOD grid


To uniquely represent the cell in the index system, these four coordinates are packed into a single 64bit identifier. These identifiers are typically referred to in the API as “cell Ids”.


Voxel-based objects will use an additional grid, which divides each cell into voxels. The number of voxels in a cell is defined in VoxelFarmConstant.BLOCK_DIMENSION.