Adding a bezier curve example#8194
Conversation
Co-authored-by: ira <[email protected]>
|
Do we have any guidance on what level of features should get examples? I have a bunch of example code for cubic curves, but wasn't sure if it would be valuable outside of a higher-level context, e.g. general animation or shape rendering. |
aevyrie
left a comment
There was a problem hiding this comment.
Some small changes, but otherwise looks good. Would it be more precise to call this cubic_curve? The techniques shown here can be applied to any of Bevy's supplied cubic curves, not just Beziers.
Co-authored-by: Aevyrie <[email protected]>
|
Changed the example name to |
aevyrie
left a comment
There was a problem hiding this comment.
I think this is a nice addition as-is. I've included some nits, but wouldn't block on them.
| // position takes a point from the curve where 0 is the initial point | ||
| // and 1 is the last point |
There was a problem hiding this comment.
I'd remove this comment to avoid duplicating the docs. I'd also prefer using t instead of step, as it is the standard input into a parametric function, and is what is used in the docs: https://docs.rs/bevy/latest/bevy/math/cubic_splines/struct.CubicCurve.html#method.position
As above, this is a pretty minor nit, and could be ignored.
There was a problem hiding this comment.
Good point for t instead of step, however, I'd keep the comment even though it's duplicating the docs to avoid any confusion the user would have.
There was a problem hiding this comment.
I very much like keeping the duplicative comment here :) The information is important and relevant here.
@aevyrie I would be happy to see these in |
|
@Kjolnyr I couldn't get pushing to your branch to cooperate: can you remove the empty |
|
That's probably because I synced my fork with bevy's current main, sorry for that. I'll remove the empty |

Objective
Examples on how to use the freshly merged
Bezierstruct ( #7653 ) are missing.Solution
bezier_curve.rsexample in theanimation/folder.