Orbdale Terrain · OrbdaleTerrainEditor module · class
UOrbdaleTerrainStampTool
Editor onlyPlaces height stamps (EBrushKind::Stamp) of the brush mask picked in the palette.
Declaration
UCLASS()
class UOrbdaleTerrainStampTool : public UInteractiveTool, public IClickDragBehaviorTarget, public IHoverBehaviorTarget- Header
#include "Tools/OrbdaleTerrainStampTool.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
A click places one stamp at the cursor with the settings' radius and the mask's angle; a click-drag past a few pixels puts the centre at the press and sets the radius to the drag's length and the angle to its direction, live, and the release places it; Esc during a drag restores both and places nothing, and Esc while a stamp waits for its ground drops it. Each stamp goes through FOrbdaleTerrainStampHold: it waits, without blocking, for editable ground under its whole extent and lands as one undo record (AppendChange from a click or a tick, never from a transaction handler).
Before the click the result shows twice, with the stamp's footprint and orientation: a shaded, translucent mesh at the edit cell, or every 2nd, 4th... post on a big stamp (the console variable Orbdale.Terrain.Stamp.PreviewPoints caps its vertices, 0 turns it off), and its contour, the 65 × 65 wire ghost (EvaluateStampPreview over the sampled ground). One worker build (FOrbdaleTerrainStampPreview) makes both over one ground snapshot when the stamp or the ground changes, so a drag shows them a build behind the cursor and the game thread only draws; the mesh is gone from the click until the stamp changes. What the stamp would cut below today's ground draws through it: the wire in red-orange, the mesh hatched. [ ] scale the radius, , . turn the mask by 15 degrees, Ctrl+wheel by 5. The mode routes the keys.
Game thread, editor only. Tier 3.
Types
- EAction enum
Action ids of the hotkeys (RegisterActions).
RadiusDown, RadiusUp, AngleDown, AngleUp, AngleFineDown, AngleFineUp, CancelStamp
Functions
- Init
- Setup
- Shutdown
- OnTick
- OnPropertyModified
- Render
- DrawHUD
- RegisterActions
- CanBeginClickDragSequence
- OnClickPress
- OnClickDrag
- OnClickRelease
- OnTerminateDragSequence
- BeginHoverSequenceHitTest
- OnBeginHover
- OnUpdateHover
- OnEndHover
- SetCursorAt
Put the cursor at Location_cm (world cm; the ground's height is taken), for captures and scripted stamps.
- PressAt
Scripted press at Location_cm: the same path as the mouse.
- DragTo
Scripted drag to Location_cm: past kDragWorld_m it sizes and turns the stamp.
- Release
Scripted release: places the stamp.
- CancelStampOrDrag
Esc: end a drag without stamping (restoring radius and angle), else drop a stamp waiting for its ground.
- TurnMask
Turn the mask by Delta degrees, as the comma and period keys do.
- ScaleRadius
Scale the radius by Factor, as
[and]do. - MakeStampBrushstatic
The Stamp brush the settings make at Centre_cm: the one conversion the tool, the editor library and the tests share.
- GetStampAtCursor
The stamp this tool would place at the cursor now; false without a baked mask or a cursor.
- GetProperties
- GetMaskProperties
- GetHold
- SetExtensionTargets
Registry ids of extension brush targets (V1 or V2) that the next stamps also drive: a V2 target receives the stamp as one dab with the mask, its angle and StampHeight_m.
- IsPressed
Whether a press is held (a click not released yet, or a drag).
- IsDragging
Whether the held press has become a drag that sizes and turns the stamp.
- GetStampsAppended
Stamps whose undo record this tool appended.
- GetGhost
The wire ghost drawn: the last build's (empty, Side 0, before the first build is collected or with no stamp).
- GetLastGhostMs
Worker milliseconds of the wire ghost drawn: ground sampling, EvaluateStampPreview, its cuts and its lines.
- GetLastWireDrawMs
Game-thread milliseconds the last Render spent drawing the wire ghost's lines.
- GetSurface
The preview: its component, the mesh shown, the wire and its builds.
- FlushSurface
Wait for the preview's build in flight and show it, the wire with the mesh: for tests and captures.
- GetLastPreviewMs
Game-thread milliseconds of the last preview update that rebuilt or handed anything over: the outline and the preview's launch and collection.
- GetHudLines
The HUD's lines as drawn this frame: for tests and captures.
Properties
| Name | Type | Default | Meaning |
|---|---|---|---|
k | float | 4.f | Screen pixels a press must move before it becomes a drag that sizes and turns the stamp. |
k | double | 1.0 | World metres a scripted drag must move before it sizes and turns the stamp. |