Skip to main content

Transform

Struct Transform 

Source
pub struct Transform<P, R> {
    pub position: P,
    pub orientation: R,
}

Fields§

§position: P§orientation: R

Implementations§

Source§

impl<P, R> Transform<P, R>
where P: Clone + AffineSpace + Add<P::Diff, Output = P>, P::Diff: VectorSpace, R: Clone + AffineSpace + Add<R::Diff, Output = R>, R::Diff: VectorSpace<Scalar = <P::Diff as VectorSpace>::Scalar>,

Source

pub fn lerp( &self, other: &Self, ratio: <P::Diff as VectorSpace>::Scalar, ) -> Self

Source§

impl<P: Copy + Add<Output = P>, R: Transform<P>> Transform<P, R>

Source

pub fn apply(&self, point: P) -> P

Trait Implementations§

Source§

impl<P, R, V, B> Add<Movement<V, B>> for Transform<P, R>
where P: Add<V, Output = P>, B: Exp<Output = R>, R: Mul<Output = R>,

Source§

type Output = Transform<P, R>

The resulting type after applying the + operator.
Source§

fn add(self, movement: Movement<V, B>) -> Self

Performs the + operation. Read more
Source§

impl<P, R, V, B> AddAssign<Movement<V, B>> for Transform<P, R>
where P: AddAssign<V>, B: Exp<Output = R>, R: MulAssign,

Source§

fn add_assign(&mut self, movement: Movement<V, B>)

Performs the += operation. Read more
Source§

impl<P: Clone, R: Clone> Clone for Transform<P, R>

Source§

fn clone(&self) -> Transform<P, R>

Returns a duplicate 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<P: Debug, R: Debug> Debug for Transform<P, R>

Source§

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

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

impl<P, R> Div for Transform<P, R>
where P: Add<Output = P> + Neg<Output = P>, R: Copy + Mul<Output = R> + Inv<Output = R> + Transform<P>,

Source§

type Output = Transform<P, R>

The resulting type after applying the / operator.
Source§

fn div(self, other: Self) -> Self

Performs the / operation. Read more
Source§

impl<P, R> DivAssign for Transform<P, R>
where P: SubAssign, R: Copy + DivAssign + Transform<P>,

Source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
Source§

impl<P, R> Inv for Transform<P, R>
where P: Neg<Output = P>, R: Copy + Inv<Output = R> + Transform<P>,

Source§

type Output = Transform<P, R>

Source§

fn inv(self) -> Self

Source§

impl<P, R> Mul for Transform<P, R>
where P: Add<Output = P>, R: Copy + Mul<Output = R> + Transform<P>,

Source§

type Output = Transform<P, R>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Self) -> Self

Performs the * operation. Read more
Source§

impl<P, R> MulAssign for Transform<P, R>
where P: AddAssign, R: Copy + MulAssign + Transform<P>,

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

impl<P: Zero, R: One> One for Transform<P, R>

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

impl<P: PartialEq, R: PartialEq> PartialEq for Transform<P, R>

Source§

fn eq(&self, other: &Transform<P, R>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<P, R, V, B> Sub<Movement<V, B>> for Transform<P, R>
where P: Sub<V, Output = P>, B: Exp<Output = R>, R: Div<Output = R>,

Source§

type Output = Transform<P, R>

The resulting type after applying the - operator.
Source§

fn sub(self, movement: Movement<V, B>) -> Self

Performs the - operation. Read more
Source§

impl<P, R, V, B> SubAssign<Movement<V, B>> for Transform<P, R>
where P: SubAssign<V>, B: Exp<Output = R>, R: DivAssign,

Source§

fn sub_assign(&mut self, movement: Movement<V, B>)

Performs the -= operation. Read more
Source§

impl<P, R> Transform<P> for Transform<P, R>
where P: Copy + Add<Output = P>, R: Transform<P>,

Source§

fn apply_point(&self, point: P) -> P

Applies this transformation to a point.
Source§

impl<P: Copy, R: Copy> Copy for Transform<P, R>

Source§

impl<P: Eq, R: Eq> Eq for Transform<P, R>

Source§

impl<P, R> StructuralPartialEq for Transform<P, R>

Auto Trait Implementations§

§

impl<P, R> Freeze for Transform<P, R>
where P: Freeze, R: Freeze,

§

impl<P, R> RefUnwindSafe for Transform<P, R>

§

impl<P, R> Send for Transform<P, R>
where P: Send, R: Send,

§

impl<P, R> Sync for Transform<P, R>
where P: Sync, R: Sync,

§

impl<P, R> Unpin for Transform<P, R>
where P: Unpin, R: Unpin,

§

impl<P, R> UnsafeUnpin for Transform<P, R>
where P: UnsafeUnpin, R: UnsafeUnpin,

§

impl<P, R> UnwindSafe for Transform<P, R>
where P: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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 T
where T: Clone,

Source§

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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.