pub struct LinearSpeed<F: Float, P: CurvePoint<F> + Distance<F>, C: Curve<F, P>> { /* private fields */ }
Expand description
The same curve as a passed one, but with a linear dependency between the time and the distance.
Implementations§
Trait Implementations§
Source§impl<F: Float, P: CurvePoint<F> + Distance<F>, C: Curve<F, P>> Curve<F, P> for LinearSpeed<F, P, C>
impl<F: Float, P: CurvePoint<F> + Distance<F>, C: Curve<F, P>> Curve<F, P> for LinearSpeed<F, P, C>
Source§fn tangent_at(&self, t: F) -> P
fn tangent_at(&self, t: F) -> P
Get the derivative at a given value
t
in range from 0 to 1.fn start_point(&self) -> P
fn end_point(&self) -> P
Source§fn estimate_length(&self, _precision: F) -> F
fn estimate_length(&self, _precision: F) -> F
Estimate the length of the curve as an average between
min
and max
estimation.
The precision parameter is the maximum ration of min
and max
estimation. Read moreSource§fn quad_bezier(p0: P, p1: P, p2: P) -> Bezier2<F, P>
fn quad_bezier(p0: P, p1: P, p2: P) -> Bezier2<F, P>
Create a quadratic bezier curve
Source§fn cubic_bezier(p0: P, p1: P, p2: P, p3: P) -> Bezier3<F, P>
fn cubic_bezier(p0: P, p1: P, p2: P, p3: P) -> Bezier3<F, P>
Create a cubic bezier curve
Source§fn into_iter(self, steps_count: usize) -> CurveIterator<F, P, Self>where
Self: Sized,
fn into_iter(self, steps_count: usize) -> CurveIterator<F, P, Self>where
Self: Sized,
Create an iterator that will generate points on the curve.
Source§fn into_iter_inclusive(self, steps_count: usize) -> CurveIterator<F, P, Self>where
Self: Sized,
fn into_iter_inclusive(self, steps_count: usize) -> CurveIterator<F, P, Self>where
Self: Sized,
Create an iterator that will generate points on the curve, including the last point.
Source§fn composed_curve(start_point: P) -> ComposedCurve<F, P>
fn composed_curve(start_point: P) -> ComposedCurve<F, P>
Create a composed curve that will be a sequence of curves.
Each segment of the curve will be represented by equal
t
range.
For example, if you have 3 curves, they will take t
ranges: 0 - 0.33
, 0.33 - 0.66
and 0.66 - 1.0
.Source§fn linear_speed(
self,
table_size: usize,
steps_count: usize,
) -> LinearSpeed<F, P, Self>
fn linear_speed( self, table_size: usize, steps_count: usize, ) -> LinearSpeed<F, P, Self>
Create a linear speed curve that will allow to move with a constant speed along the curve.
It’s especially useful when you want to animate the movement along a composed curve. Read more
Auto Trait Implementations§
impl<F, P, C> Freeze for LinearSpeed<F, P, C>
impl<F, P, C> RefUnwindSafe for LinearSpeed<F, P, C>
impl<F, P, C> Send for LinearSpeed<F, P, C>
impl<F, P, C> Sync for LinearSpeed<F, P, C>
impl<F, P, C> Unpin for LinearSpeed<F, P, C>
impl<F, P, C> UnwindSafe for LinearSpeed<F, P, C>
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