Struct xmath::Matrix

source ·
pub struct Matrix { /* private fields */ }

Implementations§

source§

impl Matrix

source

pub fn zero() -> Self

source

pub fn new( m00: f32, m01: f32, m02: f32, m03: f32, m10: f32, m11: f32, m12: f32, m13: f32, m20: f32, m21: f32, m22: f32, m23: f32, m30: f32, m31: f32, m32: f32, m33: f32 ) -> Self

source

pub fn identity() -> Self

source

pub fn rotation_x(rad: f32) -> Self

source

pub fn rotation_y(rad: f32) -> Self

source

pub fn rotation_z(rad: f32) -> Self

source

pub fn orthographic( view_width: f32, view_height: f32, near_z: f32, far_z: f32 ) -> Self

source

pub fn orthographic_off_center( view_left: f32, view_right: f32, view_bottom: f32, view_top: f32, near_z: f32, far_z: f32 ) -> Self

source

pub fn look_at(eye: Vector3, focus: Vector3, up: Vector3) -> Self

source

pub fn look_to(eye: Vector3, dir: Vector3, up: Vector3) -> Self

source

pub fn perspective(width: f32, height: f32, near_z: f32, far_z: f32) -> Self

source

pub fn perspective_fov(fov: f32, aspect: f32, near_z: f32, far_z: f32) -> Self

aspect: Width / Height

source

pub fn translation(ox: f32, oy: f32, oz: f32) -> Self

source

pub fn transpose(self) -> Self

Trait Implementations§

source§

impl Clone for Matrix

source§

fn clone(&self) -> Matrix

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Matrix

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<Matrix> for [[f32; 4]; 4]

glium_text support

source§

fn from(matrix: Matrix) -> Self

Converts to this type from the input type.
source§

impl Index<usize> for Matrix

§

type Output = [f32; 4]

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, 'b> Mul<&'a Matrix> for &'b Matrix

§

type Output = Matrix

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &'a Matrix) -> Matrix

Performs the * operation. Read more
source§

impl<'a> Mul<&'a Matrix> for Matrix

§

type Output = Matrix

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &'a Matrix) -> Matrix

Performs the * operation. Read more
source§

impl<'a> Mul<Matrix> for &'a Matrix

§

type Output = Matrix

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Matrix) -> Matrix

Performs the * operation. Read more
source§

impl Mul<Matrix> for Matrix

§

type Output = Matrix

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Matrix) -> Matrix

Performs the * operation. Read more
source§

impl PartialEq<Matrix> for Matrix

source§

fn eq(&self, other: &Matrix) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Matrix

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.