pub struct Spline<T>{ /* private fields */ }
Implementations§
Source§impl<T> Spline<T>
impl<T> Spline<T>
pub fn new(points: Vec<SplinePoint<T>>) -> Result<Self, SplineError>
pub fn linear(from: T, to: T) -> Result<Self, SplineError>
pub fn point(point: T) -> Result<Self, SplineError>
pub fn value_along_axis_iter( &self, steps: usize, axis_index: usize, ) -> Option<impl Iterator<Item = Scalar>>
pub fn sample(&self, factor: Scalar) -> T
pub fn sample_along_axis( &self, axis_value: Scalar, axis_index: usize, ) -> Option<T>
Sourcepub fn sample_first_derivative(&self, factor: Scalar) -> T
pub fn sample_first_derivative(&self, factor: Scalar) -> T
Velocity of change along the curve axis.
Sourcepub fn sample_first_derivative_along_axis(
&self,
axis_value: Scalar,
axis_index: usize,
) -> Option<T>
pub fn sample_first_derivative_along_axis( &self, axis_value: Scalar, axis_index: usize, ) -> Option<T>
Velocity of change along the curve axis.
Sourcepub fn sample_second_derivative(&self, factor: Scalar) -> T
pub fn sample_second_derivative(&self, factor: Scalar) -> T
Acceleration of change along the curve axis.
Sourcepub fn sample_second_derivative_along_axis(
&self,
axis_value: Scalar,
axis_index: usize,
) -> Option<T>
pub fn sample_second_derivative_along_axis( &self, axis_value: Scalar, axis_index: usize, ) -> Option<T>
Acceleration of change along the curve axis.
pub fn sample_k(&self, factor: Scalar) -> Scalar
pub fn sample_curvature_radius(&self, factor: Scalar) -> Scalar
pub fn sample_tangent(&self, factor: Scalar) -> T
pub fn sample_tangent_along_axis( &self, axis_value: Scalar, axis_index: usize, ) -> Option<T>
pub fn length(&self) -> Scalar
pub fn points(&self) -> &[SplinePoint<T>]
pub fn set_points(&mut self, points: Vec<SplinePoint<T>>)
pub fn curves(&self) -> &[Curve<T>]
pub fn find_curve_index_factor(&self, factor: Scalar) -> (usize, Scalar)
pub fn find_curve_index_by_axis_value( &self, axis_value: Scalar, axis_index: usize, ) -> Option<usize>
pub fn find_time_for_axis( &self, axis_value: Scalar, axis_index: usize, ) -> Option<Scalar>
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Spline<T>
impl<'de, T> Deserialize<'de> for Spline<T>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<T> Freeze for Spline<T>
impl<T> RefUnwindSafe for Spline<T>where
T: RefUnwindSafe,
impl<T> Send for Spline<T>where
T: Send,
impl<T> Sync for Spline<T>where
T: Sync,
impl<T> Unpin for Spline<T>where
T: Unpin,
impl<T> UnwindSafe for Spline<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more