Skip to content
Brass Orrery

Orrery Terrain · OrreryTerrainCore module · function

Native::

CheckSculptCommand

Experimental

Check a command against the record format and the limits, touching nothing.

Declaration

ESculptRefusal CheckSculptCommand(const FSculptCommand& Command, const FSculptLimits& Limits,
                                                          const FTerrainGrid* Grid = nullptr,
                                                          const FBrushMaskRegistry* Masks = nullptr);
Header
#include "Native/SculptCommand.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
Pure, any thread (Masks is read under its shared lock).

Description

Rules, in order: the version; a command kind (never a patch kind); a non-zero stroke. For a Brush only: every field DecodeSculptCommand accepts (a known brush kind, falloff, flatten direction, mask flag bits and stamp blend, a non-zero aspect, the mask fields at their defaults without a mask, and Add on every kind but Stamp), else BadKind; a non-zero Radius_mm, at most MaxStampRadius_mm for a Stamp (StampTooLarge, as is any Stamp without bStamps) and MaxRadius_mm for every other brush; the centre within ±kSculptMaxCentre_mm; then for PaintChannel the channel and value (Channels::GroundClass only with bPaintGroundClass, below kGroundClasses, and kHoleClass only with bPaintHoles; any other channel, the paint channels of IsPaintOnlyChannel included, is unknown), for Paint a PaintLayer up to MaxPaintLayer (any opacity), for a Stamp |Strength_mm| <= MaxStampHeight_mm and, with Grid, BrushTileCount <= MaxStampTiles, and for another height brush |Strength_mm| <= MaxStrength_mm. Last, the mask: a Stamp naming no mask is UnknownMask, and a brush naming a mask Masks does not hold is UnknownMask. KeepOutMargin_mm refuses nothing: FTerrainWorld applies it as a guard.

FTerrainWorld's brush calls pass its grid and registry whenever they are given limits, so the tile rule holds on every applied step, replays included (FSculptReplayer applies through them).

Parameters

NameTypeDefaultMeaning
Commandconst FSculptCommand&—

The record to check, as the authority would apply it.

Limitsconst FSculptLimits&—

The authority's rules.

Gridconst FTerrainGrid*nullptr

The terrain's grid, for the Stamp tile limit; null skips that one rule.

Masksconst FBrushMaskRegistry*nullptr

The terrain's mask registry (FTerrainWorld::BrushMasks); null holds no mask, so every brush naming one is UnknownMask.

Returns

None when the authority may apply it; otherwise the first rule it breaks.

Note.

Pure, any thread (Masks is read under its shared lock).