Skip to content
Brass Orrery

Orrery Terrain · OrreryTerrainCore module · struct

Native::

FBrushMaskDab

Experimental

One dab's sampler state, prepared once per dab by PrepareBrushMaskDab and read per post.

Declaration

struct FBrushMaskDab
Header
#include "Native/BrushMask.h"
Module
PublicDependencyModuleNames.Add("OrreryTerrainCore"); in your module’s Build.cs.
Stability
Experimental: supported, may change in a minor version, with a changelog line.

Description

A post's offset from the brush centre (mm) becomes the mask's local position in Q16 millimetres (Local), then M (SampleBrushMask). Every step is integer, and a post's value depends on its offset alone, never on the window or the order the posts are visited in.

Functions

  • Local

    The mask's local position of a post at offset (Dx_mm, Dy_mm) from the brush centre: rotated by -MaskAngle, mirrored when asked, in Q16 millimetres (floored).

  • SquareT_q16

    The square footprint's normalised distance in Q16: max(|X| / HalfX, |Y| / HalfY), at most 65536, with no root.

Properties

NameTypeDefaultMeaning
Maskconst FBrushMask*nullptr—
Texelsconst uint16_t*nullptr

The sampled level's u.

Sideint32_t0

Samples per side of the sampled level.

Leveluint32_t0—
Cos_q30int64_tint64_t(1) << 30—
Sin_q30int64_t0—
bMirrorboolfalse—
bBicubicboolfalse

kBrushMaskBicubic: sampled by the Catmull-Rom cubic instead of bilinearly (SampleBrushMask).

HalfX_mmint64_t0

The mask's half-sides on the ground (BrushMaskHalfSides): the aspect ratio scales the mask before the rotation.

HalfY_mmint64_t0—
HalfX_q16int64_t0—
HalfY_q16int64_t0—
Tol_q16int64_t0

How far outside the half-sides a position still counts as inside: covers the CORDIC's error.

ScaleXint64_t0

Level samples per Q16 mm along local X, << kBrushMaskScaleShift.

ScaleYint64_t0—
InvHalfXint64_t0

2^kBrushMaskInvShift / HalfX_mm, rounded.

InvHalfYint64_t0—