Bevy curve - #25380
Conversation
48879ba to
e393a3b
Compare
e393a3b to
e5204f8
Compare
f3a60ce to
b10a77f
Compare
|
You added a new feature but didn't update the readme. Please run |
b10a77f to
c115929
Compare
|
Alrighty for the afterworld here's the explanation how I resolved the heavy issues with the no_std stuff not passing the CI checks. So what's failing is
So basically what solved it was
which revealed: Which means I forgot to disable |
9eb461d to
06fc4f3
Compare
|
Merge conflicts, unsurprisingly. |
ef38525 to
f0b322e
Compare
f0b322e to
5125e1c
Compare
This was a problem since the prelude included itself because it re-exported: `crate::*`
5125e1c to
8fae22d
Compare
This lead to issues in CI that were only uncovered after doing this in two crates, see: https://github.com/bevyengine/bevy/actions/runs/33535695284/job/99949477868?pr=25380
|
I just want to highlight 950a35e which fixes stuff in the previously merged |
| let reparametrized_curve = curve | ||
| .by_ref() | ||
| .reparametrize(interval(0.0, f32::INFINITY).unwrap(), ops::exp2); | ||
| assert_abs_diff_eq!(reparametrized_curve.sample_unchecked(3.5), 3.5); |
| .by_ref() | ||
| .reparametrize(interval(0.0, f32::INFINITY).unwrap(), ops::exp2); | ||
| assert_abs_diff_eq!(reparametrized_curve.sample_unchecked(3.5), 3.5); | ||
| assert_abs_diff_eq!(reparametrized_curve.sample_unchecked(100.0), 100.0); |
| ); | ||
|
|
||
| let reparametrized_curve = curve.by_ref().reparametrize(Interval::UNIT, |t| t + 1.0); | ||
| assert_abs_diff_eq!(reparametrized_curve.sample_unchecked(0.0), 0.0); |
|
|
||
| let reparametrized_curve = curve.by_ref().reparametrize(Interval::UNIT, |t| t + 1.0); | ||
| assert_abs_diff_eq!(reparametrized_curve.sample_unchecked(0.0), 0.0); | ||
| assert_abs_diff_eq!(reparametrized_curve.sample_unchecked(1.0), 1.0); |
| let curve = FunctionCurve::new(Interval::UNIT, ops::exp2); | ||
| let first_reparam = curve.reparametrize(interval(1.0, 2.0).unwrap(), ops::log2); | ||
| let second_reparam = first_reparam.reparametrize(Interval::UNIT, |t| t + 1.0); | ||
| assert_abs_diff_eq!(second_reparam.sample_unchecked(0.0), 1.0); |
| let first_reparam = curve.reparametrize(interval(1.0, 2.0).unwrap(), ops::log2); | ||
| let second_reparam = first_reparam.reparametrize(Interval::UNIT, |t| t + 1.0); | ||
| assert_abs_diff_eq!(second_reparam.sample_unchecked(0.0), 1.0); | ||
| assert_abs_diff_eq!(second_reparam.sample_unchecked(0.5), 1.5); |
| let second_reparam = first_reparam.reparametrize(Interval::UNIT, |t| t + 1.0); | ||
| assert_abs_diff_eq!(second_reparam.sample_unchecked(0.0), 1.0); | ||
| assert_abs_diff_eq!(second_reparam.sample_unchecked(0.5), 1.5); | ||
| assert_abs_diff_eq!(second_reparam.sample_unchecked(1.0), 2.0); |
| resampled_curve.sample_unchecked(test_pt), | ||
| expected, | ||
| epsilon = 1e-6 |
| resampled_curve.sample_unchecked(test_pt), | ||
| expected, | ||
| epsilon = 1e-6 |
|
bro is trippin ... 🙄 edit: snap 📸 that's going straight into my cringe collection |
# Objective - the bevy_curve / bevy_shape split (bevyengine#25380 / bevyengine#25302) had a few issues - missing licenses files - tool generating images didn't update path - bevy_animation needs bevy_curve/reflect - some alloc gates in bevy_curve seem wrong - dependencies are not specified in the same order as other crates ## Solution - fix them
Objective
Following some discussions in the discord math-dev chat, there were multiple voices raising the idea of a split-off of the curves from the
bevy_mathcrate:Hence this PR tries to achive exactly this and nothing more while making (hopefully) only a minimal set of moves/changes.
Solution
bevy_curvecrate was created. It was already reserved by cart, which is nice ✅curvesandcubic_splinestobevy_curve. Mostly just code moving, with some minimal fixupscurvefeature frombevy_mathTesting
ToDos