-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a bezier curve example #8194
Conversation
Co-authored-by: ira <JustTheCoolDude@gmail.com>
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <aevyrie@gmail.com>
Changed the example name to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I very much like keeping the duplicative comment here :) The information is important and relevant here.
Co-authored-by: Aevyrie <aevyrie@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty sure it's this bug: #8049
I merged in main and it fixed it. Thanks for the info.
@aevyrie I would be happy to see these in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good: the debug line is particularly helpful! I'm going to push a fix up for CI; please re-review when you see it :)
@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
Bezier
struct ( #7653 ) are missing.Solution
bezier_curve.rs
example in theanimation/
folder.