Trait geo_nd::Transform

source ·
pub trait Transform<F, V3, V4, M4, Q>: Clone + Copy + Debug + Display + Defaultwhere
    F: Float,
    V3: Vector<F, 3>,
    V4: Vector<F, 4>,
    M4: SqMatrix4<F, V3, V4>,
    Q: Quaternion<F, V3, V4>,{
    // Required methods
    fn of_trs(t: V3, r: Q, s: F) -> Self;
    fn scale(&self) -> F;
    fn translation(&self) -> V3;
    fn rotation(&self) -> Q;
    fn inverse(&self) -> Self;
    fn invert(&mut self);
    fn as_mat(&self) -> M4;
}
Expand description

The Transform trait describes a translation, rotation and scaling for 3D, represented eventually as a Mat4

A transformation that is a translation . scaling . rotation (i.e. it applies the rotation to an object, then scales it, then translates it)

Required Methods§

source

fn of_trs(t: V3, r: Q, s: F) -> Self

Create a transformation that is a translation, rotation and scaling

source

fn scale(&self) -> F

Get the scale of the transform

source

fn translation(&self) -> V3

Get a translation by a vector

source

fn rotation(&self) -> Q

Get the rotation of the transfirnatuib

source

fn inverse(&self) -> Self

Get the inverse transformation

source

fn invert(&mut self)

Invert the transformation

source

fn as_mat(&self) -> M4

Convert it to a 4-by-4 matrix

Implementors§

source§

impl<F: Float + Serialize> Transform<F, FArray<F, 3>, FArray<F, 4>, FArray2<F, 4, 16>, QArray<F, FArray<F, 3>, FArray<F, 4>>> for FQArrayTrans<F>