API ReferenceGE Extensionsflowgraphnodesmathsmoothers
Spring Smoother (Flowgraph Node)
- **Node Name:** `Spring Smoother`
Overview
- Node Name:
Spring Smoother - Category:
simple - File:
extensions/flowgraph/nodes/math/smoothers/spring.lua
Provides spring-damper temporal smoothing for a numeric signal, with separate spring/damp parameters for increasing and decreasing directions.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
value | number | The target signal value |
dt | number | Delta time for smoothing |
upSpring | number | Spring stiffness when value is increasing |
downSpring | number | Spring stiffness when value is decreasing |
upDamp | number | Damping when value is increasing |
downDamp | number | Damping when value is decreasing |
set | number | Directly set the smoother's internal state |
Output Pins
| Pin | Type | Description |
|---|---|---|
value | number | The smoothed output value |
Internals
| Field | Purpose |
|---|---|
C.smoother | Smoothing object (uses newTemporalSigmoidSmoothing internally) |
C.oldSet | Tracks previous set value to detect changes |
How It Works
- On init, a smoothing object is created (note: uses
newTemporalSigmoidSmoothingwhich supports spring-damp viagetWithSpringDamp). - If the
setpin changes, the smoother state is directly set. - If no
valueis provided, the current state is output. - Otherwise, spring and damp parameters are selected based on direction.
- The smoother uses
getWithSpringDamp(sample, dt, spring, damp)- physics-based spring-damper smoothing that can overshoot.
Spring smoothing produces natural-feeling motion with potential oscillation, unlike the other smoothers which are monotonic.
Lua Example
-- Bouncy camera follow height:
-- value = target height
-- dt = frame delta time
-- upSpring = 10, upDamp = 0.5 (bouncy upward)
-- downSpring = 8, downDamp = 0.8 (less bouncy downward)Key Dependencies
newTemporalSigmoidSmoothing()- used for itsgetWithSpringDamp()methodui_imgui- displays smoother state in the node editor_flowgraph_createNode()- standard flowgraph node registration
Additional Methods
C:checkSetValue()
Node method.
C:drawMiddle(builder, style)
Custom ImGui drawing in the middle section of the node in the editor.
Parameters:
builderstyle
C:work()
Main work function called each frame/tick when the node is active.
See Also
- Linear Smoother (Flowgraph Node) - Related reference
- Nonlinear Smoother (Flowgraph Node) - Related reference
- Sigmoid Smoother (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide