Rename Bezier
to CubicBezier
for clarity
#9554
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Objective
A Bezier curve is a curve defined by two or more control points. In the simplest form, it's just a line. The (arguably) most common type of Bezier curve is a cubic Bezier, defined by four control points. These are often used in animation, etc. Bevy has a Bezier curve struct called
Bezier
. However, this is technically a misnomer as it only represents cubic Bezier curves.Solution
This PR changes the struct name to
CubicBezier
to more accurately reflect the struct's usage. Since it's exposed in Bevy's prelude, it can potentially collide with otherBezier
implementations. While that might instead be an argument for removing it from the prelude, there's also something to be said for adding a more generalBezier
into Bevy, in which case we'd likely want to use the nameBezier
. As a final motivator, not only is the struct located incubic_spines.rs
, there are also several other spline-related structs which follow theCubicXxx
naming convention where applicable. For example,CubicSegment
represents a cubic Bezier curve (with coefficients pre-baked).Migration Guide
Bezier
references toCubicBezier