Basic integration of cubic spline curves with the Curve API#15469
Merged
alice-i-cecile merged 2 commits intobevyengine:mainfrom Sep 30, 2024
Merged
Basic integration of cubic spline curves with the Curve API#15469alice-i-cecile merged 2 commits intobevyengine:mainfrom
alice-i-cecile merged 2 commits intobevyengine:mainfrom
Conversation
IQuick143
reviewed
Sep 27, 2024
IQuick143
reviewed
Sep 27, 2024
IQuick143
approved these changes
Sep 27, 2024
Contributor
IQuick143
left a comment
There was a problem hiding this comment.
I don't see any glaring issues, I just find the doc change at the rational curve odd.
eckz
approved these changes
Sep 27, 2024
JasmineLowen
approved these changes
Sep 27, 2024
Contributor
JasmineLowen
left a comment
There was a problem hiding this comment.
LGTM! There's just this one comment which should probably be double checked?
BenjaminBrienen
approved these changes
Sep 28, 2024
alice-i-cecile
approved these changes
Sep 30, 2024
robtfm
pushed a commit
to robtfm/bevy
that referenced
this pull request
Oct 4, 2024
…ne#15469) # Objective We introduced the fancy Curve API earlier in this version. The goal of this PR is to provide a level of integration between that API and the existing spline constructions in `bevy_math`. Note that this PR only covers the integration of position-sampling via the `Curve` API. Other (substantially more complex) planned work will introduce general facilities for handling derivatives. ## Solution `CubicSegment`, `CubicCurve`, `RationalSegment`, and `RationalCurve` all now implement `Curve`, using their `position` function to sample the output. Additionally, some documentation has been updated/corrected, and `Serialize`/`Deserialize` derives have been added for all the curve structs. (Note that there are some barriers to automatic registration of `ReflectSerialize`/`ReflectSerialize` involving generics that have not been resolved in this PR.) --- ## Migration Guide The `RationalCurve::domain` method has been renamed to `RationalCurve::length`. Calling `.domain()` on a `RationalCurve` now returns its entire domain as an `Interval`.
This was referenced Jan 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
We introduced the fancy Curve API earlier in this version. The goal of this PR is to provide a level of integration between that API and the existing spline constructions in
bevy_math.Note that this PR only covers the integration of position-sampling via the
CurveAPI. Other (substantially more complex) planned work will introduce general facilities for handling derivatives.Solution
CubicSegment,CubicCurve,RationalSegment, andRationalCurveall now implementCurve, using theirpositionfunction to sample the output.Additionally, some documentation has been updated/corrected, and
Serialize/Deserializederives have been added for all the curve structs. (Note that there are some barriers to automatic registration ofReflectSerialize/ReflectSerializeinvolving generics that have not been resolved in this PR.)Migration Guide
The
RationalCurve::domainmethod has been renamed toRationalCurve::length. Calling.domain()on aRationalCurvenow returns its entire domain as anInterval.