Orrery Terrain · OrreryTerrainCore module · class
Native::
FBrushMaskRegistry
ExperimentalThe brush masks one terrain holds, by content hash.
Declaration
class FBrushMaskRegistry- Header
#include "Native/BrushMaskRegistry.h"- Module
PublicDependencyModuleNames.Add("OrreryTerrainCore");in your module’s Build.cs.- Stability
- Experimental: supported, may change in a minor version, with a changelog line.
- Thread
- Add, Remove and Pin run on the game thread; Find, Contains and the counters run on any thread under a shared lock.
Description
The hash a record carries (FBrush::MaskHash) is the key, and a body is accepted under a hash only once: a different body under a held hash is refused (Collision, by a byte compare), so a collision refuses and never desyncs. FTerrainWorld owns one (FTerrainWorld::BrushMasks), so every brush step and every replayed record resolves its mask there; a hash the registry lacks is refused as ESculptRefusal::UnknownMask.
Threads. Add, Remove and Pin run on the game thread; Find, Contains and the counters run on any thread under a shared lock. A mask Find returned stays valid after a Remove, since it is shared.
Budget. The masks' bytes (
FBrushMask::Bytes, mips included) stay within the budget, 64 MiB by default.Pins. A mask stays while a pin on it lives: the world pins every mask an open stroke used until the stroke ends.
Tier 1, plain C++. Masks never enter a save: a game registers them again from its content.
Functions
- FBrushMaskRegistry (2 overloads)
- operator=
- Add
Hold Mask under its hash.
- Remove
Stop holding the mask with this hash, unless a pin holds it.
- Find
The mask with this hash, or null (0 included).
- Contains
Whether a mask with this hash is held; false for 0.
- Pin
Pin the mask with this hash; an empty pin when none is held.
- PinCount
Live pins on the mask with this hash; 0 when none or not held.
- CopyHashes
Every held hash, ascending.
- Count
Masks held. Any thread.
- Bytes
Their bytes, at most
Budget(). Any thread. - Budget
The byte budget. Any thread.