pub struct Curve<T>where
    T: Clone + Curved + CurvedChange,{ /* private fields */ }

Implementations§

source§

impl<T> Curve<T>where T: Clone + Curved + CurvedChange,

source

pub fn linear(from: T, to: T) -> Result<Self, CurveError>

source

pub fn bezier( from: T, from_param: T, to_param: T, to: T ) -> Result<Self, CurveError>

source

pub fn from(&self) -> &T

source

pub fn set_from(&mut self, value: T)

source

pub fn from_param(&self) -> &T

source

pub fn set_from_param(&mut self, value: T)

source

pub fn to_param(&self) -> &T

source

pub fn set_to_param(&mut self, value: T)

source

pub fn to(&self) -> &T

source

pub fn set_to(&mut self, value: T)

source

pub fn set(&mut self, from: T, from_param: T, to_param: T, to: T)

source

pub fn length(&self) -> Scalar

source

pub fn value_along_axis_iter( &self, steps: usize, axis_index: usize ) -> Option<impl Iterator<Item = Scalar>>

source

pub fn sample(&self, factor: Scalar) -> T

source

pub fn sample_along_axis( &self, axis_value: Scalar, axis_index: usize ) -> Option<T>

source

pub fn sample_first_derivative(&self, factor: Scalar) -> T

Velocity of change along the curve.

source

pub fn sample_first_derivative_along_axis( &self, axis_value: Scalar, axis_index: usize ) -> Option<T>

Velocity of change along the curve axis.

source

pub fn sample_second_derivative(&self, factor: Scalar) -> T

Acceleration of change along the curve.

source

pub fn sample_second_derivative_along_axis( &self, axis_value: Scalar, axis_index: usize ) -> Option<T>

Acceleration of change along the curve axis.

source

pub fn sample_k(&self, factor: Scalar) -> Scalar

source

pub fn sample_curvature_radius(&self, factor: Scalar) -> Scalar

source

pub fn sample_tangent(&self, factor: Scalar) -> T

source

pub fn sample_tangent_along_axis( &self, axis_value: Scalar, axis_index: usize ) -> Option<T>

source

pub fn split(&self, factor: Scalar) -> Result<(Self, Self), CurveError>

source

pub fn find_time_for_axis( &self, axis_value: Scalar, axis_index: usize ) -> Option<Scalar>

source

pub fn find_time_for( &self, guess: Scalar, iterations: usize, f: impl FnMut(Scalar, &Self) -> Scalar ) -> Scalar

initial time guess, number of iterations, fn(time, curve) -> time

Trait Implementations§

source§

impl<T> Clone for Curve<T>where T: Clone + Curved + CurvedChange + Clone,

source§

fn clone(&self) -> Curve<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for Curve<T>where T: Clone + Curved + CurvedChange + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> Default for Curve<T>where T: Clone + Curved + CurvedChange,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de, T> Deserialize<'de> for Curve<T>where T: Clone + Curved + CurvedChange + Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T> From<Curve<T>> for CurveDef<T>where T: Clone + Curved + CurvedChange,

source§

fn from(v: Curve<T>) -> Self

Converts to this type from the input type.
source§

impl<T> Serialize for Curve<T>where T: Clone + Curved + CurvedChange + Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<T> TryFrom<CurveDef<T>> for Curve<T>where T: Clone + Curved + CurvedChange,

§

type Error = CurveError

The type returned in the event of a conversion error.
source§

fn try_from(value: CurveDef<T>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for Curve<T>where T: RefUnwindSafe,

§

impl<T> Send for Curve<T>where T: Send,

§

impl<T> Sync for Curve<T>where T: Sync,

§

impl<T> Unpin for Curve<T>where T: Unpin,

§

impl<T> UnwindSafe for Curve<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Finalize for T

§

unsafe fn finalize_raw(data: *mut ())

Safety Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Initialize for Twhere T: Default,

§

fn initialize(&mut self)

§

unsafe fn initialize_raw(data: *mut ())

Safety Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Component for Twhere T: Send + Sync + 'static,

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,