[][src]Struct pdbtbx::TransformationMatrix

pub struct TransformationMatrix { /* fields omitted */ }

A 3D affine transformation matrix

Implementations

impl TransformationMatrix[src]

pub fn matrix(&self) -> [[f64; 4]; 3][src]

Get the raw matrix (row major order)

pub fn set_matrix(&mut self, new_matrix: [[f64; 4]; 3])[src]

Set the raw matrix (row major order), the user needs to make sure the matrix is valid

pub fn identity() -> Self[src]

Create a matrix defining identity, so no transformation

pub fn from_matrix(matrix: [[f64; 4]; 3]) -> Self[src]

Create a matrix with the given matrix

pub fn rotation_x(deg: f64) -> Self[src]

Create a matrix defining a rotation around the X axis

Arguments

  • deg the rotation in degrees

Panics

It panics if deg is not finite (f64.is_finite())

pub fn rotation_y(deg: f64) -> Self[src]

Create a matrix defining a rotation around the Y axis

Arguments

  • deg the rotation in degrees

Panics

It panics if deg is not finite (f64.is_finite())

pub fn rotation_z(deg: f64) -> Self[src]

Create a matrix defining a rotation around the Z axis

Arguments

  • deg the rotation in degrees

Panics

It panics if deg is not finite (f64.is_finite())

pub fn translation(x: f64, y: f64, z: f64) -> Self[src]

Create a matrix defining a translation

Panics

It panics if any of the arguments is not finite (f64.is_finite())

pub fn magnify(f: f64) -> Self[src]

Create a matrix defining a magnification

Arguments

  • f the factor where 1.0 is the original size

Panics

It panics if f is not finite (f64.is_finite())

pub fn multiply_translation(&mut self, factors: (f64, f64, f64))[src]

This multiplies the translation with the given factors, this can be used to convert fractional units into absolute units.

pub fn apply(&self, pos: (f64, f64, f64)) -> (f64, f64, f64)[src]

Apply this transformation to the given position. It returns the new position.

Arguments

  • pos the position (x, y, z)

pub fn combine(&self, other: &Self) -> Self[src]

Combine this transformation with another transformation to deliver a new transformation. This transformation is applied before the other transformation.

Trait Implementations

impl Clone for TransformationMatrix[src]

impl Debug for TransformationMatrix[src]

impl PartialEq<TransformationMatrix> for TransformationMatrix[src]

impl StructuralPartialEq for TransformationMatrix[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.