Skip to content
Brass Orrery

Orrery Terrain · OrreryTerrain module · class

UOrreryTerrainSculptComponent

Turns a player's pointer into sculpt strokes: the sample input component for player sculpting, shaped like rail's URailConstructionInputComponent.

Declaration

UCLASS(Blueprintable, ClassGroup=(Orrery), meta=(BlueprintSpawnableComponent),
       HideCategories=(Variable, Tags, ComponentReplication, Activation, Cooking, AssetUserData))
class UOrreryTerrainSculptComponent : public UActorComponent
Header
#include "OrreryTerrainSculptComponent.h"
Module
PublicDependencyModuleNames.Add("OrreryTerrain"); in your module’s Build.cs.
Stability
Stable: changes within a major version only add.
Thread
Game thread.
Derives from
UActorComponent
Blueprint
“Orrery Terrain Sculpt Component”, a Blueprint type; Blueprints can derive from it

Description

Drop it on a PlayerController and bind the verbs to input. While a drag is held it resolves the cursor every tick with the terrain's analytic raycast (never a physics trace, so it can hit nothing but ground), and applies brush steps at a fixed StepRateHz, whatever the frame rate: the strength is per step, so a 30 fps and a 144 fps player move the same earth per second.

⚑ It binds no keys. The plugin owns the meaning of input; the game owns its capture.

Authority seam. With bRouteCommandsExternally, a step raises OnCommandRequested with the encoded request instead of applying it; the game sends it to the server, whose subsystem applies it with ApplySculptRecord and broadcasts the authority's record to every replica. On a replica under the built-in replication (UOrreryTerrainNetSubsystem) the component routes its steps, undo and redo to the server by itself, without the flag.

One Ctrl+Z across tools is the game's to build: undo goes to the tool the player used last. Keep a "who edited last" marker, and send Ctrl+Z to that tool's Undo(). The component builds no global history.

Cold ground (G7a). A step whose ground is still loading (the subsystem answers Pending) is queued, never dropped: the component keeps the steps in order and retries the oldest on later ticks until it applies, then drains the rest, at most OrreryTerrain.Sculpt.QueueDrainPerTick per tick. While anything waits, every later verb (a step, the release, the next press, Undo, Redo) queues behind it, so a stroke on cold ground ends in the same StateHash as on resident ground; the release closes the stroke once its steps are in. Limits, each logged once per stroke: at OrreryTerrain.Sculpt.QueuedStepsMax steps the stroke stalls (steps due while the queue is full are not taken, as when the cursor leaves the ground); if the oldest step waits OrreryTerrain.Sculpt.QueueTimeout seconds, the waiting steps are given up and the stroke closes; EndPlay applies what it can and gives up the rest. Local strokes only: a routed request is the authority's to apply.

Note.

Game thread. World positions are Unreal units (cm); the subsystem converts to the terrain's fixed point once, on the authority.

Functions

Properties

NameTypeDefaultMeaning
CursorSourceBlueprintReadWriteEOrreryTerrainCursorSourceEOrreryTerrainCursorSource::MouseCursor—
TraceDistanceBlueprintReadWritedouble1.0e6

Ray length, cm.

BrushBlueprintReadWriteFOrreryTerrainBrushBP—

The brush applied at the cursor.

Centre is overwritten each step; Radius and Strength are cm.

StepRateHzBlueprintReadWritefloat30.f

Brush steps per second while dragging; Strength is per step.

StepModeBlueprintReadWriteEOrreryTerrainStepModeEOrreryTerrainStepMode::Rate

Whether steps come at StepRateHz or by distance travelled (Spacing).

Masked brushes read better with Spacing.

SpacingBlueprintReadWritedouble0.25

Spacing mode: the distance between steps as a fraction of the brush radius (0.25 puts four dabs in one radius).

RotationModeBlueprintReadWriteEOrreryTerrainMaskRotationEOrreryTerrainMaskRotation::Fixed

How each dab turns its mask; Brush.MaskAngle is the base.

RandomAngleRangeBlueprintReadWritedouble180.0

Random rotation: each dab's angle is Brush.MaskAngle plus or minus up to this many degrees (180 turns the mask any way).

bFlattenToCursorAtStartBlueprintReadWritebooltrue

Flatten and Stamp: take the target height from the ground under the cursor when the drag begins.

bRouteCommandsExternallyBlueprintReadWriteboolfalse

Raise OnCommandRequested instead of applying steps here.

Undo and Redo are requests too.

OnCommandRequestedBlueprintAssignableFOnOrreryTerrainSculptRecordBP—

An encoded sculpt request (begin, step, end, undo or redo), for the game to send to the server.

Blueprint