Transform3D

Struct Transform3D 

Source
pub struct Transform3D<T: Copy + Debug + 'static> { /* private fields */ }
Expand description

Transform3D represents a 3D transformation (rotation + translation) When the glam feature is enabled, it uses glam’s optimized types internally

Implementations§

Source§

impl<T: Copy + Debug + Default + 'static> Transform3D<T>

Source

pub fn from_matrix(mat: [[T; 4]; 4]) -> Self

Create a transform from a 4x4 matrix

Source

pub fn to_matrix(self) -> [[T; 4]; 4]

Get the transform as a 4x4 matrix

Source§

impl Transform3D<f64>

Source

pub fn translation(&self) -> [Length64; 3]

Source

pub fn rotation(&self) -> [[Angle64; 3]; 3]

Source§

impl Transform3D<f32>

Source

pub fn translation(&self) -> [Length32; 3]

Source

pub fn rotation(&self) -> [[Angle32; 3]; 3]

Source§

impl Transform3D<f32>

Source

pub fn inverse(&self) -> Self

Computes the inverse of this transformation matrix.

Source§

impl Transform3D<f64>

Source

pub fn inverse(&self) -> Self

Computes the inverse of this transformation matrix.

Trait Implementations§

Source§

impl<T: Clone + Copy + Debug + 'static> Clone for Transform3D<T>

Source§

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

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<T: Debug + Copy + Debug + 'static> Debug for Transform3D<T>

Source§

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

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

impl<T> Decode<()> for Transform3D<T>
where T: Decode<()> + Default + Copy + Debug + 'static,

Source§

fn decode<D: Decoder<Context = ()>>( decoder: &mut D, ) -> Result<Self, DecodeError>

Attempt to decode this type with the given Decode.
Source§

impl<T: Copy + Debug + Default + 'static> Default for Transform3D<T>

Source§

fn default() -> Self

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

impl<'de, T> Deserialize<'de> for Transform3D<T>
where T: Deserialize<'de> + Default + Copy + Debug + 'static,

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> Encode for Transform3D<T>
where T: Encode + Copy + Debug + Default + 'static,

Source§

fn encode<E: Encoder>(&self, encoder: &mut E) -> Result<(), EncodeError>

Encode a given type.
Source§

impl From<Affine3A> for Transform3D<f32>

Source§

fn from(aff: Affine3A) -> Self

Converts to this type from the input type.
Source§

impl From<DAffine3> for Transform3D<f64>

Source§

fn from(aff: DAffine3) -> Self

Converts to this type from the input type.
Source§

impl From<Transform3D<f32>> for Affine3A

Source§

fn from(p: Transform3D<f32>) -> Self

Converts to this type from the input type.
Source§

impl From<Transform3D<f64>> for DAffine3

Source§

fn from(p: Transform3D<f64>) -> Self

Converts to this type from the input type.
Source§

impl Mul<&Transform3D<f32>> for Transform3D<f32>

Source§

type Output = Transform3D<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Transform3D<f32>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<&Transform3D<f64>> for Transform3D<f64>

Source§

type Output = Transform3D<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Transform3D<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Transform3D<f32>> for &Transform3D<f32>

Source§

type Output = Transform3D<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Transform3D<f32>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<Transform3D<f64>> for &Transform3D<f64>

Source§

type Output = Transform3D<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Transform3D<f64>) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for &Transform3D<f32>

Reference implementations for f32

Source§

type Output = Transform3D<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for &Transform3D<f64>

Reference implementations for f64

Source§

type Output = Transform3D<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for Transform3D<f32>

Implementation for f32

Source§

type Output = Transform3D<f32>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for Transform3D<f64>

Implementation for f64

Source§

type Output = Transform3D<f64>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<T> Serialize for Transform3D<T>
where T: Serialize + Copy + Debug + Default + 'static,

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: Copy + Copy + Debug + 'static> Copy for Transform3D<T>

Auto Trait Implementations§

§

impl<T> Freeze for Transform3D<T>

§

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

§

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

§

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

§

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

§

impl<T> UnwindSafe for Transform3D<T>
where T: 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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

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