diff --git a/crates/bevy_math/src/cubic_splines.rs b/crates/bevy_math/src/cubic_splines.rs index a8597b5cf871c..a447b5484b540 100644 --- a/crates/bevy_math/src/cubic_splines.rs +++ b/crates/bevy_math/src/cubic_splines.rs @@ -280,17 +280,13 @@ impl CubicBSpline

{ impl CubicGenerator

for CubicBSpline

{ #[inline] fn to_curve(&self) -> CubicCurve

{ - let mut char_matrix = [ - [1.0, 4.0, 1.0, 0.0], - [-3.0, 0.0, 3.0, 0.0], - [3.0, -6.0, 3.0, 0.0], - [-1.0, 3.0, -3.0, 1.0], + let char_matrix = [ + [1.0 / 6.0, 4.0 / 6.0, 1.0 / 6.0, 0.0 / 6.0], + [-3.0 / 6.0, 0.0 / 6.0, 3.0 / 6.0, 0.0 / 6.0], + [3.0 / 6.0, -6.0 / 6.0, 3.0 / 6.0, 0.0 / 6.0], + [-1.0 / 6.0, 3.0 / 6.0, -3.0 / 6.0, 1.0 / 6.0], ]; - char_matrix - .iter_mut() - .for_each(|r| r.iter_mut().for_each(|c| *c /= 6.0)); - let segments = self .control_points .windows(4)