Skip to content

Add smoothing transition for value changes to simulate inertia and slow pointers#15

Open
tigert wants to merge 1 commit into
OpenAttitude:mainfrom
tigertfly:feat/core-use-smoothed-value
Open

Add smoothing transition for value changes to simulate inertia and slow pointers#15
tigert wants to merge 1 commit into
OpenAttitude:mainfrom
tigertfly:feat/core-use-smoothed-value

Conversation

@tigert

@tigert tigert commented Jun 10, 2026

Copy link
Copy Markdown

Problem to solve
Simulator data sent from an API often reflects values from the simulator flight model, but gauges with physical pointers often have inertia and react slower to value changes. Mechanical simulated gauges of course have the same restrictions that play to their advantage in this case. You sometimes want to simulate this also on digital on-screen gauges.

This PR adds the built-in Vue transition function to core, that seems to do a pretty OK job at simulating inertia on gauge pointers and also value labels that seem to change at more constant flow. It uses the easeOutExpo transition and depending on the duration, it can feel quite good.

This is also especially useful if you want to simulate electrical instruments when the aircraft battery switch is turned on or off, the pointers drift towards zero quite realistically even if your flight model electrical system does not simulate voltage decay :-)

Recording.2026-06-10.174705.mp4

New files:

  • index.ts, useSmoothedValue.ts in packages/core/src/animation: Use Vue's built-in transition to return a smoothed change of the value over time. Duration of 0 means no smoothing happens..
  • packages/core/src/index.ts: export useSmoothedValue from core.

…pointers etc. Simulator flight model data might give you instant values, while physical gauges have delay and inertia.

New files:
-index.ts, useSmoothedValue.ts in packages/core/src/animation: Use Vue's transition to return a smoothed change of the value over time. Duration of 0 means no smoothing happens..
- packages/core/src/index.ts: export useSmoothedValue from core.
@tigert

tigert commented Jun 10, 2026

Copy link
Copy Markdown
Author

I could also just do this in a gauge, but I figured this might be useful for the framework in general.

In any case I wanted to say "hello" after our chat at FSWeekend, so I might as well bring a PR along. Let me know what you think.

I added that slider to the RPM testbed only locally, since I wanted to keep the patch minimal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant