Struct bevy::math::cubic_splines::RationalSegment
pub struct RationalSegment<P>where
P: VectorSpace,{ /* private fields */ }
Expand description
A segment of a rational cubic curve, used to hold precomputed coefficients for fast interpolation.
Can be evaluated as a parametric curve over the domain [0, knot_span)
.
Segments can be chained together to form a longer compound curve.
Implementations§
§impl<P> RationalSegment<P>where
P: VectorSpace,
impl<P> RationalSegment<P>where
P: VectorSpace,
pub fn position(&self, t: f32) -> P
pub fn position(&self, t: f32) -> P
Instantaneous position of a point at parametric value t
in [0, knot_span)
.
pub fn velocity(&self, t: f32) -> P
pub fn velocity(&self, t: f32) -> P
Instantaneous velocity of a point at parametric value t
in [0, knot_span)
.
pub fn acceleration(&self, t: f32) -> P
pub fn acceleration(&self, t: f32) -> P
Instantaneous acceleration of a point at parametric value t
in [0, knot_span)
.
Trait Implementations§
§impl<P> Clone for RationalSegment<P>where
P: Clone + VectorSpace,
impl<P> Clone for RationalSegment<P>where
P: Clone + VectorSpace,
§fn clone(&self) -> RationalSegment<P>
fn clone(&self) -> RationalSegment<P>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<P> Debug for RationalSegment<P>where
P: Debug + VectorSpace,
impl<P> Debug for RationalSegment<P>where
P: Debug + VectorSpace,
§impl<P> Default for RationalSegment<P>where
P: Default + VectorSpace,
impl<P> Default for RationalSegment<P>where
P: Default + VectorSpace,
§fn default() -> RationalSegment<P>
fn default() -> RationalSegment<P>
Returns the “default value” for a type. Read more
§impl<P> Extend<RationalSegment<P>> for RationalCurve<P>where
P: VectorSpace,
impl<P> Extend<RationalSegment<P>> for RationalCurve<P>where
P: VectorSpace,
§fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = RationalSegment<P>>,
fn extend<T>(&mut self, iter: T)where
T: IntoIterator<Item = RationalSegment<P>>,
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
§impl<P> From<CubicSegment<P>> for RationalSegment<P>where
P: VectorSpace,
impl<P> From<CubicSegment<P>> for RationalSegment<P>where
P: VectorSpace,
§fn from(value: CubicSegment<P>) -> RationalSegment<P>
fn from(value: CubicSegment<P>) -> RationalSegment<P>
Converts to this type from the input type.
§impl<P> PartialEq for RationalSegment<P>where
P: PartialEq + VectorSpace,
impl<P> PartialEq for RationalSegment<P>where
P: PartialEq + VectorSpace,
§fn eq(&self, other: &RationalSegment<P>) -> bool
fn eq(&self, other: &RationalSegment<P>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<P> StructuralPartialEq for RationalSegment<P>where
P: VectorSpace,
Auto Trait Implementations§
impl<P> Freeze for RationalSegment<P>where
P: Freeze,
impl<P> RefUnwindSafe for RationalSegment<P>where
P: RefUnwindSafe,
impl<P> Send for RationalSegment<P>where
P: Send,
impl<P> Sync for RationalSegment<P>where
P: Sync,
impl<P> Unpin for RationalSegment<P>where
P: Unpin,
impl<P> UnwindSafe for RationalSegment<P>where
P: UnwindSafe,
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self
using data from the given World
.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.