# Objective Fixes #13189 ## Solution To add the reflect impls I needed to make all the struct fields pub. I don't think there's any harm for these types, but just a note for review. --------- Co-authored-by: Ben Harper <ben@tukom.org>
90 lines
1.9 KiB
Rust
90 lines
1.9 KiB
Rust
use crate as bevy_reflect;
|
|
use bevy_math::{cubic_splines::*, VectorSpace};
|
|
use bevy_reflect::std_traits::ReflectDefault;
|
|
use bevy_reflect_derive::impl_reflect;
|
|
|
|
impl_reflect!(
|
|
#[reflect(Debug)]
|
|
#[type_path = "bevy_math::cubic_splines"]
|
|
struct CubicBezier<P: VectorSpace> {
|
|
control_points: Vec<[P; 4]>,
|
|
}
|
|
);
|
|
|
|
impl_reflect!(
|
|
#[reflect(Debug)]
|
|
#[type_path = "bevy_math::cubic_splines"]
|
|
struct CubicHermite<P: VectorSpace> {
|
|
control_points: Vec<(P, P)>,
|
|
}
|
|
);
|
|
|
|
impl_reflect!(
|
|
#[reflect(Debug)]
|
|
#[type_path = "bevy_math::cubic_splines"]
|
|
struct CubicCardinalSpline<P: VectorSpace> {
|
|
tension: f32,
|
|
control_points: Vec<P>,
|
|
}
|
|
);
|
|
|
|
impl_reflect!(
|
|
#[reflect(Debug)]
|
|
#[type_path = "bevy_math::cubic_splines"]
|
|
struct CubicBSpline<P: VectorSpace> {
|
|
control_points: Vec<P>,
|
|
}
|
|
);
|
|
|
|
impl_reflect!(
|
|
#[reflect(Debug)]
|
|
#[type_path = "bevy_math::cubic_splines"]
|
|
struct CubicNurbs<P: VectorSpace> {
|
|
control_points: Vec<P>,
|
|
weights: Vec<f32>,
|
|
knots: Vec<f32>,
|
|
}
|
|
);
|
|
|
|
impl_reflect!(
|
|
#[reflect(Debug)]
|
|
#[type_path = "bevy_math::cubic_splines"]
|
|
struct LinearSpline<P: VectorSpace> {
|
|
points: Vec<P>,
|
|
}
|
|
);
|
|
|
|
impl_reflect!(
|
|
#[reflect(Debug, Default)]
|
|
#[type_path = "bevy_math::cubic_splines"]
|
|
struct CubicSegment<P: VectorSpace> {
|
|
coeff: [P; 4],
|
|
}
|
|
);
|
|
|
|
impl_reflect!(
|
|
#[reflect(Debug)]
|
|
#[type_path = "bevy_math::cubic_splines"]
|
|
struct CubicCurve<P: VectorSpace> {
|
|
segments: Vec<CubicSegment<P>>,
|
|
}
|
|
);
|
|
|
|
impl_reflect!(
|
|
#[reflect(Debug, Default)]
|
|
#[type_path = "bevy_math::cubic_splines"]
|
|
struct RationalSegment<P: VectorSpace> {
|
|
coeff: [P; 4],
|
|
weight_coeff: [f32; 4],
|
|
knot_span: f32,
|
|
}
|
|
);
|
|
|
|
impl_reflect!(
|
|
#[reflect(Debug)]
|
|
#[type_path = "bevy_math::cubic_splines"]
|
|
struct RationalCurve<P: VectorSpace> {
|
|
segments: Vec<RationalSegment<P>>,
|
|
}
|
|
);
|