API ReferenceGE Extensionsflowgraphnodesmathsmoothers
Sigmoid Smoother (Flowgraph Node)
- **Node Name:** `Sigmoid Smoother`
Overview
- Node Name:
Sigmoid Smoother - Category:
simple - File:
extensions/flowgraph/nodes/math/smoothers/sigmoid.lua
Provides sigmoid-style temporal smoothing with configurable rate limits and acceleration parameters for both increasing and decreasing signals.
Pin Schema
Input Pins
| Pin | Type | Description |
|---|---|---|
value | number | The target signal value |
dt | number | Delta time for smoothing |
upRateLimit | number | Maximum rate of change when increasing |
downRateLimit | number | Maximum rate of change when decreasing |
upStartAccel | number | Acceleration at the start of an upward transition |
downStartAccel | number | Acceleration at the start of a downward transition |
upStopAccel | number | Deceleration at the end of an upward transition |
downstopAccel | number | Deceleration at the end of a downward transition |
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 | TemporalSigmoidSmoothing object (note: assigned to class, not instance) |
C.oldSet | Tracks previous set value to detect changes |
How It Works
- On init, a
newTemporalSigmoidSmoothing()object is created. - If the
setpin changes, the smoother state is directly set. - If no
valueis provided, the current smoother state is output. - Otherwise, three parameters (rate limit, start accel, stop accel) are selected based on direction.
- The smoother uses
getWithRateAccel(sample, dt, limit, start, stop)for S-curve smoothing.
The sigmoid profile accelerates at the beginning and decelerates at the end of a transition, creating smooth starts and stops.
Lua Example
-- Smooth a UI progress bar with S-curve easing:
-- value = target progress (0-1)
-- dt = frame delta time
-- upRateLimit = 2 (max speed)
-- upStartAccel = 5 (quick start)
-- upStopAccel = 3 (gentle stop)Key Dependencies
newTemporalSigmoidSmoothing()- BeamNG sigmoid temporal smoothing primitiveui_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
- Spring Smoother (Flowgraph Node) - Related reference
- FlowGraph Guide - Guide