Skip to content
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

A Curve trait for general interoperation — Part I #14630

Merged
merged 12 commits into from
Aug 9, 2024

Conversation

mweatherley
Copy link
Contributor

Objective

This PR implements part of the Curve RFC. See that document for motivation, objectives, etc.

Solution

For purposes of reviewability, this PR excludes the entire part of the RFC related to taking multiple samples, resampling, and interpolation generally. (This means the entire cores submodule is also excluded.) On the other hand, the entire Interval type and all of the functional Curve adaptors are included.

Testing

Test modules are included and can be run locally (but they are also included in CI).

@mweatherley mweatherley added A-Math Fundamental domain-agnostic mathematical operations A-Cross-Cutting Impacts the entire engine X-Blessed Has a large architectural impact or tradeoffs, but the design has been endorsed by decision makers C-Feature A new feature, making something new possible D-Complex Quite challenging from either a design or technical perspective. Ask for help! labels Aug 5, 2024
@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Aug 5, 2024

/// Get the start of this interval.
#[inline]
pub fn start(self) -> f32 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I prefer left/right naming for these fields, which would make these consistent with the other methods.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should at least consistently use the terminology of start/end everywhere now. Hopefully that's a little better at least. (This is kind of a choice between metaphors, since start and end evoke time, while left and right are more like geometry on the real line)

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Aug 5, 2024
Copy link
Contributor

@soqb soqb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's been a long time since i last read the RFC, so take this as a layman's review. i think this is generally really solid!

crates/bevy_math/src/curve/interval.rs Outdated Show resolved Hide resolved
crates/bevy_math/src/curve/interval.rs Outdated Show resolved Hide resolved
crates/bevy_math/src/curve/interval.rs Outdated Show resolved Hide resolved
crates/bevy_math/src/curve/mod.rs Show resolved Hide resolved
crates/bevy_math/src/curve/mod.rs Show resolved Hide resolved
crates/bevy_math/src/curve/interval.rs Outdated Show resolved Hide resolved
crates/bevy_math/src/curve/mod.rs Show resolved Hide resolved
@mweatherley
Copy link
Contributor Author

I think with the most recent round of changes, I've addressed the existing comments to my satisfaction. Of course, more are always welcome. :)

@mweatherley mweatherley removed the S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged label Aug 8, 2024
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Aug 8, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Aug 9, 2024
Merged via the queue into bevyengine:main with commit 23e8727 Aug 9, 2024
27 checks passed
github-merge-queue bot pushed a commit that referenced this pull request Aug 15, 2024
# Objective

Finish what we started in #14630. The Curve RFC is
[here](https://github.com/bevyengine/rfcs/blob/main/rfcs/80-curve-trait.md).

## Solution

This contains the rest of the library from my branch. The main things
added here are:
- Bulk sampling / resampling methods on `Curve` itself
- Data structures supporting the above
- The `cores` submodule that those data structures use to encapsulate
sample interpolation

The weirdest thing in here is probably `ChunkedUnevenCore` in `cores`,
which is not used by anything in the Curve library itself but which is
required for efficient storage of glTF animation curves. (See #13105.)
We can move it into a different PR if we want to; I don't have strong
feelings either way.

## Testing

New tests related to resampling are included. As I write this, I realize
we could use some tests in `cores` itself, so I will add some on this
branch before too long.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Robert Walter <26892280+RobWalt@users.noreply.github.com>
@alice-i-cecile
Copy link
Member

Thank you to everyone involved with the authoring or reviewing of this PR! This work is relatively important and needs release notes! Head over to bevyengine/bevy-website#1669 if you'd like to help out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Cross-Cutting Impacts the entire engine A-Math Fundamental domain-agnostic mathematical operations C-Feature A new feature, making something new possible D-Complex Quite challenging from either a design or technical perspective. Ask for help! M-Needs-Release-Note Work that should be called out in the blog due to impact S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Blessed Has a large architectural impact or tradeoffs, but the design has been endorsed by decision makers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants