Skip to content
Brass Orrery

Orrery Terrain · OrreryTerrainEditor module · class

FOrreryTerrainFeaturePlacement

Editor only

Commit an editor feature (an add, or a replace in place when its Id is set) or remove one, as soon as the terrain can take it, without blocking.

Declaration

class FOrreryTerrainFeaturePlacement
Header
#include "Tools/OrreryTerrainFeaturePlacement.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

The bases a feature's bake reads reach past any cover sized to its footprint: its blocks of up to 4 edit tiles and their apron (the longest daylight plus 16 m). A commit the terrain finds Pending requests them, but only its own transaction pins them, so the streamer drops the loads as stale once the refused commit returns, and an editor with no camera over them (a headless one, or a viewport looking elsewhere) never keeps them. So while Check answers Pending, a transaction that staged the feature is held: it is never committed, but it pins and requests every base the commit needs for as long as the placement waits. Each Step checks again and commits once Check answers Ok. A refusal while every base is resident (cold sculpt pages being read back) is retried for kColdRetry_s; any other refusal is final, and so is a wait past kGroundWait_s (the last try commits or refuses). A terrain re-created or removed while it waits refuses it.

A removal (BeginRemove) waits the same way for the bases under the removed feature's footprint (CheckRemove), and GetFeatureId then names the removed feature.

The commit takes the editor follow (BeginEdit just before it, FinishEdit just after), so TakeChange returns the one record that undoes the feature and the instances that followed it. The caller appends it as one editor transaction.

Note.

Game thread, editor only. Tier 3. Ticking the terrain is the caller's: the editor ticks it every frame.

Functions

  • FOrreryTerrainFeaturePlacement (2 overloads)
  • operator=
  • Begin

    Begin placing Feature on Terrain and try at once.

  • BeginRemove

    Begin removing the feature Id from Terrain and try at once.

  • Step

    Check again and commit when the ground is loaded.

  • Cancel

    Drop a pending placement and release the ground it holds.

  • Reset

    Back to Idle once the result has been read (a pending placement is cancelled).

  • GetState
  • IsPending
  • GetWaited_s

    Seconds since Begin.

  • IsRemoval

    True while a removal is begun or done, false for an add or replace.

  • GetFeatureId

    The placed feature's id once Committed (the new id of an add; the removed id of a removal), else 0.

  • GetRefusal

    Why it was refused; empty unless Refused.

  • GetEarthworks

    The earthworks evaluated just before the last commit try (Begin's bEvaluate), else empty.

  • GetLabel
  • TakeChange

    The committed edit's undo record, the follow's wrapped in; null unless Committed, and after it was taken once.

Properties

NameTypeDefaultMeaning
kGroundWait_sdouble60.0

How long a placement waits for the ground before its last try, seconds.

kColdRetry_sdouble2.0

How long a refusal with every base resident is retried, seconds.