[go: up one dir, main page]

Struct ultraviolet::mat::DMat3x2[][src]

#[repr(C)]
pub struct DMat3x2 { pub cols: [DVec3x2; 3], }
Expand description

A 3x3 square matrix.

Useful for performing linear transformations (rotation, scaling) on 3d vectors, or for performing arbitrary transformations (linear + translation, projection, etc) on homogeneous 2d vectors

Fields

cols: [DVec3x2; 3]

Implementations

impl DMat3x2[src]

pub const fn new(col1: DVec3x2, col2: DVec3x2, col3: DVec3x2) -> Self[src]

pub fn from_translation(trans: DVec2x2) -> Self[src]

Assumes homogeneous 2d coordinates.

pub fn from_scale_homogeneous(scale: f64x2) -> Self[src]

Assumes homogeneous 2d coordinates.

pub fn from_nonuniform_scale_homogeneous(scale: DVec2x2) -> Self[src]

Assumes homogeneous 2d coordinates.

pub fn from_rotation_homogeneous(angle: f64x2) -> Self[src]

Builds a homogeneous 2d rotation matrix (in the xy plane) from a given angle in radians.

pub fn from_scale(scale: f64x2) -> Self[src]

pub fn from_nonuniform_scale(scale: DVec3x2) -> Self[src]

pub fn identity() -> Self[src]

pub fn from_euler_angles(roll: f64x2, pitch: f64x2, yaw: f64x2) -> Self[src]

Angles are applied in the order roll -> pitch -> yaw.

  • Yaw is rotation inside the xz plane (“around the y axis”)
  • Pitch is rotation inside the yz plane (“around the x axis”)
  • Roll is rotation inside the xy plane (“around the z axis”)

Important: This function assumes a right-handed, y-up coordinate space where:

  • +X axis points right
  • +Y axis points up
  • +Z axis points towards the viewer (i.e. out of the screen)

This means that you may see unexpected behavior when used with OpenGL or DirectX as they use a different coordinate system. You should use the appropriate projection matrix in projection module to fit your use case to remedy this.

pub fn from_rotation_x(angle: f64x2) -> Self[src]

Create a new rotation matrix from a rotation “around the x axis”. This is here as a convenience function for users coming from other libraries; it is more proper to think of this as a rotation in the yz plane.

Important: This function assumes a right-handed, y-up coordinate space where:

  • +X axis points right
  • +Y axis points up
  • +Z axis points towards the viewer (i.e. out of the screen)

This means that you may see unexpected behavior when used with OpenGL or DirectX as they use a different coordinate system. You should use the appropriate projection matrix in projection module to fit your use case to remedy this.

pub fn from_rotation_y(angle: f64x2) -> Self[src]

Create a new rotation matrix from a rotation “around the y axis”. This is here as a convenience function for users coming from other libraries; it is more proper to think of this as a rotation in the xz plane.

Important: This function assumes a right-handed, y-up coordinate space where:

  • +X axis points right
  • +Y axis points up
  • +Z axis points towards the viewer (i.e. out of the screen)

This means that you may see unexpected behavior when used with OpenGL or DirectX as they use a different coordinate system. You should use the appropriate projection matrix in projection module to fit your use case to remedy this.

pub fn from_rotation_z(angle: f64x2) -> Self[src]

Create a new rotation matrix from a rotation “around the z axis”. This is here as a convenience function for users coming from other libraries; it is more proper to think of this as a rotation in the xy plane.

Important: This function assumes a right-handed, y-up coordinate space where:

  • +X axis points right
  • +Y axis points up
  • +Z axis points towards the viewer (i.e. out of the screen)

This means that you may see unexpected behavior when used with OpenGL or DirectX as they use a different coordinate system. You should use the appropriate projection matrix in projection module to fit your use case to remedy this.

pub fn from_rotation_around(axis: DVec3x2, angle: f64x2) -> Self[src]

Create a new rotation matrix from a rotation around the given axis. This is here as a convenience function for users coming from other libraries.

Important: This function assumes a right-handed, y-up coordinate space where:

  • +X axis points right
  • +Y axis points up
  • +Z axis points towards the viewer (i.e. out of the screen)

This means that you may see unexpected behavior when used with OpenGL or DirectX as they use a different coordinate system. You should use the appropriate projection matrix in projection module to fit your use case to remedy this.

pub fn from_angle_plane(angle: f64x2, plane: DBivec3x2) -> Self[src]

Construct a rotation matrix given a bivector which defines a plane and rotation orientation, and a rotation angle.

plane must be normalized!

This is the equivalent of an axis-angle rotation.

pub fn into_homogeneous(self) -> DMat4x2[src]

pub fn determinant(&self) -> f64x2[src]

pub fn adjugate(&self) -> Self[src]

The adjugate of this matrix, i.e. the transpose of the cofactor matrix.

This is equivalent to the inverse but without dividing by the determinant of the matrix, which can be useful in some contexts for better performance.

One such case is when this matrix is interpreted as a a homogeneous transformation matrix, in which case uniform scaling will not affect the resulting projected 3d version of transformed points or vectors.

pub fn inverse(&mut self)[src]

If this matrix is not currently invertable, this function will return an invalid inverse. This status is not checked by the library.

pub fn inversed(&self) -> Self[src]

If this matrix is not currently invertable, this function will return an invalid inverse. This status is not checked by the library.

pub fn transpose(&mut self)[src]

pub fn transposed(&self) -> Self[src]

pub fn transform_vec2(&self, vec: DVec2x2) -> DVec2x2[src]

Transform a Vec2 by self, interpreting it as a vector.

pub fn transform_point2(&self, point: DVec2x2) -> DVec2x2[src]

Transform a Vec2 by self, interpreting it as a point.

pub fn layout() -> Layout[src]

pub fn as_array(&self) -> &[f64x2; 9][src]

pub fn as_component_array(&self) -> &[DVec3x2; 3][src]

pub fn as_slice(&self) -> &[f64x2][src]

pub fn as_component_slice(&self) -> &[DVec3x2][src]

pub fn as_byte_slice(&self) -> &[u8][src]

pub fn as_mut_slice(&mut self) -> &mut [f64x2][src]

pub fn as_mut_component_slice(&mut self) -> &mut [DVec3x2][src]

pub fn as_mut_byte_slice(&mut self) -> &mut [u8][src]

pub const fn as_ptr(&self) -> *const f64x2[src]

Returns a constant unsafe pointer to the underlying data in the underlying type. This function is safe because all types here are repr(C) and can be represented as their underlying type.

Safety

It is up to the caller to correctly use this pointer and its bounds.

pub fn as_mut_ptr(&mut self) -> *mut f64x2[src]

Returns a mutable unsafe pointer to the underlying data in the underlying type. This function is safe because all types here are repr(C) and can be represented as their underlying type.

Safety

It is up to the caller to correctly use this pointer and its bounds.

impl DMat3x2[src]

pub fn into_rotor3(self) -> DRotor3x2[src]

If self is a rotation matrix, return a Rotor3 representing the same rotation.

If self is not a rotation matrix, the returned value is a Rotor3 with undefied properties. The fact that self is a rotation matrix is not checked by the library.

Trait Implementations

impl Add<DMat3x2> for DMat3x2[src]

type Output = Self

The resulting type after applying the + operator.

fn add(self, rhs: DMat3x2) -> Self[src]

Performs the + operation. Read more

impl AddAssign<DMat3x2> for DMat3x2[src]

fn add_assign(&mut self, rhs: DMat3x2)[src]

Performs the += operation. Read more

impl Clone for DMat3x2[src]

fn clone(&self) -> DMat3x2[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for DMat3x2[src]

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

Formats the value using the given formatter. Read more

impl Default for DMat3x2[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl From<&'_ [f64x2; 9]> for DMat3x2[src]

fn from(comps: &[f64x2; 9]) -> Self[src]

Performs the conversion.

impl From<[[f64x2; 3]; 3]> for DMat3x2[src]

fn from(comps: [[f64x2; 3]; 3]) -> Self[src]

Performs the conversion.

impl From<[f64x2; 9]> for DMat3x2[src]

fn from(comps: [f64x2; 9]) -> Self[src]

Performs the conversion.

impl From<DRotor3x2> for DMat3x2[src]

fn from(rotor: DRotor3x2) -> DMat3x2[src]

Performs the conversion.

impl Index<usize> for DMat3x2[src]

type Output = DVec3x2

The returned type after indexing.

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

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

impl IndexMut<usize> for DMat3x2[src]

fn index_mut(&mut self, index: usize) -> &mut Self::Output[src]

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

impl Mul<DMat3x2> for DMat3x2[src]

type Output = Self

The resulting type after applying the * operator.

fn mul(self, rhs: Self) -> Self[src]

Performs the * operation. Read more

impl Mul<DMat3x2> for f64x2[src]

type Output = DMat3x2

The resulting type after applying the * operator.

fn mul(self, rhs: DMat3x2) -> DMat3x2[src]

Performs the * operation. Read more

impl Mul<DVec3x2> for DMat3x2[src]

type Output = DVec3x2

The resulting type after applying the * operator.

fn mul(self, rhs: DVec3x2) -> DVec3x2[src]

Performs the * operation. Read more

impl Mul<f64x2> for DMat3x2[src]

type Output = DMat3x2

The resulting type after applying the * operator.

fn mul(self, rhs: f64x2) -> DMat3x2[src]

Performs the * operation. Read more

impl PartialEq<DMat3x2> for DMat3x2[src]

fn eq(&self, other: &DMat3x2) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &DMat3x2) -> bool[src]

This method tests for !=.

impl Copy for DMat3x2[src]

impl StructuralPartialEq for DMat3x2[src]

Auto Trait Implementations

impl RefUnwindSafe for DMat3x2

impl Send for DMat3x2

impl Sync for DMat3x2

impl Unpin for DMat3x2

impl UnwindSafe for DMat3x2

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

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.

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

Performs the conversion.

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.

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

Performs the conversion.