bevyengine / bevyengine/bevy

Unify linear interpolation traits

Open
#19,848 3 comments 0 reactions 0 assignees View on GitHub
A-Animation A-Math C-Code-Quality
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

In Bevy, there are two traits with methods for linear interpolation:

* [`bevy_aniumation::animatable::Animatable`](https://docs.rs/bevy_animation/latest/bevy_animation/animatable/trait.Animatable.html)
* [`bevy_math::common_traints::StableInterpolate`](https://docs.rs/bevy_math/latest/bevy_math/common_traits/trait.StableInterpolate.html)

The former has an `interpolate` method, and the latter has `interpolate_stable` method, with the same signature. They also have different requirements (former wants `Reflect` and also `fn blend` implementation, latter needs it to be *stable* interpolation).

It might be a good idea to have a single general "interpolatable" trait, either unifying all of these properties into one, or as a supertrait of both.

(I apologize for using the non-fancy blank issue template; none of the others felt like they fit, since this isn't really a feature request nor a bug with Bevy)

Contributor guide

Open the contributing guide

Research direction

Read the Animatable trait in bevy_animation::animatable and StableInterpolate in bevy_math::common_traits first, comparing their methods and requirements. Decide whether a unified trait or a supertrait best fits Bevy's API, then confirm the relevant tests and documentation cover the chosen design.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.