8 releases (4 breaking)

0.5.1 Sep 20, 2024
0.5.0 Sep 20, 2024
0.4.1 Aug 2, 2024
0.4.0 Jul 31, 2024
0.1.0 Feb 23, 2024

#14 in #interpolation

Download history 438/week @ 2024-07-30 237/week @ 2024-08-06 234/week @ 2024-08-13 342/week @ 2024-08-20 547/week @ 2024-08-27 499/week @ 2024-09-03 290/week @ 2024-09-10 630/week @ 2024-09-17 742/week @ 2024-09-24 460/week @ 2024-10-01 393/week @ 2024-10-08 270/week @ 2024-10-15 238/week @ 2024-10-22 274/week @ 2024-10-29 752/week @ 2024-11-05 358/week @ 2024-11-12

1,673 downloads per month
Used in bevy_tween

MIT/Apache

85KB
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
  • 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.14 0.3-0.4
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

~10–52MB
~895K SLoC