[−][src]Struct quick_maths::Transform
Transform type which represents an easily invertible operator. i.e. rotation in 3D, translation, etc.
Fields
fwd: Matrix<N, N, T>
Forward transformation
bkwd: Matrix<N, N, T>
Inverted transformation
Implementations
impl<T: Float, const N: usize> Transform<T, N>
[src]
impl<T: Float> Transform<T, 4_usize>
[src]
pub fn new(m: Mat4<T>) -> Self
[src]
pub fn scale(by: Vec3<T>) -> Self
[src]
pub fn rot(axis: Vec3<T>, theta: T) -> Self
[src]
pub fn translate(by: Vec3<T>) -> Self
[src]
pub fn orthographic(z_near: T, z_far: T) -> Self
[src]
pub fn perspective(fov: T, near: T, far: T) -> Self
[src]
Perspective transformation
pub fn look_at(pos: Vec3<T>, at: Vec3<T>, up: Vec3<T>) -> Self
[src]
A transformation that orients something as if it's looking towards "at" from "pos".
pub fn apply_point(&self, pt: &Vec3<T>) -> Vec3<T>
[src]
Applies this transformation as if to a point.
pub fn apply_vec(&self, vec: &Vec3<T>) -> Vec3<T>
[src]
Applies this transformation as if applying it to a vector What this means operationally is no transformations.
pub fn apply_normal(&self, n: &Vec3<T>) -> Vec3<T>
[src]
Applies this transformation as if applying it to a (surface) normal vector
pub fn apply_ray(&self, r: &Ray3<T>) -> Ray3<T>
[src]
Applies this transform to a ray (convenience for applying point to origin and vector to direction)
impl<T: Float> Transform<T, 3_usize>
[src]
pub fn scale(by: Vec2<T>) -> Self
[src]
pub fn rot(theta: T) -> Self
[src]
pub fn translate(by: Vec2<T>) -> Self
[src]
pub fn apply_point(&self, v: Vec2<T>) -> Vec2<T>
[src]
Trait Implementations
impl<T: Clone, const N: usize> Clone for Transform<T, N>
[src]
impl<T: Copy, const N: usize> Copy for Transform<T, N>
[src]
impl<T: Debug, const N: usize> Debug for Transform<T, N>
[src]
impl<T: Eq, const N: usize> Eq for Transform<T, N>
[src]
impl<T: Float, const N: usize> Mul<Transform<T, N>> for Transform<T, N>
[src]
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, o: Self) -> Self::Output
[src]
impl<T: PartialEq, const N: usize> PartialEq<Transform<T, N>> for Transform<T, N>
[src]
fn eq(&self, other: &Transform<T, N>) -> bool
[src]
fn ne(&self, other: &Transform<T, N>) -> bool
[src]
impl<T, const N: usize> StructuralEq for Transform<T, N>
[src]
impl<T, const N: usize> StructuralPartialEq for Transform<T, N>
[src]
Auto Trait Implementations
impl<T, const N: usize> RefUnwindSafe for Transform<T, N> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, const N: usize> Send for Transform<T, N> where
T: Send,
T: Send,
impl<T, const N: usize> Sync for Transform<T, N> where
T: Sync,
T: Sync,
impl<T, const N: usize> Unpin for Transform<T, N> where
T: Unpin,
T: Unpin,
impl<T, const N: usize> UnwindSafe for Transform<T, N> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,