Skip to main content

Transform

Struct Transform 

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

Fields§

§position: V§orientation: R

Implementations§

Source§

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

Source

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

Source§

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

Source

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

Trait Implementations§

Source§

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

Source§

type Output = Transform<V, R>

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

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

Source§

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

Performs the += operation. Read more
Source§

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

Source§

fn clone(&self) -> Transform<V, 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<V: Debug, R: Debug> Debug for Transform<V, R>

Source§

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

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

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

Source§

type Output = Transform<V, R>

The resulting type after applying the / operator.
Source§

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

Performs the / operation. Read more
Source§

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

Source§

fn div_assign(&mut self, other: Self)

Performs the /= operation. Read more
Source§

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

Source§

type Output = Transform<V, R>

Source§

fn inv(self) -> Self

Source§

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

Source§

type Output = Transform<V, R>

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

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

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

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

Source§

fn one() -> Self

Source§

fn is_one(&self) -> bool

Source§

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

Source§

fn eq(&self, other: &Transform<V, 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<V, R, B> Sub<Movement<V, B>> for Transform<V, R>
where V: Sub<Output = V>, B: Exp<Output = R>, R: Div<Output = R>,

Source§

type Output = Transform<V, R>

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

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

Source§

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

Performs the -= operation. Read more
Source§

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

Source§

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

Applies this transformation to a point.
Source§

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

Source§

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

Source§

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<V, R> UnwindSafe for Transform<V, R>
where V: 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.