Orbdale Terrain · OrbdaleTerrainEditor module · class
UOrbdaleTerrainBrushTool
Editor onlyOne class for every brush: a click-drag stroke on the analytic ground, with a preview ring and a HUD.
Declaration
UCLASS()
class UOrbdaleTerrainBrushTool : public UInteractiveTool, public IClickDragBehaviorTarget, public IHoverBehaviorTarget- Header
#include "Tools/OrbdaleTerrainBrushTool.h"- Module
PublicDependencyModuleNames.Add("OrbdaleTerrainEditor");in an editor module’s Build.cs: an editor module, not in packaged games.- Stability
- Stable: changes within a major version only add.
- Thread
- Game thread, editor only.
- Derives from
UInteractiveTool,IClickDragBehaviorTarget,IHoverBehaviorTarget
Description
Height tools (Raise, Smooth, Flatten) and paint tools (kind Paint: a layer, the ground class or holes, by UOrbdaleTerrainPaintProperties::Target) share the stroke, the hotkeys, the preview and the undo record. Paint takes the layer's colour from the layer table; holes draw a dashed ring.
The cursor is RaycastGround, so it hits exactly the ground a stroke changes, with or without collision. Strokes go through FOrbdaleTerrainBrushStroke and the built-in FOrbdaleTerrainSculptHeightTarget, so a stroke here is a stroke in the tests. Each stroke is one editor transaction (FOrbdaleTerrainStrokeChange through AppendChange, never EmitObjectChange, so it outlives the tool). Shift inverts; [ ] scale the radius, Ctrl+[ ] the strength and Ctrl+Shift+[ ] the falloff; Ctrl+click in Flatten picks the target. The mode routes the keys (InputKey).
A brush mask (UOrbdaleTerrainBrushMaskProperties: the palette, the angle, rotation mode, jitter, mirror and footprint) shapes every dab: the tool registers it with the terrain when a stroke begins, the preview draws its 50 % contour and its rotated square, and , . turn it by 15 degrees, Ctrl+wheel by 5.
Game thread, editor only. Tier 3.
Types
- EAction enum
Action ids of the hotkeys (RegisterActions).
RadiusDown, RadiusUp, StrengthDown, StrengthUp, FalloffDown, FalloffUp, AngleDown, AngleUp, AngleFineDown, AngleFineUp
Functions
- Init
- Setup
- Shutdown
- OnTick
- Render
- DrawHUD
- RegisterActions
- OnPropertyModified
- CanBeginClickDragSequence
- OnClickPress
- OnClickDrag
- OnClickRelease
- OnTerminateDragSequence
- OnUpdateModifierState
- BeginHoverSequenceHitTest
- OnBeginHover
- OnUpdateHover
- OnEndHover
- FinishStroke
Close an open stroke now and append its transaction: before an undo, a tool switch or the terrain going away.
- IsStrokeOpen
Whether a stroke is open (dragging, or released and waiting for ground).
- SetExtensionTargets
Registry ids of extension brush targets (V1 or V2) that the next strokes also drive: V2 targets receive the mask and each dab's resolved angle, V1 targets the plain dab.
- SetCursorAt
Put the brush at Location_cm (world cm, Z ignored; the ground's height is taken) as if the cursor hovered there: for captures and scripted strokes, without a viewport.
- PressAt
Scripted press, drag to Location_cm and release (captures, scripted strokes): the same path as the mouse.
- DragTo
- ReleaseStroke
- GetKind
- GetProperties
- IsPaintTool
Whether this is a paint tool (kind Paint): GetPaintProperties is set.
- GetPaintProperties
- GetMaskProperties
The brush mask settings: Disc or a brush asset, and how each dab turns it.
- GetContourCache
The contour cache of the mask preview: GetComputeCount says how often a contour was traced.
- GetPreviewContour
The contour segments drawn this frame, world cm (pairs of points); empty without a strength mask.
- GetPreviewColor
The colour the preview draws this frame, before the red of unloaded or refused ground.
- IsPreviewDashed
Whether the brush ring is dashed this frame (Holes).
- GetTarget
- GetHudLines
The HUD's lines as drawn this frame: for tests and captures.
- MakeBrushSettingsstatic
The target settings a brush of Kind takes from the tool's property sets: the one conversion the tool and the editor library (
UOrbdaleTerrainEditorLibrary) share, so a scripted stroke is the tool's stroke. - RegisterMaskstatic
Register Mask's brush asset with Terrain, so a stroke may name it; Disc needs nothing.
- TurnMask
Turn the brush mask by Delta degrees, as the comma and period keys do.
- CanPaintstatic
Whether the project's author limits let a paint tool write what Paint names (holes, the ground class, a layer the layer table has).
Properties
| Name | Type | Default | Meaning |
|---|---|---|---|
k | int32 | 1 | Modifier ids of the tool's behaviours. |
k | int32 | 2 | — |
k | double | 15.0 | Degrees the comma and period keys turn a brush mask by; Ctrl+wheel turns it by kFineAngleStep_deg. |
k | double | 5.0 | — |