Orrery Terrain · OrreryTerrainEditor module · class
FOrreryTerrainStampPreview
Editor onlyThe Stamp tool's preview: asks a worker for a FOrreryTerrainStampMesh and its FOrreryTerrainStampWire when the stamp or the ground changes, shows each finished mesh on a transient actor's UOrreryTerrainStampPreviewComponent and keeps the wire for the tool to draw.
Declaration
class FOrreryTerrainStampPreview- Header
#include "Tools/OrreryTerrainStampPreviewMesh.h"- Module
PublicDependencyModuleNames.Add("OrreryTerrainEditor");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.
Description
Update rebuilds only when the stamp (centre, radius, angle, mirror, footprint, height, base, blend, falloff), the cell, the point budget or the ground's revision changed. One build runs at a time; a newer stamp waits for it and then the newest request runs, and every finished build is shown, so a drag shows the stamp a build behind the cursor. The game thread only compares, launches and hands builds over; the worker samples the ground through one FGroundQuery snapshot (lock-free), runs EvaluateStampPreview for the wire and EvaluateStampPreviewPosts in bands for the mesh, and marks the cuts of both. Hide clears the mesh after a click until the stamp changes; meanwhile a change of the ground rebuilds the wire alone, so it shows the next stamp over the stamped ground. A budget of 4 points or fewer builds the wire alone. Hide and Clear drop the build in flight, Clear the wire too; Destroy (tool exit) waits for it and destroys the actor. The destructor only waits: a tool calls Destroy from its Shutdown.
Game thread, editor only. Tier 3.
Functions
- FOrreryTerrainStampPreview (2 overloads)
- operator=
- Update
Ask for the preview of Stamp over Terrain; shows any build that finished since the last call.
- Collect
Show a build that finished since the last call; launch the newest request when one waits.
- Hide
Draw nothing until the stamp changes (after a click: the stamp's own result replaces its preview).
- Clear
Draw nothing, the wire included, and forget the request (no stamp under the cursor).
- Flush
Wait for the build in flight and the newest request, and show the result: for tests and captures.
- Destroy
Wait for the build in flight and destroy the actor: tool exit.
- GetComponent
The component; null before the first build or after Destroy.
- GetShown
The mesh drawn; null when nothing is.
- GetWire
The wire ghost of the last build shown: the tool draws it.
- GetBuilds
Builds launched since this was made.
- IsBuilding
Whether a build is running.
- IsHidden
Whether Hide holds the preview back.
- GetLastGameMs
Game-thread milliseconds of the last Update (comparing, launching, collecting, handing over).
Properties
| Name | Type | Default | Meaning |
|---|---|---|---|
k | const TCHAR* const | — | Name prefix of the transient actor the component lives on. |