Struct graphene::Matrix

source ·
#[repr(transparent)]
pub struct Matrix { /* private fields */ }

Implementations§

source§

impl Matrix

source

pub fn decompose(&self) -> Option<(Vec3, Vec3, Quaternion, Vec3, Vec4)>

source

pub fn determinant(&self) -> f32

source

pub fn equal_fast(&self, b: &Matrix) -> bool

source

pub fn row(&self, index_: u32) -> Vec4

source

pub fn value(&self, row: u32, col: u32) -> f32

source

pub fn x_scale(&self) -> f32

source

pub fn x_translation(&self) -> f32

source

pub fn y_scale(&self) -> f32

source

pub fn y_translation(&self) -> f32

source

pub fn z_scale(&self) -> f32

source

pub fn z_translation(&self) -> f32

source

pub fn interpolate(&self, b: &Matrix, factor: f64) -> Matrix

source

pub fn inverse(&self) -> Option<Matrix>

source

pub fn is_2d(&self) -> bool

source

pub fn is_backface_visible(&self) -> bool

source

pub fn is_identity(&self) -> bool

source

pub fn is_singular(&self) -> bool

source

pub fn multiply(&self, b: &Matrix) -> Matrix

source

pub fn near(&self, b: &Matrix, epsilon: f32) -> bool

source

pub fn normalize(&self) -> Matrix

source

pub fn perspective(&self, depth: f32) -> Matrix

source

pub fn print(&self)

source

pub fn project_point(&self, p: &Point) -> Point

source

pub fn project_rect(&self, r: &Rect) -> Quad

source

pub fn project_rect_bounds(&self, r: &Rect) -> Rect

source

pub fn rotate(&mut self, angle: f32, axis: &Vec3)

source

pub fn rotate_euler(&mut self, e: &Euler)

source

pub fn rotate_quaternion(&mut self, q: &Quaternion)

source

pub fn rotate_x(&mut self, angle: f32)

source

pub fn rotate_y(&mut self, angle: f32)

source

pub fn rotate_z(&mut self, angle: f32)

source

pub fn scale(&mut self, factor_x: f32, factor_y: f32, factor_z: f32)

source

pub fn skew_xy(&mut self, factor: f32)

source

pub fn skew_xz(&mut self, factor: f32)

source

pub fn skew_yz(&mut self, factor: f32)

source

pub fn to_2d(&self) -> Option<(f64, f64, f64, f64, f64, f64)>

source

pub fn transform_bounds(&self, r: &Rect) -> Rect

source

pub fn transform_box(&self, b: &Box) -> Box

source

pub fn transform_point(&self, p: &Point) -> Point

source

pub fn transform_point3d(&self, p: &Point3D) -> Point3D

source

pub fn transform_ray(&self, r: &Ray) -> Ray

source

pub fn transform_rect(&self, r: &Rect) -> Quad

source

pub fn transform_sphere(&self, s: &Sphere) -> Sphere

source

pub fn transform_vec3(&self, v: &Vec3) -> Vec3

source

pub fn transform_vec4(&self, v: &Vec4) -> Vec4

source

pub fn translate(&mut self, pos: &Point3D)

source

pub fn transpose(&self) -> Matrix

source

pub fn unproject_point3d(&self, modelview: &Matrix, point: &Point3D) -> Point3D

source

pub fn untransform_bounds(&self, r: &Rect, bounds: &Rect) -> Rect

source

pub fn untransform_point(&self, p: &Point, bounds: &Rect) -> Option<Point>

source§

impl Matrix

source

pub fn from_2d(xx: f64, yx: f64, xy: f64, yy: f64, x_0: f64, y_0: f64) -> Self

source

pub fn from_float(v: [f32; 16]) -> Self

source

pub fn from_vec4(v0: &Vec4, v1: &Vec4, v2: &Vec4, v3: &Vec4) -> Self

source

pub fn new_frustum( left: f32, right: f32, bottom: f32, top: f32, z_near: f32, z_far: f32 ) -> Self

source

pub fn new_identity() -> Self

source

pub fn new_look_at(eye: &Vec3, center: &Vec3, up: &Vec3) -> Self

source

pub fn new_ortho( left: f32, right: f32, top: f32, bottom: f32, z_near: f32, z_far: f32 ) -> Self

source

pub fn new_perspective(fovy: f32, aspect: f32, z_near: f32, z_far: f32) -> Self

source

pub fn new_rotate(angle: f32, axis: &Vec3) -> Self

source

pub fn new_scale(x: f32, y: f32, z: f32) -> Self

source

pub fn new_skew(x_skew: f32, y_skew: f32) -> Self

source

pub fn new_translate(p: &Point3D) -> Self

source

pub fn to_float(&self) -> [f32; 16]

source

pub fn values(&self) -> &[[f32; 4]; 4]

Trait Implementations§

source§

impl Clone for Matrix

source§

fn clone(&self) -> Self

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 PartialEq<Matrix> for Matrix

source§

fn eq(&self, other: &Self) -> 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 StaticType for Matrix

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl Copy for Matrix

source§

impl Eq 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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for Twhere T: GlibPtrDefault + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType> + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType>,

source§

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

const: unstable · 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> StaticTypeExt for Twhere T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

impl<T> ToClosureReturnValue for Twhere T: ToValue,

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> ToSendValue for Twhere T: Send + ToValue + ?Sized,

source§

fn to_send_value(&self) -> SendValue

Returns a SendValue clone of self.
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T> TryFromClosureReturnValue for Twhere T: for<'a> FromValue<'a> + StaticType + 'static,

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.
const: unstable · source§

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

Performs the conversion.
source§

impl<'a, T, C> FromValueOptional<'a> for Twhere T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,