[−][src]Struct rgx::math::algebra::Matrix4
A 4 x 4, column major matrix
This type is marked as #[repr(C)]
.
Fields
x: Vector4<S>
The first column of the matrix.
y: Vector4<S>
The second column of the matrix.
z: Vector4<S>
The third column of the matrix.
w: Vector4<S>
The fourth column of the matrix.
Methods
impl<S: Copy + Zero + One> Matrix4<S>
[src]
pub fn new(
c0r0: S,
c0r1: S,
c0r2: S,
c0r3: S,
c1r0: S,
c1r1: S,
c1r2: S,
c1r3: S,
c2r0: S,
c2r1: S,
c2r2: S,
c2r3: S,
c3r0: S,
c3r1: S,
c3r2: S,
c3r3: S
) -> Self
[src]
c0r0: S,
c0r1: S,
c0r2: S,
c0r3: S,
c1r0: S,
c1r1: S,
c1r2: S,
c1r3: S,
c2r0: S,
c2r1: S,
c2r2: S,
c2r3: S,
c3r0: S,
c3r1: S,
c3r2: S,
c3r3: S
) -> Self
Create a new matrix, providing values for each index.
pub fn identity() -> Self
[src]
pub fn from_translation(v: Vector3<S>) -> Self
[src]
Create a homogeneous transformation matrix from a translation vector.
pub fn row(&self, n: usize) -> Vector4<S>
[src]
pub fn from_scale(value: S) -> Matrix4<S>
[src]
Create a homogeneous transformation matrix from a scale value.
pub fn from_nonuniform_scale(x: S, y: S, z: S) -> Matrix4<S>
[src]
Create a homogeneous transformation matrix from a set of scale values.
Trait Implementations
impl<S: Clone> Clone for Matrix4<S>
[src]
impl<S: Copy> Copy for Matrix4<S>
[src]
impl<S: Debug> Debug for Matrix4<S>
[src]
impl From<Matrix4<f32>> for [[f32; 4]; 4]
[src]
impl<S: Float> From<Ortho<S>> for Matrix4<S>
[src]
impl<S> Mul<Matrix4<S>> for Matrix4<S> where
S: Mul<Output = S> + Add<Output = S> + Copy,
[src]
S: Mul<Output = S> + Add<Output = S> + Copy,
type Output = Self
The resulting type after applying the *
operator.
fn mul(self, rhs: Matrix4<S>) -> Matrix4<S>
[src]
impl Mul<Point2<f32>> for Matrix4<f32>
[src]
Transform a Point2
with a Matrix4
.
use rgx::math::*; let m = Matrix4::from_translation(Vector3::new(8., 8., 0.)); let p = Point2::new(1., 1.); assert_eq!(m * p, Point2::new(9., 9.));
type Output = Point2<f32>
The resulting type after applying the *
operator.
fn mul(self, p: Point2<f32>) -> Point2<f32>
[src]
impl Mul<Vector3<f32>> for Matrix4<f32>
[src]
Transform a Vector3
with a Matrix4
.
use rgx::math::*; let m = Matrix4::from_translation(Vector3::new(8., 8., 0.)); let v = Vector3::new(1., 1., 0.); assert_eq!(m * v, Vector3::new(9., 9., 0.));
type Output = Vector3<f32>
The resulting type after applying the *
operator.
fn mul(self, vec: Vector3<f32>) -> Vector3<f32>
[src]
impl<S: PartialEq> PartialEq<Matrix4<S>> for Matrix4<S>
[src]
impl<S> StructuralPartialEq for Matrix4<S>
[src]
Auto Trait Implementations
impl<S> RefUnwindSafe for Matrix4<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
impl<S> Send for Matrix4<S> where
S: Send,
S: Send,
impl<S> Sync for Matrix4<S> where
S: Sync,
S: Sync,
impl<S> Unpin for Matrix4<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Matrix4<S> where
S: UnwindSafe,
S: 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>,