class

FWaterCarveDebounce

Decides when an automatic terrain re-carve should follow a spline edit.

Module
Game
Header
#include "Water/WaterCarveDebounce.h"
Namespace
Mowo

A carve rewrites a heightfield region, refits collision and pushes an undo record, so running one per dragged frame is both a stall and an undo stack a designer cannot walk back through. Running one only on a button is the state this shipped in, where the river and its bed silently disagree until someone remembers. The middle is a debounce: every edit re-arms the timer, and the carve runs once the edits stop.

It is a pure decision — no clock of its own, no terrain, no transaction — so the rule is testable headlessly and the panel that owns the carve keeps owning it.

Properties

TypeNameDescription
static constexpr floatkDefaultDelaySecondsSeconds of quiet after the last edit before the carve runs. Long enough that releasing a handle to grab the next one is still one edit, short enough that the bed follows the water while the designer is still looking at it. Default 0.5f.

Public functions

ReturnsNameDescription
voidSetDelaySeconds
floatGetDelaySeconds
voidTouchAn edit landed.
boolIsPending
boolConsumeTrue exactly once per settled burst of edits.
voidCancelDrops a pending carve without running it — the body was deleted, the tool was disarmed, or the edit it belonged to was undone.

Function details

SetDelaySeconds

C++
void SetDelaySeconds(float seconds)

GetDelaySeconds

C++
float GetDelaySeconds() const

Touch

C++
void Touch(float nowSeconds)

An edit landed. Re-arms the timer whether or not one was already pending — a drag is hundreds of these and must produce one carve at the end, not one per frame.

IsPending

C++
bool IsPending() const

Consume

C++
bool Consume(float nowSeconds)

True exactly once per settled burst of edits. Consuming the pending flag here rather than leaving it to the caller is deliberate: a caller that forgot to clear it would re-carve every frame forever, which is the failure this class exists to prevent.

Cancel

C++
void Cancel()

Drops a pending carve without running it — the body was deleted, the tool was disarmed, or the edit it belonged to was undone.

Generated from Water/WaterCarveDebounce.h via game.json · Nov 5, 2026Version 1.0.0