#bevy #curve #lookup #assets #cubic #editor

bevy_lookup_curve

Editable lookup curve for Bevy

12 releases (breaking)

new 0.9.0 May 5, 2025
0.8.0 Mar 16, 2025
0.7.0 Jan 31, 2025
0.6.0 Dec 3, 2024
0.1.0 Feb 23, 2024

#186 in Game dev

Download history 252/week @ 2025-01-19 258/week @ 2025-01-26 399/week @ 2025-02-02 179/week @ 2025-02-09 169/week @ 2025-02-16 697/week @ 2025-02-23 616/week @ 2025-03-02 346/week @ 2025-03-09 476/week @ 2025-03-16 270/week @ 2025-03-23 357/week @ 2025-03-30 596/week @ 2025-04-06 188/week @ 2025-04-13 285/week @ 2025-04-20 259/week @ 2025-04-27 526/week @ 2025-05-04

1,258 downloads per month
Used in bevy_tween

MIT/Apache

86KB
1.5K SLoC

bevy_lookup_curve 📈

github Latest version Documentation MIT Apache

Editable lookup curve for Bevy that can be used for many things, for example:

  • Animation
  • Gameplay progressiom (control different aspects over time or other variables)
  • Physics (for example: tweakable feel on a character controller)
  • Probability control (for item drops etc)
  • Shaders
  • ... just about anything where you need a formula (x -> y) that you can fine tune, with a GUI instead of diving into math

If you have used AnimationCurve in Unity, this would be an attempt at something similar for Bevy.

Features

  • LookupCurve type with modifiable knots and tangents. Three types of interpolation: Constant, Linear, and Cubic
  • LookupCurve implements bevy_math::Curve<f32> to fit into the ecosystem, giving access to resampling and other conveniences.
  • Asset loader and save functionality
  • egui-based editor
  • Integration with bevy-inspector-egui for quick and easy tweaking

https://github.com/villor/bevy_lookup_curve/assets/7102243/180aed95-ca9a-4e3b-97c4-2516055ea648

Usage

See examples for now

Feature flags

Feature Default Description
serialize Yes Enable serde serialization/deserialization for the LookupCurve
ron Yes Enable loading/saving the curve as a ron file
bevy_reflect Yes Implement Reflect on most types in the crate
bevy_asset Yes Implement AssetLoader for LookupCurve
editor_egui Yes Enables the egui-based editor
editor_bevy Yes ECS component for convenient spawning of editor windows inside Bevy
inspector-egui No Integration with bevy-inspector-egui

Bevy support

bevy bevy_lookup_curve
0.16 0.9
0.15 0.6-0.8
0.14 0.3-0.5
0.13 0.1-0.2

Using without Bevy

This crate can be used without Bevy as well (except for bevy_math which is a core dependency).

Just set default-features = false. And enable serialize, ron, and/or editor_egui if needed.

See the egui_only example. It can also be used as a standalone curve editor.

Contributing

Contributions are welcome. Feel free to make a PR!

License

Dual-licensed under either:

Dependencies

~11–54MB
~1M SLoC