https://github.com/villor/bevy_lookup_curve
Editable lookup curve for Bevy
https://github.com/villor/bevy_lookup_curve
Last synced: 14 days ago
JSON representation
Editable lookup curve for Bevy
- Host: GitHub
- URL: https://github.com/villor/bevy_lookup_curve
- Owner: villor
- License: apache-2.0
- Created: 2024-02-16T19:19:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-16T23:56:05.000Z (about 1 month ago)
- Last Synced: 2025-03-29T01:11:26.670Z (21 days ago)
- Language: Rust
- Homepage:
- Size: 121 KB
- Stars: 57
- Watchers: 2
- Forks: 5
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
- awesome-bevy - `bevy_lookup_curve`
README
# bevy_lookup_curve 📈
[
](https://github.com/villor/bevy_lookup_curve)
[](https://crates.io/crates/bevy_lookup_curve)
[](https://docs.rs/bevy_lookup_curve)
[](https://github.com/emilk/egui/blob/master/LICENSE-MIT)
[](https://github.com/emilk/egui/blob/master/LICENSE-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 mathIf you have used AnimationCurve in Unity, this would be an attempt at something similar for Bevy.
## Features
- [x] `LookupCurve` type with modifiable knots and tangents. Three types of interpolation: Constant, Linear, and Cubic
- [x] `LookupCurve` implements `bevy_math::Curve` to fit into the ecosystem, giving access to resampling and other conveniences.
- [x] Asset loader and save functionality
- [x] `egui`-based editor
- [x] Integration with [bevy-inspector-egui](https://github.com/jakobhellermann/bevy-inspector-egui) for quick and easy tweakinghttps://github.com/villor/bevy_lookup_curve/assets/7102243/180aed95-ca9a-4e3b-97c4-2516055ea648
## Usage
See [examples](https://github.com/villor/bevy_lookup_curve/tree/main/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](https://github.com/emilk/egui)-based editor|
|**editor_bevy**|**Yes**|ECS component for convenient spawning of editor windows inside Bevy|
|**inspector-egui**|No|Integration with [bevy-inspector-egui](https://github.com/jakobhellermann/bevy-inspector-egui)|## Bevy support
|bevy|bevy_lookup_curve|
|---|---|
|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:
* MIT License ([LICENSE-MIT](LICENSE-MIT) or [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT))
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0))