class

FFoliageCells

The per-cell store behind FoliageInstancesComponent::cells. Instances live in 64 m world cells, one codec string per occupied cell.

Module
Game
Header
#include "Terrain/FoliageInstances.h"
Namespace
Mowo

Properties

TypeNameDescription
static constexpr floatkCellSizeDefault 64.0f.

Public functions

ReturnsNameDescription
voidCellOf
uint64_tKey
uint64_tHashInstancesOrder-sensitive hash of a cell's instances; what the brush compares to decide whether a cell needs re-encoding.
boolMigrateMoves a legacy whole-level blob (instances) into cells and empties the blob.
boolDecodeAllThe legacy blob plus every cell, in a stable order.
boolDecodeAllHashedThe same, and records each cell's content hash so the next Store can skip the cells the brush did not touch.
boolDecodeCell
uint32_tStoreReplaces the component's content with all: partitions it into cells, re-encodes only the cells whose hash changed, drops emptied cells and clears the legacy blob.

Function details

CellOf

C++
static void CellOf(const Vec3& position, int32_t& outX, int32_t& outZ)

Key

C++
static uint64_t Key(int32_t x, int32_t z)

HashInstances

C++
static uint64_t HashInstances(const std::vector<FFoliagePaintedInstance>& instances)

Order-sensitive hash of a cell's instances; what the brush compares to decide whether a cell needs re-encoding.

Migrate

C++
static bool Migrate(FoliageInstancesComponent& component)

Moves a legacy whole-level blob (instances) into cells and empties the blob. False when there was nothing to migrate or the blob is unreadable (then it is left untouched, so a newer build's data is never lost).

DecodeAll

C++
static bool DecodeAll(const FoliageInstancesComponent& component, std::vector<FFoliagePaintedInstance>& out)

The legacy blob plus every cell, in a stable order. False when any part is unreadable.

DecodeAllHashed

C++
static bool DecodeAllHashed(FoliageInstancesComponent& component, std::vector<FFoliagePaintedInstance>& out)

The same, and records each cell's content hash so the next Store can skip the cells the brush did not touch.

DecodeCell

C++
static bool DecodeCell(const FFoliageCell& cell, std::vector<FFoliagePaintedInstance>& out)

Store

C++
static uint32_t Store(FoliageInstancesComponent& component, const std::vector<FFoliagePaintedInstance>& all)

Replaces the component's content with all: partitions it into cells, re-encodes only the cells whose hash changed, drops emptied cells and clears the legacy blob. Returns how many cells were re-encoded.

Generated from Terrain/FoliageInstances.h via game.json · Dec 5, 2026Version 1.1.0