Struct pdbtbx::TransformationMatrix [−][src]
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 scale(x: f64, y: f64, z: f64) -> Self
[src]
Create a matrix defining a magnification with three different factors
Arguments
x
the factor for the x dimension where 1.0 is the original sizey
the factor for the y dimension where 1.0 is the original sizez
the factor for the z dimension where 1.0 is the original size
Panics
It panics if any of the arguments 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]
fn clone(&self) -> TransformationMatrix
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TransformationMatrix
[src]
impl PartialEq<TransformationMatrix> for TransformationMatrix
[src]
fn eq(&self, other: &TransformationMatrix) -> bool
[src]
fn ne(&self, other: &TransformationMatrix) -> bool
[src]
impl StructuralPartialEq for TransformationMatrix
[src]
Auto Trait Implementations
impl RefUnwindSafe for TransformationMatrix
impl Send for TransformationMatrix
impl Sync for TransformationMatrix
impl Unpin for TransformationMatrix
impl UnwindSafe for TransformationMatrix
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,